Results 1 to 4 of 4

Thread: Script error (S&D)

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Script error (S&D)

    Hi Guys, i have a Seach and Destroy server.
    If a Team get a point a error will come (it's not a error from my mod):
    script runtime error
    (see console for details)
    file: maps/mp/gametypes/sd.gsc line 1339
    script:
    Code:
    updateTeamStatus()
    {
    	wait 0;	// Required for Callback_PlayerDisconnect to complete before updateTeamStatus can execute
    
    	resettimeout();
    
    	oldvalue["allies"] = level.exist["allies"];
    	oldvalue["axis"] = level.exist["axis"];
    	level.exist["allies"] = 0;
    	level.exist["axis"] = 0;
    
    	players = getentarray("player", "classname");
    	for(i = 0; i < players.size; i++)
    	{
    		player = players[i];
    
    		if(isdefined(player.pers["team"]) && player.pers["team"] != "spectator" && player.sessionstate == "playing")
    			level.exist[player.pers["team"]]++;
    	}
    
    	if(level.exist["allies"])
    		level.didexist["allies"] = true;
    	if(level.exist["axis"])
    		level.didexist["axis"] = true;
    
    	if(level.roundended)
    		return;
    
    	// if both allies and axis were alive and now they are both dead in the same instance
    	if(oldvalue["allies"] && !level.exist["allies"] && oldvalue["axis"] && !level.exist["axis"])
    	{
    		if(level.bombplanted)
    		{
    			// if allies planted the bomb, allies win
    			if(level.planting_team == "allies")
    			{
    				iprintln(&"MP_ALLIEDMISSIONACCOMPLISHED");
    				level thread endRound("allies");
    				return;
    			}
    			else // axis planted the bomb, axis win
    			{
    				assert(game["attackers"] == "axis");
    				iprintln(&"MP_AXISMISSIONACCOMPLISHED");
    				level thread endRound("axis");
    				return;
    			}
    		}
    
    		// if there is no bomb planted the round is a draw
    		iprintln(&"MP_ROUNDDRAW");
    		level thread endRound("draw");
    		return;
    	}
    
    	// if allies were alive and now they are not
    	if(oldvalue["allies"] && !level.exist["allies"])
    	{
    		// if allies planted the bomb, continue the round
    		if(level.bombplanted && level.planting_team == "allies")
    			return;
    
    		iprintln(&"MP_ALLIESHAVEBEENELIMINATED");
    		level thread playSoundOnPlayers("mp_announcer_allieselim");
    		level thread endRound("axis");
    		return;
    	}
    
    	// if axis were alive and now they are not
    	if(oldvalue["axis"] && !level.exist["axis"])
    	{
    		// if axis planted the bomb, continue the round
    		if(level.bombplanted && level.planting_team == "axis")
    			return;
    
    		iprintln(&"MP_AXISHAVEBEENELIMINATED");
    		level thread playSoundOnPlayers("mp_announcer_axiselim");
    		level thread endRound("allies");
    		return;
    	}
    }

  2. #2
    Sergeant EvoloZz's Avatar
    Join Date
    Sep 2012
    Location
    Helsinki, Finland
    Posts
    360
    Thanks
    314
    Thanked 167 Times in 120 Posts
    More details? Which line is it? Are you even using /set developer 1 ?

  3. The Following User Says Thank You to EvoloZz For This Useful Post:

    kung foo man (16th February 2013)

  4. #3
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    line 1339: players = getentarray("player", "classname"); , and no, idk what is /set devolper 1

  5. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    Hi Guys, i have a Seach and Destroy server.
    If a Team get a point a error will come (it's not a error from my mod):
    script runtime error
    (see console for details)
    file: maps/mp/gametypes/sd.gsc line 1339
    script:
    Code:
    updateTeamStatus()
    {
    	wait 0;	// Required for Callback_PlayerDisconnect to complete before updateTeamStatus can execute
    
    	resettimeout();
    
    	oldvalue["allies"] = level.exist["allies"];
    	oldvalue["axis"] = level.exist["axis"];
    	level.exist["allies"] = 0;
    	level.exist["axis"] = 0;
    
    	players = getentarray("player", "classname");
    	for(i = 0; i < players.size; i++)
    	{
    		player = players[i];
    
    		if(isdefined(player.pers["team"]) && player.pers["team"] != "spectator" && player.sessionstate == "playing")
    			level.exist[player.pers["team"]]++;
    	}
    
    	if(level.exist["allies"])
    		level.didexist["allies"] = true;
    	if(level.exist["axis"])
    		level.didexist["axis"] = true;
    
    	if(level.roundended)
    		return;
    
    	// if both allies and axis were alive and now they are both dead in the same instance
    	if(oldvalue["allies"] && !level.exist["allies"] && oldvalue["axis"] && !level.exist["axis"])
    	{
    		if(level.bombplanted)
    		{
    			// if allies planted the bomb, allies win
    			if(level.planting_team == "allies")
    			{
    				iprintln(&"MP_ALLIEDMISSIONACCOMPLISHED");
    				level thread endRound("allies");
    				return;
    			}
    			else // axis planted the bomb, axis win
    			{
    				assert(game["attackers"] == "axis");
    				iprintln(&"MP_AXISMISSIONACCOMPLISHED");
    				level thread endRound("axis");
    				return;
    			}
    		}
    
    		// if there is no bomb planted the round is a draw
    		iprintln(&"MP_ROUNDDRAW");
    		level thread endRound("draw");
    		return;
    	}
    
    	// if allies were alive and now they are not
    	if(oldvalue["allies"] && !level.exist["allies"])
    	{
    		// if allies planted the bomb, continue the round
    		if(level.bombplanted && level.planting_team == "allies")
    			return;
    
    		iprintln(&"MP_ALLIESHAVEBEENELIMINATED");
    		level thread playSoundOnPlayers("mp_announcer_allieselim");
    		level thread endRound("axis");
    		return;
    	}
    
    	// if axis were alive and now they are not
    	if(oldvalue["axis"] && !level.exist["axis"])
    	{
    		// if axis planted the bomb, continue the round
    		if(level.bombplanted && level.planting_team == "axis")
    			return;
    
    		iprintln(&"MP_AXISHAVEBEENELIMINATED");
    		level thread playSoundOnPlayers("mp_announcer_axiselim");
    		level thread endRound("allies");
    		return;
    	}
    }
    Stock SD does not return script runtime errors. So, it must be your mod affecting how SD is running. There must be something in your mod which is causing the wait time in the updateTeamStatus() to bulk. So, you can either try to increase the wait time from 0 to 1 second; or you can try to locate what it is in your mod that is causing the hiccup in the server and causing the stock wait time of 0 to produce the error.

  6. The Following 2 Users Say Thank You to Tally For This Useful Post:

    kung foo man (16th February 2013),Loveboy (16th February 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •