Raised This Month: $51 Target: $400
 12% 

[HELP] limit cvars' access via. amx_cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tRipLe.
Senior Member
Join Date: Dec 2009
Location: Estonia, Pärnu
Old 05-08-2010 , 13:29   [HELP] limit cvars' access via. amx_cvar
Reply With Quote #1

Hi, i am having a problem on my server. I have a lot of admins, and today someone had changed some server important cvars.

Is it possible to for ex. only admins with l flag can change the cvar mp_timelimit.
it is like admin with k flag can change sv_password.

Maybe a *.ini file, where i define cvars like "sv_gravity" "<flag>" so admins without "<flag>" can't change sv_gravity via amx_cvar.

If there is a topic or plugin about it already, then sorry.
And excuse my bad english, hope you understand
tRipLe. is offline
Send a message via MSN to tRipLe. Send a message via Skype™ to tRipLe.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2010 , 15:54   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #2

Don't let them use amx_cvar.
__________________
fysiks is offline
tRipLe.
Senior Member
Join Date: Dec 2009
Location: Estonia, Pärnu
Old 05-08-2010 , 16:02   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #3

I think you or me is not understanding

I don't want to remove them the amx_cvar right, just limit some cvar i don't want them to change.
tRipLe. is offline
Send a message via MSN to tRipLe. Send a message via Skype™ to tRipLe.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2010 , 17:19   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #4

I figured you would say that , I thought I might try the easiest answer first. Anyways, doing what you want I think modifying the amx_cvar command would be best.

EDIT:

Ok, test this. mp_timelimit requires "l" and sv_gravity requires "t" (for testing purposes). Tell me if it works correctly for both cvars with and without the admin flag. If it does I can make it read a .ini.
__________________

Last edited by fysiks; 02-24-2016 at 21:36. Reason: Removed old test plugin.
fysiks is offline
tRipLe.
Senior Member
Join Date: Dec 2009
Location: Estonia, Pärnu
Old 05-08-2010 , 20:21   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #5

Works perfect


] amx_cvar mp_timelimit
[AMXX] You have no access to that cvar

very nice gj so you can do like somename.ini where it reads the cvars so i put there cvars and the flag behind?
tRipLe. is offline
Send a message via MSN to tRipLe. Send a message via Skype™ to tRipLe.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2010 , 21:02   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #6

/addons/amxmodx/configs/cvaraccess.ini
Code:
"sv_password" "k"
"mp_timelimit" "l"
"sv_gravity" "t"
Also, if there is no cvaraccess.ini it will add sv_password automatically.

Let me know if it works.
Attached Files
File Type: sma Get Plugin or Get Source (admincmd.sma - 566 views - 31.5 KB)
__________________

Last edited by fysiks; 02-24-2016 at 21:36. Reason: Updated the base code to 1.8.2
fysiks is offline
tRipLe.
Senior Member
Join Date: Dec 2009
Location: Estonia, Pärnu
Old 05-09-2010 , 07:48   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #7

I'll try that

I think this feature should be in amxmodx default

//EDIT: Works perfectly! Thanks!

Last edited by tRipLe.; 06-02-2010 at 05:56.
tRipLe. is offline
Send a message via MSN to tRipLe. Send a message via Skype™ to tRipLe.
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 02-24-2016 , 21:05   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #8

Can someone update it? It's not working for me.
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-24-2016 , 21:38   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #9

What part isn't working? Did you create cvaraccess.ini properly?

Anyways, I updated the base code to match AMX Mod X 1.8.2. Nothing related to the custom cvar access was changed in this update.
__________________
fysiks is offline
crnova
Senior Member
Join Date: Sep 2015
Old 02-25-2016 , 05:31   Re: [HELP] limit cvars' access via. amx_cvar
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
What part isn't working? Did you create cvaraccess.ini properly?

Anyways, I updated the base code to match AMX Mod X 1.8.2. Nothing related to the custom cvar access was changed in this update.
Why not release it to the public, like make a new topic in the "New plugin submissions" board, i believe there are some people out there that need smth like this
__________________

Last edited by crnova; 02-25-2016 at 05:32.
crnova is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode