ULX

Author Topic: Build & War  (Read 2318 times)

0 Members and 1 Guest are viewing this topic.

Offline Spider

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Build & War
« on: June 10, 2013, 07:23:37 PM »
I was just wondering if there could be a command in ULX that enables and disables both noclip and godmode in sandbox. I mean the sandbox cvar not the ulx command.
Okay, I'm new to editing ulx commands and I kinda just guessed on this one but this is the basic I came up with:
local CATEGORY_NAME = "Admin"


------------------------------ Admin --------------------------
function ulx.build( should_war )
                v:ConCommand("sbox_godmode 1")
                v:ConCommand("sbox_noclip 1")
                v:ChatPrint("The server has been changed to war/build.")
            else
                v:ConCommand("sbox_noclip 0")
      v:ConCommand("sbox_godmode 0")
            end
    end
   
    if not should_war then
        ulx.fancyLogAdmin( calling_ply, "#A Changed the mode of the server",  )
    else
        ulx.fancyLogAdmin( calling_ply, "#A changed the mode of the serverr.", )
    end
end

local build = ulx.command( CATEGORY_NAME, "ulx build", ulx.build, "!build" )
build:addParam{ type=ULib.cmds.PlayersArg }
build:addParam{ type=ULib.cmds.BoolArg, invisible=true }
build:defaultAccess( ULib.ACCESS_SUPERADMIN )
build:setOpposite( "ulx war", {_, _, true}, "!war" )

Sorry its super sloppy and bad, but I hope it helps do some stuff.
Thanks in advance

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given