SA-MP Forums Archive
Help strfind - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help strfind (/showthread.php?tid=487482)



Help strfind - MatriXgaMer - 13.01.2014

Help i have this code
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "jedi govna", true) !=-1 && strfind(text, "mrs", true) !=-1 && strfind(text, "jebem ti mater", true)!=-1)
    {
        SendClientMessage(playerid, -1, ""SVETLOSMEDJA"[CL:RP]: "BELA"(( Budi dobar decko i ne govori proste reci! ))");
        return 0;
    }
    return 1;
}
It should prevent the player saving this bad words, it worked with "**** *****" then i added "***" and "***** ** *****" and its only works now with the last one (CENSORED!).


Re: Help strfind - Don_Cage - 13.01.2014

Try this.
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "jedi govna", true) !=-1 || strfind(text, "mrs", true) !=-1 || strfind(text, "jebem ti mater", true)!=-1)
    {
        SendClientMessage(playerid, -1, ""SVETLOSMEDJA"[CL:RP]: "BELA"(( Budi dobar decko i ne govori proste reci! ))");
        return 0;
    }
    return 1;
}



Re: Help strfind - MatriXgaMer - 13.01.2014

Thanks