SA-MP Forums Archive
Player killed by player [HELP] +REP - 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)
+--- Thread: Player killed by player [HELP] +REP (/showthread.php?tid=570642)



Player killed by player [HELP] +REP - Chausar - 12.04.2015

i want the message shown when player 1 killed player two with gun type that player 2 used to kill player 1 example:

Код:
SendClientMessage(playerid, -1, " player 1 has been killed by player 2 with (Weapon)");
Example: Carl has been killed by niko with shotgun!


HELP ME PLS!


AW: Player killed by player [HELP] +REP - Mencent - 12.04.2015

Hello!

You can use the function GetWeaponName:
PHP код:
new gunname[32],string[145],fName[MAX_PLAYER_NAME],sName[MAX_PLAYER_NAME];
GetWeaponName(reason,gunname,sizeof gunname);
GetPlayerName(playerid,fName,MAX_PLAYER_NAME);
GetPlayerName(killerid,sName,MAX_PLAYER_NAME);
format(string,sizeof string,"player %s has been killed by player %s with %s",fName,sName,gunname);
SendClientMessageToAll(-1,string); 
Mencent


Re: Player killed by player [HELP] +REP - R0 - 12.04.2015

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new gunname[32],string[128],Name[MAX_PLAYER_NAME],kName[MAX_PLAYER_NAME];
    GetWeaponName(reason,gunname,sizeof gunname);
    GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
    GetPlayerName(killerid,kName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has been killed by player %s with %s",Name,kName,gunname);
    SendClientMessageToAll(-1,string);  
    return 1;
}