Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Ready up Period Looping Eekhoorn
#1
Exclamation 
Eekhoorn allowed me to use the ready up snippet from cmmod in the sd.gsc file.

When i get in game the ready up period keeps on looping and stays on screen. Im guessing the problem is from this.

Code:
self thread readyUp();
self thread askReadyUp();
self thread readyUpMonitorLoop();
self thread playerReadyUpLoop();
self thread matchStartTimer();

Code:
/*Ready Up*/
//Made by Eekhoorn - www.ItsMods.com

readyUp() {
        level.timerStopped = true;
        
        wait .5;
        
        readyUpMonitorLoop();
        
        level.timerStopped = false;
        
        wait .5;
        
        matchStartTimer();
        game["ready_up"] = false;
        
        map_restart(true);
}

askReadyUp() {
        if(!isDefined(game["ready_up"]))
                game["ready_up"] = true;
    self takeAllWeapons();

        
        if(game["ready_up"])
                return true;
                
        return false;
}

readyUpMonitorLoop() {
        level.ready_up_complete = false;
        
        level.status = createServerFontString("default", 1.4);
        level.status setPoint("TOPRIGHT", "TOPRIGHT", -7, 30);
        level.status.color = (1, 1, 1);
        level.status setText("Status:");
        
        level.waiting = createServerFontString("default", 1.4);
        level.waiting setPoint("TOPRIGHT", "TOPRIGHT", -7, 80);
        level.waiting.color = (1, 1, 1);
        level.waiting setText("Waiting for");
        
        level.number = createServerFontString("default", 1.4);
        level.number setPoint("TOPRIGHT", "TOPRIGHT", -7, 100);
        level.number.color = (1, 1, 1);
        
        level.players = createServerFontString("default", 1.4);
        level.players setPoint("TOPRIGHT", "TOPRIGHT", -7, 120);
        level.players.color = (1, 1, 1);
        level.players setText("players");
        
        precacheStatusIcon("compassping_friendlyfiring_mp");
        precacheStatusIcon("compassping_enemy");
    self takeAllWeapons();

        
        
        
        while(!level.ready_up_complete) {
                wait .25;
                
                if(!isDefined(self))
                        return;
                        
                level.inGracePeriod = true;
                
                players = getEntArray("player", "classname");
                ready_counter = 0;
                
                for(i = 0; i < players.size; i++) {
                        if(isDefined(players[i].ready))
                                ready_counter += players[i].ready;
                        else
                                players[i] thread playerReadyUpLoop();
                }
                
                level.number setValue(players.size - ready_counter);
                
                if(players.size > 0 && ready_counter == players.size)
                        level.ready_up_complete = true;
        }
        
        level.waiting destroy();
        level.number destroy();
        level.players destroy();
        level.status destroy();
        
        
}



playerReadyUpLoop() {
        self endon("disconnect");
        
        if(isDefined(self.in_loop))
                return;
        
        self.in_loop = true;
        self.ready = false;
    self.maxhealth = 9999;
    self.health = self.maxhealth;
        
        self.state = self createFontString("default", 1.4);
        self.state setPoint("TOPRIGHT", "TOPRIGHT", -7, 50);
        self.state.color = (1, 1, 1);
        self.state setText("[LOADING]");
        
        self.info = self createFontString("default", 1.4);
        self.info setPoint("TOPRIGHT", "TOPRIGHT", -7, 140);
        self.info.color = (1, 1, 1);
        self.info setText("[{+actionslot 2}] to Open/Close Create-a-class");

    self.info1 = self createFontString("default", 1);
        self.info1 setPoint("TOPRIGHT", "TOPRIGHT", -7, 170);
        self.info1.color = (1, 1, 1);
        self.info1 setText("Press ^3[{+activate}]^7 to Ready up.");

        
        self.info1 = self createFontString("default", 1);
        self.info1 setPoint("TOPRIGHT", "TOPRIGHT", -7, 200);
        self.info1.color = (1, 1, 1);
        self.info1 setText("Press ^3[{+actionslot 1}]^7 to drop the Bomb.");

        
        while(!level.ready_up_complete) {
                wait .25;

                if(self.health<self.maxhealth)
                {
                        self.health = self.maxhealth;
                }
        
        self EnableInvulnerability();
        setDvar("player_sustainammo", 1);
        setDvar("g_speed", 0);
        self freeze_player_controls(false);

                
                if(!isDefined(self))
                        return;
        
                if(self useButtonPressed() && self.inmenu == 0)
                        self.ready = !self.ready;
                        
                if(self.ready) {
                        self.state.color = (.25, 1, .25);
                        self.state setText("[READY]");
                        self.statusicon = "compassping_friendlyfiring_mp";

                } else {
                        self.state.color = (1, .25, .25);
                        self.state setText("[NOT READY]");
                        self.statusicon = "compassping_enemy";

                }              
                        
                while(self useButtonPressed())
                        wait .25;      
        }

        self.state destroy();
        self.info destroy();
        
        self.pers["kills"] = 0;
        self.pers["score"] = 0;
        self.pers["deaths"] = 0;
    self.maxhealth = 100;
    self.health = self.maxhealth;
    

        
        
}

matchStartTimer() {
        timer = 5;

        level.player_ready = createServerFontString( "objective", 1.5 );
        level.player_ready setPoint( "CENTER", "CENTER", 0, -40 );
        level.player_ready.sort = 1001;
        level.player_ready setText("All Players are Ready");
        level.player_ready.foreground = false;
        level.player_ready.hidewheninmenu = false;
        level.player_ready.glowColor = (0.3, 0.6, 0.3);
        level.player_ready.glowAlpha = 1;
        level.player_ready setPulseFX( 100, 2000, 2000 );
        level.player_ready maps\mp\gametypes\_hud::fontPulseInit();

        level.starting = createServerFontString( "extrabig", 1.5 );
        level.starting setPoint( "CENTER", "CENTER", 0, -20 );
        level.starting.sort = 1001;
        level.starting setText( game["strings"]["match_starting_in"] );
        level.starting.foreground = false;
        level.starting.hidewheninmenu = false;

        level.timer = createServerTimer( "extrabig", 2.2 );
        level.timer setPoint( "CENTER", "CENTER", 0, 0 );
        level.timer setTimer(timer);
        level.timer.sort = 1001;
        level.timer.foreground = false;
        level.timer.hideWhenInMenu = false;

        wait timer;

        level.player_ready destroy();
        level.starting destroy();
        level.timer destroy();
}


Got any idea what I did wrong?
Reply

#2
Do I only do this one?

Code:
self thread askReadyUp();

Tried it, it doesn't work with just self thread askReadyUp();
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Its My Birthday! Happy birthday, Eekhoorn! Party Bot 7 3,973 08-13-2013, 20:20
Last Post: Eekhoorn
  Eekhoorn wood concept Arteq 7 4,943 02-23-2013, 08:34
Last Post: Arteq
Its My Birthday! Happy birthday, Eekhoorn! Party Bot 22 9,134 08-27-2012, 19:06
Last Post: AZUMIKKEL
  ready up period Cprl.Rst 7 3,707 04-27-2012, 08:54
Last Post: kris
  looping water slide number1 3 2,633 07-04-2011, 09:59
Last Post: Xzite
  Help Can you disable the jump button for a period of time? clxyeah 5 3,467 07-02-2011, 02:01
Last Post: koil
  Ready Up Period Mod/Snippet Boomshay 5 3,074 06-30-2011, 05:52
Last Post: Boomshay
  Grace period name No One 4 3,031 03-15-2011, 23:38
Last Post: No One
Its My Birthday! Happy birthday, Eekhoorn! Party Bot 14 7,107 01-09-2011, 13:39
Last Post: DANNYIZPRO
  happy new year with eekhoorn xd TheSaboteur 2 2,413 01-03-2011, 19:07
Last Post: TheSaboteur

Forum Jump:


Users browsing this thread:
1 Guest(s)

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