What's new

Unsolved Submenu in players menu

  • Thread starter Mr Knife God
  • Start date
  • Views 288
M

Mr Knife God

Enthusiast
Messages
282
Reaction score
11
Can someone show me how to create a sub menu in the players menu? It doesn't look like it's the same for all sub menus.
 
I

ImOx

(^._.^)ノ
Retired
Messages
9,968
Reaction score
2,962
I highly doubt there would be something off about it. Just use the function that your menu base uses.
Show me the submenu creation function(s) and the players menu and I can most likely tell you how to do it.
 
M

Mr Knife God

Enthusiast
Messages
282
Reaction score
11
I highly doubt there would be something off about it. Just use the function that your menu base uses.
Show me the submenu creation function(s) and the players menu and I can most likely tell you how to do it.
Code:
updatePlayersMenu()
{
    self.menu.menucount["PlayersMenu"] = 0;
    for (i = 0; i < 12; i++)
    {
        player = level.players[i];
        name = player.name;
     
        playersizefixed = level.players.size - 1;
        if(self.menu.curs["PlayersMenu"] > playersizefixed)
        {
            self.menu.scrollerpos["PlayersMenu"] = playersizefixed;
            self.menu.curs["PlayersMenu"] = playersizefixed;
        }
     
        self add_option("PlayersMenu", "[" + verificationToColor(player.status) + "^7] " + player.name, ::submenu, "pOpt " + i, "[" + verificationToColor(player.status) + "^7] " + player.name);
 
        self add_menu_alt("pOpt " + i, "PlayersMenu");
        self add_option("pOpt " + i, "Give CoHost", ::changeVerificationMenu, player, "CoHost");
        self add_option("pOpt " + i, "Give Admin", ::changeVerificationMenu, player, "Admin");
        self add_option("pOpt " + i, "Give VIP", ::changeVerificationMenu, player, "VIP");
        self add_option("pOpt " + i, "Verify", ::changeVerificationMenu, player, "Verified");
        self add_option("pOpt " + i, "Unverify", ::changeVerificationMenu, player, "Unverified");
        self add_option("pOpt " + i, "Teleport To Me", ::teletome, player);
        self add_option("pOpt " + i, "Teleport To Him", ::teletohim, player);
        self add_option("pOpt " + i, "Give Godmode", ::givegodmode, player);
        self add_option("pOpt " + i, "Give Infinite Ammo", ::giveammo, player);
        self add_option("pOpt " + i, "Give Invisibility", ::giveInvisibility, player);
        self add_option("pOpt " + i, "Kill", ::killplayer, player);
        self add_option("pOpt " + i, "Kick", ::kickplayer, player);
        self add_option("pOpt " + i, "Freeze/Unfreeze", ::freezeplayer, player);
        self add_option("pOpt " + i, "Blind", ::blindplayer, player);
        self add_option("pOpt " + i, "Spin", ::ToggleSpin, player);
        self add_option("pOpt " + i, "Send to Space", ::sendtospace, player);
        self add_option("pOpt " + i, "Take All Weapons", ::takewepsfromplayer, player);
        self add_option("pOpt " + i, "Give Adventure Time", ::giveadventuretime, player);
        self add_option("pOpt " + i, "Give Hunter Killer Ride", ::givehunterride, player);
    }
}

Code:
submenu(input, title)
{
    if (verificationToNum(self.status) >= verificationToNum(self.menu.status[input]))
    {
        self.menu.options destroy();

        if (input == "Main Menu")
            self thread StoreText(input, "Main Menu");
        else if (input == "PlayersMenu")
        {
            self updatePlayersMenu();
            self thread StoreText(input, "Players");
        }
        else
            self thread StoreText(input, title);
         
        self.CurMenu = input;
     
        self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu];
        self.menu.curs[input] = self.menu.scrollerpos[input];
     
        if (!self.menu.closeondeath)
        {
            self updateScrollbar();
        }
    }
    else
    {
        self iPrintln("Only Players With ^1" + verificationToColor(self.menu.status[input]) + " ^7Can Access This Menu!");
    }
}
The "pOpt" + i stuff confuses the hell out of me... That's why I said it doesn't feel like it's the same.
 
I

ImOx

(^._.^)ノ
Retired
Messages
9,968
Reaction score
2,962
Code:
updatePlayersMenu()
{
    self.menu.menucount["PlayersMenu"] = 0;
    for (i = 0; i < 12; i++)
    {
        player = level.players[i];
        name = player.name;
    
        playersizefixed = level.players.size - 1;
        if(self.menu.curs["PlayersMenu"] > playersizefixed)
        {
            self.menu.scrollerpos["PlayersMenu"] = playersizefixed;
            self.menu.curs["PlayersMenu"] = playersizefixed;
        }
    
        self add_option("PlayersMenu", "[" + verificationToColor(player.status) + "^7] " + player.name, ::submenu, "pOpt " + i, "[" + verificationToColor(player.status) + "^7] " + player.name);

        self add_menu_alt("pOpt " + i, "PlayersMenu");
        self add_option("pOpt " + i, "Give CoHost", ::changeVerificationMenu, player, "CoHost");
        self add_option("pOpt " + i, "Give Admin", ::changeVerificationMenu, player, "Admin");
        self add_option("pOpt " + i, "Give VIP", ::changeVerificationMenu, player, "VIP");
        self add_option("pOpt " + i, "Verify", ::changeVerificationMenu, player, "Verified");
        self add_option("pOpt " + i, "Unverify", ::changeVerificationMenu, player, "Unverified");
        self add_option("pOpt " + i, "Teleport To Me", ::teletome, player);
        self add_option("pOpt " + i, "Teleport To Him", ::teletohim, player);
        self add_option("pOpt " + i, "Give Godmode", ::givegodmode, player);
        self add_option("pOpt " + i, "Give Infinite Ammo", ::giveammo, player);
        self add_option("pOpt " + i, "Give Invisibility", ::giveInvisibility, player);
        self add_option("pOpt " + i, "Kill", ::killplayer, player);
        self add_option("pOpt " + i, "Kick", ::kickplayer, player);
        self add_option("pOpt " + i, "Freeze/Unfreeze", ::freezeplayer, player);
        self add_option("pOpt " + i, "Blind", ::blindplayer, player);
        self add_option("pOpt " + i, "Spin", ::ToggleSpin, player);
        self add_option("pOpt " + i, "Send to Space", ::sendtospace, player);
        self add_option("pOpt " + i, "Take All Weapons", ::takewepsfromplayer, player);
        self add_option("pOpt " + i, "Give Adventure Time", ::giveadventuretime, player);
        self add_option("pOpt " + i, "Give Hunter Killer Ride", ::givehunterride, player);
    }
}

Code:
submenu(input, title)
{
    if (verificationToNum(self.status) >= verificationToNum(self.menu.status[input]))
    {
        self.menu.options destroy();

        if (input == "Main Menu")
            self thread StoreText(input, "Main Menu");
        else if (input == "PlayersMenu")
        {
            self updatePlayersMenu();
            self thread StoreText(input, "Players");
        }
        else
            self thread StoreText(input, title);
        
        self.CurMenu = input;
    
        self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu];
        self.menu.curs[input] = self.menu.scrollerpos[input];
    
        if (!self.menu.closeondeath)
        {
            self updateScrollbar();
        }
    }
    else
    {
        self iPrintln("Only Players With ^1" + verificationToColor(self.menu.status[input]) + " ^7Can Access This Menu!");
    }
}
The "pOpt" + i stuff confuses the hell out of me... That's why I said it doesn't feel like it's the same.
Sorry took me ages to reply, I was away for two days so didn't really check Se7enSins at all.

In case you still need help with it:
Yeah, it was nothing too special, I Googled that base, it's ShArk's base, right?
So in his base I'm pretty sure you should do it just like this:

C:
self add_option("pOpt " + i, "Page 2", ::submenu, "PlayerPage2", "More Player Stuff");

self add_menu_alt("PlayerPage2", "pOpt " + i);
self add_option("PlayerPage2", "My Cool Function", ::SpawnCatsToPlayer, player);

That alternative function to add a menu should do well.
If that doesn't do it, let me know.
 
M

Mr Knife God

Enthusiast
Messages
282
Reaction score
11
Code:
 self add_option("pOpt " + i, "Page 2", ::submenu, "pOpt2 " + i, "[" + verificationToColor(player.status) + "^7] " + playerName);
       
        self add_menu("pOpt2 " + i, "pOpt " + i, "Co-Host");
        self add_option("pOpt2 " + i, "Revive Player", ::revivePlayer, player);
        self add_option("pOpt2 " + i, "Take All Weapons", ::takewepsfromplayer, player);
        self add_option("pOpt2 " + i, "Give Portal Gun", ::GivePortalGun, player);
       
    }
}
Didn't try that, but I used this from one of waterfall's bases before I seen you reply to this and it worked.
 
Top Bottom