OnPlayerDeath
#1

~~~~~~
Reply
#2

Anyone?
Reply
#3

Bump
Reply
#4

could you explain what exactly does NOT work?

what's this piece of code supposed to do.

what does not work.
Reply
#5

Its supposed to show up when a player dies or when a player gets killed, if i suicide the message won't send..
Reply
#6

put this in your GM, it's got some debug msgs to determine where the problem occurs.

pawn Код:
print( "starting" );
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
    {
        print( "1" );
        new WeapName[32], Name[MAX_PLAYER_NAME], KillerName[MAX_PLAYER_NAME];
        print( "2" );
        GetWeaponName(reason, WeapName, sizeof(WeapName));
        printf( "wepName: %s", WeapName );
        GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
        printf( "pName: %s", Name );
        GetPlayerName(killerid, KillerName, MAX_PLAYER_NAME);
        printf( "kname: %s", KillerName );
        format(string, sizeof(string),"%s (%d) Died. Killed By: %s (%d) - %s. ", Name, playerid, KillerName, killerid, WeapName);
        printf( "%s", string );
        SendClientMessageToAll(COLOR_DARKRED, string);
        print( "7" );
        SendDeathMessage(killerid, playerid, reason);
        print( "8" );
    }
    else
    {
        print( "9" );
        new Name[MAX_PLAYER_NAME];
        print( "10" );
        GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
        printf( "%s", Name );
        format(string, sizeof(string),"%s (%d) Died.", Name, playerid);
        printf( "%s", string );
        SendClientMessageToAll(COLOR_DARKRED, string);
        print( "13" );
        SendDeathMessage(killerid, playerid, reason);
        print( "14" );
    }
print( "end!" );
go ingame, suicide or get killed, and paste the server-log here.
Reply
#7

pawn Код:
[13:38:27] Number of vehicle models: 10
[13:38:27] Incoming connection: 127.0.0.1:55380
[13:38:27] [npc:join] [BOT]TestBot has joined the server (0:127.0.0.1)
[13:39:27] [death] Ananisiki died 255
[13:39:58] [death] Ananisiki died 54
Reply
#8

It should call OnPlayerDeath, so post the whole callback.
Reply
#9

Try to use the OnPlayerDeath reason
pawn Код:
switch(reason)
{
   case 53: // Drowned
   case 54: // Collision
   default: // This happens when it is a different reason
}
Reply
#10

That is all i got in my server_log
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)