Player name
#1

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?
Reply
#2

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;
}
Reply
#3

Thanks
Reply
#4

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

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

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

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.
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)