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

How to register a CVAR?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-25-2011 , 14:38   How to register a CVAR?
Reply With Quote #1

I want to register a CVAR that it'll call a function at some point of the code according to what the cvar is (for example if amx_cvar kill_admin will be on '1') when its time for a function in the order of a code i made, the function that kills all admins will be called, if its on '0' it wont be called when it gets to the function.

NOTE: I want it to be permanent, like all those CVARS that never change even when u do map change.
Diegorkable is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-25-2011 , 16:22   Re: How to register a CVAR?
Reply With Quote #2

Cvars are settings and don't cause action.

This post is very informative. (ignore all replies in the thread)
__________________
fysiks is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-26-2011 , 06:30   Re: How to register a CVAR?
Reply With Quote #3

You can register a server command that *acts* like a cvar, requiring input values and stuff.
__________________
Hunter-Digital is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-26-2011 , 06:41   Re: How to register a CVAR?
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?t=154642
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-26-2011 , 12:34   Re: How to register a CVAR?
Reply With Quote #5

But, lets say I have a plugin, and it goes through some functions, in order ofcourse. what I want is to register a cvar that can be edited ingame, that if you put 0 or 1, when the plugin runs, it'll skip or do the function according to what the cvar value is. and I want that CVAR to not change after map change, how do I do that?
Diegorkable is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-26-2011 , 16:00   Re: How to register a CVAR?
Reply With Quote #6

Quote:
Originally Posted by Diegorkable View Post
But, lets say I have a plugin, and it goes through some functions, in order ofcourse. what I want is to register a cvar that can be edited ingame, that if you put 0 or 1, when the plugin runs, it'll skip or do the function according to what the cvar value is. and I want that CVAR to not change after map change, how do I do that?
You make a cvar. That's it.
__________________
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 04:55.


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