OnPlayerDeath problem
#1

Hello, members of SA-MP Forums. I have the following code:

pawn Код:
new gunname[32], dName[MAX_PLAYER_NAME], rName[MAX_PLAYER_NAME];
        GetWeaponName(reason,gunname,sizeof(gunname));
        GetPlayerName(playerid,dName,MAX_PLAYER_NAME);
        GetPlayerName(killerid,rName,MAX_PLAYER_NAME);
        printf("%d,%d,%d",playerid,killerid,reason);
        format(string, sizeof(string), "Administrator Warning: %s has killed %s using %s.", rName, dName, gunname);
        SendClientMessage(playerid, -1, string);
And.. console output:
Код:
1,65535,255
1 - playerid ; 65535 - killerid ; 255 - reason (weapon id) - 255

In-game output:
Код:
. has killed [player name here] using .
Why is this happening and how to fix it?
Reply
#2

put your code in :

PHP код:
if(killerid != INVALID_PLAYER_ID)
{
    
//your code
    
return 1;

Reply
#3

Now it doesn't even output anything...
Reply
#4

One more thing, the reason is always 255 no matter what weapon has been used or who has killed who...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)