public OnPlayerUpdate(playerid)
{
new string[128], string2[128], nev[MAX_PLAYER_NAME], Float:ST[4], sebesseg[MAX_PLAYERS];
if(trafiidovan[playerid] == false)
{
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(playerid, 50.0, tx, ty, tz))
{
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
sebesseg[playerid] = floatround(ST[3]);
if(sebesseg[playerid] > maxspeed)
{
SendClientMessage(playerid, PIROS, \"----------------------------------BÍRSÁG----------------------------------\");
format(string, sizeof(string), \"| Sebességed: %d km/h | Megengedett sebesség: %d | Bírság: $%d |\", sebesseg[playerid], maxspeed, birsag);
SendClientMessage(playerid, SARGA, string);
SendClientMessage(playerid, PIROS, \"----------------------------------BÍRSÁG----------------------------------\");
GivePlayerMoney(playerid, -birsag);
GetPlayerName(playerid, nev, sizeof(nev));
format(string2, sizeof(string2), \"%s-t lekapta a trafipax. Sebessége: %d km/h | Megengedett sebesség: %d | Bírság: $%d |\", nev, sebesseg[playerid], maxspeed, birsag);
SendClientMessage(i, PIROS, string2);
trafiidovan[playerid] = true;
SetTimerEx(\"trafiido\",5000,false,\"i\", playerid);
}
}
}
}
}
return 1;
}