ItsMods

Full Version: [Solved] EndGame Is Acting Gay...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This function is placed in init()

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.
(03-12-2011, 18:18)4FunPlayin Wrote: [ -> ]This function is placed in init()

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.

Did you try

Code:
thread maps\mp\gametypes\_globallogic::endGame( "axis", "Satellite-C3 was captured" );
(03-12-2011, 18:57)zxz0O0 Wrote: [ -> ]
(03-12-2011, 18:18)4FunPlayin Wrote: [ -> ]This function is placed in init()

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.

Did you try

Code:
thread maps\mp\gametypes\_globallogic::endGame( "axis", "Satellite-C3 was captured" );

u dont need this i think.

EDIT: Sry Big Grin
Yeap, it worked.
plzzz give thanks + rep I am a whore!!!