#1

Guys i need help:

when a guy givedamage it should show a heart or a armour over the head of the player which he attacked

someone can remember this ?
Reply
#2

here : https://sampforum.blast.hk/showthread.php?tid=250076
Reply
#3

i mean a heart over the head or armour not numbers!
Reply
#4

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;
}
Reply
#5

C:\Documents and Settings\magnifique2012\Bureau\zm.pwn(47) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Remove dot (".")

Код:
if(GetPlayerHealth(playerid) > 0.0) .
Reply
#7

That was due to a dot by accident:
pawn Код:
if(GetPlayerHealth(playerid) > 0.0) . // <--
However, take a look at those function.

https://sampwiki.blast.hk/wiki/GetPlayerArmour
https://sampwiki.blast.hk/wiki/GetPlayerHealth

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).
Reply
#8

Thank You!!!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)