25.07.2013, 03:33
Hi, i'm trying to make a possible anti health hack but i have a problem, when i connect to my server no problem, when 2nd player connects he gets kicked when spawns.
Can someone help me? what's wrong with the code
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid,99);
SetPVarInt(playerid, "i_health", 99);
SetTimerEx("antigodmode",1000,1,"d",playerid);
return 1;
}
Код:
stock antigodmode();
public antigodmode(){
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Float:pHealth;
GetPlayerHealth(i, Float:pHealth);
if(GetPVarInt(i, "i_health") > Float:pHealth)
{
SetPVarInt(i, "i_health", Float:pHealth);
}
if(Float:pHealth > 99)
{
new pname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(i, pname, sizeof (pname));
format(string, sizeof(string), "%s is kicked for possible health hack.", pname);
SendClientMessageToAll(COLOR_RED, string);
Kick(i);
}else if(Float:pHealth <= 99){
}
}
return 1;
}


