Name problem
#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


Messages In This Thread
Name problem - by OnY - 06.12.2013, 16:32
Re: Name problem - by fordawinzz - 06.12.2013, 16:35
Re: Name problem - by OnY - 06.12.2013, 19:19
Re: Name problem - by Audi_Quattrix - 06.12.2013, 19:24
Re: Name problem - by OnY - 06.12.2013, 19:33
Re: Name problem - by xVIP3Rx - 06.12.2013, 19:38
Re: Name problem - by arakuta - 06.12.2013, 19:57
Re: Name problem - by Audi_Quattrix - 06.12.2013, 20:03

Forum Jump:


Users browsing this thread: 1 Guest(s)