Raised This Month: $51 Target: $400
 12% 

[HELP] Menu modify.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lolzin123
Member
Join Date: Apr 2009
Old 08-01-2009 , 15:40   [HELP] Menu modify.
Reply With Quote #1

How i modify this menu.
PHP Code:
menu_additem(gCustomMenu"Godmode""2"accessCustom, -1); 
I've tryed
PHP Code:
case 2// GodMode
        
{
            new 
szTitle[49];
            new 
szGodmode[6];
            
szGodmode = (get_user_godmode(plr) ? "\yOn" "\rOff");
            
            
format(szTitle48"GodMode: %s"szGodmode); 
Any idea? I'm trying to make like B.M

THX
lolzin123 is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 08-01-2009 , 18:10   Re: [HELP] Menu modify.
Reply With Quote #2

You can copy string to a Array.

formatex(szTitle, 48, "GodMode: %s", get_user_godmode(plr) ? "\yOn" : "\rOff" );
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
lolzin123
Member
Join Date: Apr 2009
Old 08-01-2009 , 19:51   Re: [HELP] Menu modify.
Reply With Quote #3

but this gonna change the case two of the menu to the right way?
lolzin123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-02-2009 , 00:21   Re: [HELP] Menu modify.
Reply With Quote #4

It doesn't change the menu . . . well it might, you don't give us much reference to the actual menu.
__________________
fysiks is offline
lolzin123
Member
Join Date: Apr 2009
Old 08-02-2009 , 11:16   Re: [HELP] Menu modify.
Reply With Quote #5

PHP Code:
gCustomMenu menu_create("Custom Menu""mnuCustom"0);
    
menu_additem(gCustomMenu"Revive""1"accessCustom, -1);
    
menu_additem(gCustomMenu"Godmode""2"accessCustom, -1);
    
menu_additem(gCustomMenu"Scout + Usp""3"accessCustom, -1);
    
menu_additem(gCustomMenu"Healer""4"accessCustom, -1);
    
menu_additem(gCustomMenu"About Plugin.""5"0, -1);
    
menu_setprop(gCustomMenuMPROP_EXITNAME"Main Menu"); 
PHP Code:
public mnuCustom(plrmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_display(plrgMainMenu0);
        return 
PLUGIN_CONTINUE;
    }
    
    new 
szCmd[3],  _accesscallback;
    
menu_item_getinfo(menuitem_accessszCmd2""0callback);
    
    switch( 
str_to_num(szCmd) )
    {
        case 
1// Revive
        
{
            
/// CODE
                
}
        case 
2// GodMode
        
{
               new 
szTitle[49]; 
                           new 
szGodmode[6]; 
                           
szGodmode = (get_user_godmode(plr) ? "\yOn" "\rOff"); 
             
                           
format(szTitle48"GodMode: %s"szGodmode);  
                       
// CODE
                
}            
        case 
3// Scout + Usp
        // CODE
        
case 5// Sobre este plugin.
        
{
            
// CODE
        
}
    }
    
    
menu_display(plrgCustomMenu0);
    return 
PLUGIN_CONTINUE;

lolzin123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-02-2009 , 16:12   Re: [HELP] Menu modify.
Reply With Quote #6

Ok, so I forgot to ask: What is the question? I can't understand you.
__________________
fysiks is offline
lolzin123
Member
Join Date: Apr 2009
Old 08-02-2009 , 16:29   Re: [HELP] Menu modify.
Reply With Quote #7

I'm tryng to modify the GodMode... When is turn on apears in the mnu GODMODE: ON and when is off GODMODE: OFF... understand dude?
lolzin123 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-02-2009 , 17:13   Re: [HELP] Menu modify.
Reply With Quote #8

Quote:
Originally Posted by lolzin123 View Post
understand dude?
dude? Way to be rude.

Code:
menu_additem(gCustomMenu, get_user_godmode(plr) ? "GODMODE: \yON" : "GODMODE: \rOFF", "2", accessCustom, -1);
__________________
fysiks is offline
lolzin123
Member
Join Date: Apr 2009
Old 08-03-2009 , 10:21   Re: [HELP] Menu modify.
Reply With Quote #9

I've tryed this before... but doesn't works. :/ and sorry about 'dude'.
lolzin123 is offline
lolzin123
Member
Join Date: Apr 2009
Old 08-03-2009 , 10:38   Re: [HELP] Menu modify.
Reply With Quote #10

I'm add at:

PHP Code:
public plugin_init() 
And when i add this code:
PHP Code:
gCustomMenu menu_create("Custom Menu""mnuCustom"0);
    
menu_additem(gCustomMenu"Revive""1"accessCustom, -1);
    
menu_additem(gCustomMenuget_user_godmode(plr) ? "GODMODE: \yON" "GODMODE: \rOFF""2"accessCustom, -1);
    
menu_additem(gCustomMenu"Scout + Usp""3"accessCustom, -1);
    
menu_additem(gCustomMenu"Healer""4"accessCustom, -1);
    
menu_additem(gCustomMenu"Sobre este plugin.""5"0, -1);
    
menu_setprop(gCustomMenuMPROP_EXITNAME"Main Menu"); 
With 'plr' apears the code bug:
undefined symbol 'plr'

and

argument type mistmach <argument 2>

And my plugin doesn't works with 'id' ... the way is add plr at:
PHP Code:
public plugin_init() 
but i think this bug the plugin...
lolzin123 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:21.


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