SA-MP Forums Archive
Death Message Weapon? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Death Message Weapon? (/showthread.php?tid=67969)



Death Message Weapon? - StrickenKid - 05.03.2009

i want to send a message on death with the gun the killer used

this is what i coded but no weapon appears, it just has a space

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  SendDeathMessage(killerid, playerid, reason);
  GetPlayerName(killerid, name, sizeof(name));
  GetPlayerName(playerid, dname, sizeof(dname));
  if(killerid != INVALID_PLAYER_ID){

        format(string, sizeof(string), "%s(%d) Has Killed %s(%d) With a %s.", name,killerid, dname,playerid,reason);
        SendClientMessageToAll(COLOR_RED, string);
    } else {
        format(string, sizeof(string), "%s (%d) Died.",dname,playerid);
        SendClientMessageToAll(COLOR_RED, string);
    }

    return 1;
}
i want it to say for example:

Jonny (8 Has Killed Steve (45) With A Combat Shotgun.

if he uses a combat shotgun....

thanks.


Re: Death Message Weapon? - Donny_k - 06.03.2009

'reason' is an integer not a string.


Re: Death Message Weapon? - Daren_Jacobson - 06.03.2009

GetWeaponName(reason)? that function is buggy though