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

menu bug (?)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 05-13-2021 , 12:43   menu bug (?)
Reply With Quote #1

Hi! I have some code for menu, and it is working but only for 1 player at the same time.
I mean when menu opened by 2 or more people and someone exiting it, menu stops working for all players. It stops reacting to any keys pressed but keeps showing up. Thereafter when someone opens menu again it starts to work for everyone again until someone else tries to exit. How to fix it? (I hope you understand what I mean)

code

Last edited by kww; 05-13-2021 at 13:31.
kww is offline
OrangePeel
Junior Member
Join Date: Aug 2019
Old 05-13-2021 , 21:56   Re: menu bug (?)
Reply With Quote #2

Code:
public m(id)
{
    static szTitle[63]
    formatex(szTitle, charsmax(szTitle), "\rTitle")
    new menu = menu_create(szTitle, "mh")

    formatex(szTitle, charsmax(szTitle), "\yBhop \d[%s]", gBhop[id] ? "Enabled" : "Disabled")
    menu_additem(menu,  szTitle)
    menu_setprop(menu, MPROP_EXITNAME, "ExIt")
    menu_display(id, menu)
    return PLUGIN_HANDLED
}

public mh(id, menu, item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }

    menu_destroy(menu)

    static szMsg[255]
    switch(item)
    {
        case 0:
        {
            gBhop[id] = !gBhop[id]
            formatex(szMsg, charsmax(szMsg), "Bhop %s!", gBhop[id] ? "enabled" : "disabled")
        }
    }
    
    set_dhudmessage(243, 180, 48, 0.06, 0.74, 0, 1.0, 1.0, 0.1, 2.0)
    show_dhudmessage(id, szMsg)
    
    m(id)
    return PLUGIN_HANDLED
}
OrangePeel is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-14-2021 , 05:17   Re: menu bug (?)
Reply With Quote #3

szMsg[255] the array size is too big max limit is like 192 for chat message.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 05-14-2021 , 07:37   Re: menu bug (?)
Reply With Quote #4

Quote:
Originally Posted by Natsheh View Post
szMsg[255] the array size is too big max limit is like 192 for chat message.
Oh, thanks for info. But here used director hud, not the chat

But what's causing this happen? I don't think this array is the problem (i just copied someone's code...)

Last edited by kww; 05-14-2021 at 07:38.
kww 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 03:33.


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