01.09.2011, 18:28
pawn Код:
public OnPlayerUpdate(playerid)
{
if(GetSpeedKM(playerid) > 130)
{
new s[128],n[24];
GetPlayerName(playerid,n,24);
format(s,128,"-Server- '%s' foi banido do servidor [Motivo: Speed hacker |Velocidade:'%d'|",n,GetSpeedKM(playerid));
SendClientMessage(playerid,-1,s);
Ban(playerid);
}
return 1;
}
stock GetSpeedKM(playerid)
{
new Float:Pos[3],Float:Speeddistance;
GetVehicleVelocity(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
Speeddistance = floatmul(floatsqroot(floatadd(floatadd(floatpower(Pos[0], 2), floatpower(Pos[1], 2)), floatpower(Pos[2], 2))), 170.0);
new spe = floatround(Speeddistance * 1);
return spe;
}
Testa ae;