when a guy givedamage it should show a heart or a armour over the head of the player which he attacked
pawn Код:
forward RemoveIcon(playerid);
public RemoveIcon(playerid)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(GetPlayerArmour(playerid) > 0.0)
{
SetTimerEx("RemoveIcon", 1500, false, "i", playerid);
if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
SetPlayerAttachedObject(playerid, 9, 1242, 17, 0.601999, -0.036000, 0.011000, 96.299972, 79.500015, -81.599990, 1, 1, 1);
return 1;
}
if(GetPlayerHealth(playerid) > 0.0)
{
SetTimerEx("RemoveIcon", 1500, false, "i", playerid);
if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9);
SetPlayerAttachedObject(playerid, 9, 1240, 17, 0.587000, -0.027000, 0.028000, 86.100051, 79.499977, -69.599990, 1, 1, 1);
return 1;
}
}
return 1;
}
C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(47) : error 029: invalid expression, assumed zero
You should store the amount of health/armour somewhere and they're passed by reference. They do not return the amount (actually GetPlayerHealth returns a value but for success/failure, not what you need).