Ulysses

General => Developers Corner => Topic started by: nexbr on June 20, 2013, 08:47:12 AM

Title: Help With Plugin
Post by: nexbr on June 20, 2013, 08:47:12 AM
Hi.

I want to do a Plugin, I Know Lua and Already did somethings with ULX and ULIB, I read some of the ULX Documentation, but I didn't figure out how to make this Plugin as I want to do.

I need create a ULX User Flag, that can be set on ULX Panel.
And i need make this Flag Global to I access it from Global Like: Player:IsAllowedToDoX().
Title: Re: Help With Plugin
Post by: Megiddo on June 20, 2013, 08:52:24 AM
To create access flags you use registerAccess (http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.registerAccess) (this gives it default permissions and registers it on XGUI) and ply:query(...) (http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#Player:query)
Title: Re: Help With Plugin
Post by: nexbr on June 20, 2013, 08:55:26 AM
To create access flags you use registerAccess (http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.registerAccess) (this gives it default permissions and registers it on XGUI) and ply:query(...) (http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#Player:query)

Thanks but how exactly works query? Since it do not show any Args?
Title: Re: Help With Plugin
Post by: nexbr on June 20, 2013, 09:26:44 AM
Ok, how i add a new ?registerAccess category? i typed a custom category and it do not show up.
Title: Re: Help With Plugin
Post by: nexbr on June 20, 2013, 10:12:33 AM
i think i did wrong: ucl.registerAccess("ulx permXX", {"admin", "superadmin"}, "Give access to XX", "Other") it doesn't shows on Perm list.

Help!
Title: Re: Help With Plugin
Post by: nexbr on June 20, 2013, 10:53:12 AM
I fixed, I was doing wrong on if. it is working now. Thanks!


Just one more question, This query is Gmod Default? I mean if there is no ulx or other admin mod it will give error? or it is overwrited like meta?
Title: Re: Help With Plugin
Post by: Megiddo on June 20, 2013, 11:56:34 AM
Querying accesses is unique to ULib, Gmod has no equivalent.
Title: Re: Help With Plugin
Post by: nexbr on June 20, 2013, 12:37:26 PM
Thanks Megiddo. You helped me Much, Thanks.  ;)