Raised This Month: $ Target: $400
 0% 

Put in a variable in MenuItem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
condolent
AlliedModders Donor
Join Date: Jan 2016
Location: gc_sLocation;
Old 05-26-2017 , 07:14   Put in a variable in MenuItem
Reply With Quote #1

Hi,
I have this code currently:
Code:
menu.AddItem(CHOICE2, "Respawns left: %d", ITEMDRAW_DISABLED);
I want it to be like this:
Code:
menu.AddItem(CHOICE2, "Respawns left: %d", Number, ITEMDRAW_DISABLED);
Where %d translates to the value of Number. But that gives a argument mismatch on the code. How can I do this in another way?
condolent is offline
CamerDisco
AlliedModders Donor
Join Date: Aug 2015
Location: Poland
Old 05-26-2017 , 07:36   Re: Put in a variable in MenuItem
Reply With Quote #2

PHP Code:
char buff[128];
Format(buffsizeof(buff), "Respawns left: %d"Number);
menu.AddItem(CHOICE2buffITEMDRAW_DISABLED); 
__________________


Max-Play.pl - the best polish servers
CamerDisco is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 05-26-2017 , 10:20   Re: Put in a variable in MenuItem
Reply With Quote #3

[INC] Menu stocks
PHP Code:
AddMenuItemFormat(hMenu"weapon_ak47"_"AK-47 + %d ammo"90); 
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick 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 08:26.


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