12.08.2013, 13:13
Hi everyone. I've encountered an issue with this script:
The health or armour won't appear (only some times they will).
But if I change the ">" in "!=" I won't have this problem.
By the way, the object will display even when a player gets healed and I don't want that to happen. How can I solve this problem? Thanks
pawn Код:
GetPlayerHealth(playerid, pHealth);
GetPlayerArmour(playerid, pArmour);
if(Giocatore[playerid][Health] > floatround(pHealth))
{
Giocatore[playerid][Health] = floatround(pHealth);
new cuore;
cuore = CreateObject(1240, 0, 0, 0, 0, 0, 0);
AttachObjectToPlayer(cuore, playerid, 0, 0, 1.35, 0, 0, 0);
SetTimerEx("HealthArmour", 500, false, "i", cuore);
}
if(Giocatore[playerid][Armour] > floatround(pArmour))
{
Giocatore[playerid][Armour] = floatround(pArmour);
new giubbotto;
giubbotto = CreateObject(1242, 0, 0, 0, 0, 0, 0);
AttachObjectToPlayer(giubbotto, playerid, 0, 0, 1.50, 0, 0,0);
SetTimerEx("HealthArmour", 500, false, "i", giubbotto);
}
But if I change the ">" in "!=" I won't have this problem.
By the way, the object will display even when a player gets healed and I don't want that to happen. How can I solve this problem? Thanks
