Author Topic: Own ULX Command is marked as _Uncategorized Cmds  (Read 1980 times)

0 Members and 1 Guest are viewing this topic.

Offline MajorPain931

  • Newbie
  • *
  • Posts: 5
  • Karma: -1
Own ULX Command is marked as _Uncategorized Cmds
« on: October 15, 2014, 03:19:00 AM »
Hey, I wrote two commands to make a player swap teams and for making some1 spectate. I want them to be displayed in XGUI, but when I want to manage the rights, they're located in "_Uncategorized Cmds" and they don't appear in the command list, although they should?  At first, I wanted an own category for them, but it didn't work, so I tried "Teleport".

Code: [Select]
function ulx.forceswap( calling_ply, target_ply )
        if target_ply:Team() == 2 then
                if target_ply:Alive() then
                        target_ply:Kill()
                end
                target_ply:SetTeam(1)
        elseif target_ply:Team() == 1 then
                if target_ply:Alive() then
                        target_ply:Kill()
                end
                target_ply:SetTeam(2)
        end
        ulx.fancyLogAdmin( calling_ply, "#A has forced #T to switch teams.", target_ply )
end

function ulx.forcespec( calling_ply, target_ply )
        if target_ply:Alive() then
                target_ply:Kill()
        end
        target_ply:SetTeam(1002)
        ulx.fancyLogAdmin( calling_ply, "#A has forded #T to spectate.", target_ply )
end

local forceswap = ulx.command( "Teleport", "ulx forceswap", ulx.forceswap, "!swap" )
local forcespec = ulx.command( "Teleport", "ulx forcespec", ulx.forcespec, "!spec" )
forceswap:defaultAccess( ULib.ACCESS_ADMIN )
forceswap:addParam{ type=ULib.cmds.PlayerArg }
forceswap:help( "Swaps a players team" )
forcespec:defaultAccess( ULib.ACCESS_ADMIN )
forcespec:addParam{ type=ULib.cmds.PlayerArg }
forcespec:help( "Forces a player to spectate (If AFK) " )

Interesting to mention, the commands appear in the right category when using "ulx help". Just saw it.
Code: [Select]
Category: Teleport
o ulx bring <player> - Brings target to you. (say: !bring)
o ulx forcespec <player> - Forces a player to spectate (If AFK)  (say: !spec)
o ulx forceswap <player> - Swaps a player's team (say: !swap)
o ulx goto <player> - Goto target. (say: !goto)
o ulx return [<player, defaults to self>] - Returns target to last position before a teleport. (say: !return)
o ulx send <player> <player> - Goto target. (say: !send)
o ulx teleport [<player, defaults to self>] - Teleports target. (say: !tp)
« Last Edit: October 15, 2014, 03:27:37 AM by MajorPain931 »

An Error Has Occurred!

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