GetPlayerName help
#6

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
Like this:
pawn Код:
#include <a_samp>

public OnPlayerSpawn(playerid)
{
    new name[24];
    GetPlayerName(playerid,name,24);
    if(!strcmp(name,"Michael",false)) SendClientMessageToAll(0x00FF00FF,"Michael has spawned!");
    return 1;
}
I wouldn't use 24 but MAX_PLAYER_NAME instead...

pawn Код:
new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name));
SAMP's name length could always change...then you'd be the one going through all of your new name[24] (unless using a stock) changing them to the new size..
Reply


Messages In This Thread
GetPlayerName help - by MichaelProPlayer - 09.05.2012, 09:13
Re: GetPlayerName help - by [MG]Dimi - 09.05.2012, 09:17
Re: GetPlayerName help - by MichaelProPlayer - 09.05.2012, 09:19
Re: GetPlayerName help - by JaKe Elite - 09.05.2012, 09:20
Re: GetPlayerName help - by [MG]Dimi - 09.05.2012, 09:22
Re: GetPlayerName help - by [ABK]Antonio - 09.05.2012, 09:24
Re: GetPlayerName help - by MichaelProPlayer - 09.05.2012, 09:27

Forum Jump:


Users browsing this thread: 1 Guest(s)