Little help
#10

This probably doesn't work as I'm new to this as well. I just looked up a lot of C++ references to help me come up with this.


pawn Код:
public OnPlayerConnect(playerid)
{
    new IP[20],filestring[124];
    GetPlayerIp(playerid,IP,sizeof(IP)); //Stores the players IP into the IP string
    new File:banfile=fopen(/*your file here*/,io_read)// this opens your ban file and prepares it for reading.
    while(fread(/*your file here*/,filestring,sizeof(filestring)); // Reads the ban file and stores its content into filestring
    {
        if(strfind(filestring,IP) != -1)
        {
            SendClientMessage(playerid,-1,"You are banned.");
            Kick(playerid);
        }
    }
    return 1;
}

You might also wanna learn how the file functions work completely if you haven't already. Goodluck man.
Reply


Messages In This Thread
Little help - by new121 - 01.03.2012, 03:54
Re: Little help - by Walsh - 01.03.2012, 03:58
Re: Little help - by new121 - 01.03.2012, 04:01
Re: Little help - by Walsh - 01.03.2012, 04:05
Re: Little help - by new121 - 01.03.2012, 04:06
Re: Little help - by Walsh - 01.03.2012, 04:12
Re: Little help - by new121 - 01.03.2012, 04:21
Re: Little help - by Walsh - 01.03.2012, 04:23
Re: Little help - by new121 - 01.03.2012, 04:23
Re: Little help - by Walsh - 01.03.2012, 04:48

Forum Jump:


Users browsing this thread: 1 Guest(s)