Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2011
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.01 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define FILTERSCRIPT
  4. #if defined FILTERSCRIPT
  5.  
  6. #define Driver 0
  7. #define Passanger 2
  8.  
  9. new Act[MAX_PLAYERS];
  10. new InCar[MAX_PLAYERS];
  11. new WhatCar[MAX_PLAYERS];
  12.  
  13. #endif
  14.  
  15. public OnPlayerExitVehicle(playerid, vehicleid)
  16. {
  17.     InCar[playerid] = 1;
  18.     return 1;
  19. }
  20.  
  21. public OnPlayerStateChange(playerid, newstate, oldstate)
  22. {
  23.     if(Act[playerid] == 0)
  24.     {
  25.         if(oldstate == PLAYER_STATE_DRIVER)
  26.         {
  27.             if(newstate == PLAYER_STATE_ONFOOT)
  28.             {
  29.                 if(InCar[playerid] == 0)
  30.                 {
  31.                     PutPlayerInVehicle(playerid, WhatCar[playerid], Driver);
  32.                 }
  33.             }
  34.         }
  35.         if(oldstate == PLAYER_STATE_PASSENGER)
  36.         {
  37.             if(newstate == PLAYER_STATE_ONFOOT)
  38.             {
  39.                 if(InCar[playerid] == 0)
  40.                 {
  41.                     PutPlayerInVehicle(playerid, WhatCar[playerid], Passanger);
  42.                 }
  43.             }
  44.         }
  45.         if(oldstate == PLAYER_STATE_ONFOOT)
  46.         {
  47.             if(newstate == PLAYER_STATE_DRIVER || PLAYER_STATE_PASSENGER)
  48.             {
  49.                 InCar[playerid] = 0;
  50.                 WhatCar[playerid] = GetPlayerVehicleID(playerid);
  51.             }
  52.         }
  53.     }
  54.     return 1;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement