How do I fix that? That's an unban command.
It'll look in the folder for the name typed, open his file and set it's banned bools for
. So, it's the problem: I need to keep these value on an variable, and I don't know how to do it on Y_INI.
pawn Code:
new id[30], string[400], File[256];
new msg[100];
new bool:PB, bool:TB, TimesBanned;
if(sscanf(params, "s[30]", id)) return Msg(playerid, color, ""#gold"[USAGE]: "#blue"/unban <player name>");
format(File,sizeof(File),Server,id);
if(!strcmp(Server, id, false, 3)) return Msg(playerid, color, ""#gold"[ERROR]: "#blue"this account name doesn't exists");
ini = INI_Open(File);
INI_Bool(ini,"TempBan",TB);
INI_Bool(ini,"PermBan,PB);
if(PB == true || TB == true)
{
format(msg,sizeof(msg),""#gold"[SERVER]: "#ice"%s "#blue"has been successfully unbanned!",id);
INI_WriteBool(ini,"TempBan",false);
INI_WriteBool(ini,"PermBan",false);
INI_WriteInt(ini, "UnbanYear", 0);
INI_WriteInt(ini, "UnbanMonth", 0);
INI_WriteInt(ini, "UnbanDay", 0);
INI_WriteInt(ini, "UnbanHour", 0);
INI_WriteInt(ini, "UnbanMinute", 0);
INI_WriteInt(ini, "UnbanSecond", 0);
INI_WriteString(ini, "Reason", "");
INI_WriteInt(ini,"HowManyBanned", Info[id][HowManyBanned] + 1);
}
else return Msg(playerid, color,""#gold"[ERROR]: "#blue"this player is not banned");
INI_Close(ini);