Guest
Public paste!

Untitled

By: a guest | Apr 6th, 2008 | Syntax: C++ | Size: 1.10 KB | Hits: 713 | Expires: Never
Copy text to clipboard
  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. }