strreplace problem
#4

You could easily use the standard strfind function to do the same thing, for example:

pawn Code:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));

    pname[strfind(pname, "_", false)] = ' '; // Find the location of _ in the array and replace it with a space!

    format(str, sizeof(str), "%s says: %s", pname, text);
    ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 0;
}
Simple as that, no need for a custom function!
Reply


Messages In This Thread
strreplace problem - by antonio600x - 30.08.2011, 11:58
Re: strreplace problem - by Pinguinn - 30.08.2011, 12:00
Re: strreplace problem - by antonio600x - 30.08.2011, 12:03
Re: strreplace problem - by JaTochNietDan - 30.08.2011, 12:18
Re: strreplace problem - by antonio600x - 30.08.2011, 12:26
Re: strreplace problem - by JaTochNietDan - 30.08.2011, 12:54

Forum Jump:


Users browsing this thread: 2 Guest(s)