Thread Rating:
  • 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 12,965 09-09-2013, 15:21
Last Post: surtek
Information Help How to edit new derived entry? (Solved) SSonic70 1 2,736 08-20-2013, 15:29
Last Post: Nekochan
  Help [solved]red hitmark mod? founderlj 7 4,718 12-30-2012, 23:06
Last Post: Pozzuh
  !weapon Plugin help pls [solved] Hallla 0 1,971 12-30-2012, 14:04
Last Post: Hallla
  Help !giveammo Plugin doesnt work [solved] Hallla 3 3,549 12-29-2012, 20:53
Last Post: Hallla
  Help OnPlayerConnect [Solved] 99IRock 4 4,127 11-18-2012, 10:07
Last Post: 99IRock
  Give Gun Error [SOLVED] koro35 4 3,882 11-17-2012, 15:15
Last Post: koro35
  Help Mw3 server error 2 [Solved] 99IRock 6 23,081 11-17-2012, 12:38
Last Post: 99IRock
  Help Mw3 server Error [Solved] 99IRock 3 4,700 11-16-2012, 07:38
Last Post: 99IRock
Information [Solved] Info about functions, events and etc. Nerus 2 2,499 09-09-2012, 20:57
Last Post: surtek

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.