This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[Resolved] Display a cvar content into a vote


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NouveauJoueur
SourceMod Donor
Join Date: May 2009
Old 05-18-2012 , 15:04   [Resolved] Display a cvar content into a vote
Reply With Quote #1

Hi,

I hope the title isn't too confusing : my english is bad as my coding skills.

I've a cvar set to "15" and I want this "15" to be displayed into a vote choice.

The following code gives no errors at compilation, but ingame the vote only display one choice, 2. "%d test"

Code:
      
        new testa = GetConVarInt(cvarTESTA);
        new testb = GetConVarInt(cvarTESTB);
Code:
        AddMenuItem(menu, "test", "%d test", testa);
        AddMenuItem(menu, "TesT", "%d test", testb);
Any idea on how I could get those vote choices display what the cvars are set to ?
__________________
NouveauJoueur is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-18-2012 , 15:17   Re: Display a cvar content into a vote
Reply With Quote #2

PHP Code:
new testa GetConVarInt(cvarTESTA);
new 
testb GetConVarInt(cvarTESTB);

decl String:sTemp[32];
Format(sTempsizeof(sTemp), "%d test"testa);
AddMenuItem(menu"test"sTemp);
Format(sTempsizeof(sTemp), "%d test"testb);
AddMenuItem(menu"TesT"sTemp); 
__________________
Silvers is offline
NouveauJoueur
SourceMod Donor
Join Date: May 2009
Old 05-18-2012 , 15:25   Re: Display a cvar content into a vote
Reply With Quote #3

Thank you very much : It works !
__________________

Last edited by NouveauJoueur; 05-18-2012 at 15:25.
NouveauJoueur 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 10:10.


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