Raised This Month: $ Target: $400
 0% 

Putting a cvar in a quote?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 07-26-2008 , 09:56   Putting a cvar in a quote?
Reply With Quote #1

So here's a basic line of code in my plugin:
Code:
menu_additem(menu, "\w200 Gravity", "1", 0);
That displays the option "200 gravity" on my menu. I want to add the price of the gravity onto the name. But, since this is decided by a cvar, I don't really understand.
I can't just put
Code:
"menu_additem(menu, "\w200 Gravity - get_pcvar_num(MyCvar)","1",0);
What's in red is the command that shows up... I don't want that to actually show up as it's typed, but I want the number that the cvar "MyCvar" is set to to show up.
How can I do this?

Thanks! +karma could be yours
PvtSmithFSSF is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-26-2008 , 10:10   Re: Putting a cvar in a quote?
Reply With Quote #2

new item[]
formatex(item, "\w200 gravity - %d", get_pcvar_)
menu_additem(menu, item, _ )
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 07-26-2008 , 10:15   Re: Putting a cvar in a quote?
Reply With Quote #3

lol, explain for a noobie?
don't understand
i'm using the new menus btw, like in the tut. by Emp`
PvtSmithFSSF is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-26-2008 , 10:17   Re: Putting a cvar in a quote?
Reply With Quote #4

http://www.amxmodx.org/funcwiki.php?...atex&go=search
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 07-26-2008 , 10:18   Re: Putting a cvar in a quote?
Reply With Quote #5

edit - ok i got it.


i have another question if you don't mind helping.
i have a plugin ''Buy Gravity'' in new plugin submissions currently... The gravity lasts for the whole round, though. I'd like it to last until the players dies. Would this be too challenging for a newbie?
btw- using fakemeta

Last edited by PvtSmithFSSF; 07-26-2008 at 21:57.
PvtSmithFSSF 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 05:31.


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