General > Developers Corner

ply:isUserGroup advice

<< < (2/5) > >>

Tomzen:

--- Quote from: Aaron113 on May 13, 2015, 08:23:24 PM ---http://wiki.garrysmod.com/page/gameevent/Listen
https://github.com/Nayruden/Ulysses/blob/052983fb132af59859784d3d6320ccdba01fe802/ulib/lua/ulib/server/ucl.lua#L562-L573

That is literally everything you need to do this.  It won't even let them download files.

I got ninja'd, but for the mode being saved, you could just create a cvar or save to a data file.

--- End quote ---

New to lua, could you post an example? or perhaps link to another add-on that's used that before.

Tomzen:
Would the following work:


--- Code: ---CreateConVar( "server_mode", "1" )
--- End code ---

(server_mode 1 to enable) and to turn it off just add another but with 0?


--- Code: ---CreateConVar( "server_mode", "0" )
--- End code ---

and to read it:

--- Code: ---if GetConVarNumber( "server_mode" ) == 1 then
...
--- End code ---

Is this right?

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version