18.04.2012, 00:01
So, I've made this command, but when I /banip, it sends that "Admin %s has banned IP ( [%s ) when I don't have a "[" in sight. Any ideas?
EDIT: Also sent "Banned IP [insertIPhere" in RCON.
EDIT: Also sent "Banned IP [insertIPhere" in RCON.
pawn Код:
if(strcmp(cmd, "/banip", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, " <| USAGE: /banip [ip] |>");
return 1;
}
if(PlayerStats[playerid][pAdmin] >= 6)
{
new ip;
ip = strval(tmp);
format(string, sizeof(string), "banip %s", ip);
SendRconCommand(string);
SendRconCommand("reloadbans");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " <| Admin %s has banned IP: ( %s ) |>", sendername, ip);
SendClientMessageToAll(COLOR_LIGHTRED, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " <| You must be an Administrator to use this command! |>");
return 1;
}
}
return 1;
}