AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New Question: Setting a cvar's value -.- (https://forums.alliedmods.net/showthread.php?t=94546)

P i x e L 06-12-2009 11:24

New Question: Setting a cvar's value -.-
 
new question as of 5:43 EST
:oops:
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 =/

Bugsy 06-12-2009 11:26

Re: checkings to see if user has gun
 
if ( user_has_weapon( id , CSW_M4A1 ) )

if ( user_has_weapon( id , CSW_USP ) )

P i x e L 06-12-2009 11:33

Re: checkings to see if user has gun
 
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 :)

Bugsy 06-12-2009 11:38

Re: checkings to see if user has gun
 
http://www.bosskey.net/cs/weapons.html

P i x e L 06-12-2009 11:38

Re: checkings to see if user has gun
 
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 06-12-2009 17:45

Re: New Question: Setting a cvar's value -.-
 
New question, heh =\

zacky 06-12-2009 17:47

Re: New Question: Setting a cvar's value -.-
 
set_cvar_num("your_cvar", value)

Bugsy 06-12-2009 17:50

Re: New Question: Setting a cvar's value -.-
 
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 );



P i x e L 06-12-2009 17:53

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

Originally Posted by Bugsy (Post 847523)
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! :up:

fysiks 06-12-2009 18:40

Re: New Question: Setting a cvar's value -.-
 
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.


All times are GMT -4. The time now is 14:05.

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