this not working. where to put?
#1

i have this:
pawn Код:
stock GetName(playerid)
{
    new
        name[24];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace(name, '_', ' ');
    return name;
}
i have roleplay server. when people name like this: Firstname_lastname , it will remove the "_" from the names so it would look like Firstname lastname . but it not working. i put at the end of my script nothing happens?
Reply
#2

put this some where at last of your script thats it
and then you have to use it
in like
pawn Код:
public OnPlayerText(playerid , text[])
{
   new string[128];
   format(string ,sizeof(string) , "[%s]: %s",GetName(playerid),text))
   SendClientMessageToAll(-1,string);// this will send a white colored message
}
Reply
#3

okay so i put
pawn Код:
stock GetName(playerid)
{
    new
        name[24];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace(name, '_', ' ');
    return name;
}
at end of script at the bottom and what else do i add, edit, or remove?
Reply
#4

help?
Reply
#5

any errors?
Reply
#6

try this
pawn Код:
stock UnderScore(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;
}

public OnPlayerText(playerid,text[])
{
    new string[128];
    format(string,sizeof(string),"%s: %s", UnderScore(playerid),text);
    SendClientMessageToAll(color,string);
    return 0;
}
Reply
#7

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
try this
pawn Код:
stock UnderScore(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;
}

public OnPlayerText(playerid,text[])
{
    new string[128];
    format(string,sizeof(string),"%s: %s", UnderScore(playerid),text);
    SendClientMessageToAll(color,string);
    return 0;
}
workings! thanks!
Reply
#8

Np....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)