OnPlayerTakeDamage
#1

Hi, my Onplayertakedamage sometimes doesnt respond like it should, the player can just continue running like nothing ever happend.

pawn Код:
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(weaponid == 23)
        {
            if(tazer[issuerid] == 1)
            {
                TogglePlayerControllable(playerid, 0);
                SetTimerEx("Tazed", 10000, false, "i", playerid);
                ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
            }
        }
    }
    return 1;
}
Reply
#2

Don't use
Код:
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
Reply
#3

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Don't use
Код:
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
Thats the worst comment I ever heared.

If I remove that it will give me a warning that the symbol needs more explanation etc.
Reply
#4

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Thats the worst comment I ever heared.

If I remove that it will give me a warning that the symbol needs more explanation etc.
costel_nistor96 is correct!
The callback was added at 0.3d
There is no reason to forward the callback, as it's already.
Reply
#5

Quote:
Originally Posted by Dwane
Посмотреть сообщение
costel_nistor96 is correct!
The callback was added at 0.3d
There is no reason to forward the callback, as it's already.
But why does it give me that warning even if I have everything updated?
Reply
#6

Does it give you warning 235?
pawn Код:
warning 235: public function lacks forward declaration (symbol "OnPlayerTakeDamage")
If you got this warning, make sure you have all 0.3d includes.
Else if it's another warning, post it here.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)