Post: Check alive players
01-07-2012, 01:59 AM #1
Default Avatar
Newelly
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); Something simply coded a while ago can be shortened and is messy due to me not caring when i wrote it up.

    
CheckTeam()
{
if (level.alivecounterstarted != 1)
{
level.alivecounterstarted = 1;
level.alliesalive = 0;
level.axisalive = 0;
}
self.ateam = self.pers["team"];
if (self.ateam == "allies")
{
level.alliesalive += 1;
} else if (self.ateam == "axis") {
level.axisalive += 1;
}
self thread DoLabel();
self waittill("death");
if (self.ateam == "allies")
{
level.alliesalive -= 1;
} else if (self.ateam == "axis") {
level.axisalive -= 1;
}
}

DoLabel()
{
self endon("death");

lbl = self createFontString("default", 2);
lbl setPoint("TOPCENTER", "TOPCENTER");
self thread deleteondeath(lbl);
lbl.hideWhenInMenu = true;
for(;Winky Winky {

if (self.ateam == "allies")
{
if (getDvar("g_gametype") != "dm"){

lbl setText("^2Your Team:" + level.alliesalive+ " |^1|Axis:" +level.axisalive);
} else {
//FREE FOR ALL
lbl setText("^21" + " ^1" + (level.players.size -1));
}
} else if (self.ateam == "axis") {
if (getDvar("g_gametype") != "dm"){

lbl setText("^2Your Team:" + level.alliesalive+ " |^1| Axis:" +level.axisalive);
} else {
lbl setText("^21" + " ^1" + (level.players.size - 1));
}
}
wait 0.1;
}
}
deleteondeath(hud){self waittill("death");hud destroy();}


This can be shortened but i kept getting errors even when Correy tried /facepalm he sucks :carling:

Peace

//Im Back :love:
(adsbygoogle = window.adsbygoogle || []).push({});
01-07-2012, 03:11 AM #11
Originally posted by Newelly View Post


//Im Back :love:
Ban this noob .. :evil:
01-07-2012, 04:19 AM #12
Kush Friendly
League Champion
Originally posted by jbglitching View Post
Cool i guess but kinda pointless why would you need to know players that are alive Happy


you could use it in zombies to see who is alive on your team maybe, other than that, i dont see much else to use this for.
01-07-2012, 08:49 AM #13
Karoolus
I'm the W@W Menu Guy !
Originally posted by Lz View Post
you could use it in zombies to see who is alive on your team maybe, other than that, i dont see much else to use this for.


quite useful in S&Awesome face as well.. i like to know how many teamplayers are alive (or enemy players ftm)

The following 2 users say thank you to Karoolus for this useful post:

Kush Friendly,
01-07-2012, 02:32 PM #14
xRaW
xI2aW-
Originally posted by Karoolus View Post
quite useful in S&Awesome face as well.. i like to know how many teamplayers are alive (or enemy players ftm)


is that why you just press select and look if they have the dog tag next to their name :lol:?
01-07-2012, 03:17 PM #15
Originally posted by Newelly View Post
was banned on here just realised i wasnt today im not sure how long ive been unbanned for :S

why do you think i put

" //Im Back :love: "
ooo lolz why you get banned :(
01-16-2012, 01:05 PM #16
ExceptionHell
▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄ ▀▄
Originally posted by reScript
Would this work? O.o
    
CheckPlayers(freq)
{
lbl = self createFontString("default", 2);
lbl setPoint("TOPCENTER", "TOPCENTER");
self thread deleteondeath(lbl);
lbl.hideWhenInMenu = true;
for(;Winky Winky
{
level.teamCount["axis"] = 0;
level.teamCount["allies"] = 0;
level.teamCount["dead"] = 0;
for(i = 0; i < level.players.size; i++)
{
if(level.players[i] isAlive())
{
if(self.pers["team"] = "allies")
level.teamCount["allies"] += 1;
else
level.teamCount["axis"] += 1;
}
else
level.teamCount["dead"] += 1;
}
lbl setText("^2Your Team:" + level.teamCount["allies"] + " |^1|Axis:" + level.teamCount["axis"]);
wait freq;
}
}
deleteondeath(hud)
{
self waittill("death");
hud destroy();
}


-edit updated it with text on screen.


don't works, Bad syntax for me..
01-16-2012, 01:55 PM #17
247Yamato
< ^ > < ^ >
Just add something to check players team (if you want)

    AlivePlayers()
{
aplayers = 0;
for ( i = 0; i < level.players.size; i++ )
if ( level.players[i].health > 0 )
aplayers ++;
return aplayers;
}
01-16-2012, 02:46 PM #18
Correy
I'm the Original
Originally posted by 247Yamato View Post
Just add something to check players team (if you want)

    AlivePlayers()
{
aplayers = 0;
for ( i = 0; i < level.players.size; i++ )
if ( level.players[i].health > 0 )
aplayers ++;
return aplayers;
}


health is reset back to 100 on death
    
CheckPlayers()
{
for(;Winky Winky
{
for( p=0; p<level.players.size; p++ )
{
level.players[i] waittill( "death" );
level.alive -= 1;
}
wait 1;
}
}


just a little example.
01-16-2012, 03:27 PM #19
247Yamato
< ^ > < ^ >
Originally posted by Correy View Post
health is reset back to 100 on death
    
CheckPlayers()
{
for(;Winky Winky
{
for( p=0; p<level.players.size; p++ )
{
level.players[i] waittill( "death" );
level.alive -= 1;
}
wait 1;
}
}


just a little example.


That will fail You shouldnt use isAlive() function, is buggy, use players health instead.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo