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