Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: jamysaurus on August 15, 2013, 08:03:50 AM

Title: Is there ANY way to restrict a console command to a certain rank?
Post by: jamysaurus on August 15, 2013, 08:03:50 AM
A server i play in has just added GCompute for ingame lua editing so the owner himself has an easier job to code, and the coders.
But the problem is, everyone can use it right now--how would he go about blocking it only for some ranks?
Title: Re: Is there ANY way to restrict a console command to a certain rank?
Post by: MrPresident on August 15, 2013, 10:48:15 AM
He is a coder and yet needs to know how to restrict a command to admin only? :D

The easiest way would be to have him open the file for the addon that has the command in it and add this to the top of the function.

if not ply:IsAdmin() then return end


^in this example I assume the function passes the player calling the function as ply. If not, change as appropriate.
Title: Re: Is there ANY way to restrict a console command to a certain rank?
Post by: JamminR on August 15, 2013, 02:24:23 PM
And just to be clear, MrPresident's way wouldn't even require ULib or uLX.
Would work on any server where a player had 'admin' group access.
Title: Re: Is there ANY way to restrict a console command to a certain rank?
Post by: Bite That Apple on August 15, 2013, 07:27:56 PM
And just to be clear, MrPresident's way wouldn't even require ULib or uLX.
Would work on any server where a player had 'admin' group access.

and what else is other than ulx, evolve :p ?
Title: Re: Is there ANY way to restrict a console command to a certain rank?
Post by: JamminR on August 15, 2013, 07:34:35 PM
and what else is other than ulx, evolve :p ?
100% Vanilla Console.
Something which I wish more people learned before ever installing an admin mod.
:)