Author Topic: URS BETA - A Highly Customizeable Restriction System (or will be)  (Read 450506 times)

0 Members and 1 Guest are viewing this topic.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 414
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #555 on: November 17, 2015, 06:45:24 PM »
I'm trying to tell if that is sarcastic or not.  But, I have been around gmod just not a lot.  I haven't really kept up on much in gmod for like 3 or 4 years.  Now I just place once in a while on a random server I pick out.

I was actually being serious. You were dead for the last few years, it wasn't until like May of this year that you had pretty much fully returned. I just hadn't said anything until now.

Anyone welcoming you back is serious.
We're glad you're back to coding one of your bigger projects, updating URS.
The fact coding G-Lua every 3-4 years is, in and of itself, like learning a new programming language every 3 or 4 years.
It is a self serving automatic sarcasm feature whether the original poster intended it or not. :)

Indeed, our beloved JamminR is correct. I thought URS was as well dead. As for the last bit he said, sarcasm is a feature I don't play too much apart of, though the occasional troll here and there is something I do, do, just not here most of the time.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline nex86

  • Newbie
  • *
  • Posts: 22
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #556 on: November 18, 2015, 08:21:19 AM »
More sbox cvar limits would be awesome, like wiremod limits or the rest of the gmod limit?

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #557 on: November 18, 2015, 09:02:05 AM »
it wasn't until like May of this year that you had pretty much fully returned. I just hadn't said anything until now.
That's what I thought heh.  I was like... I've been kinda half way back for months.  It's just phases, I like to mix it up.

More sbox cvar limits would be awesome, like wiremod limits or the rest of the gmod limit?
Good idea, I'll look into it.

Offline theGoldTrigger

  • Newbie
  • *
  • Posts: 18
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #558 on: November 25, 2015, 02:07:35 PM »
Is there a way I could print the limit of a category to say a hud?

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 414
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #559 on: November 25, 2015, 03:13:58 PM »
Is there a way I could print the limit of a category to say a hud?

Assuming URS is old school, and uses flat files in the DATA folder, then you can have server side grab the cvar's set data from the file, and move it client side to a HUD.

Though I don't know too much about cvar's though, and you might be able to actually grab that cvar data from a command that garry's mod has, like:

Code: Lua
  1. local whatever_cvar_name_is = GetConVar( "wire_lights" )
  2. print( whatever_cvar_name_is:GetInt() )

I don't know if cvars are client or server though, I lack that information on them, but you can try to see if the above command would work for you.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline theGoldTrigger

  • Newbie
  • *
  • Posts: 18
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #560 on: November 25, 2015, 03:20:13 PM »
Assuming URS is old school, and uses flat files in the DATA folder, then you can have server side grab the cvar's set data from the file, and move it client side to a HUD.

Though I don't know too much about cvar's though, and you might be able to actually grab that cvar data from a command that garry's mod has, like:

Code: Lua
  1. local whatever_cvar_name_is = GetConVar( "wire_lights" )
  2. print( whatever_cvar_name_is:GetInt() )

I don't know if cvars are client or server though, I lack that information on them, but you can try to see if the above command would work for you.

Gmod has a way of doing this in the form of :
Code: [Select]
cvars.Number( "sbox_maxprops" )which is what I'm using however, this inserts the original server side value and not the one set in urs :(

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 414
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #561 on: November 26, 2015, 12:43:47 AM »
Gmod has a way of doing this in the form of :
Code: [Select]
cvars.Number( "sbox_maxprops" )which is what I'm using however, this inserts the original server side value and not the one set in urs :(

huh, weird. Wait for aaron to say something, he knows this best.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #562 on: November 26, 2015, 07:20:43 AM »
Is there a way I could print the limit of a category to say a hud?
Uh, you would have to check to see if URS has the limit first.  You can do that through XGUI's data.  The table is xgui.data.URSLimits.  After that you would have to check default limit.  I would make a function that does this so you can just call one function.  There is no built in URS function in this version.  However, in the future version I have included one, but it could use some fine tweaking for this specific situation.

You can see my serverside code for checking here (do keep in mind you have to change it to use the above mentioned table):  https://github.com/Aaron113/urs/blob/master/lua/ulx/modules/urs_server.lua#L74-L85

EDIT: 800th post... WHOO!

Offline theGoldTrigger

  • Newbie
  • *
  • Posts: 18
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #563 on: November 26, 2015, 03:00:14 PM »
Could I run it like this if every usergroup had a set limit?

Code: [Select]
LocalPlayer():GetCount( "props" ) .. "/" .. xgui.data.URSLimits["prop"][LocalPlayer():GetUserGroup()]
EDIT: It works... however, when I first load into the game I get lua errors saying: "prop" is a nil value. This goes away after a few seconds. My guess is that the table isn't getting initialized until I spawn. How could I make the table initialize before I completely load in?
« Last Edit: November 26, 2015, 03:19:17 PM by theGoldTrigger »

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 857
  • Karma: 414
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #564 on: November 27, 2015, 01:35:48 AM »
You can most likely fix that by doing this:

Code: [Select]
if xgui != nil then
LocalPlayer():GetCount( "props" ) .. "/" .. xgui.data.URSLimits["prop"][LocalPlayer():GetUserGroup()]
end
« Last Edit: November 27, 2015, 01:37:35 AM by Bite That Apple »
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #565 on: November 27, 2015, 08:29:54 AM »
Could I run it like this if every usergroup had a set limit?

Code: [Select]
LocalPlayer():GetCount( "props" ) .. "/" .. xgui.data.URSLimits["prop"][LocalPlayer():GetUserGroup()]
EDIT: It works... however, when I first load into the game I get lua errors saying: "prop" is a nil value. This goes away after a few seconds. My guess is that the table isn't getting initialized until I spawn. How could I make the table initialize before I completely load in?
You have to check to make sure all the tables exist before trying to access them.  Otherwise you will get errors.  And this won't work for people who don't have limits.

Offline theGoldTrigger

  • Newbie
  • *
  • Posts: 18
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #566 on: November 27, 2015, 01:12:48 PM »
Managed to make it work with a simple check
Code: [Select]
if xgui.data.URSLimits["prop"] then
Thanks bob ;-;

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #567 on: November 27, 2015, 10:16:30 PM »
Managed to make it work with a simple check
Code: [Select]
if xgui.data.URSLimits["prop"] then
Thanks bob ;-;
Might want to see if the usergroup one exists as well.

Offline theGoldTrigger

  • Newbie
  • *
  • Posts: 18
  • Karma: 0
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #568 on: November 28, 2015, 12:24:14 AM »
I'm a little lost what do you mean?

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: URS BETA - A Highly Customizeable Restriction System (or will be)
« Reply #569 on: December 04, 2015, 09:17:21 AM »
I'm a little lost what do you mean?
Code: [Select]
if xgui.data.URSLimits["prop"] and xgui.data.URSLImits["prop"][ply:GetUserGroup() thenThat, just to make sure both exist. 

PS.  Sorry for late reply, don't believe I ever got notified.