SA-MP Forums Archive
how to put players name? - 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: how to put players name? (/showthread.php?tid=519682)



how to put players name? - DIVESHSEET - 15.06.2014

like >>>>>>>>>>>>> WELCOME (PLAYERNAME) TO ***********
>>>>>>>>>>>>> (PLAYER NAME) HAS KILLED (DEADPERSON)
>>>>>>>>>>>>> (playername) has successfully DESTROYED THE BASE of b*** t***


Re: how to put players name? - RenovanZ - 15.06.2014

Use GetPlayerName


Re: how to put players name? - SyntaxQ - 15.06.2014

pawn Код:
stock GetName(playerid)
{
    new pName[MAX_PLAYERS];
    GetPlayerName(playerid, pName, sizeof(pName));
    return pName;
}
GetName(id_of_the_player);

For example:
pawn Код:
// OnPlayerDeath
new str[128];
format(str, sizeof(str), "You have been killed by %s", GetName(killerid));
SendClientMessage(playerid, -1, str);