gema
Would you like to react to this message? Create an account in a few clicks or log in to continue.


A website for every gema-assaultcube fan
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log in  

 

 !givemod and !removemod by admin

Go down 
AuthorMessage
DotA

DotA


Messages : 102
Joined/Date d'inscription : 2012-08-05

!givemod and !removemod by admin Empty
PostSubject: !givemod and !removemod by admin   !givemod and !removemod by admin EmptySun Feb 01, 2015 5:42 pm

k
basic system

1 - create a function

Code:
function is_moderator(cnx)  
end

2 - command "!addmod (cn)"

Code:
["!addmod"] =
  {
    { true, false, false };
            function (cn, args)
 local name = getname(cn)
 
    local cnx = tonumber(args[1])
    if cn == nil then say("\f4Wrong cn",cn) return end

    function is_moderator(cnx)
                    if (cnx == tonumber(args[1])) then
                    return true
                    end
                    end
                    say ("\f1 New Moderator: \f2" .. getname(cnx) .. "\f1 added by \fH" .. getname(cn))
                    say ("\f1 You are Moderator! , type \f2!cmds \f1to see the new commands", cnx);
                    end
  };
command "!removemod (cn)"


Code:
["!removemod"] =
{
  { true, false, false };
   function (cn, args)
    local name = getname(cn)

       local cnx = tonumber(args[1])
     if cn == nil then say ("\f4Wrong cn",cn) return end
   function is_moderator(cnx)
if (cnx == tonumber(args[1])) then
return false
end
end
   say ("\f1 Moderator Removed \f2" .. getname(cnx) .. "\f1 by \fH" .. getname(cn))
   say ("\f1 your Moderator was been removed :(", cnx)
end
};


mods commands : !kick, !ban, !ext

just add "if is_moderator(cn) then" before the command like this:

Code:

["!kick"] =
 {
   { false, false, false };
           function (cn, args)
            if is_moderator(cn) then
local name = getname(cn)

   local cnx = tonumber(args[1])
   if cn == nil then say("\f4Wrong cn",cn) return end
   say(string.format("\f2[SERVER INFO] \f1" .. getname(cnx) .. "\f0 is kicked by \f2" .. getname(cn) .. "\f4!"))
     disconnect(cnx, DISC_MKICK)
say("\fR[SERVER INFO]\f1  " ..getname(acn).. "\f2 was kicked. IP:" ..getip(acn).. ".")

                   else
                      say("you are not a moderator kkkkk", cn)
 end

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------


add your commands to !cmds:

Code:
if is_moderator(cn) then
        say("\f2MODERATOR COMMANDS: \f6| \f2!extend <minutes> \f6| \f2!k (cn) \f6| \f2!b (cn) \f6| \fP", cn)
   end
Back to top Go down
 
!givemod and !removemod by admin
Back to top 
Page 1 of 1
 Similar topics
-
» Colossus bad admin
» Admin Script
» its a special day for our No. 1 admin and beloved friend

Permissions in this forum:You cannot reply to topics in this forum
gema :: International :: Scripts-
Jump to: