[Question] strdel(string, strfind...) ?
#2

Why are you trying to force an if test inside strdel?

pawn Код:
stock rpname(playerid)
{
    new cname[MAX_PLAYER_NAME], charpos;
    GetPlayerName(playerid, cname, sizeof(cname));
    charpos = strfind(cname, "_"); //get the position of the '_' if it exists inside the name.
    if(charpos != -1) //if charpos is -1, that means that '_' was not found, else it's the position of '_'
        strdel(cname, charpos, charpos); //delete the '_'
    return cname; //return the final result
}
Reply


Messages In This Thread
[Question] strdel(string, strfind...) ? - by Lorrden - 09.02.2011, 19:40
Re: [Question] strdel(string, strfind...) ? - by Krx17 - 09.02.2011, 20:02
Re: [Question] strdel(string, strfind...) ? - by Lorrden - 09.02.2011, 20:45
Re: [Question] strdel(string, strfind...) ? - by MadeMan - 09.02.2011, 20:58
Re: [Question] strdel(string, strfind...) ? - by randomkid88 - 09.02.2011, 21:12
Re: [Question] strdel(string, strfind...) ? - by Lorrden - 09.02.2011, 22:11
Re: [Question] strdel(string, strfind...) ? - by Krx17 - 10.02.2011, 02:04
Re: [Question] strdel(string, strfind...) ? - by randomkid88 - 10.02.2011, 02:10

Forum Jump:


Users browsing this thread: 1 Guest(s)