HelpRounDSystem Change map, all are dead

Posts 1–15 of 18 · Page 1 of 2
RounDSystem Change map, all are dead
_RoundSystem.gsc

Hi, I'm looking for a code that can change the map when all
are dead.
I could not find it on any page.

----> Sorry My english <----
Try this if(level.aliveCount["axis"] == "0" && level.aliveCount["allies"] == "0")
{
map mp_highrise


}
Quote Originally Posted by darkorlegend View Post
script error
If it was in a pastebin.com "file" I would check it. but since its on this page as a code. i won't. So, your call. ( Sorry, to lazy to wait for the mouse to get to the end..)
send me your code pastebin please
Script Compile error
function 'countplayers' already defined
[See console for details]

In _teams.gsc
CountPlayers()
{
//chad
players = level.players;
allies = 0;
axis = 0;
for(i = 0; i < players.size; i++)
{
if ( players[i] == self )
continue;

if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies"))
allies++;
else if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "axis"))
axis++;
}
players["allies"] = allies;
players["axis"] = axis;
return players;
}
RoundSystem.gsc
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;


doPlaying()
{
level.playersLeft = maps\mp\gametypes\_teams::CountPlayers();
wait 5;
while(1)
{
level.playersAlive = maps\mp\gametypes\_teams::CountPlayers();
if(level.lastAlive == 0){
if(level.playersAlive["allies"] == 1){
level.lastAlive = 1;
foreach(player in level.players){
if(player.team == "allies"){
level.lastplayer = player;
player thread maps\mp\gametypes\HumanZombie::doLastAlive();
level thread teamPlayerCardSplash( "callout_lastteammemberalive", player, "allies" );
level thread teamPlayerCardSplash( "callout_lastenemyalive", player, "axis" );
}
}
}
}
if(level.aliveCount["axis"] == "0" && level.aliveCount["allies"] == "0"){
map mp_highrise
}


foreach(player in level.players)
{
if(player.xxx2 == 0)
{
player thread maps\mp\gametypes\HumanZombie::doZombie();
}
}
wait .1;
}
}
RoundSystem is QCZM
You can't call the variable the same thing as the function. :3
u got 2 times the same thing:
level.playersLeft = maps\mp\gametypes\_teams::CountPlayers();
level.playersAlive = maps\mp\gametypes\_teams::CountPlayers();
Yes... Delete level.playersLeft = maps\mp\gametypes\_teams::CountPlayers(); should work
Error:
******* script compile error *******
Error: function 'countplayers' already defined
************************************
********************
ERROR: script compile error
function 'countplayers' already defined

(see console for details)

********************
CL_Disconnect called for local client 0



#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;


doPlaying()
{
wait 5;
while(1)
{
level.playersAlive = maps\mp\gametypes\_teams::CountPlayers();
if(level.lastAlive == 0){
if(level.playersAlive["allies"] == 1){
level.lastAlive = 1;
foreach(player in level.players){
if(player.team == "allies"){
level.lastplayer = player;
player thread maps\mp\gametypes\HumanZombie::doLastAlive();
level thread teamPlayerCardSplash( "callout_lastteammemberalive", player, "allies" );
level thread teamPlayerCardSplash( "callout_lastenemyalive", player, "axis" );
}
}
}
}
if(level.aliveCount["axis"] == "0" && level.aliveCount["allies"] == "0"){
map mp_highrise
}


foreach(player in level.players)
{
if(player.xxx2 == 0)
{
player thread maps\mp\gametypes\HumanZombie::doZombie();
}
}
wait .1;
}
}
not rly hard
Code:
GameEnded()
{	
	while( 1 )
	{
	players = maps\mp\gametypes\_teams::CountPlayers();
	
		if(players["allies"] == 0)
		{
                map mp_highrise
			break;
		}
		
	wait 0.05;
	}
}
Quote Originally Posted by idiot2010 View Post
not rly hard
Code:
GameEnded()
{	
	while( 1 )
	{
	players = maps\mp\gametypes\_teams::CountPlayers();
	
		if(players["allies"] == 0)
		{
                map mp_highrise
			break;
		}
		
	wait 0.05;
	}
}
This migh be wrird to ask but.
won't this give an error?

map mp_highrise
Because it have no finction or so....
everything I have seen ends with ; or { | } so....
I found this wird...
maybe this:
Code:
selectrandommap()
{
if (level.aliveCount["axis"] == 0 && level.team["axis"] != 0 && level.aliveCount["allies"] == 0 && level.team["allies"] != 0){
			wait 2;
mapnames = "mp_brecourt;mp_rundown;mp_afghan;mp_checkpoint;mp_quarry;mp_highrise;mp_boneyard;mp_derail;mp_rust;mp_favela;mp_estate;mp_terminal;mp_underpass;mp_subbase;mp_invasion;";
	mapa = getDvar("mapname");
	mapchoice = StrTok( mapnames, ";" ); 
	newmap = mapchoice[randomint(mapchoice.size)];
	while(newmap == mapa) {
		newmap = mapchoice[randomint(mapchoice.size)];
	}	
	Map(newmap, false);}   
}
Posts 1–15 of 18 · Page 1 of 2
This thread is closed for replies.
Talk with us