#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");
}
}
#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");
}
}
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;
}
}
}
Try this
PHP код:
|
PHP код:
|
C:\Users\User\Desktop\SAE\filterscripts\sPing.pwn(8) : error 017: undefined symbol "isFrozen" C:\Users\User\Desktop\SAE\filterscripts\sPing.pwn(8) : warning 215: expression has no effect C:\Users\User\Desktop\SAE\filterscripts\sPing.pwn(8) : error 001: expected token: ";", but found "]" C:\Users\User\Desktop\SAE\filterscripts\sPing.pwn(8) : error 029: invalid expression, assumed zero C:\Users\User\Desktop\SAE\filterscripts\sPing.pwn(8) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
#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;
}
}
}
Try now.
PHP код:
|