Advertisement
Hiddos

Driveby include 1.0

Jul 31st, 2011
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.29 KB | None | 0 0
  1. #include <a_samp>
  2. #if defined h_driveby_included
  3.     #endinput
  4. #endif
  5. #define h_driveby_included
  6. new bool:h_drivebying[MAX_PLAYERS];
  7.  
  8. /*
  9. native IsPlayerDrivebying(playerid);
  10. */
  11.  
  12. forward OnPlayerStartDriveby(playerid);
  13. forward OnPlayerStopDriveby(playerid);
  14.  
  15. public OnPlayerDisconnect(playerid, reason)
  16. {
  17.     h_drivebying[playerid] = false;
  18.  
  19.     if(funcidx("H_db_OnPlayerDisconnect") != -1)
  20.     {
  21.         return CallLocalFunction("H_db_OnPlayerDisconnect", "ii", playerid, reason);
  22.     }
  23.     return 1;  
  24. }
  25.  
  26.  
  27. #define OnPlayerDisconnect H_db_OnPlayerDisconnect
  28. forward OnPlayerDisconnect(playerid, reason);
  29.  
  30. public OnPlayerUpdate(playerid)
  31. {
  32.     if(GetPlayerCameraMode(playerid) == 55 && h_drivebying[playerid] == false)
  33.     {
  34.         h_drivebying[playerid] = true;
  35.         CallLocalFunction("OnPlayerStartDriveby", "i", playerid);
  36.     }
  37.     else if(GetPlayerCameraMode(playerid) != 55 && h_drivebying[playerid] == true)
  38.     {
  39.         h_drivebying[playerid] = false;
  40.         CallLocalFunction("OnPlayerStopDriveby", "i", playerid);
  41.     }
  42.  
  43.     if(funcidx("H_db_OnPlayerUpdate") != -1)
  44.     {
  45.         return CallLocalFunction("H_db_OnPlayerUpdate", "i", playerid);
  46.     }
  47.     return 1;
  48. }
  49.  
  50. stock IsPlayerDrivebying(playerid)
  51. {
  52.     return h_drivebying[playerid] == true ? 1 : 0;
  53. }
  54.  
  55. #define OnPlayerUpdate H_db_OnPlayerUpdate
  56. forward OnPlayerUpdate(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement