AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   CVAR can only be change by Certain Admins (https://forums.alliedmods.net/showthread.php?t=209621)

deadman909 02-27-2013 16:17

CVAR can only be change by Certain Admins
 
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?

naven 02-27-2013 17:37

Re: CVAR can only be change by Certain Admins
 
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?

deadman909 02-27-2013 19:26

Re: CVAR can only be change by Certain Admins
 
Quote:

Originally Posted by naven (Post 1903289)
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.

fysiks 02-27-2013 21:15

Re: CVAR can only be change by Certain Admins
 
Quote:

Originally Posted by deadman909 (Post 1903344)
Its because it is not for my server it is for a friend.

That doesn't make sense.

Quote:

Originally Posted by deadman909 (Post 1903344)
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.

deadman909 02-27-2013 21:26

Re: CVAR can only be change by Certain Admins
 
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?

fysiks 02-27-2013 21:30

Re: CVAR can only be change by Certain Admins
 
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.

naven 02-28-2013 03:02

Re: CVAR can only be change by Certain Admins
 
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.

Backstabnoob 02-28-2013 03:17

Re: CVAR can only be change by Certain Admins
 
Quote:

Originally Posted by naven (Post 1903545)
It is using concmds as a cvars, pretty weird but it works.

How is it weird? It's basically the same thing.

naven 02-28-2013 04:16

Re: CVAR can only be change by Certain Admins
 
Quote:

Originally Posted by Backstabnoob (Post 1903551)
How is it weird? It's basically the same thing.

I got used to register_cvar.

fysiks 02-28-2013 05:18

Re: CVAR can only be change by Certain Admins
 
Quote:

Originally Posted by naven (Post 1903545)
It is using concmds as a cvars, pretty weird but it works.

I take it you've never looked a Deagles Map Manager.


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

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