Raised This Month: $ Target: $400
 0% 

cvar changing help...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 02-22-2005 , 18:37   cvar changing help...
Reply With Quote #1

im very new to this... i was wondering what the code would be for me to make an admin with an access of ADMIN_LEVEL_A change the cvar ping_max

and is this code right to make a new cvar?

Code:
register_cvar("ping_max","175",FCVAR_PRINTABLEONLY)
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 18:48  
Reply With Quote #2

Code:
    register_cvar("sv_cvar","1", ADMIN_LEVEL_A)

That Should Be right

Just change the sv_cvar into yours

cause ADMIN_LEVEL_A is the Level of Admin you must have
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 02-22-2005 , 18:53  
Reply With Quote #3

ok, and i would replace the '1' with the default i want it at right?

and what would the code be for me to make an admin with an access of ADMIN_LEVEL_A change the cvar ping_max? any extra code? or just that?

EDIT: and would i have to make this line even if i register the new cvar:

Code:
new ping_max[30]
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 18:55  
Reply With Quote #4

yes

Code:
    register_cvar("amx_ping","175", ADMIN_LEVEL_A)

Tell me if you get any errors

I am pretty sure though

__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 18:57  
Reply With Quote #5

Quote:
Originally Posted by Sp4rt4n
ok, and i would replace the '1' with the default i want it at right?

and what would the code be for me to make an admin with an access of ADMIN_LEVEL_A change the cvar ping_max? any extra code? or just that?

EDIT: and would i have to make this line even if i register the new cvar:

Code:
new ping_max[30]
What Is That For In The Plugin?
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-22-2005 , 18:59  
Reply With Quote #6

Dizzy, that is incorrect.

The third parameter is the cvar flags, not the access level.

You would have to register a console command for admins with ADMIN_LEVEL_A that uses cvar_set_int or something to set the cvar. Keep the cvar registering line as you had it before.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 02-22-2005 , 19:00  
Reply With Quote #7

very cool, it worked.... thank you
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 19:01  
Reply With Quote #8

isn't the cvar automatically ADMIN encrypted?

A regualar Client can't change cvars without rcon

soo...

with admin you can already use the cvar

Just don't give your rcon away to anyone

the cvar doesn't need to be ADMIN_LEVEL_A'ed

just the concmd

register_concmd("amx_maxping","maxping", ADMIN_LEVEL_A)

Like that

Or just have a Cvar
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 02-22-2005 , 19:27  
Reply With Quote #9

ah, much easier... thank you
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 20:08  
Reply With Quote #10

np glad that Avalance and I could help ya
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
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 13:58.


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