SA-MP Forums Archive
how to get player 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to get player name (/showthread.php?tid=265752)



how to get player name - handerson - 02.07.2011

how to get player name and put it to this function

Quote:

ShowPlayerDialog(playerid, 11, 0,"Sergeant's Reinforcement","Good Day Sgt.[Player Name]

i want get player name and put it to dialog
like this

ShowPlayerDialog(playerid, 11, 0,"Sergeant's Reinforcement","Good Day Sgt.[Player Name]

pls tell me

im a newb


Re: how to get player name - JaTochNietDan - 02.07.2011

See the example provided here

https://sampwiki.blast.hk/wiki/GetPlayerName

It has all you're asking for already written for you


Re: how to get player name - iPLEOMAX - 02.07.2011

This thread might also help you:

String Formatting


Re: how to get player name - Gazmull - 02.07.2011

pawn Код:
new name[MAX_PLAYER_NAME], string[64 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "Good Day Sgt.%s", name);
    ShowPlayerDialog(playerid, 11, 0,"Sergeant's Reinforcement", string, "OK", "CANCEL");
If you can't make one format .