Clean Players Names - 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: Clean Players Names (
/showthread.php?tid=93845)
Clean Players Names -
mini-d - 27.08.2009
Does any1 have a function that Clean a players name of _ Like GetPlayerName then Like set the "_" to ""
Re: Clean Players Names -
Sergei - 27.08.2009
pawn Код:
stock GetPlayerNameEx(playerid)
{
new string[24];
GetPlayerName(playerid,string,24);
new str[24];
strmid(str,string,0,strlen(string),24);
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if (str[i] == '_') str[i] = ' ';
}
return str;
}
Re: Clean Players Names -
WrathOfGenesis - 27.08.2009
Quote:
stock GetPlayerNameEx(playerid)
{
new string[24];
GetPlayerName(playerid,string,24);
new str[24];
strmid(str,string,0,strlen(string),24);
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if (str[i] == '_') str[i] = ' ';
}
return str;
}
|
Wouldnt work. That would change LOL_HAI to LOL HAI. He needs it to change to LOLHAI from what his first post said.
Re: Clean Players Names -
MenaceX^ - 27.08.2009
Use strdel.
pawn Код:
stock GetPlayerNameEx(playerid)
{
new n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
for(new i=0;i<strlen(n);i++)
if(n[i]=='_')
n[i]=' ';
return n;
}
My GetPlayerNameEx function. I think using strmid is useless in the other posted codes.
Quote:
Originally Posted by XCultz
Quote:
Originally Posted by $ЂЯĢ
pawn Код:
stock GetPlayerNameEx(playerid) { new string[24]; GetPlayerName(playerid,string,24); new str[24]; strmid(str,string,0,strlen(string),24); for(new i = 0; i < MAX_PLAYER_NAME; i++) { if (str[i] == '_') str[i] = ' '; } return str; }
|
lol nice?
|
Why are you spamming?
Re: Clean Players Names -
WrathOfGenesis - 27.08.2009
pawn Код:
stock GetPlayerNameEx(playerid)
{
new string[24];
GetPlayerName(playerid,string,24);
new str[24];
strmid(str,string,0,strlen(string),24);
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if (str == '_') strdel ( str , i , i );
}
return str;
}
Ive never used strdel. Would it be used something like this?
Re: Clean Players Names -
MenaceX^ - 27.08.2009
Wiki.