Raised This Month: $32 Target: $400
 8% 

Solved Menu malfunction


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-21-2019 , 07:54   Menu malfunction
Reply With Quote #1

Talking about the row below 1.
There is a t4shot

Code:
new g_rgLR[eLastRequest] = { GAME_NONE, 0, 0 };
I have a kind of BUG, I do not find the problem here in the code:
PHP Code:
ShowMenuS4S(this)
{
    new 
iMenuszBuffer[64], iLen;

    
formatex(szBuffercharsmax(szBuffer), "\r[4Honor`] \d- \wLR \yShot4Shot \wMenu");
    
iMenu menu_create(szBuffer"MenuS4S");

    
iLen copy(szBuffercharsmax(szBuffer), "Guard: \y");

    if (!
g_rgLR[LR_GUARD])
        
iLen += copy(szBuffer[iLen], charsmax(szBuffer) - iLen"Not yet selected");
    else
        
iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen"%n"g_rgLR[LR_GUARD]);

    
szBuffer[iLen] = '^n';

    
menu_additem(iMenuszBuffer);

    
formatex(szBuffercharsmax(szBuffer), "Health: \d%d"g_iHealthMAX_HEALTH);
    
menu_additem(iMenuszBuffer);

    
formatex(szBuffercharsmax(szBuffer), "Weapon: \y%s"g_szCSWeaponNames[g_iWeaponId]);
    
menu_additem(iMenuszBuffer);

    
AddMenuSettings(iMenu);

    if (!
g_rgLR[LR_GUARD])
        
copy(szBuffercharsmax(szBuffer), "\dStart");
    else
        
copy(szBuffercharsmax(szBuffer), "Start");

    
menu_additem(iMenuszBuffer);

    
menu_display(thisiMenu);


Last edited by Fuck For Fun; 07-22-2019 at 20:05.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
E1_531G
Senior Member
Join Date: Dec 2017
Old 07-21-2019 , 10:42   Re: Menu malfunction
Reply With Quote #2

Those text is a part of a menu title.
Reset the buffer after formating the title. (menu_create())
__________________
My English is A0
E1_531G is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-21-2019 , 12:09   Re: Menu malfunction
Reply With Quote #3

Quote:
Originally Posted by E1_531G View Post
Those text is a part of a menu title.
Reset the buffer after formating the title. (menu_create())
Fixed, thanks

Last edited by Fuck For Fun; 07-22-2019 at 20:05.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2019 , 12:50   Re: Menu malfunction
Reply With Quote #4

One simple way is to set the first character as the "end of string" (EOS).

Code:
szBuffer[0] = EOS
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 16:42.


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