pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

C++ pastebin - collaborative debugging tool View Help


Posted by Anonymous on Sun 6 Apr 18:30
report abuse | View followups from regdsghsdg and Anonymous | download | new post

  1. #include <a_samp>
  2.  
  3. #define FILTERSCRIPT
  4. #if defined FILTERSCRIPT
  5.  
  6. #define Driver 0
  7. #define Passanger 2
  8.  
  9. new InCar[MAX_PLAYERS];
  10. new WhatCar[MAX_PLAYERS];
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.         print("------------------------------");
  15.         print(" Anti fall off bike v2 loaded ");
  16.         print("------------------------------");
  17.         return 1;
  18. }
  19.  
  20. #endif
  21.  
  22. public OnPlayerExitVehicle(playerid, vehicleid)
  23. {
  24.         InCar[playerid] = 0;
  25.         return 1;
  26. }
  27.  
  28. public OnPlayerStateChange(playerid, newstate, oldstate)
  29. {
  30.         if(oldstate == PLAYER_STATE_DRIVER)
  31.         {
  32.                 if(newstate == PLAYER_STATE_ONFOOT)
  33.                 {
  34.                         if(InCar[playerid] == 1)
  35.                         {
  36.                                 PutPlayerInVehicle(playerid, WhatCar[playerid], Driver);
  37.                         }
  38.                 }
  39.         }
  40.         if(oldstate == PLAYER_STATE_PASSENGER)
  41.         {
  42.                 if(newstate == PLAYER_STATE_ONFOOT)
  43.                 {
  44.                         if(InCar[playerid] == 1)
  45.                         {
  46.                                 PutPlayerInVehicle(playerid, WhatCar[playerid], Passanger);
  47.                         }
  48.                 }
  49.         }
  50.         if(oldstate == PLAYER_STATE_ONFOOT)
  51.         {
  52.                 if(newstate == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
  53.                 {
  54.                         InCar[playerid] = 1;
  55.                         WhatCar[playerid] = GetPlayerVehicleID(playerid);
  56.                 }
  57.         }
  58.         return 1;
  59. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post