03-12-2011, 18:18
(This post was last modified: 03-12-2011, 19:59 by 4FunPlayin.)
This function is placed in init()
Turns screen black-white, I can still move and shoot, but game doesn't end.
Code:
captureObjectiveArray(org)
{
level endon("game_ended");
rad = 120;
level.captureBarValue = 0;
while(1)
{
for ( i = 0; i < level.players.size; i++ )
{
player = level.players[i];
dis = distance(player.origin, org);
if(dis < rad)
{
if(player.pers["team"] == "axis")
level.captureBarValue++;
else if(player.pers["team"] == "allies")
{
if(level.captureBarValue >= 0)
level.captureBarValue--;
}
wait 1;
}
}
if(level.captureBarValue == 100)
maps\mp\gametypes\_globallogic::endGame( "axis", "Satellite-C3 was captured" );
wait .1;
}
}
Turns screen black-white, I can still move and shoot, but game doesn't end.