04.11.2017, 14:20
Try now.
PHP код:
#include <a_samp>
#define FILTERSCRIPT
#define MAX_PING 15
new isFrozen[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
isFrozen[playerid] = false;
return 1;
}
public OnPlayerUpdate(playerid) {
if(GetPlayerPing(playerid) > MAX_PING)
{
if(!isFrozen[playerid])
{
TogglePlayerControllable(playerid, 0); //true/freeze
SendClientMessage(playerid, -1, "true");
isFrozen[playerid] = true;
}
}
else if(GetPlayerPing(playerid) < MAX_PING)
{
if(isFrozen[playerid])
{
TogglePlayerControllable(playerid, 1); //false/unfreeze
SendClientMessage(playerid, -1, "false");
isFrozen[playerid] = false;
}
}
}