Raised This Month: $ Target: $400
 0% 

New Question: Setting a cvar's value -.-


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
P i x e L
Junior Member
Join Date: Jun 2009
Location: eBaum's World
Old 06-12-2009 , 11:24   New Question: Setting a cvar's value -.-
Reply With Quote #1

new question as of 5:43 EST

Can somebody please explain how I can set a cvar's value through my code for example when the round ends I want to change a cvar to 0 (disabled).

Thanks =]

-sorry for all the questions i just began coding yesterday. never coded anything in my life, heh =/

Last edited by P i x e L; 06-12-2009 at 17:45.
P i x e L is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-12-2009 , 11:26   Re: checkings to see if user has gun
Reply With Quote #2

if ( user_has_weapon( id , CSW_M4A1 ) )

if ( user_has_weapon( id , CSW_USP ) )
__________________
Bugsy is offline
P i x e L
Junior Member
Join Date: Jun 2009
Location: eBaum's World
Old 06-12-2009 , 11:33   Re: checkings to see if user has gun
Reply With Quote #3

Yes thank you very much

Don't want to make a new thread but another question: I searched but with no success; is there a list perhaps of all the items in CS 1.6 and how much they cost? Would be great if somebody could link me there or post it here! I will keep searching in the meantime
P i x e L is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-12-2009 , 11:38   Re: checkings to see if user has gun
Reply With Quote #4

http://www.bosskey.net/cs/weapons.html
__________________
Bugsy is offline
P i x e L
Junior Member
Join Date: Jun 2009
Location: eBaum's World
Old 06-12-2009 , 11:38   Re: checkings to see if user has gun
Reply With Quote #5

Wow that's perfect can't believe I never found that one thanks a lot you are a big help!
P i x e L is offline
P i x e L
Junior Member
Join Date: Jun 2009
Location: eBaum's World
Old 06-12-2009 , 17:45   Re: New Question: Setting a cvar's value -.-
Reply With Quote #6

New question, heh =\
P i x e L is offline
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 06-12-2009 , 17:47   Re: New Question: Setting a cvar's value -.-
Reply With Quote #7

set_cvar_num("your_cvar", value)
zacky is offline
Send a message via Skype™ to zacky
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-12-2009 , 17:50   Re: New Question: Setting a cvar's value -.-
Reply With Quote #8

PHP Code:
new g_pCVar;

//plugin_init()
register_logevent"fwRoundEnd" "1=Round_End" )
    
g_pCVar register_cvar"your_cvar" "134" );
//or
g_pCVar get_cvar_pointer"an_existing_cvar" );

public 
fwRoundEnd()
{
    
set_pcvar_numg_pCVar );

__________________
Bugsy is offline
P i x e L
Junior Member
Join Date: Jun 2009
Location: eBaum's World
Old 06-12-2009 , 17:53   Re: New Question: Setting a cvar's value -.-
Reply With Quote #9

Quote:
Originally Posted by Bugsy View Post
PHP Code:
new g_pCVar;

//plugin_init()
register_logevent"fwRoundEnd" "1=Round_End" )
    
g_pCVar register_cvar"your_cvar" "134" );
//or
g_pCVar get_cvar_pointer"an_existing_cvar" );

public 
fwRoundEnd()
{
    
set_pcvar_numg_pCVar );

Ah I was about to ask zacky about pcvars but you just answered everything thanks lots!
P i x e L is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2009 , 18:40   Re: New Question: Setting a cvar's value -.-
Reply With Quote #10

Wow, this thread makes no sense now!

This forum is here to help others, therefore, always leave your question in your original post (including leaving the title). Just post again in the thread with your new question and somebody will likely answer it.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 14:05.


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