ULX

Author Topic: Adding "List" to XGUI?  (Read 1610 times)

0 Members and 1 Guest are viewing this topic.

Offline PieCrafted

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Adding "List" to XGUI?
« on: December 29, 2015, 01:40:19 PM »
I have this code below and when I type ulx help it shows up in its pwn category like it is supposed to, but in XGUI they are not showing up at all (only in Groups, Manag Permissions, _UncategorizedCMDS) but in ulx help they are in their own custom group?

Please help me out.

Code: [Select]
-- Excl's Jailbreak 7 Commands for ULX

local CATEGORY_NAME_UTILITY = "Jailbreak Utility"
local CATEGORY_NAME_MISC = "Jailbreak Misc"

--[Utility]
-- 1 Used to set a player to prisoner
function ulx.prisoner(calling_ply, target_ply)
if target_ply:Team() == TEAM_PRISONER then
ULib.tsayError( calling_ply, target_ply:Nick() .. " is already a prisoner!", true)
else
target_ply:Kill()
target_ply:SetTeam(TEAM_PRISONER);
ulx.fancyLogAdmin( calling_ply, "#A set prisoner for #T", target_ply)
end
end

local prisoner = ulx.command( CATEGORY_NAME_UTILITY, "ulx prisoner", ulx.prisoner, "!setprisoner")
prisoner:addParam{ type=ULib.cmds.PlayerArg}
prisoner:defaultAccess(ULib.ACCESS_SUPERADMIN)
prisoner:help( "Sets target player to prisoner" )

-- 2 Used to set a player to guard
function ulx.guard(calling_ply, target_ply)
if target_ply:Team() == TEAM_GUARD then
ULib.tsayError( calling_ply, target_ply:Nick() .. " is already a guard!", true)
else
target_ply:Kill()
target_ply:SetTeam(TEAM_GUARD);
ulx.fancyLogAdmin( calling_ply, "#A set guard for #T", target_ply)
end
end

local guard = ulx.command( CATEGORY_NAME_UTILITY, "ulx guard", ulx.guard, "!setguard")
guard:addParam{ type=ULib.cmds.PlayerArg}
guard:defaultAccess(ULib.ACCESS_SUPERADMIN)
guard:help( "Sets target player to guard" )

-- 3 Used to set a player to spectator
function ulx.spectator(calling_ply, target_ply)
if target_ply:Team() == TEAM_SPECTATOR then
ULib.tsayError( calling_ply, target_ply:Nick() .. " is already a spectator!", true)
else
target_ply:Kill()
target_ply:SetTeam(TEAM_SPECTATOR)
ulx.fancyLogAdmin( calling_ply, "#A set spectator for #T", target_ply)
end
end

local spectator = ulx.command( CATEGORY_NAME_UTILITY, "ulx spectator", ulx.spectator, "!setspectator")
spectator:addParam{ type=ULib.cmds.PlayerArg}
spectator:defaultAccess(ULib.ACCESS_SUPERADMIN)
spectator:help( "Sets target player to spectator" )

-- 4 Sets player to warden
function ulx.warden(calling_ply, target_ply)

if target_ply:Team() == TEAM_GUARD then
target_ply:AddWardenStatus()
ulx.fancyLogAdmin( target_ply, "#A has been set to warden by #T", calling_ply)
else
ULib.tsayError( calling_ply, target_ply:Nick() .. " is not a guard!", true)
end
end

local warden = ulx.command( CATEGORY_NAME_UTILITY, "ulx warden", ulx.warden, "!setwarden")
warden:addParam{type=ULib.cmds.PlayerArg}
warden:defaultAccess(ULib.ACCESS_SUPERADMIN)
warden:help( "Sets player to warden" )

-- 5 Removes player from warden
function ulx.rwarden(calling_ply, target_ply)
if target_ply:Team() == TEAM_GUARD then
target_ply:RemoveWardenStatus()
ulx.fancyLogAdmin( target_ply, "#T has been removed from warden by #A", calling_ply)
else
ULib.tsayError( calling_ply, target_ply:Nick() .. "  is not a guard!", true )
end
end

local rwarden = ulx.command( CATEGORY_NAME_UTILITY, "ulx removewarden", ulx.rwarden, "!removewarden")
rwarden:addParam{type=ULib.cmds.PlayerArg}
rwarden:defaultAccess(ULib.ACCESS_SUPERADMIN)
rwarden:help( "Removes player from warden" )

-- 6 Ends Round
function ulx.endround(calling_ply)
JB:EndRound(TEAM_SPECTATOR)
ulx.fancyLogAdmin( calling_ply, "#A ended the round")
end

local endround = ulx.command( CATEGORY_NAME_UTILITY, "ulx endround", ulx.endround, "!endround")
endround:defaultAccess(ULib.ACCESS_SUPERADMIN)
endround:help( "Ends the current round" )

--[Misc.] Just for fun or debugging
-- 7 Used to set a player to rebel
function ulx.rebel(calling_ply, target_ply)
target_ply:SetRebel(true)

JB:BroadcastNotification(target_ply:Nick().." is rebelling!")

target_ply:SetPlayerColor(Vector(1,0,0));
target_ply:SetWeaponColor(Vector(1,0,0));
end

local rebel = ulx.command( CATEGORY_NAME_MISC, "ulx rebel", ulx.rebel)
rebel:addParam{ type=ULib.cmds.PlayerArg}
rebel:defaultAccess(ULib.ACCESS_SUPERADMIN)
rebel:help( "Sets target player to rebeler" )

-- 8 Used to set a player to not rebelling
function ulx.rebel(calling_ply, target_ply)
target_ply:SetRebel(false)

JB:BroadcastNotification(target_ply:Nick().." is no longer rebelling!")

target_ply:SetPlayerColor(Vector(.9,.9,.9));
target_ply:SetWeaponColor(Vector(.9,.9,.9));
end

local norebel = ulx.command( CATEGORY_NAME_MISC, "ulx norebel", ulx.rebel)
norebel:addParam{ type=ULib.cmds.PlayerArg}
norebel:defaultAccess(ULib.ACCESS_SUPERADMIN)
norebel:help( "Sets target player to rebeler" )

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Adding "List" to XGUI?
« Reply #1 on: December 30, 2015, 10:57:29 AM »
That is quite odd. Is this all of the code, or is it tied to something else? Also, where are you storing this code and having it run?
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline PieCrafted

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Adding "List" to XGUI?
« Reply #2 on: December 30, 2015, 03:00:12 PM »
It is tied to nothing else.

I have it running from addons/ulx/lua/ulx/modules as jailbreak.lua

That is the code in its entirety.