03.11.2017, 21:02
The purpose of this script is to warn the user that their ping exceeds the maximum amount and freezes the player until their ping calms down... but that hasn't got quit the way I expected it too.
Why does it keep freezing, freezing, freezing them? I just want it to freeze the player once.
Why does it keep unfreezing, unfreezing, unfreezing them? I just want it to unfreeze the player once.
(You can see this when the text 'true/false' repeats)
Can someone improve the script (help me)?
Why does it keep freezing, freezing, freezing them? I just want it to freeze the player once.
Why does it keep unfreezing, unfreezing, unfreezing them? I just want it to unfreeze the player once.
(You can see this when the text 'true/false' repeats)
PHP код:
#include <a_samp>
#define FILTERSCRIPT
#define MAX_PING 15
public OnPlayerUpdate(playerid) {
if (GetPlayerPing(playerid) < MAX_PING)
{
TogglePlayerControllable(playerid, 0); //true/freeze
SendClientMessage(playerid, -1, "true");
}
else if (GetPlayerPing(playerid) > MAX_PING)
{
TogglePlayerControllable(playerid, 1); //false/unfreeze
SendClientMessage(playerid, -1, "false");
}
}