Get name before underscore
#2

This will help you out buddy:
pawn Код:
stock getFirstName(szPlayerName[]) {
    new
        _tmpSzPlayerName[MAX_PLAYER_NAME],
        iCh = strfind(szPlayerName, "_", true);
       
    if(iCh != -1) {
        strcat(_tmpSzPlayerName, szPlayerName, MAX_PLAYER_NAME);
        strdel(_tmpSzPlayerName, iCh, strlen(szPlayerName));
    } else {
        format(_tmpSzPlayerName, sizeof(_tmpSzPlayerName), "Nameless");
    }

    return _tmpSzPlayerName;
}
Reply


Messages In This Thread
Get name before underscore - by SKAzini - 14.11.2012, 17:14
Re: Get name before underscore - by Faisal_khan - 14.11.2012, 17:43
Re: Get name before underscore - by SKAzini - 14.11.2012, 18:25

Forum Jump:


Users browsing this thread: 2 Guest(s)