Advertisement
Shiny_

Drift (lubego)

Aug 23rd, 2013
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.17 KB | None | 0 0
  1. public OnPlayerUpdate(playerid) {
  2.     new cs;
  3.  
  4.     for(new i = 0; i < MAX_PLAYERS; i++) {
  5.         new Float:x, Float:y, Float:z;
  6.         if(IsPlayerInAnyVehicle(i))GetVehiclePos(GetPlayerVehicleID(i), x, y, z); else GetPlayerPos(i, x, y, z);
  7.         ppos[i][0] = x;
  8.         ppos[i][1] = y;
  9.         ppos[i][2] = z;
  10.         cs=GetPlayerState(i);
  11.  
  12.         if(AutoFixBool[i] && IsPlayerInAnyVehicle(i)) {
  13.             SetVehicleHealth(GetPlayerVehicleID(i),HealthInit[i]);
  14.         }
  15.         if(DriftMode[i] && cs==PLAYER_STATE_DRIVER && DriftPointsNow[i]>70) {
  16.             new Float:h;
  17.             GetVehicleHealth(GetPlayerVehicleID(i),h);
  18.             if(h<HealthInit[i]) {
  19.                 KillTimer(DriftTimer[i]);
  20.                 DriftExit(i);
  21.                 GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~r~Boom",800,5);
  22.                 DriftMode[i]=false;
  23.             }
  24.         }
  25.         if(cs==PLAYER_STATE_DRIVER && DriftMode[i]==false) {
  26.             if(GetVType(GetPlayerVehicleID(i))) {
  27.                 DriftMode[i]=true;
  28.                 GetVehicleHealth(GetPlayerVehicleID(i),HealthInit[i]);
  29.                 AutoFixBool[i]=false;
  30.                 DriftTimer[i]=SetTimerEx("Drift", 200, true, "i", i);
  31.             }
  32.         }
  33.         else if(cs!=PLAYER_STATE_DRIVER && DriftMode[i]==true) {
  34.             KillTimer(DriftTimer[i]);
  35.             DriftMode[i]=false;
  36.             AutoFixBool[i]=true;
  37.         }
  38.         else{}
  39.     }
  40.     return 1;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement