AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to register a CVAR? (https://forums.alliedmods.net/showthread.php?t=162999)

Diegorkable 07-25-2011 14:38

How to register a CVAR?
 
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.

fysiks 07-25-2011 16:22

Re: How to register a CVAR?
 
Cvars are settings and don't cause action.

This post is very informative. (ignore all replies in the thread)

Hunter-Digital 07-26-2011 06:30

Re: How to register a CVAR?
 
You can register a server command that *acts* like a cvar, requiring input values and stuff.

wrecked_ 07-26-2011 06:41

Re: How to register a CVAR?
 
http://forums.alliedmods.net/showthread.php?t=154642

Diegorkable 07-26-2011 12:34

Re: How to register a CVAR?
 
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?

fysiks 07-26-2011 16:00

Re: How to register a CVAR?
 
Quote:

Originally Posted by Diegorkable (Post 1518981)
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.


All times are GMT -4. The time now is 01:09.

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