Recent Posts

Pages: [1] 2 3 ... 10
1
Developers Corner / Re: Am I missing something?
« Last post by Timmy on March 08, 2019, 01:37:35 AM »
...everytime I use [the command] in-game no one has access to it, not even me and doesn't appear in the ULX menu so missing something else.

The first time ULib’s Access Control List (UCL) is informed about the existence of a command, it will give the groups specified in cmd:defaultAccess access. After that, never again!

Sure, you corrected nodeath:defaultaccess( ULib.ACCESS_ADMIN ) to nodeath:defaultAccess( ULib.ACCESS_ADMIN ) later. But UCL already knew about the command, so default access was ignored.

Solution - Manually add to a group's access
Code: [Select]
ulx groupallow admin "ulx nodeath"
2
Developers Corner / Re: Am I missing something?
« Last post by BlueNova on March 07, 2019, 11:25:05 PM »
Third time lucky, I'm a Junior Dev so this is all new to me.

--snip long code piece--

Works but just need to add in usergroups I think, everytime I use it in-game no one has access to it, not even me and doesn't appear in the ULX menu so missing something else. Tried adding it into fun.lua then onto the server, nodeath.lua and using CATEGORY_NAME = "Nodeath" but nothing again.

Thinking it's something with category name here:
Code: Lua
  1. local nodeath = ulx.command( "CATEGORY_NAME", "ulx nodeath", ulx.nodeath, "!nodeath", true )
but might be wrong.

You're trying to pass CATEGORY_NAME as a string when it's usually a variable. At the top of every ULX command file it'll have like
Code: Lua
  1. local CATEGORY_NAME = "some name here"

So just take the quotes off of category name.
As for access for the command you could do

Code: Lua
  1. nodeath:defaultAccess(ULib.ACCESS_ADMIN) --Access default to admin only

Alternatively you could just specifiy in your code specific access like
Code: Lua
  1. if not calling_ply:IsAdmin() then return end

In regards to the health thing that JamminR brought up, you are making it search for exactly 5. You could make it look for less than six but you could also do
Code: Lua
  1. ply:Health() =< 5

Just some speculation on my part
3
Off-Topic / Re: UE4 Project
« Last post by MrPresident on March 07, 2019, 09:10:47 PM »
Yes, and no.

I've been working a lot more lately (Substitute Teaching) which is why I haven't been making as regular of updates, but the main reason is that the things I'm doing aren't really ready to be shown off yet.

Here are some examples:

Working on some new building tiles for overwork houses (learning blender along the way)


Working on more advanced AI for NPCs.
http://g4p.org/uploads/knTh2pv1ot.webm

Been working on getting some animals added:


Toying around with bows and bow animations:
http://g4p.org/uploads/6ye0wU4mCF.webm

NPC Dialogue:


Farming.. which is nearly complete (or at least the shell of it is)


Lots of other small things that I can't remember.
Maybe this weekend I'll push an update that you guys can look at, it's just there really isn't any more content yet.. just working on some systems.
4
Off-Topic / Re: UE4 Project
« Last post by JamminR on March 07, 2019, 08:02:39 PM »
I've not noticed any updates in a while... real life getting in the way?
(even if so, hope the real's is good stuffs and not bad)
5
Developers Corner / Re: Am I missing something?
« Last post by JamminR on March 07, 2019, 07:17:31 PM »
Any console errors (client, or server, either way) when server starts, or client joins, or client takes damage?
Also, likely nothing to do with it not working, you'll probably want your health check to check less than 6, instead of == 5.
As is, it's quite possible someone could get hurt and hit 1, 2, 3, or 4 instead, which wouldn't help anyone with your current code needing to be exactly 5 health.

As a dev learning G-lua, those errors are extremely useful.
Learning to decode them can sometimes take a while though.
6
Developers Corner / Re: Am I missing something?
« Last post by I_AM_TOOD on March 07, 2019, 04:49:09 PM »
Third time lucky, I'm a Junior Dev so this is all new to me.

Code: Lua
  1. function ulx.nodeath( calling_ply, target_ply )
  2.     if not target_ply:Alive() then target_ply:Spawn() end
  3.     if (not target_ply._ulxnodeath) then target_ply._ulxnodeath = true else return end
  4.     ulx.fancylogadmin( calling_ply, true, "#A granted nodeath on #T", target_ply )
  5. end
  6. local nodeath = ulx.command( "CATEGORY_NAME", "ulx nodeath", ulx.nodeath, "!nodeath", true )
  7. nodeath:addParam{ type=ULib.cmds.PlayerArg }
  8. nodeath:defaultAccess( ULib.ACCESS_ADMIN )
  9. nodeath:help( "Player no longer takes damage once they reach 5hp" )
  10.  
  11. hook.Add("EntityTakeDamage", "NoDeathCheck", function(ply, dmg)
  12.     if not ply:IsPlayer() then return end
  13.     if (ply._ulxnodeath) then
  14.     if ply:Health() == 5 then
  15.         ply:ScaleDamage(0.00000000000001)
  16.     else return end
  17.  
  18.     end
  19. end )

Works but just need to add in usergroups I think, everytime I use it in-game no one has access to it, not even me and doesn't appear in the ULX menu so missing something else. Tried adding it into fun.lua then onto the server, nodeath.lua and using CATEGORY_NAME = "Nodeath" but nothing again.

Thinking it's something with category name here:
Code: Lua
  1. local nodeath = ulx.command( "CATEGORY_NAME", "ulx nodeath", ulx.nodeath, "!nodeath", true )
but might be wrong.
7
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.
8
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).
9
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
10
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.
Pages: [1] 2 3 ... 10