Raised This Month: $ Target: $400
 0% 

problem with get_pcvar_num in menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mati009988
Member
Join Date: Jul 2009
Old 07-22-2010 , 07:16   problem with get_pcvar_num in menu
Reply With Quote #1

Hi.
I have a problem with get_pcvar_num() in menu.

PHP Code:
public Sklep(id){
    if(!
is_user_alive(id) && get_pcvar_num(alive_only) == 1){
        
ColorChat(idRED"%L"LANG_PLAYER"NO_ALIVE_MENU_MSG"tag
            return 
PLUGIN_HANDLED 
    
}
    if(
get_pcvar_num(shop_on) != 1){     
            
ColorChat(idRED"%L"LANG_PLAYER"SHOP_OFF_MSG"tag
            return 
PLUGIN_HANDLED 
    
}
    new 
szText555 char ];
    
formatexszTextcharsmaxszText ), "%L"LANG_PLAYER"SHOP_NAME_MSG"id );
    new 
menu menu_createszText"sklep_h" );
    
formatexszTextcharsmaxszText ), "%L"LANG_PLAYER"ITEM1_MSG"idget_pcvar_numhpa_koszt ) );
    
menu_additemmenuszText"1");
    
formatexszTextcharsmaxszText ), "%L"LANG_PLAYER"ITEM2_MSG"idget_pcvar_numhpb_koszt ) );
    
menu_additemmenuszText"2");
    
formatexszTextcharsmaxszText ), "%L"LANG_PLAYER"ITEM3_MSG"idget_pcvar_numxpa_koszt ) );
    
menu_additemmenuszText"3");
    
formatexszTextcharsmaxszText ), "%L"LANG_PLAYER"ITEM4_MSG"idget_pcvar_numxpb_koszt ) );
    
menu_additemmenuszText"4");    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
menu_displayidmenu);
    return 
PLUGIN_CONTINUE;

Code:
ITEM1_MSG = \w50 hp \r[\yCost \r%d\y$\r]
ITEM2_MSG = \w100 hp \r[\yCost \r%d\y$\r]
ITEM3_MSG = \w50 xp \r[\yCost \r%d\y$\r]
ITEM4_MSG = \w100 xp \r[\yCost \r %d\y$\r]
Always a price displayed 1
What I`m doing wrong?
mati009988 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-22-2010 , 09:43   Re: problem with get_pcvar_num in menu
Reply With Quote #2

Because you are passing id to the %d.
PHP Code:
formatexszTextcharsmaxszText ), "%L"LANG_PLAYER"ITEM1_MSG"idget_pcvar_numhpa_koszt ) ); 

PHP Code:
formatexszTextcharsmaxszText ), "%L"id"ITEM1_MSG"get_pcvar_numhpa_koszt ) ); 
There is 1 line fix, now use that and correct your other lines
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
mati009988
Member
Join Date: Jul 2009
Old 07-22-2010 , 10:26   Re: problem with get_pcvar_num in menu
Reply With Quote #3

work. Thank you
mati009988 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 00:06.


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