ULX

Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Developers Corner / Re: This documentation...
« Last post by iViscosity on March 07, 2019, 11:05:49 AM »
There is no official documentation for ulx, just ULib (actually I was working on documentation for ulx a while ago but kinda forgot about it)

You can find the source for ulx.command here.
22
Developers Corner / Re: This documentation...
« Last post by mark272 on March 07, 2019, 10:58:39 AM »
Ah thanks  ;D
But where is ulx.command in the documentation? I may not see it but the search gives nothing (good).
23
Releases / GWorkshop Popup
« Last post by mark272 on March 07, 2019, 10:52:36 AM »
A simple script that opens a Derma that tells you to download the Workshop Collection.
The derma only opens on the first join, but it can be reopened with !content in chat.

Download/Issues/etc.
https://github.com/mark27205/GWorkshop-Popup
24
Developers Corner / Re: This documentation...
« Last post by iViscosity on March 07, 2019, 10:47:22 AM »
The method is being fully entered.

The syntax for ulx.command is
Code: Lua
  1. ulx.command("Category Name", "console command", function_name, "!chatcommand", hide_command, require_space)
  2.  

Where you have the category to sort the command into, the console command to use the command, the actual function to execute when using the command, and then three optional arguments: the chat command, whether or not the person using the command should have their use message show in chat (useful for things like !p where you don't want it to show), and whether or not to require a space between the chat command and the arguments (useful for asay (@message))

The documentation shows ucl.registerAccess because that's how it was in the source code.

At the very top of the file, they have this line:
Code: Lua
  1. local ucl = ULib.ucl
  2.  

Which just makes it easier for them to write. Referencing outside of that file is still "ULib.ucl.registerAccess", remember it's all contained under the main "ULib" table.
25
Developers Corner / This documentation...
« Last post by mark272 on March 07, 2019, 10:35:51 AM »
I don't understand the documentation.
For example where is ulx.command like ulx.command( CATEGORY_NAME, "ulx bring", ulx.bring, "!bring" )
I only found cmds.addCommand
And why is the method not fully entered? In documentation: ucl.registerAccess but in real code it is ULib.ucl.registerAccess
Could someone help me out here? I am so confused.
Thanks.
26
Developers Corner / Re: Noclip for specific darkrp jobs
« Last post by JamminR on March 06, 2019, 02:21:48 PM »
Well, not quite like you ask using a hook specific to noclip.
I think of two ways quickly. Both reasonably complex. My fellow coders could probably look and say "why not just do x" and x would be 20x easier than my thoughts.
1)
When player joins a job, grant them "ulx noclip ^" access. ULib/ULX don't just limit commands to groups - you can grant access to individual players.
The "^" would make sure they don't noclip anyone else, as ^ means only themself.
Challenges to this, you'd need to watch job changes and player disconnects/bans/etc to remove that access so they wouldn't keep it.
Additional complexity if you ever purposely wanted someone to have that individual access and were NOT part of that job. It could easily get removed when using code to ensure cleanup of the job noclip players.

2) (this would be what I do, but I like ULib challenges)
ULib, that ulx is built on, has a *sever side only* hook called
ULibCommandCalled
It can be used to monitor for any function used within ULib (including ulx functions)
I imagine using it to monitor for "ulx noclip", then check job, if job matches, use the direct function "ulx.noclip" rather than using "ULX access check included" command "ulx noclip"
My example pseudo code logic -

Code: [Select]
function noclip_job_check(calling_ply, cmd, args)
if cmd == "ulx noclip" and job == match then ulx.noclip(calling_ply, calling_ply) -- skip "ulx noclip" checks, go straight to noclip ulx function (ulx.noclip)
elseif cmd == "ulx noclip" then return -- if above logic didn't match, act normal, allow ULX to do it's normal access checks to determine if player/group player is in has normal noclip access.
end

hook.Add(ULibCommandCalled, "noclip check", noclip_job_check)

27
Developers Corner / Re: Am I missing something?
« Last post by MrPresident on March 06, 2019, 06:18:25 AM »
Even with setting up the hook correctly, your hook doesn't check any kind of access assigned from your command.

You'll need your ULX command to flag the player in some way as having this "nodeath" effect and then your hook will need to check for it.
28
Developers Corner / Re: Noclip for specific darkrp jobs
« Last post by Nickolay on March 06, 2019, 06:11:36 AM »
Thanks for the answers.
So I managed to make it so an usergroup can noclip only when they're in a specific darkrp job.
Though, this only covers the sandbox version of NoClip, aka they'll need to use it through the console instead of ULX.

Are there actually any ways to enable noclip, perhaps in a hook, as the ULX version of it?
29
Developers Corner / Re: Am I missing something?
« Last post by JamminR on March 05, 2019, 01:23:53 PM »
wouldn't you need to add a unique identifier
Yes, absolutely.
30
Developers Corner / Re: Am I missing something?
« Last post by BlueNova on March 05, 2019, 08:34:48 AM »
--snip--

For hooks wouldn't you need to add a unique identifier with it? You don't seem to have that

Code: Lua
  1. hook.Add("EntityTakeDamage", "no_death_hook", function(ply, dmg)
  2.      --Code here
  3. end)
Pages: 1 2 [3] 4 5 ... 10