Advertisement
Shiny_

Untitled

Aug 29th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.70 KB | None | 0 0
  1. TimerEx(CountDrift -> playerid) {
  2.     // Timer(CountDrift) {
  3.         static Float: Angle[2];
  4.         static Float: Speed[2];
  5.         static Float: Position[3];
  6.         static s[96];
  7.        
  8.         // for(new playerid; playerid < MAX_PLAYERS; playerid++) {
  9.         GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
  10.         Speed[1] = floatsqroot(floatadd(floatadd(floatpower(floatabs(floatsub(Position[0], SavedPos[playerid][sX])), 2), floatpower(floatabs(floatsub(Position[1], SavedPos[playerid][sY])), 2)), floatpower(floatabs(floatsub(Position[2], SavedPos[playerid][sZ])), 2)));
  11.         Angle[0] = ReturnPlayerAngle(playerid);
  12.         Angle[1] = GetPlayerTheoreticAngle(playerid);
  13.         Speed[0] = floatmul(Speed[1], 12);
  14.        
  15.         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsCar(GetPlayerVehicleID(playerid)) && floatabs(floatsub(Angle[0], Angle[1])) > DRIFT_MINKAT && floatabs(floatsub(Angle[0], Angle[1])) < DRIFT_MAXKAT && Speed[0] > DRIFT_SPEED) {
  16.             if(Timer_PlayerDriftPoints[playerid] > 0) KillTimer(Timer_PlayerDriftPoints[playerid]);
  17.             Timer_PlayerDriftPoints[playerid] = 0;
  18.             PointsFromDrift[playerid] += floatval(floatabs(floatsub(Angle[0], Angle[1])) * 3 * (Speed[0] * 0.1)) / 10;
  19.             Timer_PlayerDriftPoints[playerid] = SetTimerEx("LoadDrift", 3000, 0, "d", playerid);
  20.         }
  21.        
  22.         if(PointsFromDrift[playerid] > 0) {
  23.             format(s, sizeof(s), "\n\n\n%d $\n%d %s\n~k~~VEHICLE_FIREWEAPON~ - {FF0000}Nitro{FFFFFF}!", PointsFromDrift[playerid] / 2, PointsFromDrift[playerid], dli(PointsFromDrift[playerid], "Punkt", "Punkty", "Punktów"));
  24.             UpdatePlayer3DTextLabelText(playerid, Drift3DText[playerid], -1, s);
  25.         }
  26.  
  27.         SavedPos[playerid][sX] = Position[0];
  28.         SavedPos[playerid][sY] = Position[1];
  29.         SavedPos[playerid][sZ] = Position[2];
  30.         // }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement