25.03.2012, 20:25
I have this at a timer which updates every 1 second
And this is the stock to get players speed
The problem is, it won't send a message to admins even if the player is driving 500 km/h, it should send a message to admins if the players reaches over 200 km/h
It compiles without errors and warnings, but it doesn't work
Can anyone help? I'll give +rep
pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new speed = GetSpeed(i);
if(speed > 200 && PlayerInfo[i][pAdmin] < 1)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, sizeof(string), "[ACHTUNG] Folgender Spieler hat mцglicherweise Speedhack: [%d]%s - %d km/h",i,sendername,speed);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}
}
pawn Код:
public GetSpeed(id)
{
new Float:s[4];
GetVehicleVelocity(GetPlayerVehicleID(id),s[0],s[1],s[2]);
return floatround(1.61*floatsqroot(floatabs(floatpower(s[0]+s[1]+s[2],2)))*100);
}
It compiles without errors and warnings, but it doesn't work
Can anyone help? I'll give +rep