01.03.2009, 14:23
hey i need a command that can ban a IP (player not on server)
can someone help me?
can someone help me?
Originally Posted by Mikep
Why the fuck make a new cmd when thers an RCON one?
|
Originally Posted by Schock
lol i know this but i dont want that every admin get the rcon or the interface login
|
if(!strcmp(cmd,"/banip",true))
{
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,0xFFFFFFAA,"USAGE: /banip [player's IP]");
format(string,sizeof(string),"banip %s",cmd);
SendRconCommand(string);
SendRconCommand("reloadbans");
format(string,sizeof(string),"You've successfully banned the IP: %d",cmd);
return SendClientMessage(playerid,0xFFFFFFAA,string);
}
if(strcmp(cmd, "/banip", true) == 0)
if(strcmp(cmd, "/banipz", true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /banip [IP]");
return 1;
}
new icnt;
for(new i = 0 , j = strlen(string); i < j; i++)
{
if(string[i] == '.')
icnt++;
}
if(icnt != 3)
{
SendClientMessage(playerid,COLOR_YELLOW,"That is not a valid IP address.");
return 1;
}
if(strlen(string[0]) > 18)
{
SendClientMessage(playerid,COLOR_YELLOW,"That is not a valid length for a IP address.");
return 1;
}
new name[24];
new banipstring[64];
GetPlayerName(playerid,name,24);
format(banipstring,64,"banip %s",string);
format(string,128,"[BAN-IP] Name: %s || IP: %s",name,string);
SendClientMessage(playerid,COLOR_WHITE,string);
print(string);
SendRconCommand(banipstring);
return 1;
}
if(strcmp(cmd, "/banip", true) == 0) { tmp = strtok(cmdtext, idx); giveplayerid = strval(tmp); new playerip[16]; strmid(playerip, tmp, 0, strlen(tmp)); new string2[256]; if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /banip [ip]"); return 1; } new playa; if(IsStringAName(tmp)) { playa = GetPlayerID(tmp); } else { playa = strval(tmp); } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if (PlayerInfo[playerid][pAdmin] >= 1) { format(string, sizeof(string), "AdmCmd: %s Has been banned by %s", playerip, sendername); SendClientMessageToAll(COLOR_RED, string); format(string2, sizeof(string2), "banip %s", playerip); SendRconCommand(string2); } else { SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!"); } return 1; }