Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Is there ANYTHING in this .gsc file that explains eventual crashes??

Is there ANYTHING in this .gsc file that explains eventual crashes??

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 2 Posters 332 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Gangorraundefined Offline
    Gangorraundefined Offline
    Gangorra
    wrote on last edited by Gangorra
    #1

    SO i'm hosting some servers in here and for some reason my GSC makes it crash after a couple of good minutes.

    People can play to high rounds and thing but all of a sudden it crashes for no apparent reason.
    there are absolutely 0 patterns. No time related, no round related, nothing.

    Can you guys help me?

    (Yeah Identation is quite messed up but still)

    /*
    *	 Black Ops 2 - GSC Studio by iMCSx
    *
    *	 Creator : Gangorra
    *	 Project : Teste
    *    Mode : Zombies
    *	 Date : 2020/04/21 - 02:03:13	
    *
    */	
    
    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\gametypes_zm\_hud_util;
    #include maps\mp\gametypes_zm\_hud_message;
    #include maps\mp\zombies\_zm_utility;
    
    init()
    {
        level thread onPlayerConnect();
        level thread drawZombiesCounter();
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected", player);
            player thread onPlayerSpawned();
            player thread healthPlayer();
            player thread killCount();
            player thread showScore();
            player thread showDiscord();
        }
    }
    
    onPlayerSpawned()
    {
        self endon("disconnect");
    	level endon("game_ended");
        for(;;)
        {
            self waittill("spawned_player");
    		// Will appear each time when the player spawn, that's just an exemple.
    		self iprintln("^2Bem-vindo ao Zombies ^1Gangorra Aidetica!");
        }
    }
    
    healthPlayer()
    
    {
    	self endon("disconnect");
    	self.healthText = createFontString("Objective" , 1.2); //Fixed
        self.healthText setPoint("CENTER", "BOTTOM", -100, 20);
        while(true)
              {
               self.healthText setText( "^2HP: ^7"+ self.health);
               wait 0.5;
              }
    }
    
    drawZombiesCounter()
    {
        level.zombiesCounter = createServerFontString("Objective" , 1.3);
        level.zombiesCounter setPoint("CENTER", "BOTTOM", -160, 20);
        level thread updateZombiesCounter(); 
    }
    
    updateZombiesCounter()
    {
        oldZombiesCount = get_current_zombie_count();
        while(true)
        {   	
            newZombiesCount = get_current_zombie_count();
            wait 0.4;
            if(oldZombiesCount != newZombiesCount)
            {
                level thread updateZombiesCounter();
                return;
            }
            else
            {
            	if(newZombiesCount != 0)
            		level.zombiesCounter.label = &"Zumbis: ^1";
            	else
            		level.zombiesCounter.label = &"Zumbis: ^5";
            	level.zombiesCounter setValue(newZombiesCount);
            }
        }
    }
    
    killCount()
    {
    	i = 0;
    
    	while( i < level.players.size)
    	{
    		if(level.players[i] == self)
    		{
    			self thread killCountSelf(level.players[i]);
    		}
    		i++;
    		wait 0.3;
    	}
    }
    
    killCountSelf(thisPlayer)
    {
    	self.kill = createFontString("small" , 1.2); //Fixed
    	self.kill setPoint("CENTER", "BOTTOM", -40, 20);
    	while(true)
    	{
    		self.kill.label = &"^3Baixas:  ^7";
    		self.kill setValue(thisPlayer.kills);
    		wait 0.4;
    	}
    }
    
    showScore()
    {
    	self.scoreShow = createFontString("small" , 1.2); //Fixed
    	self.scoreShow setPoint("CENTER", "BOTTOM", 40, 20);
    	while(true)
    	{
    		self.scoreShow.label = &"^6Score:  ^7";
    		self.scoreShow setValue(self.score);
    		wait 0.25;
    	}
    }
    
    showDiscord()
    {
    	self.showDiscord = createFontString("small" , 1.0); //Fixed
    	self.showDiscord setPoint("CENTER", "TOP", 0, -30);
    	self.showDiscord setText("^3Discord:  ^7tinyurl.com/bo2gangorra");
    }
    
    
    1 Reply Last reply
    0
    • Gangorraundefined Offline
      Gangorraundefined Offline
      Gangorra
      wrote on last edited by
      #2

      SOLVED. And I hope it's a lesson to every new scripting learner.
      ALWAYS. Instruct your open threads to finish.

      It solved just as easy as it sounds.
      One line to each open thread.

      1 Reply Last reply
      1
      • Drgnundefined Offline
        Drgnundefined Offline
        Drgn Plutonium Staff
        wrote on last edited by
        #3

        Locked as he solved his issue and explained further so other people who have this issue can fix it.

        1 Reply Last reply
        1

        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Donate