Raised This Month: $ Target: $400
 0% 

Problem with %d


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-30-2014 , 11:11   Re: Problem with %d
Reply With Quote #5

This is an example and also what you should you do with other menu, if you want to show the cost:
Code:
 menu_additem(menu, "Invisible (30sec) (Counter Terrorist) (%d$)", "3", 0, g_invi30);
-->
Quote:
Originally Posted by YamiKaitou View Post
Code:
formatex(msg, charsmax(msg), "Invisible (30sec) (Counter Terrorist) (%d$)", g_invi30);
menu_additem(menu, msg, "3", 0);
If you still cannot understand, just see below example:
PHP Code:
public iMenu(id
{
    new 
szTemp[101]
    
    new 
menu menu_create("Item Menu \rv4.0""menu_Handler")
    
    
formatex(szTempcharsmax(szTemp), "Health Regeneration -- \y%d"g_CCost_Regenerate)
    
menu_additem(menuszTemp"1")
    
    
formatex(szTempcharsmax(szTemp), "Invisible -- \y%d"g_CCost_Invi)
    
menu_additem(menuszTemp"2")
    
    
formatex(szTempcharsmax(szTemp), "Health -- \y%d"g_CCost_HP)
    
menu_additem(menuszTemp"3")
    
    
formatex(szTempcharsmax(szTemp), "Armor -- \y%d"g_CCost_Armor)
    
menu_additem(menuszTemp"4")
    
    
// Other codes. ;)
    
    
menu_display(idmenu)
}

public 
menu_Handler(idmenuitem
{    
    if(
item == MENU_EXIT
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    switch(
item
    {
        case 
0:
        {
            
// Other codes. ;)
        
}
    }
    
    return 
PLUGIN_HANDLED


Last edited by zmd94; 12-30-2014 at 11:17.
zmd94 is offline
 



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 15:29.


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