SA-MP Forums Archive
Help - 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 (/showthread.php?tid=386728)



Help - Counterafk - 21.10.2012

Hi, i got a question.

i would like to have a text in the chat saying "A player has just been killed" But instead of a player, it should be the players name, how do i fix that? This is what i've done sofar.

public OnPlayerDeath(playerid, killerid, reason)
{
SendClientMessageToAll(0xDEEE20FF, "A player has just been killed!"
return 1;
}

Thanks in forehand!


Re: Help - Glint - 21.10.2012

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new pName[MAX_PLAYER_NAME], Str[128];
	GetPlayerName(playerid, pName, sizeof(pName));
	format(Str, sizeof(Str), "%s has just been killed", pName);
	SendClientMessageToAll(-1, Str);
	return 1;
}