Raised This Month: $ Target: $400
 0% 

Can someone help me with this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
091231238123
BANNED
Join Date: Aug 2011
Old 10-18-2011 , 20:54   Can someone help me with this?
Reply With Quote #1

Can someone tell me what is wrong with this code, because when I want to enter the menu nothing happen
PHP Code:
 public nvg_color(id)
{
    new 
menu6 menu_create("NVG Color""menu_nvg")
    
    static 
inum_color[4]
    for (
08i++)
    {    
        
num_to_str(inum_colorcharsmax(num_color))
        
menu_additem(menu6NVG_NAMES[i], num_color)
    }
    
    
menu_setprop(menu6,MPROP_EXITNAME,"\y Salir")
    
menu_setprop(menu6MPROP_EXITMEXIT_ALL)
    
menu_display(idmenu60)
    return 
PLUGIN_HANDLED
}
public 
menu_nvg(iditemmenu6)
{
    
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu6)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback
    menu_item_getinfo
(menu6itemAccessDatasizeof(Data)-1Namesizeof(Name)-1Callback)
    switch (
str_to_num(Data))
    {
        case 
1
        {
            
g_nvg[id] = { 25511240 }
            
nvg_color(id)
        }
        case 
2
        {
            
g_nvg[id] = { 0255}
            
nvg_color(id)
        }
        case 
3
        {
            
g_nvg[id] = { 255255}
            
nvg_color(id)
        }
        case 
4
        {
            
g_nvg[id] = { 135206255 }
            
nvg_color(id)
        }
        case 
5
        {
            
g_nvg[id] = { 255192103 }
            
nvg_color(id)
        }
        case 
6:
        {
            
g_nvg[id] = { 2550}
            
nvg_color(id)
        }
    }
    
    
menu_destroy(menu6)    
    
nvg_color(id)    
    return 
PLUGIN_HANDLED;

and the const
PHP Code:
 new const NVG_NAMES[][] =
{
    
"Naranja",
    
"Verde",
    
"Azul",
    
"Amarillo",
    
"Celeste",
    
"Blanco",
    
"Rosado",
    
"Rojo"

091231238123 is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-18-2011 , 21:18   Re: Can someone help me with this?
Reply With Quote #2

hmhmhmhm we
__________________
alan_el_more is offline
FoxueR
Senior Member
Join Date: Jun 2011
Old 10-18-2011 , 21:30   Re: Can someone help me with this?
Reply With Quote #3

Your problem is unclear. Is the menu not showing at all, or is it just doing nothing when you press a button?

The first thing I see is that the order of parameters for the callback should be:

PHP Code:
public menu_nvgidmenu6item 
__________________
¯\_(ツ)_/¯
FoxueR is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 10-18-2011 , 21:57   Re: Can someone help me with this?
Reply With Quote #4

for (i = 0; i > 8; i++)


for ( start ; condition ; up/down )
if these loop , the variable i always will be minor than 8 , that's the reason that the menu doesnt work.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 10-19-2011 at 21:33. Reason: sorry , my bad understand.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
FoxueR
Senior Member
Join Date: Jun 2011
Old 10-18-2011 , 22:10   Re: Can someone help me with this?
Reply With Quote #5

Whoa, don't know how I missed that.
__________________
¯\_(ツ)_/¯
FoxueR is offline
091231238123
BANNED
Join Date: Aug 2011
Old 10-19-2011 , 16:04   Re: Can someone help me with this?
Reply With Quote #6

Quote:
Originally Posted by lucas_7_94 View Post
for (i = 0; i > 8; i++)


for ( start ; condition ; up/down )

if these loop , the variable i always will be minor than 8 , that's the reason that the menu doesnt work.

You're good changing autor's , but why you cant make a simple loop ?
Thank you lucas, but why are you saying that i change authors?
I have never put my name in nothing what was not mine
091231238123 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 10-19-2011 , 21:34   Re: Can someone help me with this?
Reply With Quote #7

Quote:
Originally Posted by 091231238123 View Post
Thank you lucas, but why are you saying that i change authors?
I have never put my name in nothing what was not mine
i'm wrong, sorry.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
091231238123
BANNED
Join Date: Aug 2011
Old 10-20-2011 , 18:19   Re: Can someone help me with this?
Reply With Quote #8

Quote:
Originally Posted by lucas_7_94 View Post
i'm wrong, sorry.
ok, you think that i was destroyer, right?
091231238123 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 10-20-2011 , 22:02   Re: Can someone help me with this?
Reply With Quote #9

yes, sorry.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
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 06:02.


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