SA-MP Forums Archive
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: Player name (/showthread.php?tid=109685)



Player name - Luka P. - 21.11.2009

I'm editing one RP gamemode.
When you connect, it has, "Welcome %s!" and other things.
So when I connect, there's a message "Welcome Firstname_Lastname!"
but I want to make it "Welcome Firstname Lastname!" so there's no _ char.

Please I need help, thanks.

EDIT: Also,how to create a folder with pawn?


Re: Player name - Donuts - 21.11.2009

pawn Код:
stock GetPlayerNameEx(playerid)
{
   new string[MAX_PLAYER_NAME];
   GetPlayerName(playerid, string, sizeof(string));
   for(new i; i < MAX_PLAYER_NAME; i++) if (string[i] == '_') string[i] = ' ';
   return string;
}



Re: Player name - Luka P. - 21.11.2009

Thanks


Re: Player name - dice7 - 21.11.2009

try this
http://forum.sa-mp.com/index.php?topic=117138.0


Re: Player name - Luka P. - 22.11.2009

Quote:
Originally Posted by dice7
I can't create a folder with it, just files.


Re: Player name - Dj_maryo1993 - 25.11.2009

try this on creating folders
pawn Код:
blabla .... .
format(entry, sizeof(entry), "folder1\folder2infloder1\folder3infolder2\file\n",string);
bla bla ....
It was something like that


Re: Player name - Luka P. - 25.11.2009

Quote:
Originally Posted by Dj_maryo1993
try this on creating folders
pawn Код:
blabla .... .
format(entry, sizeof(entry), "folder1\folder2infloder1\folder3infolder2\file\n",string);
bla bla ....
It was something like that
I don't want to insult you, but you should know what you're typing.
You're formatting, not creating file/folder.
And that won't work because it only creates a file if the folder exist, not creating a new folder.


Re: Player name - Sergei - 25.11.2009

pawn Код:
stock PlayerNameEx(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    new i = strfind(pname,"_",true);
    if(i != (-1)) pname[i] = ' ';
    return pname;
}
If you don't need loops I don't know why would you use it.