• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] EndGame Is Acting Gay...
#1
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.
[Image: 1fxsnb.jpg]
  Reply
#2
(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" );
[Image: azuw.jpg]
  Reply
#3
(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
  Reply
#4
Yeap, it worked.
[Image: 1fxsnb.jpg]
  Reply
#5
plzzz give thanks + rep I am a whore!!!
[Image: azuw.jpg]
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help [C#] WebClient how to know real url [solved] narkos 21 11,750 09-09-2013, 15:21
Last Post: surtek
Information Help How to edit new derived entry? (Solved) SSonic70 1 2,453 08-20-2013, 15:29
Last Post: Nekochan
  Help [solved]red hitmark mod? founderlj 7 4,162 12-30-2012, 23:06
Last Post: Pozzuh
  !weapon Plugin help pls [solved] Hallla 0 1,834 12-30-2012, 14:04
Last Post: Hallla
  Help !giveammo Plugin doesnt work [solved] Hallla 3 3,229 12-29-2012, 20:53
Last Post: Hallla
  Help OnPlayerConnect [Solved] 99IRock 4 3,831 11-18-2012, 10:07
Last Post: 99IRock
  Give Gun Error [SOLVED] koro35 4 3,568 11-17-2012, 15:15
Last Post: koro35
  Help Mw3 server error 2 [Solved] 99IRock 6 21,928 11-17-2012, 12:38
Last Post: 99IRock
  Help Mw3 server Error [Solved] 99IRock 3 4,136 11-16-2012, 07:38
Last Post: 99IRock
Information [Solved] Info about functions, events and etc. Nerus 2 2,292 09-09-2012, 20:57
Last Post: surtek

Forum Jump:


Users browsing this thread: 1 Guest(s)