zGaming Bug. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: zGaming Bug. (
/showthread.php?tid=388242)
zGaming Bug. -
Laure - 28.10.2012
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.
Re: zGaming Bug. -
Laure - 28.10.2012
Anybody to help me?
Re: zGaming Bug. -
-=Dar[K]Lord=- - 28.10.2012
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
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
Re: zGaming Bug. -
Laure - 28.10.2012
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);
}
Re: zGaming Bug. -
-=Dar[K]Lord=- - 28.10.2012
pawn Код:
if(dini_Int(file, "pBanned") == 1) // file O.O where is it?
Re: zGaming Bug. -
Laure - 28.10.2012
Код:
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"
Re: zGaming Bug. -
Laure - 28.10.2012
Can i be assisted here please?
Re: zGaming Bug. -
CoDeZ - 28.10.2012
[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
Re: zGaming Bug. -
Laure - 28.10.2012
I already tried it by capitalizing F it didnt work.
Re: zGaming Bug. -
ryansheilds - 28.10.2012
Make sure you have the file ban.cfg in scriptfiles. Since the code looks fine it seems that it's missing causing a crash.