a pastebin project

Unnamed

  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. }

advertising

Create a Paste

Please enter your new post below (or upload a file instead):





Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.