Player killed by player [HELP] +REP
#1

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!
Reply
#2

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
Reply
#3

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)