Unban IP Not working - 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: Unban IP Not working (
/showthread.php?tid=417593)
Unban IP Not working -
Infinity90 - 21.02.2013
Okay, I made a /unbanacc command which allows you to unban someone ofc. I used the same function as /unbanip and that works but here is doesn't. Whats it doing? = Opening the users file searching for the pIP = xx.xx.xx.xx and then Sends a rcon command to unban the ip. It's just not working. It sends me the message of "unbanip xx.xx.xx.xx" but doesn't unban through the samp.ban file.
pawn Код:
CMD:unbanacc(playerid, params[])
{
if(isnull(params)) {
return SendClientMessage(playerid, -1, "Usage: /unbanacc [PlayerFile]");
}
new filename[MAX_PLAYER_NAME+18];
format(filename, sizeof(filename), "/ZMA/Users/%s.ini", params);
if(!fexist(filename)) {
return SendClientMessage(playerid, -1, "That account doesn't exist!");
}
new
File:file = fopen(filename, io_read),
string[128],
Name[20],
Value[128],
cash;
while(fread(file, string)) {
if(!sscanf(string, "p<=>s[20]s[128]", Name, Value)) {
if(!strcmp(Name, "pIP ")) {
cash = strval(Value);
format(string, sizeof(string), "unbanip%s", cash);
SendClientMessage(playerid, -1, string);
SendRconCommand(string);
SendRconCommand("reloadbans");
break;
}
}
}
return true;
}
Re: Unban IP Not working -
tyler12 - 21.02.2013
"unbanip%s", cash);
There should be a space.
Re: Unban IP Not working -
Infinity90 - 21.02.2013
No I've tried it like that. It loads the space from the user file (pIP = xx.xx.xx.xx)
Re: Unban IP Not working - Riddy - 22.02.2013
Have you tried unbanning someone on 1 command and then, unbanning the IP on another?
Re: Unban IP Not working -
S0n1COwnsYou - 22.02.2013
not:
PHP код:
format(string, sizeof(string), "unbanip%s", cash);
use:
PHP код:
format(string, sizeof(string), "unbanip %s", cash);
Re: Unban IP Not working -
mamorunl - 22.02.2013
Apart from the weird naming that you use for your variables. Why do you all put an INTEGER in a STRING and then try to use it to unban an IP (which is not an INT value anyways)