Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerUpdate(playerid) {
- new cs, Float:x, Float:y, Float:z;
- if(IsPlayerInAnyVehicle(playerid))GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z); else GetPlayerPos(playerid, x, y, z);
- ppos[playerid][0] = x;
- ppos[playerid][1] = y;
- ppos[playerid][2] = z;
- cs=GetPlayerState(playerid);
- if(AutoFixBool[playerid] && IsPlayerInAnyVehicle(playerid)) {
- SetVehicleHealth(GetPlayerVehicleID(playerid),HealthInit[playerid]);
- }
- if(DriftMode[playerid] && cs==PLAYER_STATE_DRIVER && DriftPointsNow[playerid]>70) {
- new Float:h;
- GetVehicleHealth(GetPlayerVehicleID(playerid),h);
- if(h<HealthInit[playerid]) {
- KillTimer(DriftTimer[playerid]);
- DriftExit(playerid);
- GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~r~Boom",800,5);
- DriftMode[playerid]=false;
- }
- }
- if(cs==PLAYER_STATE_DRIVER && DriftMode[playerid]==false) {
- if(GetVType(GetPlayerVehicleID(playerid))) {
- DriftMode[playerid]=true;
- GetVehicleHealth(GetPlayerVehicleID(playerid),HealthInit[playerid]);
- AutoFixBool[playerid]=false;
- DriftTimer[playerid]=SetTimerEx("Drift", 200, true, "i", playerid);
- }
- }
- else if(cs!=PLAYER_STATE_DRIVER && DriftMode[playerid]==true) {
- KillTimer(DriftTimer[playerid]);
- DriftMode[playerid]=false;
- AutoFixBool[playerid]=true;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement