SA-MP Forums Archive
Load file & check words? - 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: Load file & check words? (/showthread.php?tid=166561)



Load file & check words? - Schnacke - 09.08.2010

(Sry for bad English)
I've created a command with which I can write words in a file.
Now I want to load these words under OnGameModeInit and check in OnPlayerText.
But how?xD


Re: Load file & check words? - Claude - 09.08.2010

pawn Код:
new file[100];
format(file, sizeof(file),"badwords.txt");
new File:badword = fopen("badwords.txt", io_append);
if(badword)
{
    if(strfind(text[], file, true) != -1)
    {
        SendClientMessage(playerid, COLOR_RED,"That word is not allowed");
        return 0;
    }
}
Add that on OnPlayerText, not sure if it works