31.05.2010, 21:54
Hi can anyone help make a command that u do /unban ip and it will unban a players ip
CMD:unbanip( playerid, params[] )
{
if( ! isnull( params ) )
{
new
String[ 39 ];
format( String, sizeof( String ), "unbanip %s", params );
SendRconCommand( String );
SendRconCommand( "reloadbans" ); // Not sure if it's required.
}
else
{
// Didn't enter an IP
}
return 1;
}
if(strcmp(cmd,"/unbanip",true) == 0) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) return SendClientMessage(playerid,color_red,"USAGE: /unbanip (IP)"); new stringIP[128]; format(stringIP,sizeof(stringIP),"unbanip %s",tmp); SendRconCommand(stringIP); format(stringIP,sizeof(stringIP),"IP %s has been unbanned.",tmp); SendClientMessage(playerid,color,stringIP); SendRconCommand("reloadbans"); return 1; }
if(IsPlayerAdmin(playerid))//whatever variable you are using to store a player admin level. { return 1; }