im creating an anti health & armour cheat but it seems dont working,look at the code below:
Код:
stock SetPlayerHealthEx(playerid, Float:health)
{
SetPVarFloat(playerid,"Zivot",health);
SetPlayerHealth(playerid, health);
}
stock SetPlayerArmourEx(playerid, Float:armour)
{
SetPVarFloat(playerid,"Armour",armour);
SetPlayerArmour(playerid, armour);
}
public OnPlayerConnect(playerid)
{
SetPlayerHealthEx(playerid, 100);
SetPlayerArmourEx(playerid, 0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerHealthEx(playerid, 0);
SetPlayerArmourEx(playerid, 0);
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new Float:health,Float:armour,m[30],str[128];
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
if(GetPVarFloat(playerid, "Zivot") != health)
{
GetPlayerName(playerid,m,30);
format(str,128,"player %s used hp hack (had %0.1f now %0.1f)",m,health,GetPVarFloat(playerid, "Zivot"));
SendClientMessageToAll(-1,str);
//Kick(playerid);
}
else
{
return SetPVarFloat(playerid,"Zivot",health-amount);
}
if(armour != 0.0 && GetPVarFloat(playerid,"Armour") != armour)
{
GetPlayerName(playerid,m,30);
format(str,128,"player %s used arm hack (had %0.1f now %0.1f) kick",m,health,GetPVarFloat(playerid, "Armour"));
SendClientMessageToAll(-1,str);
//Kick(playerid);
}
else
{
return SetPVarFloat(playerid,"Armour",armour-amount);
}
return 1;
}