Raised This Month: $ Target: $400
 0% 

Menu issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 07-10-2010 , 18:26   Menu issue
Reply With Quote #1

I have made a menu and in Exit option I want to make other option (Do random),but when I use them,debug shows me...

Code:
L 07/10/2010 - 19:13:56: Plugin called menu_display when item=MENU_EXIT
L 07/10/2010 - 19:13:56: [AMXX] Displaying debug trace (plugin "Untitled.amxx")
L 07/10/2010 - 19:13:56: [AMXX] Run time error 10: native error (native "menu_display")
How I can make the option using the EXIT option?
is new menu
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-11-2010 , 00:14   Re: Menu issue
Reply With Quote #2

Show us your code, please.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 07-11-2010 , 07:56   Re: Menu issue
Reply With Quote #3

PHP Code:
public MenuWinner(Winner) {
    
    new 
Menu menu_create("\r[AMXX]\y Elige un teammate :","MenuWinnerHandler")
    
    new 
Players[32
    new 
Num
    get_players
(Players,Num)
    
    for(new 
0;<= Num;i++)
    {
        if(
is_user_connected(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR)
        {
            new 
name[32]
            
get_user_name(i,name,31)
            
            new 
temp[32]
            
num_to_str(i,temp,31)
            
            
menu_additem(Menu,name,temp,_,menu_makecallback("WinnerCallback"))
        }
    }
    
    
menu_setprop(Menu,MPROP_BACKNAME,"Atras")
    
menu_setprop(Menu,MPROP_NEXTNAME,"Siguiente^n")
    
menu_setprop(Menu,MPROP_EXITNAME,"Random")
    
    
menu_display(Winner,Menu)
}
//----------------------------------------------------------//
public WinnerCallback(Winner,Menu,item
    return 
Choosing[Winner] ? ITEM_ENABLED ITEM_DISABLED

//----------------------------------------------------------//
public MenuWinnerHandler(Winner,Menu,item) {
    
    new 
name[32]
    
get_user_name(Winner,name,31)
    
    if(
item == MENU_EXIT)
    {
        
RandomPlayer(Winner)
        
ChatColor(0,"!y[!gAMXX!y] %s hizo una eleccion random",name)
    }
    
    new 
iData[6]
    new 
iName[64]
    new 
Access
    
new Callback
    menu_item_getinfo
(Menu,item,Access,iData,5,iName,63,Callback)
    
    new 
Choosed str_to_num(iData)
    
    if(
Choosed)
    {
        
cs_set_user_team(Choosed,cs_get_user_team(Winner))
        
ChatColor(0,"!y[!gAMXX!y] %s eligio a %s como su teammate",name,iName)
    }
    
    if(
item == MENU_EXIT)
    {
        
RandomPlayer(Winner)
        
ChatColor(0,"!y[!gAMXX!y] %s hizo una eleccion random",name)
    }
        
    
Choosing[Winner] = false
    
    Choosing
[Looser] = true
    MenuLooser
(Looser)
    
    
menu_display(Winner,Menu)
    return 
PLUGIN_HANDLED

#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 07-11-2010 , 13:44   Re: Menu issue
Reply With Quote #4

Dunno about your error, I'm lazy to read, but in the first view I noticed this (see highlighted lines):
Code:
public MenuWinner(Winner) {         new Menu = menu_create("\r[AMXX]\y Elige un teammate :","MenuWinnerHandler")         new Players[32]     new Num     get_players(Players,Num)         for(new i = 0;i <= Num;i++)     {         if(is_user_connected(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR)         {             new name[32]             get_user_name(i,name,31)                         new temp[32]             num_to_str(i,temp,31)                         menu_additem(Menu,name,temp,_,menu_makecallback("WinnerCallback"))         }     }         menu_setprop(Menu,MPROP_BACKNAME,"Atras")     menu_setprop(Menu,MPROP_NEXTNAME,"Siguiente^n")     menu_setprop(Menu,MPROP_EXITNAME,"Random")         menu_display(Winner,Menu) }
It's a major error creating variables in loops.
__________________
"There is no knowledge, that is not power"
fezh is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 07-11-2010 , 14:01   Re: Menu issue
Reply With Quote #5

Quote:
Originally Posted by fezh View Post
Dunno about your error, I'm lazy to read, but in the first view I noticed this (see highlighted lines)
It's a major error creating variables in loops.
Okay Thanks!
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
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 14:30.


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