04.11.2017, 15:18
(
Последний раз редактировалось billy1337samp; 04.11.2017 в 16:29.
)
- error fixed -
if//code here { if//code here { new Float:health, string[20]; GetPlayerHealth(playerid,health); SendClientMessage(playerid, -1, string); TogglePlayerControllable(playerid, 0); //true/freeze SetPlayerHealth(playerid, INFINITE); //already defined SendClientMessage(playerid, -1, "true"); isFrozen[playerid] = true; //other code here } } else if //code here { if//code here { SetPlayerHealth(playerid, "%f")
#include <a_samp>
#define FILTERSCRIPT
//help by frouzen
new isFrozen[MAX_PLAYERS];
new lastHealth[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
isFrozen[playerid] = false;
lastHealth[playerid] = 0;
return 1;
}
public OnPlayerUpdate(playerid) {
if(GetPlayerPing(playerid) > MAX_PING)
{
if(!isFrozen[playerid])
{
new string[20];
GetPlayerHealth(playerid, lastHealth[playerid]);
SendClientMessage(playerid, -1, string);
TogglePlayerControllable(playerid, 0); //true/freeze
SetPlayerHealth(playerid, 999999);
SendClientMessage(playerid, -1, "true");
isFrozen[playerid] = true;
}
}
else if(GetPlayerPing(playerid) < MAX_PING)
{
if(isFrozen[playerid])
{
SetPlayerHealth(playerid, lastHealth[playerid])
TogglePlayerControllable(playerid, 1); //false/unfreeze
SendClientMessage(playerid, -1, "false");
isFrozen[playerid] = false;
}
}
}
#include <a_samp>
#define FILTERSCRIPT
//help by frouzen
new isFrozen[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
isFrozen[playerid] = false;
return 1;
}
public OnPlayerUpdate(playerid) {
if(GetPlayerPing(playerid) > MAX_PING)
{
if(!isFrozen[playerid])
{
new Float:health, string[20];
GetPlayerHealth(playerid, health);
SetPVarFloat(playerid, "lastHealth", health);
SendClientMessage(playerid, -1, string);
TogglePlayerControllable(playerid, 0); //true/freeze
SetPlayerHealth(playerid, 999999);
SendClientMessage(playerid, -1, "true");
isFrozen[playerid] = true;
}
}
else if(GetPlayerPing(playerid) < MAX_PING)
{
if(isFrozen[playerid])
{
SetPlayerHealth(playerid, GetPVarFloat(playerid, "lastHealth"));
TogglePlayerControllable(playerid, 1); //false/unfreeze
SendClientMessage(playerid, -1, "false");
isFrozen[playerid] = false;
}
}
}