Post: How to give something to just team in BO2 GSC CODE???
11-19-2016, 04:32 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); hey guys i want to give EB to just my team, what is the code for that or how to i make something only go to my team?
11-19-2016, 04:45 PM #2
anthonything
Space Ninja
Originally posted by joebrochu View Post
hey guys i want to give EB to just my team, what is the code for that or how to i make something only go to my team?


Something like this: You must login or register to view this content.
11-20-2016, 08:12 PM #3
@anthonything You can do getPlayers(<team>Winky Winky too.
    
//just make sure that val isn't an array
callOnArray(array, func, exclude_val)
{
if(isArray(array) && isDefined(func))
{
foreach(val in array)
{
if(isDefined(exclude_val) && val != exclude_val)
val thread [[ func ]]();

else if(!isDefined(exclude_val))
val thread [[ func ]]();
}
}
}
//example
self callOnArray(getPlayers(self.team), "EB function"); //calling eb func on yourself too
self callOnArray(getPlayers(self.team), "EB function", self); //excluding yourself
Last edited by CxwhMods ; 11-21-2016 at 05:30 PM.
03-07-2017, 03:49 PM #4
MrXcell1
Pokemon Trainer
Its pretty simple Smile

doMyTeamFunction()
{

foreach(player in level.players)
if(player.pers["team"] == self.pers["team"])
player thread ToggleUAV();
wait 0.03;
self iPrintln("^2My Team: ^7UAV ^2SET");

}

The following user groaned MrXcell1 for this awful post:

anthonything
03-07-2017, 10:04 PM #5
Patrick
League Champion
Originally posted by MrXcell1 View Post
Its pretty simple Smile

doMyTeamFunction()
{

foreach(player in level.players)
if(player.pers["team"] == self.pers["team"])
player thread ToggleUAV();
wait 0.03;
self iPrintln("^2My Team: ^7UAV ^2SET");

}


why would you post this when you can see the thread has been answered?
03-08-2017, 01:42 AM #6
MrXcell1
Pokemon Trainer
It was just another example, nothing more. Sure it may have been answered, but there is always more than one way to do that
03-08-2017, 01:48 AM #7
anthonything
Space Ninja
Originally posted by MrXcell1 View Post
It was just another example, nothing more. Sure it may have been answered, but there is always more than one way to do that


And you evidently didnt read the previous responses where 'your' way was explicitly stated in a much more explanatory way. You just copied the first thing you could find on the managed code list with team in it, which doesnt help someone trying to learn GSC.
03-08-2017, 02:17 AM #8
Kronos
Former Staff
Answered, Closed.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo