Raised This Month: $ Target: $400
 0% 

register cvar but no change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
n0rt
Junior Member
Join Date: Jul 2008
Old 08-02-2010 , 13:49   register cvar but no change
Reply With Quote #1

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

Last edited by n0rt; 08-02-2010 at 13:53.
n0rt is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-02-2010 , 13:53   Re: register cvar but no change
Reply With Quote #2

Quote:
Originally Posted by n0rt View Post
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
__________________

Last edited by Bugsy; 08-02-2010 at 13:55.
Bugsy is offline
n0rt
Junior Member
Join Date: Jul 2008
Old 08-02-2010 , 14:13   Re: register cvar but no change
Reply With Quote #3

ok ok i think iv got it

Last edited by n0rt; 08-02-2010 at 14:16.
n0rt is offline
n0rt
Junior Member
Join Date: Jul 2008
Old 08-02-2010 , 13:56   Re: register cvar but no change
Reply With Quote #4

yes,im searching something like this
but i dont know what format is it use :]

thanks! ill try

Last edited by n0rt; 08-02-2010 at 13:59.
n0rt is offline
n0rt
Junior Member
Join Date: Jul 2008
Old 08-02-2010 , 14:38   Re: register cvar but no change
Reply With Quote #5

can you make 1-2 examples,1 for text and 1 for value please
i think im doing smth wrong :/
n0rt is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-02-2010 , 15:24   Re: register cvar but no change
Reply With Quote #6

Above covers integers, for arrays and strings.

new const var[ 555 ]
new var[ 555 ]
__________________
Bugsy is offline
n0rt
Junior Member
Join Date: Jul 2008
Old 08-02-2010 , 16:15   Re: register cvar but no change
Reply With Quote #7

hmm i cant get it
but tries will bring me to success... maybe

Last edited by n0rt; 08-02-2010 at 16:19.
n0rt is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-02-2010 , 18:05   Re: register cvar but no change
Reply With Quote #8

Quote:
Originally Posted by n0rt View Post
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.
__________________
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-02-2010 , 16:37   Re: register cvar but no change
Reply With Quote #9

What are you trying to do?
__________________
Bugsy 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 00:11.


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