Results 1 to 13 of 13
  1. #1
    chrisdavis97's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    2

    Counting Players on Team

    How can I count players on each team, so that I can use that variable for ending the game? I'm counting events that happen when players are alive, and need to compare that to total players on each team.

    By the way, this is 'Freeze Tag'. I'm trying to end the game after all the players on one team are frozen, making the other team the winners.

  2. #2
    Lemon30's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    66
    Reputation
    10
    Thanks
    10
    My Mood
    Devilish
    players = maps\mp\gametypes\_teams::CountPlayers();
    Join to play in modded servers(MW2 and BO):[/COLOR]
    http://steamcommunity.com/groups/mw2zombiemod

    Selling Lvl 64 Guardian Account - Adventure Quest - Battleon
    Pm me if you are interested.


    Buy Black Ops []
    Prestige []
    Make my first mod for BO []
    Host a server []

  3. The Following User Says Thank You to Lemon30 For This Useful Post:

    chrisdavis97 (10-27-2010)

  4. #3
    chrisdavis97's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    2
    Okay, I'm almost there, but I have to finish that script.

    something like:

    if(level.Frozen[self.team] == players) //help here... tried players, "players", +players+, "+players+"
    { etc... }

    How do I apply it?

  5. #4
    bomb21's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Unknown
    Posts
    57
    Reputation
    10
    Thanks
    22
    just a heads up, level.Frozen at times can be glitchy (ex. counts too many players)


    try this:
    Code:
    if(level.Frozen[self.team] == players[self.team]){ ... }

  6. The Following User Says Thank You to bomb21 For This Useful Post:

    chrisdavis97 (10-30-2010)

  7. #5
    chrisdavis97's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    2
    Code:
    for(;;)
    {
    	self waittill("spawned_player");
    
    	if(self.team == "allies")
    	OppsTeam = "axis";
    		
    	if(self.team == "axis")
    	OppsTeam = "allies";
    
    	players = maps\mp\gametypes\_teams::CountPlayers();
    
    	if(level.Frozen[self.team] == players[self.team])
    	{
    		level thread maps\mp\gametypes\_gamelogic::forceEnd();
    	}
    	else if(level.Frozen[OppsTeam] == players[OppsTeam])
    	{
    		level thread maps\mp\gametypes\_gamelogic::forceEnd();
    	}
    }
    Syntax Error.
    But, if I change players[self.team] (and same for OppsTeam) to 6, or any other number, it loads fine.

    EDIT: My bad. Sleep Deprived, I forgot I changed another part of the script. So... it loads fine now, but instantly ends the game with a DRAW.
    Last edited by chrisdavis97; 10-28-2010 at 12:12 AM.

  8. #6
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    [php]maps\mp\gametypes\_gamescore::_setTeamScore("allie s", 2000);

    maps\mp\gametypes\_gamescore::_setTeamScore("axis" , 2000);

    [/php]

  9. #7
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,331
    My Mood
    Breezy
    Quote Originally Posted by mathieutje12 View Post
    [php]maps\mp\gametypes\_gamescore::_setTeamScore("allie s", 2000);

    maps\mp\gametypes\_gamescore::_setTeamScore("axis" , 2000);

    [/php]
    What's that got to do with counting players?
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  10. #8
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    he said the game ends in a draw:
    EDIT: My bad. Sleep Deprived, I forgot I changed another part of the script. So... it loads fine now, but instantly ends the game with a DRAW.

    this is the code for set points at the end of the game...

  11. #9
    chrisdavis97's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    2
    Sorry, clarification, the moment the game loads, before the timer is finished counting down to run off and kill... it ends, and since no one has any kills, it results in a DRAW...

    The Draw wasn't the concern, the concern is getting the script to count team players, and compare to frozen players, resulting in Ending the Game if Total Frozen equals Total Team Players.

  12. #10
    bomb21's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Unknown
    Posts
    57
    Reputation
    10
    Thanks
    22
    Quote Originally Posted by chrisdavis97 View Post
    Sorry, clarification, the moment the game loads, before the timer is finished counting down to run off and kill... it ends, and since no one has any kills, it results in a DRAW...

    The Draw wasn't the concern, the concern is getting the script to count team players, and compare to frozen players, resulting in Ending the Game if Total Frozen equals Total Team Players.
    Seems you are not calling this as a level thread but on my site it is onPlayerSpawned()

    so...
    as soon as anyone spawns and the is no one on the other team it ends early

  13. The Following User Says Thank You to bomb21 For This Useful Post:

    chrisdavis97 (10-30-2010)

  14. #11
    chrisdavis97's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    2
    Yeah, you're right. I changed it up a bit to allow someone to join...
    Code:
    if((players[self.team] > 0) && (level.Frozen[self.team] == players[self.team]))
    {
    level thread maps\mp\gametypes\_gamelogic::forceEnd();
    }
    if((players[OppsTeam] > 0) && (level.Frozen[OppsTeam] == players[OppsTeam]))
    {
    level thread maps\mp\gametypes\_gamelogic::forceEnd();
    }
    I got it working, and you're right... level.Frozen is VERY glitchy...

    We'll work on another way around it, but for now, it's kinda fun to play with.

  15. #12
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    btw i got already a mod something like that calls freetag too

  16. #13
    chrisdavis97's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    2
    Care to share? I did a search, and didn't see anything on MPGH. If not, that's okay too.

    So, at this point, it's not very fun to play, because it doesn't work properly. I am thinking of a few ideas I can do to make it better.

    1. Keep existing conditions, but give a timer once frozen to unfreeze after 30 seconds.
    2. Keep existing conditions, but give a timer, as stated above, but it's a timer of death. (I'm diggin this idea, maybe with S&D settings)
    3. Re-write the freezing method, to count the actions, instead of the self.frozen code.

    What do you think?

    EDIT: Another option would be to place them in a holding cell (Jail) when they are knifed (frozen), with a designated location per map, care package walls, etc.
    Last edited by chrisdavis97; 10-30-2010 at 07:32 PM.

Similar Threads

  1. Trading a LVL 102 and for FIFA 11 ultimate team coins or players[Xbox]
    By Baha245 in forum Trade Accounts/Keys/Items
    Replies: 0
    Last Post: 08-12-2011, 01:28 AM
  2. [Solved] Need Commands to change Players Team
    By GrafBumsula in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 1
    Last Post: 07-16-2011, 04:54 PM
  3. Getting players in team
    By Boon Pek in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 2
    Last Post: 10-21-2010, 07:15 PM
  4. Counting players!
    By maarten551 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 5
    Last Post: 09-28-2010, 09:07 AM
  5. More then 9 players in one team?
    By shotyoudie in forum Call of Duty Modern Warfare 2 Help
    Replies: 3
    Last Post: 08-19-2010, 05:04 AM