General > Developers Corner

ULX Accsess stuff

<< < (2/4) > >>

kennis942:
its for allowing to spawn an entity...so yeah ill test that out.

kennis942:
Now have :

--- Code: ---ucl.registerAccess("PlayerXController","","Allows users to controll the PlayerX")


function PlayX.IsPermitted(ply)
    if PlayXIsPermittedHandler then
        return PlayXIsPermittedHook(ply)
    else
return ucl.query(ply,"PlayerXController",false)
    end
end
--- End code ---
and it aint working ...



Also tryed issuing this command :
ulx luarun ucl.query(ply,"PlayerXController",false)
L 04/03/2010 - 05:01:11: Lua Error: :1: attempt to index global 'ucl' (a nil value)
:1: attempt to index global 'ucl' (a nil value)

Stickly Man!:
Note when looking at the docs, that most (or all?) of the functions are in the ULib namespace--

Basically, it needs to be ULib.ucl.query() instead of just ucl.query()

kennis942:
OKAY.... now i got this, and it worked once but after a server restart it didn't work anymore :(


--- Code: ---ULib.ucl.registerAccess("PLX","","Allows users to controll the PlayerX")
--- Returns whether a player is permitted to use the player.
-- @param ply Player
-- @return
function PlayX.IsPermitted(ply)
    if ULib.ucl.query(ply,"PLX",false) then
print("Allowed access.")
return true
    else

        return false
    end
end

--- End code ---


How can i fix that ?
It gives no errors, it just dosent spawn.

Megiddo:
When you're calling registerAccess(), you're specifying that no groups have access to the command (or an empty group at least, which might be an error condition).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version