AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Problem With menu (https://forums.alliedmods.net/showthread.php?t=243363)

Snitch 07-03-2014 11:41

[HELP] Problem With menu
 
solved

Flick3rR 07-03-2014 11:57

Re: [HELP] Problem With menu
 
Why you don't simply display a HUD message? I don't find sense in creating a menu.

Snitch 07-03-2014 12:03

Re: [HELP] Problem With menu
 
Picture related to my code. I show my problem
What appears to me 13 to exit

I just want to show Texts without
1: prices

Can you fix my code?

mottzi 07-03-2014 12:33

Re: [HELP] Problem With menu
 
Set the third parameter of menu_addtext() to 0:

Eg: menu_additem( iMenu, "Prices:^n", 0 );

Snitch 07-03-2014 12:55

Re: [HELP] Problem With menu
 
Seems to me you did not understand me.

I want no Handler >
Quote:

"CmdPricesHandler" );
Text appears just as it shows the
SuperAdmin
Without Number 1: or 2:

Flick3rR 07-03-2014 13:10

Re: [HELP] Problem With menu
 
Just use a HUD Message? What's the purpose of creating a menu only for this. Or better - use a MOTD window. There are better ways to achieve what you want in this case. Is there any reason you want a menu?

Eagle07 07-03-2014 18:38

Re: [HELP] Problem With menu
 
Quote:

format(iMenu,.............

Eagle07 07-03-2014 18:55

Re: [HELP] Problem With menu
 
Hey, Try :)
PHP Code:

#include < amxmodx >
 
new Info][ ] =
{
        
"Test Menu",
        
"1.0",
        
"Snitch"
};
 
public 
plugin_init()
{
    
register_pluginInfo], Info], Info] );
    
    
register_clcmd"say prices","PricesMenu" );
    
register_clcmd"say /prices","PricesMenu" );
    
register_clcmd"say_team /prices","PricesMenu" );
    
    
set_task(160.0,"Prices",.flags="b");
}

public 
Pricesclient )
{
        
ColorChat(client"Wanna buy cash or admin? type: /prices.")
}

public 
PricesMenuclient )
{  
    if ( !
is_user_connectedclient ) )
        return 
1;
        
    new 
iMenu[295]
    new 
keys MENU_KEY_0
    format
(iMenu295"Prices:^n\wManager: \y99 \rILS \d(per Month)^n\wSuperAdmin: \y75 \rILS \d(per Month)^n\wAdmin: \y50 \rILS \d(per Month)^n\wVIP: \y25 \rILS \d(per Month)^n----------------------------^n\w1,000,000 Cash: \y99 \rILS^n\w500,000 Cash: \y50 \rILS^n\w150,000 Cash: \y25 \rILS^n\rName Owner: \rSnitch^n^n0. \wExit"
    
show_menu(clientkeysiMenu
    
    return 
0;
}

public 
CmdPricesHandler(idkeymenu)
{
    if(
key == 0) {
         return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}    
 
stock ColorChat(const id, const input[], any:...)
{
        new 
count 1players[32]
        static 
msg[191]
        
vformat(msg190input3)
   
        
replace_all(msg190"!g""^4"// Green Color
        
replace_all(msg190"!y""^1"// Default Color
        
replace_all(msg190"!team""^3"// Team Color
   
        
if (idplayers[0] = id
        
else get_players(playerscount"ch")
        for (new 
0counti++)
        {
                if (
is_user_connected(players[i]))
        {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i])
                
write_string(msg)
                
message_end()
                }
        }



Flick3rR 07-03-2014 19:38

Re: [HELP] Problem With menu
 
PHP Code:

new iMenu[295
    
format(iMenu295//...... 

And this will resolve as one big "index out of bounds".... Use charsmax() instead of manually typing the size, because of errors like this.

Snitch 07-05-2014 20:03

Re: [HELP] Problem With menu
 
Thanks Tested.
PHP Code:

formatexiMenucharsmaxiMenu ), 



All times are GMT -4. The time now is 21:08.

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