07.09.2018, 07:38
Good afternoon everyone, I am trying to make a "speedgun" like system, for the cops so that they can track other players. The only problem that I have is that the system I did tracks everything too fast so it just crashes. How can I make this more efficient, any ideas?
Код:
public SpeedChecker(playerid) { while(radarstatus[playerid] == 1) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(GetDistanceBetweenPlayers(playerid,i) < 100.00) { if(player_vehicle_speed[i] > 159.99) { new numeplayervit[256]; GetCharacterName(i, numeplayervit); new mesajviteza[256]; format(mesajviteza,sizeof(mesajviteza), "{FFA500} %s a fost surprins cu viteza de {FF4C4C}%f km/h!", numeplayervit, player_vehicle_speed[i]); SendClientMessage(playerid, -1, mesajviteza); } } } } }