SA-MP Forums Archive
Anti-Swear help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti-Swear help (/showthread.php?tid=145857)



Anti-Swear help - Torran - 04.05.2010

Before you reply, I am not using any filterscripts, I want to make it myself

Anyway im making Anti-Swear, And i know to use strfind to find a swear word?
Anyway once found how can i replace only AND ONLY the swear word with -SWEAR BLOCKED- ??


Re: Anti-Swear help - Norck - 04.05.2010

Use strfind to find a swear world, strdel to delete it and strins to insert "Swear Blocked"


Re: Anti-Swear help - Torran - 04.05.2010

And how will i use Strdel on a players text?
As i wont know where the first character and last character is?


Re: Anti-Swear help - dice7 - 04.05.2010

with strfind to get the first caracters pos and strlen for the swear words length


Re: Anti-Swear help - Kyle - 04.05.2010

pawn Код:
new Filter[][] =
{
  "hacker",
  "haxx",
  "hax",
};

ONPLAYERTEXT

for(new d; d<sizeof(Filter); d++)
{  
  if(strfind(text,Filter[d],true) != -1 ) return 0;
}