[HELP] Read From A File...
#4

Quote:
Originally Posted by Backwardsman97
Посмотреть сообщение
Ummmmmm... Try this.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[64];
    new File:forbiddenwords = fopen("ForbiddenWords.txt", io_read);
    while(fread(forbiddenwords, string))
    {
        if(!strcmp(string,text))
        {
            SendClientMessage(playerid, 0xFFFFFFF, "That word is forbidden!!!");
            fclose(forbiddenwords);
            return 0;
    }
    }
    fclose(forbiddenwords);
    return 1;
}
Warnings: Loose intendation
And why do you loop the fclose()?
Reply


Messages In This Thread
[HELP] Read From A File... - by Larsey123IsMe - 30.12.2010, 03:20
Re: [HELP] Read From A File... - by _rAped - 30.12.2010, 03:24
Re: [HELP] Read From A File... - by Backwardsman97 - 30.12.2010, 03:38
Re: [HELP] Read From A File... - by _rAped - 30.12.2010, 03:41
Re: [HELP] Read From A File... - by Backwardsman97 - 30.12.2010, 04:09
Re: [HELP] Read From A File... - by _rAped - 30.12.2010, 04:11
Re: [HELP] Read From A File... - by Larsey123IsMe - 30.12.2010, 04:45
Re: [HELP] Read From A File... - by Larsey123IsMe - 30.12.2010, 04:51
Re: [HELP] Read From A File... - by _rAped - 30.12.2010, 04:54
Re: [HELP] Read From A File... - by Larsey123IsMe - 30.12.2010, 04:57

Forum Jump:


Users browsing this thread: 3 Guest(s)