OnPlayerGiveDamageActor Not Calling
#1

Hi everyone,

When I shoot actors OnPlayerGiveDamageActor callback is not calling. I can't figure out why. It was working a while ago. But because of some reason which is i don't know, it stopped working. What can cause this issue?

EDIT: I've put a print message in public but it's not showing up either. I also set actor's invulnerable to false.

EDIT 2: Problem solved! Check this if you have the same problem.
Reply
#2

did u try to test it?
pawn Код:
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
{
    new string[128], attacker[MAX_PLAYER_NAME];
    new weaponname[24];
    GetPlayerName(playerid, attacker, sizeof (attacker));
    GetWeaponName(weaponid, weaponname, sizeof (weaponname));
 
    format(string, sizeof(string), "%s has made %.0f damage to actor id %d, weapon: %s", attacker, amount, damaged_actorid, weaponname);
    SendClientMessageToAll(0xFFFFFFFF, string);
    return 1;
}
Reply
#3

Quote:
Originally Posted by tungki
Посмотреть сообщение
did u try to test it?
pawn Код:
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
{
    new string[128], attacker[MAX_PLAYER_NAME];
    new weaponname[24];
    GetPlayerName(playerid, attacker, sizeof (attacker));
    GetWeaponName(weaponid, weaponname, sizeof (weaponname));
 
    format(string, sizeof(string), "%s has made %.0f damage to actor id %d, weapon: %s", attacker, amount, damaged_actorid, weaponname);
    SendClientMessageToAll(0xFFFFFFFF, string);
    return 1;
}
Yes. I've put a print message right after public header. But it's not showing up.
Reply
#4

Try it on a normal server, not home host. Easy fix.
Reply
#5

Problem is still going on. Can anyone help?
Reply
#6

that's SAMP i guess. i've seen hundred's of simillars issues.

OnPlayerGiveDamageActor doesn't work anymore. i don't know why. (downgrade to 0.3x and try again)
Reply
#7

Make sure you set the actor's invulnerability to 0, SetActorInvulnerable.

Quote:
Originally Posted by XeonMaster
Посмотреть сообщение
OnPlayerGiveDamageActor doesn't work anymore. i don't know why. (downgrade to 0.3x and try again)
Quote:
Originally Posted by SA-MP Wiki
This callback was added in SA-MP 0.3.7 and will not work in earlier versions!
Reply
#8

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Make sure you set the actor's invulnerability to 0, SetActorInvulnerable.
Reply
#9

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Make sure you set the actor's invulnerability to 0, SetActorInvulnerable.
that's make me sure.

Actors was released first time for 0.3.7 so there might be some bugs on it.

EDIT: @OP set actor health to 100 and try again.
Reply
#10

Quote:
Originally Posted by Novacaine
Посмотреть сообщение
Hi everyone,

When I shoot actors OnPlayerGiveDamageActor callback is not calling. I can't figure out why. It was working a while ago. But because of some reason which is i don't know, it stopped working. What can cause this issue?

EDIT: I've put a print message in public but it's not showing up either. I also set actor's invulnerable to false.
Solved ? If it is, tell me the solution please! ahah
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)