05.07.2013, 08:54
Alright, another noobie question from me! I have this code I found on the wiki:
This part: "if(GetPlayerAnimationIndex(playerid) != 1666" is supposed to check if player has vending machine use animation. But it still proceeds the code, what am I doing wrong? I don't want to remove them machines.
pawn Код:
forward CheckHealth(playerid);
public CheckHealth(playerid)
{
new Float:fHealth;
GetPlayerHealth(playerid, Float:fHealth);
if(fHealth != GetPVarFloat(playerid, "faPlayerHealth"))
{
if(GetPlayerAnimationIndex(playerid) != 1666 && GetTickCount() < (lastupdate[playerid]+2000) && fHealth > GetPVarFloat(playerid, "faPlayerHealth"))
{
SendClientMessageToAll(-1, "HACKS");
}
else
{
//player lost health && GetPlayerInterior(playerid) == 0
}
SetPVarFloat(playerid, "faPlayerHealth", fHealth);
}
return 1;
}