01.03.2012, 04:48
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.
You might also wanna learn how the file functions work completely if you haven't already. Goodluck man.
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.

