AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   register cvar but no change (https://forums.alliedmods.net/showthread.php?t=134246)

n0rt 08-02-2010 13:49

register cvar but no change
 
hi all
well i have 1 question

i want to register(maybe i even dont need to do that) a cvar,specify value to it and dont allow to change that(only in sma), and i dont want that to appear somewhere in game,help please?

for example

i have autohealing plugin with cvar autoheal_hp and value 55

new cvar_hp

cvar_hp = register_cvar("autoheal_hp", "55");

how can i hold that to 55 and make it never appear in Plugin Cvars Menu or smth like that
FCVAR_PROTECTED flag
but its not correct im sure

Bugsy 08-02-2010 13:53

Re: register cvar but no change
 
Quote:

Originally Posted by n0rt (Post 1259480)
hi all
well i have 1 question

i want to register(maybe i even dont need to do that) a cvar,specify value to it and dont allow to change that(only in sma), and i dont want that to appear somewhere in game,help please?

for example

i have autohealing plugin with cvar autoheal_hp and value 55

new cvar_hp

cvar_hp = register_cvar("autoheal_hp", "55");

how can i hold that to 55 and make it never appear in Plugin Cvars Menu or smth like that

Why not use a regular variable?

const var = 55 //cant be changed.
new var = 55 //can be changed

n0rt 08-02-2010 13:56

Re: register cvar but no change
 
yes,im searching something like this
but i dont know what format is it use :]

thanks! ill try

n0rt 08-02-2010 14:13

Re: register cvar but no change
 
ok ok i think iv got it

n0rt 08-02-2010 14:38

Re: register cvar but no change
 
can you make 1-2 examples,1 for text and 1 for value please
i think im doing smth wrong :/

Bugsy 08-02-2010 15:24

Re: register cvar but no change
 
Above covers integers, for arrays and strings.

new const var[ 555 ]
new var[ 555 ]

n0rt 08-02-2010 16:15

Re: register cvar but no change
 
hmm i cant get it
but tries will bring me to success... maybe

Bugsy 08-02-2010 16:37

Re: register cvar but no change
 
What are you trying to do?

fysiks 08-02-2010 18:05

Re: register cvar but no change
 
Quote:

Originally Posted by n0rt (Post 1259604)
hmm i cant get it
but tries will bring me to success... maybe

After reading your first post, using Tries is not the answer. Just use the global variable Bugsy mentioned.


All times are GMT -4. The time now is 00:11.

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