• Print

Author Topic: XLib Documentation  (Read 16194 times)

0 Members and 1 Guest are viewing this topic.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: XLib Documentation
« Reply #15 on: January 22, 2017, 05:53:29 pm »
include your file inside a hook that is called after ULX loads.

Code: Lua
  1. function LoadMyCustomScript()
  2.      include( myscript.lua )
  3. end
  4. hook.Add( ulx.HOOK_ULXDONELOADING, "LoadMyCustomScript", LoadMyCustomScript )
  5.  

Then just save your script as myscript.lua (or whatever just change above) and place it in garrysmod/lua (not autorun).

The code above SHOULD be in something that gets autorun. Preferably as a ULX module so it gets called after ulx is created in memory for the hook name.

Offline captain1342

  • Full Member
  • ***
  • Posts: 104
  • Karma: 6
  • Quality is our standard
    • Aperture Development - Quality is our standard
Re: XLib Documentation
« Reply #16 on: January 23, 2017, 06:18:47 am »
Well I figured out a Solution for that .. but well is there a way to check Client Side if you have Permission to something? like

If YouHavePermission then

getServerData()

end
Aperture Development
Quality is our standard

Website - GitHub  - Forum  - Steam  - Discord

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: XLib Documentation
« Reply #17 on: January 23, 2017, 01:25:33 pm »
Well I figured out a Solution for that .. but well is there a way to check Client Side if you have Permission to something? like

If YouHavePermission then

getServerData()

end
ULib.ucl.query has your back.
bw81@ulysses-forums ~ % whoami
Homepage

Offline captain1342

  • Full Member
  • ***
  • Posts: 104
  • Karma: 6
  • Quality is our standard
    • Aperture Development - Quality is our standard
Re: XLib Documentation
« Reply #18 on: January 23, 2017, 02:20:58 pm »
Well I tryed that and it gave me an error that I tryed to index a nil value so I printed the ucl table .. well thats the result ( Screenshot in Attachment )
Aperture Development
Quality is our standard

Website - GitHub  - Forum  - Steam  - Discord

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: XLib Documentation
« Reply #19 on: January 23, 2017, 03:11:56 pm »
Well I tryed that and it gave me an error that I tryed to index a nil value so I printed the ucl table .. well thats the result ( Screenshot in Attachment )
Note, it's ULib.ucl, not ucl itself. Plus, I believe you need to be operating in ULX/ULib module space for the ULib table to be defined, but I could be wrong.
bw81@ulysses-forums ~ % whoami
Homepage

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: XLib Documentation
« Reply #20 on: January 24, 2017, 01:26:21 am »
you can call ULib.ucl from anywhere.

Offline captain1342

  • Full Member
  • ***
  • Posts: 104
  • Karma: 6
  • Quality is our standard
    • Aperture Development - Quality is our standard
Re: XLib Documentation
« Reply #21 on: January 29, 2017, 08:39:57 am »
Thanks Everyone for helping me :D I finished my addon and Released it.

So this thread can be closed
Aperture Development
Quality is our standard

Website - GitHub  - Forum  - Steam  - Discord

  • Print