Name problem
#1

Hello...
I have a roleplay server with name : Lastname_Firstname..
But,when i type /me and /do or at any roleplay the name appear with "_"

Example :
((/me))
John_Koperfield extends his hand...
That _ i don`t want to appear at roleplay...

Look here :



See there ? I don`t want that underline appear there at /me and /do
Reply
#2

pawn Код:
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof szName);
szName[strfind(szName, "_")] = ' ';
Reply
#3

Don`t working...I want to keep RP name but i don`t want to appear that underline at /me and /do
Reply
#4

Use it in your command i guess
Reply
#5

No...this underline it`s on all commands[RP commands]...
Reply
#6

Post /me or /do command And I'll edit it for you..
Reply
#7

It's simple, you can get player name and clean player name once, then just call it.

pawn Код:
new pName[MAX_PLAYERS][24];
new cName[MAX_PLAYERS][24];

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid,pName[playerid],24);
    ClearName(playerid);

    // Other shit

    return 1;
}

stock ClearName(playerid)
{
    cName[playerid] = pName[playerid];
    new pos = strfind(pName[playerid],"_");
    if(pos != -1)
        cName[playerid][pos] = 32;
}

// Now you can use pName[playerid] to get a player name
// And you also can use cName[playerid] to get his name without underlines.

// example

CMD:example(playerid)
{  
    printf("Player Name: %s | Clean Name: %s",pName[playerid],cName[playerid]);
    return 1;
}
Fast and easy, just have to get and clean name once, making your server a little faster ^^

@edit

Sorry, removed an unnecessary placeholder.
Reply
#8

pawn Код:
CMD:example(playerid)
{  
    printf("Player Name: %s | Clean Name: %s",pName[playerid],cName[playerid]); //Your example was wrong :D
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)