unbanip problem -
Tanush123 - 25.08.2011
Well i made unbanip for players but it wont work for some reason, i ban someone and use it and when he says he logged in it says hes still banned
pawn Код:
CMD:unbanip(playerid,params[])
{
if(PlayerData[playerid][AdminLevel] < 2) return 0;
format(str,sizeof(str),"unbanip %s",Ip);
SendRconCommand(str);
SendRconCommand("reloadbans");
return 1;
}
pawn Код:
CMD:ban
(playerid, params
[]){ if(PlayerData
[playerid
][AdminLevel
] > 2) { if(sscanf
(params,
"us", ID, Reason
)) return SendClientMessage
(playerid, 0xFF0000FF,
"USAGE: /ban [ID] [reason]");
if(!IsPlayerConnected
(ID
)) return SendClientMessage
(playerid,red,
"ERROR: That user is not connected!");
GetPlayerName
(playerid,Nam,
sizeof(Nam
));
if(PlayerData
[playerid
][AdminLevel
] < 5 && PlayerData
[ID
][AdminLevel
] > 4) return SendClientMessage
(playerid,red,
"ERROR: You cannot ban over level 5 admins!");
GetPlayerName
(ID, pname,
sizeof(pname
));
format(str,
sizeof(str
),
"Administartor %s has banned %s from the server for: %s",Nam,pname, Reason
);
SendClientMessageToAll
(0xFF9900AA, str
);
SendClientMessage
(ID,0xFF0000FF,
"Banned Wrongfully?? Go to http://www.vercettirp.smfnew.com to make a ban appeal!");
SendClientMessage
(playerid,0xFF9900AA,str
);
GetPlayerIp
(ID,tmp3,
sizeof(tmp3
));
MessageToAdmins
(orange,tmp3
);
Ban
(ID
);
} else return SendClientMessage
(playerid,
-1,
"SERVER: Unknown command.");
return 1;
}
Re: unbanip problem -
Dragony92 - 25.08.2011
Copy here your ban command
Re: unbanip problem -
Tanush123 - 25.08.2011
pawn Код:
CMD:ban
(playerid, params
[]){ if(PlayerData
[playerid
][AdminLevel
] > 2) { if(sscanf
(params,
"us", ID, Reason
)) return SendClientMessage
(playerid, 0xFF0000FF,
"USAGE: /ban [ID] [reason]");
if(!IsPlayerConnected
(ID
)) return SendClientMessage
(playerid,red,
"ERROR: That user is not connected!");
GetPlayerName
(playerid,Nam,
sizeof(Nam
));
if(PlayerData
[playerid
][AdminLevel
] < 5 && PlayerData
[ID
][AdminLevel
] > 4) return SendClientMessage
(playerid,red,
"ERROR: You cannot ban over level 5 admins!");
GetPlayerName
(ID, pname,
sizeof(pname
));
format(str,
sizeof(str
),
"Administartor %s has banned %s from the server for: %s",Nam,pname, Reason
);
SendClientMessageToAll
(0xFF9900AA, str
);
SendClientMessage
(ID,0xFF0000FF,
"Banned Wrongfully?? Go to http://www.vercettirp.smfnew.com to make a ban appeal!");
SendClientMessage
(playerid,0xFF9900AA,str
);
GetPlayerIp
(ID,tmp3,
sizeof(tmp3
));
MessageToAdmins
(orange,tmp3
);
Ban
(ID
);
} else return SendClientMessage
(playerid,
-1,
"SERVER: Unknown command.");
return 1;
}
Re: unbanip problem -
Dragony92 - 25.08.2011
And public Ban...
Re: unbanip problem -
Tanush123 - 25.08.2011
i dont have public ban -_- i only need help with unbanip
Re: unbanip problem -
Dragony92 - 25.08.2011
Sorry, my mistake...
pawn Код:
CMD:unbanip(playerid,params[])
{
new Ip[16];
if(PlayerData[playerid][AdminLevel] < 2) return 0;
if(sscanf(params, "s[16]", Ip)) return SendClientMessage(playerid, COLOR_GREY, "/unbanip ip");
format(str,sizeof(str),"unbanip %s",Ip);
SendRconCommand(str);
SendRconCommand("reloadbans");
return 1;
}
Re: unbanip problem -
[MWR]Blood - 25.08.2011
pawn Код:
CMD:unbanip(playerid,params[])
{
new Ip[16];
if(PlayerData[playerid][AdminLevel] < 2) return 0;
if(sscanf(params,"s[16]",Ip)) return SendClientMessage(playerid,0xFFFF6CFF,"USAGE: /unbanip <ip>");
format(str,sizeof(str),"unbanip %s",Ip);
SendRconCommand(str);
SendRconCommand("reloadbans");
return 1;
}
EDIT: Too late
Re: unbanip problem -
Tanush123 - 27.08.2011
i keep getting USAGE: /unbanip <ip>
Re: unbanip problem -
Pinguinn - 27.08.2011
Try
pawn Код:
if(sscanf(params,"s[16]+1",Ip)) return SendClientMessage(playerid,0xFFFF6CFF,"USAGE: /unbanip <ip>");