Guest User

Untitled

a guest
Apr 27th, 2012
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. stock GetPlayerSpeed(playerid,bool:kmh)
  2. {
  3.     new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
  4.     if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
  5.     rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
  6.     return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
  7. }
  8.     public OnPlayerUpdate(playerid)
  9.     {
  10.         if(GetPlayerSpeed(playerid, true) > 250)
  11.         {
  12.             for(new f; f<MAX_PLAYERS; f++)
  13.             {
  14.                 SpeedA[playerid]++;
  15.                 if(IsPlayerAdmin(f))
  16.                 {
  17.                     if(SpeedA[playerid] < 5)
  18.                     {
  19.                         new amsg[256];
  20.                         format(amsg, sizeof(amsg), "%s Speed is %d", GetName(playerid), GetPlayerSpeed(playerid, true));
  21.                         SendClientMessage(f, COLOR_RED, amsg);
  22.                     }
  23.                 }
  24.                 if(SpeedA[playerid] >= 5)
  25.                 {
  26.                     SendClientMessage(playerid, COLOR_RED, "You Have Been Kicked Because You Used SpeedHack");
  27.                     Kick(playerid);
  28.                 }
  29.            
  30.             }
  31.         }
  32.         return 1;
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment