/unban command
#1

Hi can anyone help make a command that u do /unban ip and it will unban a players ip
Reply
#2

pawn Код:
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;
}
Using zcmd.
Reply
#3

Код:
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;
}
Reply
#4

Oh thx but could ubplz make it strcmp command I don't get that one u made if u could that would be great and if u do male it I need ur name for the creditso
Reply
#5

Thx how can I make it so only certain level admins can use this CMd
Reply
#6

Add an if condition like so:
Код:
if(IsPlayerAdmin(playerid))//whatever variable you are using to store a player admin level.
{
return 1;
}
Reply
#7

Wat are the variables I want only admins that are level 6,7 to use this command can some on add it to script
Reply
#8

That is for you to code, we don't know what your admin level variable is...
try looking for a variable called level or something.
hope that helps
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)