Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #if defined h_driveby_included
- #endinput
- #endif
- #define h_driveby_included
- new bool:h_drivebying[MAX_PLAYERS];
- /*
- native IsPlayerDrivebying(playerid);
- */
- forward OnPlayerStartDriveby(playerid);
- forward OnPlayerStopDriveby(playerid);
- public OnPlayerDisconnect(playerid, reason)
- {
- h_drivebying[playerid] = false;
- if(funcidx("H_db_OnPlayerDisconnect") != -1)
- {
- return CallLocalFunction("H_db_OnPlayerDisconnect", "ii", playerid, reason);
- }
- return 1;
- }
- #define OnPlayerDisconnect H_db_OnPlayerDisconnect
- forward OnPlayerDisconnect(playerid, reason);
- public OnPlayerUpdate(playerid)
- {
- if(GetPlayerCameraMode(playerid) == 55 && h_drivebying[playerid] == false)
- {
- h_drivebying[playerid] = true;
- CallLocalFunction("OnPlayerStartDriveby", "i", playerid);
- }
- else if(GetPlayerCameraMode(playerid) != 55 && h_drivebying[playerid] == true)
- {
- h_drivebying[playerid] = false;
- CallLocalFunction("OnPlayerStopDriveby", "i", playerid);
- }
- if(funcidx("H_db_OnPlayerUpdate") != -1)
- {
- return CallLocalFunction("H_db_OnPlayerUpdate", "i", playerid);
- }
- return 1;
- }
- stock IsPlayerDrivebying(playerid)
- {
- return h_drivebying[playerid] == true ? 1 : 0;
- }
- #define OnPlayerUpdate H_db_OnPlayerUpdate
- forward OnPlayerUpdate(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement