public OnPlayerDeath(playerid, killerid, reason)
#1

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
        if(!
IsPlayerNPC(playerid))
        {
            new 
name[24], kname[30], string[64];
            
GetPlayerName(playeridname24);
            
GetPlayerName(killeridkname30);
            
format(stringsizeof(string), "%s has been killed by %s with weapon: %s"name,kname,reason);
SendMessageToAllAdmins(string, -1); 
But at weapon name it shows "t"
Reply
#2

Reason is the reason of death. example died from falling etc, not the name of the weapon
Reply
#3

The reason isn't an array. You need use GetWeaponName to get weapon name.
Reply
#4

Reason is an integer you were printing a string.
You need to check if the player died by fall/fire/drown etc aka killerid = INVALID_PLAYER_ID.
Otherwise if player died by a weapon just get the weapon name.
Reply
#5

You should assign manually the weaponid it's name, and that by using a list.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)