Detecting where a string is using strfind?
#5

Ah.. I did something like this hope it works:
pawn Code:
public OnPlayerText(playerid, text[])
{
    if(( strfind( text, "~r~", true ) != -1 ) && !( strfind( text, "~r~", true, 3 ) != -1))
    {
        new
            cStr [ 128 ],
            plName [ MAX_PLAYER_NAME ];

        GetPlayerName( playerid, plName, MAX_PLAYER_NAME );

        strdel( text, 0, 3 );
        format( cStr, 128, ""#I_White"%s says: "#I_ARed"%s", plName, text );
        SendClientMessageToAll( -1, cStr );
        return false;
    }
    return true;
}
Reply


Messages In This Thread
Detecting where a string is using strfind? - by 2KY - 18.11.2012, 14:04
Re: Detecting where a string is using strfind? - by Faisal_khan - 18.11.2012, 14:15
Re: Detecting where a string is using strfind? - by 2KY - 18.11.2012, 14:17
Re: Detecting where a string is using strfind? - by [KHK]Khalid - 18.11.2012, 14:20
Re: Detecting where a string is using strfind? - by Faisal_khan - 18.11.2012, 14:23
Re: Detecting where a string is using strfind? - by 2KY - 18.11.2012, 14:23
Re: Detecting where a string is using strfind? - by Vince - 18.11.2012, 14:24
Re: Detecting where a string is using strfind? - by [KHK]Khalid - 18.11.2012, 14:24

Forum Jump:


Users browsing this thread: 1 Guest(s)