SA-MP Forums Archive
Repost: RP Name help - 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)
+--- Thread: Repost: RP Name help (/showthread.php?tid=644580)



Repost: RP Name help - Arbico - 10.11.2017

Note: I posted this before, but people seem to stop replying, and i still need help
Hello guys, i made this function to return the player name without the "_" but it returns nothing at all

Here's the code
PHP код:
stock RPname(playerid) { 
    new 
playerName[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridplayerNamesizeof(playerName)); 
    new 
RName[MAX_PLAYER_NAME]; 
    for(new 
0strlen(Name(playerid)); i++) { 
        if(!
strcmp(playerName[i], "_"true)) { 
            
strins(RName" "strlen(RName)); 
        } 
        else { 
            
strcat(RNameplayerName[i], strlen(RName)); 
        } 
    } 
    return 
RName

What's wrong here?


Re: Repost: RP Name help - Meller - 10.11.2017

uhm, i cant bother reading that code, you could've easily done this:

PHP код:
rpname(playerid) {
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof name);
    for(new 
charEx 0charEx strlen(name); charEx++)
        if(
name[charEx] == '_')
         
name[charEx] = ' ';
    return 
name;

simple ye?


Re: Repost: RP Name help - Arbico - 10.11.2017

Quote:
Originally Posted by Meller
Посмотреть сообщение
uhm, i cant bother reading that code, you could've easily done this:

PHP код:
rpname(playerid) {
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof name);
    for(new 
charEx 0charEx strlen(name); charEx++)
        if(
name[charEx] == '_')
         
name[charEx] = ' ';
    return 
name;

simple ye?
I did that ands it's not working for me.


Re: Repost: RP Name help - Thomas Dallos - 10.11.2017

Код:
stock Name(playerid)
{
	new Role_Play_Name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Role_Play_Name, sizeof(Role_Play_Name));

	for(new i = 0; i < MAX_PLAYER_NAME; i++) // By.: Gentleman
	{
   		if(Role_Play_Name[i] == '_')
   		{
        	Role_Play_Name[i] = ' ';
   		}
	}

	return Role_Play_Name;
}



Re: Repost: RP Name help - Meller - 10.11.2017

Quote:
Originally Posted by Arbico
Посмотреть сообщение
I did that ands it's not working for me.





Then you did something wrong.


Re: Repost: RP Name help - Lucases - 10.11.2017

We already told you what's the error.
You forgot the %s specifier in your format function, before the SendClientMessage function.


Re: Repost: RP Name help - n00blek - 10.11.2017

meller whats that text editor i really want it?
Atom?


Re: Repost: RP Name help - Meller - 10.11.2017

Quote:
Originally Posted by n00blek
Посмотреть сообщение
meller whats that text editor i really want it?
Atom?
https://www.sublimetext.com/
https://sampforum.blast.hk/showthread.php?tid=511195