04.08.2013, 10:22
so I'm working on a ban system
in my server, onplayerdisconnect, I made it saves the IP, as IP. IP == ***.***.**.**
and also when banned, anti cheat banned, Banned == 1
I want it to loop through all offline INI files to check for the IP and Banned
for example
What do you think?
in my server, onplayerdisconnect, I made it saves the IP, as IP. IP == ***.***.**.**
and also when banned, anti cheat banned, Banned == 1
I want it to loop through all offline INI files to check for the IP and Banned
for example
pawn Код:
if(PlayerInfo[playerid][pBanned] == 1) //Kicks from server, that's for name ban
//for IP matching ban..
//I want it to loop through all offline members in the "PATH" and check for IP matching and IP in Y_INI files and if banned == 1
//I tried doing something bbut it didn't work, look
//under OnPlayerConnect
new pIPp[16];
//new file[60];
GetPlayerIp(playerid, pIPp, sizeof(pIPp));
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
/*for(new i=0; i<MAX_PLAYERS; i++)
{
format(file,sizeof(file),"Users/%s.ini",i);
if(fexist(file))
{
INI_ParseFile(UserPath(i), "LoadUser_%s", .bExtra = true, .extra = i);
GetPlayerName(playerid,pname,sizeof(pname));
if(pIPp[playerid] == PlayerInfo[i][pIP] && PlayerInfo[i][pBanned] == 1 && strcmp(UserPath(i),pname) == 0)
{
format(string,sizeof(string),"[BANNED] You are currently banned from the server. [Reason: Ban Evading]");
SendClientMessage(playerid, COLOR_RED,string);
new INI:File = INI_Open(UserPath(playerid));
INI_WriteString(File,"Reason2","Ban Evading");
INI_Close(File);
SendClientMessage(playerid, COLOR_RED,"[BANNED] Your ban duration is now increased due to ban evading.");
SetTimerEx("KickPlayer",1000,false,"i",playerid);
return 1;
}
}
}*/
if(PlayerInfo[playerid][pBanned] == 1)
{
format(string,sizeof(string),"[BANNED] You are currently banned from the server. [Reason: %s]",PlayerInfo[playerid][pBanReason]);
SendClientMessage(playerid, COLOR_RED,string);
SendClientMessage(playerid, COLOR_RED,"[BANNED] Please Ban Appeal on our forums at www.website.net");
SetTimerEx("KickPlayer",1000,false,"i",playerid);
return 1;
}