Little problem.
#1

Hey, It's been my second time today but..
I'm trying to remove the underscore in the WHOLE string,
Like any other roleplay script, Ive been trying few guides But I can't get it to work.
Can someone explain to me what to do carefully, or just help me to script it.
If it can come in a filterscript it will help, Thanks in advance.
Reply
#2

Код:
stock GetRPName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}
You'll have to use GetRPName instead of GetPlayerName if you want to remove underscores, just stick this anywhere in your game mode
Reply
#3

Cool one jaydenJason bhai
Reply
#4

Lighter one:
PHP код:
stock GetName(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    
name[strfind(name,"_")] = ' ';
    return 
name;

Reply
#5

I don't understand where Do I put it? Cus it aint working
Reply
#6

Just put this:
PHP код:
stock GetRPName(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    for(new 
0MAX_PLAYER_NAMEi++)
    {
        if(
name[i] == '_'name[i] = ' ';
    }
    return 
name;

anywhere in the script.
Reply
#7

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Just put this:
PHP код:
stock GetRPName(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    for(new 
0MAX_PLAYER_NAMEi++)
    {
        if(
name[i] == '_'name[i] = ' ';
    }
    return 
name;

anywhere in the script.
Thanks for the credits
Reply
#8

And then use it by doing something like this:
pawn Код:
format(string, sizeof(string), "%s", GetRPName(playerid));
Reply
#9

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
And then use it by doing something like this:
pawn Код:
format(string, sizeof(string), "%s", GetRPName(playerid));
Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
Thanks for the credits
Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Just put this:
PHP код:
stock GetRPName(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    for(new 
0MAX_PLAYER_NAMEi++)
    {
        if(
name[i] == '_'name[i] = ' ';
    }
    return 
name;

anywhere in the script.
Quote:
Originally Posted by zork
Посмотреть сообщение
Lighter one:
PHP код:
stock GetName(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    
name[strfind(name,"_")] = ' ';
    return 
name;

Y'all helped me a lot! Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)