Thread: [Solved] Sometimes i get an error
View Single Post
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-18-2020 , 08:41   Re: Sometimes i get an error
Reply With Quote #2

If you press Exit in the menu you are not resetting the bool.

I would change the code below just for preference.

PHP Code:
public Meniu(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback)

    switch(
item)
    {
        case 
0:
        {
            
client_cmd(id"deagle")
        }
        case 
1:
        {
            
client_cmd(id"Ak")
        }
    }

    
CanOpen[id] = false
    menu_destroy
(menu);
    return 
PLUGIN_HANDLED;



PHP Code:
public Meniu(idmenuitem)
{
        if(
item != MENU_EXIT)
        {
        new 
command[6], name[64], accesscallback;

            
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback)

            switch(
item)
            {
                case 
0:
                {
                        
client_cmd(id"deagle")
                }
                case 
1:
                {
                        
client_cmd(id"Ak")
                }
            }
    }

       
CanOpen[id] = false
        menu_destroy
(menu);
        return 
PLUGIN_HANDLED;

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr