SA-MP Forums Archive
[HELP] Killed by * - 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: [HELP] Killed by * (/showthread.php?tid=510738)



[HELP] Killed by * - monster010 - 02.05.2014

I tried to make a SendClientMesaje whe killed by the killer.

Eg: * You got killed by Father *

pawn Код:
GetPlayerName(killerrid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Killed by %s *", killerid);
I put these at:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)



Re: [HELP] Killed by * - Eth - 02.05.2014

any place in your gamemode:
pawn Код:
stock GetName(playerid)
{
    new pName[24];
    GetPlayerName(playerid, (pName), sizeof(pName));
    return pName;
}
onplayerdeath:
pawn Код:
new string[256];
format(string, sizeof(string), "* Killed by %s *", GetName(killerid));
SendClientMessage(playerid,-1,string);



Re: [HELP] Killed by * - Konstantinos - 02.05.2014

You have it as:
pawn Код:
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Killed by %s *", killerid);
but you first need to format and then send the formatted message:
pawn Код:
format(string, sizeof(string), "* Killed by %s *", killerid);
SendClientMessage(playerid, COLOR_LIGHTRED, string);