CheckPh
#8

Quote:
Originally Posted by Roel
Посмотреть сообщение
Ah ok, I suggest you to use a simpel random(999999); or something, it will almost never happen, that there are two the same numbers used, and that those two players are at the same time online.

But if you wan't it that way, you should put this at the
Код:
if(strcmp(string, "number", true) == 0)
Remember to set the number format to a string.
Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
stock CheckPh(nmbr)
{
    new string[20];
    new File: file = fopen("phone.cfg", io_read);
    if(!fexist("phone.cfg")) { print("Couldn't find phone.cfg, created file."); fcreate("phone.cfg"); return 0; }
    while(fread(file, string))
    {
        if(strval(string) == nmbr)
        {
            fclose(file);
            return 1;
        }
    }
    fclose(file);
    return 0;
}
I would recommend using MySQL for these kinds of things.
I guess I will go to MySQL later, but right now I'd like to use flatfiles.

Thank you.
Reply


Messages In This Thread
CheckPh - by Why - 03.10.2012, 14:16
Re: CheckPh - by Roel - 03.10.2012, 14:19
Re: CheckPh - by Why - 03.10.2012, 14:23
Re: CheckPh - by Roel - 03.10.2012, 14:24
Re: CheckPh - by Why - 03.10.2012, 14:26
Re: CheckPh - by SuperViper - 03.10.2012, 14:27
Re: CheckPh - by Roel - 03.10.2012, 14:28
Re: CheckPh - by Why - 03.10.2012, 14:28
Re: CheckPh - by SuperViper - 03.10.2012, 14:29
Re: CheckPh - by Roel - 03.10.2012, 14:32

Forum Jump:


Users browsing this thread: 2 Guest(s)