Try this if(level.aliveCount["axis"] == "0" && level.aliveCount["allies"] == "0")
{
map mp_highrise
}
_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
}
Last edited by mathieutje12; 06-14-2011 at 09:40 AM.
me, I'll try
script error
send me your code pastebin please
Script Compile error
function 'countplayers' already defined
[See console for details]
In _teams.gsc
RoundSystem.gscCountPlayers()
{
//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 is QCZM#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;
}
}
Last edited by darkorlegend; 06-14-2011 at 03:55 PM.
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();
delente one?
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;
}
}
Last edited by darkorlegend; 06-15-2011 at 01:21 PM.
not rly hard
Code:GameEnded() { while( 1 ) { players = maps\mp\gametypes\_teams::CountPlayers(); if(players["allies"] == 0) { map mp_highrise break; } wait 0.05; } }
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);} }
Last edited by mathieutje12; 06-18-2011 at 11:52 AM.