cuddly-table-7819
01/10/2023, 10:24 AM[23:10:27] [debug] Long callback execution detected (hang or performance issue)
[23:10:27] [debug] AMX backtrace:
[23:10:27] [debug] #0 003abfe4 in public KickHighPingPlayers (i=73) at /home/hiwyn/Documents/sampserver/gamemodes/MM.pwn:21371
[23:10:27] [debug] #1 0037a8d8 in public SEC_5_SVLOOP () at /home/hiwyn/Documents/sampserver/gamemodes/MM.pwn:18366
21371:
if(pingwarning[i] > 9) {
c++
forward KickHighPingPlayers(i);
public KickHighPingPlayers(i) {
new string[128];
if(pingwarning[i] > 9) {
format(string,sizeof(string),"AdmCmd: %s was Kicked for SERVER. Reason: High Ping.", PlayerName(i));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(i);
pingwarning[i] = 0;
}
else if(GetPlayerPing(i) > 700) {
pingwarning[i] += 2;
SendClientMessage(i, COLOR_LIGHTRED, "You have exceeded the PING limit, adjust your internet or you will be kicked!");
}
else if(pingwarning[i] > 0 && GetPlayerPing(i) <= 700) { pingwarning[i] -= 1; }
}
is anybody got any idea about how to do it better?wooden-dusk-70200
01/10/2023, 11:21 AMc
forward KickHighPingPlayers(i);
public KickHighPingPlayers(i) {
if(GetPlayerPing(i) > 700) {
if(++pingwarning[i] >= 5) { //adjust, don't spam the player with messages, lol
format(string,sizeof(string),"AdmCmd: %s was Kicked for SERVER. Reason: High Ping.",
PlayerName(i));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(i);
pingwarning[i] = 0;
} else {
SendClientMessage(i, COLOR_LIGHTRED, "You have exceeded the PING limit, adjust your internet or you will be kicked!");
}
} else {
pingwarning[i] = 0;
}
}
¯\\\_(ツ)_/¯cuddly-table-7819
01/13/2023, 10:02 AMwooden-dusk-70200
01/13/2023, 10:15 AMwooden-dusk-70200
01/13/2023, 10:16 AM