zGaming Bug.
#1

Hello all i have zGaminged script i edited it and now using it for my server but i found a weird bug here.I banned a player
as he tries to re connect to the server instead of auto kicking him my server crashes and it needs to be restarted from the host to make it back working.Heres my banned check.
Код:
	// Checking for rangeban
	new range[4][4];
	split(RPIP(playerid), range, '.');
	format(string, sizeof(string), "%s.%s.*.*", range[0], range[1]);
	if(CheckBan(string) == 1 && !dini_Int(file, "Whitelisted"))
	{
	    SetPlayerName(playerid, "BannedPlayer");
	    SendClientMessage(playerid, COLOR_DARKRED, "Xtreme Gaming: Your range is banned from this server. (You can request getting whitelisted at www.samp-xrp.co.cc)");
		Kick(playerid);
		return 1;
	}
	// Checking for IP ban
	if(CheckBan(RPIP(playerid)) == 1)
	{
	    SetPlayerName(playerid, "BannedPlayer");
	    SendClientMessage(playerid, COLOR_DARKRED, "Xtreme Gaming: You are banned from Xtreme Gaming Roleplay. (Make a ban appeal at www.samp-xrp.co.cc)");
		Kick(playerid);
		return 1;
	}
	// Checking for character ban
	if(dini_Int(file, "pBanned") == 1)
	{
	    SetPlayerName(playerid, "BannedPlayer");
	    SendClientMessage(playerid, COLOR_DARKRED, "Xtreme Gaming: You are banned from this server. (Make a ban appeal at www.samp-xrp.co.cc)");
	    AddBan(playerid);
	    Kick(playerid);
	    return 1;
	}
	return 1;
Help will be appreciated.
Reply
#2

Anybody to help me?
Reply
#3

Check that the directories of addban and all like adding users Exist if they dont they will send a rcon command to console automatically to close the server

#EDIT:
Please Check whether there is

pawn Код:
stock AddBan(playerid)
and if there u need to create a folder for it

if its there please show us the code

// Srry for editing so many times :P
Reply
#4

Yep i have it.
Код:
stock AddBan(playerid)
{
 	new string[24];
	new File:ban = fopen("ban.cfg", io_append);
	format(string, sizeof(string), "%s\r\n", RPIP(playerid));
	fwrite(ban, string);
	fclose(ban);
}
Reply
#5

pawn Код:
if(dini_Int(file, "pBanned") == 1) // file O.O where is it?
Reply
#6

Код:
stock AddBan(playerid)
{
 	new string[24];
	new File:ban = fopen("ban.cfg", io_append);
	if(dini_Int(file, "pBanned") == 1) // file O.O where is it?
	format(string, sizeof(string), "%s\r\n", RPIP(playerid));
	fwrite(ban, string);
	fclose(ban);
}
Then error i got
Код:
Undefined Symbol "file"
Reply
#7

Can i be assisted here please?
Reply
#8

[QUOTE=Imperor;2191965]
Код:
stock AddBan(playerid)
{
 	new string[24];
	new File:ban = fopen("ban.cfg", io_append);
	if(dini_Int(file, "pBanned") == 1) // file O.O where is it?
	format(string, sizeof(string), "%s\r\n", RPIP(playerid));
	fwrite(ban, string);
	fclose(ban);
}
Код:
if(dini_Int(File, "pBanned") == 1)
This should work
Reply
#9

I already tried it by capitalizing F it didnt work.
Reply
#10

Make sure you have the file ban.cfg in scriptfiles. Since the code looks fine it seems that it's missing causing a crash.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)