A website for every gema-assaultcube fan
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Share | 
 

 !givemod and !removemod by admin

View previous topic View next topic Go down 
AuthorMessage
DotA



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

PostSubject: !givemod and !removemod by admin   Sun 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
View user profile
 
!givemod and !removemod by admin
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Learning to admin a UT3 server
» ADMIN meeting
» Ban lift? Admin please take a look!
» Admin Abuse
» how do i become an admin as fast as possible?

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