AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Putting a cvar in a quote? (https://forums.alliedmods.net/showthread.php?t=74867)

PvtSmithFSSF 07-26-2008 09:56

Putting a cvar in a quote?
 
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 :mrgreen: :up:

jim_yang 07-26-2008 10:10

Re: Putting a cvar in a quote?
 
new item[]
formatex(item, "\w200 gravity - %d", get_pcvar_)
menu_additem(menu, item, _ )

PvtSmithFSSF 07-26-2008 10:15

Re: Putting a cvar in a quote?
 
lol, explain for a noobie?
don't understand
i'm using the new menus btw, like in the tut. by Emp`

jim_yang 07-26-2008 10:17

Re: Putting a cvar in a quote?
 
http://www.amxmodx.org/funcwiki.php?...atex&go=search

PvtSmithFSSF 07-26-2008 10:18

Re: Putting a cvar in a quote?
 
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


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

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