Raised This Month: $51 Target: $400
 12% 

Sourcemod CVARS ? How to..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-GSE-||Obsession^
Junior Member
Join Date: Oct 2006
Location: Monnickendam
Old 07-02-2007 , 08:55   Sourcemod CVARS ? How to..
Reply With Quote #1

Hey I got a question abouth the cvars and sourcemod-plugins:
Where do I have to set their value, do I have to set the value in the core code of the plugin (so before compiling) or do I have to set them in the sourcemod CFG file?

By the way:
I want to say to all you Sourcemod-scipters out there: Great Job.
I love u all, finally amxx is coming to source!!
Thank you all
-GSE-||Obsession^ is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-02-2007 , 08:56   Re: Sourcemod CVARS ? How to..
Reply With Quote #2

The default value should be set in the plugins' source. To change them, treat them like any other cvar. You could place them in server.cfg, for example.
__________________
I'm a blast from the past!
ferret is offline
-GSE-||Obsession^
Junior Member
Join Date: Oct 2006
Location: Monnickendam
Old 07-02-2007 , 09:06   Re: Sourcemod CVARS ? How to..
Reply With Quote #3

Ok thanks, especially for the quick respond .
And you say I could use the server.cfg file for changing them later on right?
But couldn't I could use the sourcemod.cfg file instead?
bcause this file allso is executed every mapchange:

// SourceMod Configuration File
// This file is automatically executed by SourceMod every mapchange.

So that i have the server.cfg file is for normal cvars and the sourmemod.cfg for my sourcemod-cvars.
Which is a bit more organized when there are more plugins..

But thank you again for your respond, now I can move on then..
-GSE-||Obsession^ is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-02-2007 , 09:08   Re: Sourcemod CVARS ? How to..
Reply With Quote #4

You could use either.
__________________
I'm a blast from the past!
ferret is offline
-GSE-||Obsession^
Junior Member
Join Date: Oct 2006
Location: Monnickendam
Old 07-02-2007 , 09:20   Re: Sourcemod CVARS ? How to..
Reply With Quote #5

Oh ok, I think I got it, but just an example to be shure ok..
So for example with the C4-timer plugin I should change the value 5 in this line?
Quote:
sm_c4timer = CreateConVar("sm_c4timer", 5", "Time that a countdown is given for the bomb; disable with value of 0", FCVAR_PLUGIN, true, 0.0, true, 30.0);
In the public OnPluginStart() part?

And what does the part FCVAR_PLUGIN and after do? Is it the max value for the cvar or somthing like that?
Well that doesn't matter acually.. But was in the right line?

Last edited by -GSE-||Obsession^; 07-02-2007 at 09:23.
-GSE-||Obsession^ is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-02-2007 , 09:32   Re: Sourcemod CVARS ? How to..
Reply With Quote #6

Nonono, leave all that alone. Don't change the plugin. All that is doing is setting the default to 5 and sets the range to 0-30.

Just put in sourcemod.cfg or server.cfg:
sm_c4timer 5
__________________
I'm a blast from the past!
ferret is offline
-GSE-||Obsession^
Junior Member
Join Date: Oct 2006
Location: Monnickendam
Old 07-02-2007 , 09:38   Re: Sourcemod CVARS ? How to..
Reply With Quote #7

Ow oke.. but this was what I meant with setting them in the core.
So I change the cvars values in the cfg files so that they are set every mapchange..
Now I think I really got it
-GSE-||Obsession^ is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-02-2007 , 09:40   Re: Sourcemod CVARS ? How to..
Reply With Quote #8

Yes., If you put them in the cfg files, it'll always be there. But if you change the plugin, you'll have to change it EVERYTIME you download a new copy of the plugin.
__________________
I'm a blast from the past!
ferret is offline
-GSE-||Obsession^
Junior Member
Join Date: Oct 2006
Location: Monnickendam
Old 07-02-2007 , 09:50   Re: Sourcemod CVARS ? How to..
Reply With Quote #9

Yeah I know,
but I used to play 1.6 & cz for some years now and was using amxx. And here I did set the value I wanted in the core of the code (.sma file) so that it would set the wanted value right away.

But sourcemod is a bit different with coding I gues, but I know do understand why I shouldn't do this here.
Bcause then the range isnt checked and when it doesnt fit it isnt automatically set right anymore or maybe crash..
This anwers all my questions so far..
Thank you for your support!

Last edited by -GSE-||Obsession^; 07-02-2007 at 10:06.
-GSE-||Obsession^ is offline
GriMz
Senior Member
Join Date: Jul 2007
Old 08-22-2007 , 18:52   Re: Sourcemod CVARS ? How to..
Reply With Quote #10

by the same token, if you created a new cfg file, called it plugins.cfg and then added exec plugins.cfg to the server.cfg, this would keep rcon admins from being able to change the plug ins if they didnt know what they were doing right? would this be a better way?
__________________
GriMz 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 07:52.


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