Raised This Month: $ Target: $400
 0% 

CVAR can only be change by Certain Admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deadman909
Veteran Member
Join Date: Oct 2008
Old 02-27-2013 , 16:17   CVAR can only be change by Certain Admins
Reply With Quote #1

I was wondering if there is a way to register a CVAR but be able to control what admins can change this cvar.

because I know for CMD like this below

register_concmd("amx_heal", "CmdHeal", ADMIN_LEVEL_A, "<nick, #userid, authid or @team> <HP to give>");

you are able to control the Admin Level. But what about for CVARS I want admins to have Immunity and Cvar access in order to use the CVAR.

register_cvar("amx_ship_amount", "50")

Like for example that one above how would I set it up like how I explained above?
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 02-27-2013 , 17:37   Re: CVAR can only be change by Certain Admins
Reply With Quote #2

Basically there is one flag for cvars.

Quote:
to use the CVAR.
Use? Or did you mean change?

Why just don't give your admins cvar flag. Why do they need it anyway?
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 02-27-2013 , 19:26   Re: CVAR can only be change by Certain Admins
Reply With Quote #3

Quote:
Originally Posted by naven View Post
Basically there is one flag for cvars.


Use? Or did you mean change?

Why just don't give your admins cvar flag. Why do they need it anyway?
Its because it is not for my server it is for a friend. And they use cvar like for gravity. That is why I was wondering if there is a way to make a CVAR but to be able to control what admins can change the CVAR.
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-27-2013 , 21:15   Re: CVAR can only be change by Certain Admins
Reply With Quote #4

Quote:
Originally Posted by deadman909 View Post
Its because it is not for my server it is for a friend.
That doesn't make sense.

Quote:
Originally Posted by deadman909 View Post
And they use cvar like for gravity. That is why I was wondering if there is a way to make a CVAR but to be able to control what admins can change the CVAR.
You can change gravity with amx_cvar.
__________________

Last edited by fysiks; 02-27-2013 at 21:16.
fysiks is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 02-27-2013 , 21:26   Re: CVAR can only be change by Certain Admins
Reply With Quote #5

It is for a server that is not mine. The server is a friend of mines. And yea I know that is what I mean they give amx_cvar so players can change Gravity in the server.

But I want to make a CVAR that controls how much Health a player should get like for a kill.

For Example: amx_cvar player_kill_hp_bonus 50

I want it so only admins with Immunity can change the 50 value to like 20 or whatever else they want.

If there isnt a way to do this than Ill tell him that there is a risk that other admins well change this value.

Also if there is not a way to do this than is there a way to LOG what admins change this value?
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-27-2013 , 21:30   Re: CVAR can only be change by Certain Admins
Reply With Quote #6

The easiest way is to create a plugin with a function to do what you want. This way, you can control who uses it and what values are allowed. Very simple.
__________________
fysiks is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 02-28-2013 , 03:02   Re: CVAR can only be change by Certain Admins
Reply With Quote #7

Check out this plugin
http://forums.alliedmods.net/showthread.php?t=59535
or that version:
http://forums.alliedmods.net/showthread.php?t=177180
It is using concmds as a cvars, pretty weird but it works.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 02-28-2013 , 03:17   Re: CVAR can only be change by Certain Admins
Reply With Quote #8

Quote:
Originally Posted by naven View Post
It is using concmds as a cvars, pretty weird but it works.
How is it weird? It's basically the same thing.
Backstabnoob is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 02-28-2013 , 04:16   Re: CVAR can only be change by Certain Admins
Reply With Quote #9

Quote:
Originally Posted by Backstabnoob View Post
How is it weird? It's basically the same thing.
I got used to register_cvar.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-28-2013 , 05:18   Re: CVAR can only be change by Certain Admins
Reply With Quote #10

Quote:
Originally Posted by naven View Post
It is using concmds as a cvars, pretty weird but it works.
I take it you've never looked a Deagles Map Manager.
__________________
fysiks 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 21:37.


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