function ulx.god( calling_ply, target_plys, should_revoke )
if not target_plys[ 1 ]:IsValid() then
if not should_revoke then
Msg( "You are the console, you are already god.\n" )
else
Msg( "Your position of god is irrevocable; if you don't like it, leave the matrix.\n" )
end
return
end
local affected_plys = {}
for i=1,
#target_plys do
local v = target_plys[ i ]
if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
else
if not should_revoke then
v:GodEnable()
v.ULXHasGod = true
else
v:GodDisable()
v.ULXHasGod = nil
end
table.insert( affected_plys, v )
end
end
if not should_revoke then
ulx.fancyLogAdmin( calling_ply, "#A granted god mode upon #T", affected_plys )
else
ulx.fancyLogAdmin( calling_ply, "#A revoked god mode from #T", affected_plys )
end
end
local god = ul*****mmand( CATEGORY_NAME, "ulx god", ulx.god, "!god" )
god:addParam{ type=ULib.cmds.PlayersArg, ULib.cmds.optional }
god:addParam{ type=ULib.cmds.BoolArg, invisible=true }
god:defaultAccess( ULib.ACCESS_ADMIN )
god:help( "Grants god mode to target(s)." )
god:setOpposite( "ulx ungod", {_, _, true}, "!ungod" )