AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Infinity menu cases? (https://forums.alliedmods.net/showthread.php?t=277270)

Baws 01-05-2016 20:06

Infinity menu cases?
 
What's the infinity menu case? Like we have case 0, case 1..etv what's the infinity one?

And for a little bit of garniture, make a menu with 2 cases, 1 name is banana and the other are all the players names.

Love Baws.

Syturi0 01-05-2016 23:38

Re: Infinity menu cases?
 
What you mean with "infinity one"

Baws 01-06-2016 00:22

Re: Infinity menu cases?
 
Like: case ..: ?
case infinitty?:

I don't know?

Syturi0 01-06-2016 00:25

Re: Infinity menu cases?
 
If you want a menu with 2 cases, why you need "infinity case"?

Baws 01-06-2016 00:27

Re: Infinity menu cases?
 
Just for testing basically and see what can be done, but I need a menu with 2 cases. 1 is the banana and the other is a list of all players.

1. banana
menu_addblank2( bananamenu );
2. Baws
3.Syturi0
4. Bailopan
5. Babe
6. player 6...etc

Depends on how many players in are in the server. There will be other pages obviously if there's more than 7 players.

Syturi0 01-06-2016 00:31

Re: Infinity menu cases?
 
PHP Code:

public Yo(id)
{
    new 
players[32], szTempid[7], num
    get_players
(playersnum"chi")

    new 
szMenu[200]
    
formatex(szMenucharsmax(szMenu), "Title Menu")
    new 
Menu menu_create(szMenu"Yo_Handler")
    
menu_additem(Menu"Banana 1"""0)
menu_additem(Menu"Banana 2"""0)
menu_additem(Menu"Banana 3"""0)
menu_additem(Menu"Banana 4"""0)

    for(new 
0numi++)
    {
        new 
tempid players[i]

        if(
tempid != id)
        {
            new 
szName[32]
            
get_user_name(tempidszNamecharsmax(szName))
    
            
num_to_str(tempidszTempid6)
            
            
formatex(szMenucharsmax(szMenu), "%s"szName)
            
menu_additem(MenuszMenuszTempid0)
        }
    }
        
    
menu_setprop(MenuMPROP_BACKNAME"\yAnterior")
    
menu_setprop(MenuMPROP_NEXTNAME"\yProximo")
    
menu_setprop(MenuMPROP_EXITNAME"\yRetroceder")
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL)
    
menu_setprop(MenuMPROP_PERPAGE6)

    
menu_display(idMenu0)
    return 
PLUGIN_HANDLED


Something like that.

Baws 01-06-2016 00:54

Re: Infinity menu cases?
 
Yes, but where's the handler for it?

Syturi0 01-06-2016 02:17

Re: Infinity menu cases?
 
PHP Code:

new Data[6], Name[64]
    new 
AccessCallback
    menu_item_getinfo
(MenuitemAccessData5Name63Callback)

    new 
tempid str_to_num(Data)
    
gidPlayer[id] = tempid

    get_user_name
(gidPlayer[id], g_NickReceptorcharsmax(g_NickReceptor))
    
g_Escolhido[id] = true

    menu_destroy
(Menu)
    return 
PLUGIN_HANDLED 

something like that

Jhob94 01-06-2016 09:48

Re: Infinity menu cases?
 
Just add banana as case 0, then with a loop for players just set their index.
In the handler check if item is higher than 0 for player.
Anyway, you should also pass their userid just to make sure it's the same player. (For the case the player choosen disconnects and a new player that connects gets his index)

Baws 01-06-2016 17:08

Re: Infinity menu cases?
 
Quote:

Originally Posted by Jhob94 (Post 2380575)
Just add banana as case 0, then with a loop for players just set their index.
In the handler check if item is higher than 0 for player.
Anyway, you should also pass their userid just to make sure it's the same player. (For the case the player choosen disconnects and a new player that connects gets his index)

I want it like banana1 or banana2 is chosen for x player. You get what I mean? But I want that to be in the same menu and not doing multiple menus. Like I chose banana in the same menu I will chose the player.


All times are GMT -4. The time now is 09:26.

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