Post: Team menu?
01-25-2016, 10:54 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I am trying to get Team Menu in my menu and its something I have put off cuz I don't fully understand it, I was wondering if someone could help me.
(adsbygoogle = window.adsbygoogle || []).push({});
01-25-2016, 11:12 PM #2
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
I am trying to get Team Menu in my menu and its something I have put off cuz I don't fully understand it, I was wondering if someone could help me.


Mess with .pers.

    foreach(player in level.players)
{
if(player.pers["team"] == self.pers["team"])
{
//do function
}
}
01-25-2016, 11:14 PM #3
Originally posted by TheHiddenHour View Post
Mess with .pers.

    foreach(player in level.players)
{
if(player.pers["team"] == self.pers["team"])
{
//do function
}
}


So would it be something like this?

KillMyteam()
{
foreach(player in level.players)
{
if(self.pers["team_ally"] != player.pers["team_enemy"])
{
player thread commitSuicide();
}
}
}

KillAllForEnemy()
{
foreach(player in level.players)
{
if(self.pers["team_enemy"] != player.pers["team_ally"])
{
player thread commitSuicide();
}
}
}
01-25-2016, 11:48 PM #4
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
So would it be something like this?

KillMyteam()
{
foreach(player in level.players)
{
if(self.pers["team_ally"] != player.pers["team_enemy"])
{
player thread commitSuicide();
}
}
}

KillAllForEnemy()
{
foreach(player in level.players)
{
if(self.pers["team_enemy"] != player.pers["team_ally"])
{
player thread commitSuicide();
}
}
}


Use CODE tags to make it easier to read
    killMyTeam()
{
foreach(player in level.players)
{
if(player.pers["team"] == self.pers["team"])
{
if(!player isHost())
player suicide();
}
}
}

I'm not sure what you're trying to do in the second function.
01-25-2016, 11:49 PM #5
Originally posted by TheHiddenHour View Post
Use CODE tags to make it easier to read
    killMyTeam()
{
foreach(player in level.players)
{
if(player.pers["team"] == self.pers["team"])
{
if(!player isHost())
player suicide();
}
}
}

I'm not sure what you're trying to do in the second function.


I am not sure here is what I got is what someone else told me to do when I asked them for help

self add_option("AllPlayers", "Teams Menu", ::submenu, "TeamsMenu", "Teams Menu");
self add_menu("TeamsMenu", "AllPlayers", "Teams Menu", "Co-Host");


self add_option("TeamsMenu", "Ally Menu", ::submenu, "AllyMenu", "Ally Menu");
self add_menu("AllyMenu", "TeamsMenu", "Ally Menu", "Co-Host");
self add_option("AllyMenu", "Kill Team", ::KillMyteam);


self add_option("TeamsMenu", "Enemy Menu", ::submenu, "EnemyMenu", "Enemy Menu");
self add_menu("EnemyMenu", "TeamsMenu", "Enemy Menu", "Co-Host");
self add_option("EnemyMenu", "Kill Team", ::KillAllForEnemy);


// Team menu shit

KillMyteam()
{
foreach(player in level.players)
{
if(self.pers["team"] != player.pers["team"])
{
player thread commitSuicide();
}
}
}

KillAllForEnemy()
{
foreach(player in level.players)
{
if(self.pers["team"] != player.pers["team"])
{
player thread commitSuicide();
}
}
}
01-25-2016, 11:50 PM #6
I am trying to make it so I can have a team and enemy menu in my menu.
01-26-2016, 12:06 AM #7
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
I am trying to make it so I can have a team and enemy menu in my menu.


    killTeams(mode)
{
foreach(player in level.players)
{
if(mode==1)
{
if(player.pers["team"] == self.pers["team"])
player suicide();
}
else if(mode==2)
{
if(player.pers["team"] != self.pers["team"])
player suicide();
}
}
}


Set "mode" to 1 to kill your team. Set it to 2 to kill the other team.
01-26-2016, 12:08 AM #8
Originally posted by TheHiddenHour View Post
    killTeams(mode)
{
foreach(player in level.players)
{
if(mode==1)
{
if(player.pers["team"] == self.pers["team"])
player suicide();
}
else if(mode==2)
{
if(player.pers["team"] != self.pers["team"])
player suicide();
}
}
}


Set "mode" to 1 to kill your team. Set it to 2 to kill the other team.


is there a way to do the function in two like I have it above since my menu is going to have a Team Menu and a Enemy Menu
01-26-2016, 12:10 AM #9
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
is there a way to do the function in two like I have it above since my menu is going to have a Team Menu and a Enemy Menu


Just take the parts in if(mode==number) and add them to a function. Dont forget the foreach(player in level.players) as well.

You could also call it in a menu like ::killTeams, 1 or 2);
01-26-2016, 12:12 AM #10
So how is it determining which team is which is what I am not really understanding.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo