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-26-2016, 12:16 AM #11
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
So how is it determining which team is which is what I am not really understanding.


    killTeams(mode)
{
//For every player in the game
foreach(player in level.players)
{
//if the mode at the top after killTeams is 1
if(mode==1)
{
//if the player's team is my team
if(player.pers["team"] == self.pers["team"])
player suicide();
}
else if(mode==2)//if mode is 2
{
//if the player's team is not my team
if(player.pers["team"] != self.pers["team"])
player suicide();
}
}
}
01-26-2016, 12:19 AM #12
Originally posted by TheHiddenHour View Post
    killTeams(mode)
{
//For every player in the game
foreach(player in level.players)
{
//if the mode at the top after killTeams is 1
if(mode==1)
{
//if the player's team is my team
if(player.pers["team"] == self.pers["team"])
player suicide();
}
else if(mode==2)//if mode is 2
{
//if the player's team is not my team
if(player.pers["team"] != self.pers["team"])
player suicide();
}
}
}


Yes but using the mode how would I add that into my menu itself, Like I do not get how to add it that way and how it is even telling which is which.
01-26-2016, 12:25 AM #13
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
Yes but using the mode how would I add that into my menu itself, Like I do not get how to add it that way and how it is even telling which is which.


Yes but using the mode how would I add that into my menu itself, Like I do not get how to add it that way
    addOption("teamMenu', "Kill my team", ::killTeams, 1);
addOption("teamMenu", "Kill enemy team", ::killTeams, 2);


how it is even telling which is which
See "mode" in the parentheses of the killTeams(mode) function? In the function I have it so that if the "mode" is 1 then it does something. If it is 2 then it does something else.
01-26-2016, 12:27 AM #14
jwm614
NextGenUpdate Elite
Originally posted by TheNiceUb3r View Post
Yes but using the mode how would I add that into my menu itself, Like I do not get how to add it that way and how it is even telling which is which.


    
teamfinder()
{
host = gethostplayer();//you
if(self.pers["team"] == host.pers["team"])//checking if player is on your team
self thread myteam();
else if(player.pers["team"] != host.pers["team"])//checking if player is not on your team
self thread enemyteam();
}

myteam()
{


}

enemyteam()
{


}
01-26-2016, 12:27 AM #15
Okay I got that, What would I put in that so it does not kill verified and host etc?
01-26-2016, 12:30 AM #16
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
Okay I got that, What would I put in that so it does not kill verified and host etc?


What are your verification variables?
01-26-2016, 12:33 AM #17
Originally posted by TheHiddenHour View Post
What are your verification variables?


I am using Source Engine as a base.
01-26-2016, 12:35 AM #18
HiddenHour
I defeated!
Originally posted by TheNiceUb3r View Post
I am using Source Engine as a base.


I haven't used it, so I don't know what the variables are. They're usually something like self.verificationLevel = "host";
01-26-2016, 12:36 AM #19
jwm614
NextGenUpdate Elite
Originally posted by TheNiceUb3r View Post
Okay I got that, What would I put in that so it does not kill verified and host etc?




    
self thread killteam(allies);//kills your team

killteam(team)
{
host = gethostplayer();
(player in level.players)
{
if(player.pers["team"] == host.pers["team"] && !player isHost() && team == "allies" && !player.verified)//myteam
player suicide();
else if(player.pers["team"] != host.pers["team"] && team == "axis" && !player.verified)//enemyteam
player suicide();
}
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo