OnPlayerGiveDamageActor don't work
#1

Код:
CMD:actor(playerid)
{
        new Float:pos[3];
        GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
	Actor[playerid] = CreateActor(28, pos[0], pos[1], pos[2], 0.0);
	SetActorInvulnerable(Actor[playerid], false);
        SetActorHealth(Actor[playerid], 100);
return 1;
}

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;
}
nothing happens when I shoot or punch actor
Reply
#2

Are you getting any warnings on compiling your gamemode?
Reply
#3

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Are you getting any warnings on compiling your gamemode?
Compiling does not give any warnings
Reply
#4

Weird, because that code, works fine when on a clean gamemode.
Reply
#5

This is working perfectly for me. It's weird...
Put some print on the callback to get where is the error.
Reply
#6

Sorry, I forgot 1 line

CMD:actor(playerid)
{
new Floatos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
Actor[playerid] = CreateActor(28, pos[0], pos[1], pos[2], 0.0);
SetActorInvulnerable(Actor[playerid], false);
SetActorHealth(Actor[playerid], 100);
ApplyActorAnimation(Actor[playerid], "CRACK", "crckdeth3", 4.1, 0,1,0,1,1);
return 1;
}

So I guess problem is in the animation
Reply
#7

Nope, still works. Do you do anything with OnPlayerGiveDamage?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)