Post: Need Help Adding A Client Functions Option To A Menu!
06-19-2015, 07:59 PM #1
Miricle
I am error
(adsbygoogle = window.adsbygoogle || []).push({}); Hey there, I have been working on a project the last couple of days and I decided to try and add a Clients Menu to this project but I have tried and failed on so many different occasions. I would appreciate anyone that can lend a helping hand to me.

So, I am using Sharks Zombieland Menu and I plan on adding a Host Option to kick/kill the annoying brats that you always end up playing with.

I am trying to add a Clients Menu to the bottom of this:
    		if(self isHost())
{
self add_menu("Host", "Main Menu Human", "Host" , "human");
self add_option("Host", "^7Host Mods", ::submenu, "HostModifications");
self add_option("Host", "^7Lobby", ::submenu, "Lobby");
self add_option("Host", "^7Standard Maps", ::submenu, "Maps");
self add_option("Host", "^7DLC Maps", ::submenu, "Maps2");


I hope you guys can help me on this, I have been banging my head on my desk the past few days trying to get it to work xD

Also, if it counts for anything, I did originally try this way but I get connection interrupted when I have 6 Seconds left on the timer. Maybe I have done something wrong with this or it doesn't work for the source, idk lol.
    		if(self isHost())
{
self add_menu("Host", "Main Menu Human", "Host" , "human");
self add_option("Host", "^7Host Mods", ::submenu, "HostModifications");
self add_option("Host", "^7Lobby", ::submenu, "Lobby");
self add_option("Host", "^7All Players", ::submenu, "APMenu");
self add_option("Host", "^7Standard Maps", ::submenu, "Maps");
self add_option("Host", "^7DLC Maps", ::submenu, "Maps2");
self add_option("Host", "^7Forge Mode", ::submenu, "ForgeMenu");
self add_option("Host", "^7Players Menu", ::submenu, "PlayrsMenu");

self add_menu("PlayrsMenu", "Host", self.menu.menuopt["Host"], "human" );
for(i=0; i < playerName.size; i++)
{
player = level.players[i];
name = player getName();
self add_option("Clients Menu", i," ^7" + name, ::SubMenu, "ClieMenu");
}
self thread MonitorPlayers();

self add_menu("ClieMenu", "Main Menu Human", "Clients Menu" , "human");
self add_option("ClieMenu", "^7Kill Player", ::Suicide);


    MonitorPlayers()
{
self endon("disconnect");
for(;Winky Winky
{
for(i=0; i < playerName.size; i++)
{
player = level.players[i];
name = player getName();
self.menu.getmenu["Clients Menu"][i] = " ^7" + name;
self.menu.menucount["Clients Menu"][i] = ::SubMenu;
self.menu.previousmenu["Clients Menu"][i] = "ClieMenu";
wait 0.05;
}
wait 0.05;
}
}


    getName(player)
{
playername = getSubStr(player.name, 0, player.name.size);
for(i = 0; i < playername.size; i++)
{
if(playername[i]=="]")
break;
}
if(playername.size != i)
playname = getSubStr(playername, i + 1, playername.size);

return playername;
}
(adsbygoogle = window.adsbygoogle || []).push({});
06-19-2015, 11:52 PM #2
HiddenHour
I defeated!
Add this to your menu
    self add_option("Main Menu", "Players", ::submenu, "PlayersMenu", "Players");

This as well
    self add_menu("PlayersMenu", "Main Menu", "CoHost");
for (i = 0; i < 12; i++)
{ self add_menu("pOpt " + i, "PlayersMenu", "CoHost"); }

Add this to your project
    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");
}
}

Add this to submenu(input, title)
    else if (input == "PlayersMenu")
{
self updatePlayersMenu();
self thread StoreText(input, "Players");
}

It's going to take some re-working. I'm sure you can figure out what needs to be changed.

The following user thanked HiddenHour for this useful post:

Miricle
06-20-2015, 12:38 AM #3
Originally posted by TheHiddenHour View Post
Add this to your menu
    self add_option("Main Menu", "Players", ::submenu, "PlayersMenu", "Players");

This as well
    self add_menu("PlayersMenu", "Main Menu", "CoHost");
for (i = 0; i < 12; i++)
{ self add_menu("pOpt " + i, "PlayersMenu", "CoHost"); }

Add this to your project
    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");
}
}

Add this to submenu(input, title)
    else if (input == "PlayersMenu")
{
self updatePlayersMenu();
self thread StoreText(input, "Players");
}

It's going to take some re-working. I'm sure you can figure out what needs to be changed.

Message me
06-20-2015, 01:37 AM #4
Miricle
I am error
Originally posted by TheHiddenHour View Post
Add this to your menu
    self add_option("Main Menu", "Players", ::submenu, "PlayersMenu", "Players");

This as well
    self add_menu("PlayersMenu", "Main Menu", "CoHost");
for (i = 0; i < 12; i++)
{ self add_menu("pOpt " + i, "PlayersMenu", "CoHost"); }

Add this to your project
    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");
}
}

Add this to submenu(input, title)
    else if (input == "PlayersMenu")
{
self updatePlayersMenu();
self thread StoreText(input, "Players");
}

It's going to take some re-working. I'm sure you can figure out what needs to be changed.


I added the following, changed the functions to work with the menu. I was able to spawn into the game but when I went down to the host menu, clicked on the Players Menu, it gives me connection interrupted and freezes me :/
06-20-2015, 01:55 AM #5
HiddenHour
I defeated!
Could you PM me how you edited it?
06-20-2015, 02:14 AM #6
Miricle
I am error
Originally posted by TheHiddenHour View Post
Could you PM me how you edited it?

Sure, I'll inject it again because I have changed up a few things about it. But if the same thing happens again, I'll message you how I added it. Thanks for helping btw Smile
06-20-2015, 02:16 AM #7
HiddenHour
I defeated!
Originally posted by MCmiricle View Post
Sure, I'll inject it again because I have changed up a few things about it. But if the same thing happens again, I'll message you how I added it. Thanks for helping btw Smile


No problem. I had the same problem when I did it as well.

The following user thanked HiddenHour for this useful post:

Miricle

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo