Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock GetPlayerSpeed(playerid,bool:kmh)
- {
- new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
- if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
- rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
- return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPlayerSpeed(playerid, true) > 250)
- {
- for(new f; f<MAX_PLAYERS; f++)
- {
- SpeedA[playerid]++;
- if(IsPlayerAdmin(f))
- {
- if(SpeedA[playerid] < 5)
- {
- new amsg[256];
- format(amsg, sizeof(amsg), "%s Speed is %d", GetName(playerid), GetPlayerSpeed(playerid, true));
- SendClientMessage(f, COLOR_RED, amsg);
- }
- }
- if(SpeedA[playerid] >= 5)
- {
- SendClientMessage(playerid, COLOR_RED, "You Have Been Kicked Because You Used SpeedHack");
- Kick(playerid);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment