Raised This Month: $ Target: $400
 0% 

[SOLVED] Creating ConVar's


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Trippp
Member
Join Date: Jul 2015
Old 02-04-2016 , 11:32   [SOLVED] Creating ConVar's
Reply With Quote #1

Hey it's me Trippp again with yet another question.

I'm trying to create some Cvar's, I tried everything but it just doesn't seem to work
This is the code i have

Code:
ConVar sm_funsounds_bombsound = null;
ConVar sm_funsounds_headshotsound = null;
ConVar sm_funsounds_defusesound = null;

public void OnPluginStart()
{
    sm_funsounds_bombsound = CreateConVar("sm_funsounds_bombsound", "1", "Turn bombsounds on");
    sm_funsounds_headshotsound = CreateConVar("sm_funsounds_headshotsound", "1", "Turn headshotsounds on");
    sm_funsounds_defusesound = CreateConVar("sm_funsounds_defusesound", "1", "Turn defuse sounds on");
}
What am I doing wrong, if I type the cvar's in console it says unknown command? Help!

Last edited by Trippp; 02-05-2016 at 12:50. Reason: Solved
Trippp is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 02-04-2016 , 11:58   Re: [HELP] Creating ConVar's
Reply With Quote #2

ConVars aren't commands. If you want to change it you need to do it through ftp, sm_cvar, or rcon. Like "sm_rcon sm_funsounds_bombsound 0".

Last edited by blaacky; 02-04-2016 at 11:58.
blaacky is offline
good_live
AlliedModders Donor
Join Date: Oct 2013
Old 02-04-2016 , 11:58   Re: [HELP] Creating ConVar's
Reply With Quote #3

A Cvar is no Command ^^

https://wiki.alliedmods.net/Commands...Mod_Scripting)

https://wiki.alliedmods.net/ConVars_...Mod_Scripting)
good_live is offline
Trippp
Member
Join Date: Jul 2015
Old 02-04-2016 , 12:40   Re: [HELP] Creating ConVar's
Reply With Quote #4

Thanks guys, Is there anyway you can let a client change a client-sided ConVar you made?
Trippp is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-04-2016 , 12:59   Re: [HELP] Creating ConVar's
Reply With Quote #5

Quote:
Originally Posted by Trippp View Post
Thanks guys, Is there anyway you can let a client change a client-sided ConVar you made?
Uhh... What? I think you mean SERVER-sided cvar.
WildCard65 is offline
Trippp
Member
Join Date: Jul 2015
Old 02-04-2016 , 13:03   Re: [HELP] Creating ConVar's
Reply With Quote #6

Quote:
Originally Posted by WildCard65 View Post
Uhh... What? I think you mean SERVER-sided cvar.
No, I'm having some plugins here that play a sound on some Events, for example Bomb Explosion.
How do I make it so the client can turn it on/off. My guess was making a Cvar that a client can change...?
Trippp is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 02-04-2016 , 13:09   Re: [HELP] Creating ConVar's
Reply With Quote #7

You cannot make a client-sided cvar.
__________________
ddhoward is offline
Trippp
Member
Join Date: Jul 2015
Old 02-04-2016 , 13:11   Re: [HELP] Creating ConVar's
Reply With Quote #8

So how do I make it so the client can turn it on/off?
Any suggestions?
Trippp is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 02-04-2016 , 13:11   Re: [HELP] Creating ConVar's
Reply With Quote #9

you don't, you implement settings via commands
Miu is offline
Trippp
Member
Join Date: Jul 2015
Old 02-04-2016 , 13:16   Re: [HELP] Creating ConVar's
Reply With Quote #10

Quote:
Originally Posted by Miu View Post
you don't, you implement settings via commands
I'm not talking about changing the Cvar anymore.
I'm just wondering if anybody can give me a kick in the right direction.
Like I want the client to choose if he wants to enable the sound or not

Last edited by Trippp; 02-04-2016 at 13:17.
Trippp 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 03:53.


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