Players crash at start of the rounds
#1

The issue must be in my script, different players randomly crash in my server. At the start of the round they are teleported into their cars and the chase starts. They dont always crash, but quite often. Crash reports:

Код:
SA-MP 0.3.7
Exception At Address: 0x0081214A
Base: 0x03B50000
SCM Op: 0x470, lDbg: 0 LastRendObj: 646
// Full report: https://pastebin.com/ABFCdMCf
Код:
SA-MP 0.3.7
Exception At Address: 0x0081214A
Base: 0x036F0000
SCM Op: 0x2BF, lDbg: 0 LastRendObj: 646
// Full report: https://pastebin.com/swzDQevE
Код:
SA-MP 0.3.7-R2
Exception At Address: 0x00756B89
Base: 0x03C80000
SCM Op: 0x6BD, lDbg: 0 LastRendObj: 1226
// Full report: https://pastebin.com/LJ2z3mMG
Код:
SA-MP 0.3.7
Exception At Address: 0x00756B89
Base: 0x03500000
SCM Op: 0x6BD, lDbg: 0 LastRendObj: 1399
// Full report: https://pastebin.com/9zZAQmPx
Код:
SA-MP 0.3.7
Exception At Address: 0x3FB33333
Base: 0x03D10000
SCM Op: 0x6BD, lDbg: 0 LastRendObj: 625
// Full report: https://pastebin.com/GXy8TpSz
As seen, the most often crash cause is 0x6BD. This is my code, when the round starts (when players crash most often):

Код:
stock StartGame(roomid)
{
	new str[128];
	format(str, sizeof(str), "A new copchase has started (room %d) "COLOR_WHITE"Players:"COLOR_ORANGE" %d/10", roomid+1, rInfo[roomid][rPlayers]);
	SendClientMessageToAll(C_ORANGE, str);
	
	new randomIndex, currentIndex, copcarIndex = 1, randomSkin, randomWeather, randomSpawn, randomWeapon, randomCrime;

	TextDrawSetString(rInfo[roomid][rJoinTD], "SPEC");
	
	randomIndex = random(rInfo[roomid][rPlayers]); // Chooses an index and that player will be set as criminal in the loop.
	randomSpawn = random(sizeof(randomSpawns)); // Chooses the spawn.
	randomWeather = random(24); // Chooses the weather (hours ranging from 0-23)
	randomWeapon = 24;
	
	randomCrime = random(sizeof(criminalCrimes)); // Chooses the reason why the criminal is wanted for.
	rInfo[roomid][rReward] = randomEx(10, 40); // Chooses the reward in THOUSANDS that the cops/criminal get. Ex. 10 = 10,000$; 40 = 40,000$

	foreach(Player, i)
	{
	    if(pInfo[i][pRoomID] == roomid)
	    {
	        new car;
	        
			hideRoomSelection(i);
			SetPlayerTime(i, randomWeather, 0);
	        
	        if(currentIndex == randomIndex)
	        {
				randomSkin = criminalSkins[random(sizeof(criminalSkins))];
	        	SendClientMessage(i, C_RED, "You have been chosen as the criminal!");
	        	
	        	SetPlayerColor(i, C_RED);
	        	pInfo[i][pIsCriminal] = true;
	        	rInfo[roomid][rCriminalID] = i;
	        	SetPlayerTeam(i, NO_TEAM);
	        	
				car = AddStaticVehicleEx(criminalCars[random(sizeof(criminalCars))], randomSpawns[randomSpawn][0][0], randomSpawns[randomSpawn][0][1], randomSpawns[randomSpawn][0][2], randomSpawns[randomSpawn][0][3], -1, -1, 120, 0);
			}
			else
			{
			    randomSkin = policeSkins[random(sizeof(policeSkins))];
				SendClientMessage(i, C_NICEBLUE, "You have been chosen as police!");
				
				SetPlayerColor(i, C_NICEBLUE);
				SetPlayerTeam(i, roomid);
				ShowGPSTextdraw(i);
				
				car = CreateVehicle (596, randomSpawns[randomSpawn][copcarIndex][0], randomSpawns[randomSpawn][copcarIndex][1], randomSpawns[randomSpawn][copcarIndex][2], randomSpawns[randomSpawn][copcarIndex][3], -1, -1, -1, 0);
	        	copcarIndex++;
			}
			
			TogglePlayerControllable(i, false);
			GivePlayerWeapon(i, 24, 64);
			SetPlayerSkin(i, randomSkin);
			SetVehicleVirtualWorld(car, rInfo[roomid][rVirtualWorld]);
			SetPlayerVirtualWorld(i, rInfo[roomid][rVirtualWorld]);
			
			if(IsPlayerInAnyVehicle(i)) RemovePlayerFromVehicle(i);
			PutPlayerInVehicle(playerid, car, 0);

			SetPlayerHealth(i, 100);
			
			pInfo[i][pCountdownStep] = 5;
			pInfo[i][pCountdownTimer] = SetTimerEx("ShowCountdown", 1000, true, "i", i);
			
			currentIndex++;
		}
	}
	
	SetDashTextdraw(roomid, rInfo[roomid][rCriminalID], randomCrime, rInfo[roomid][rReward], randomWeapon);
	foreach(Player, i) // Have to make a new loop, because in the first loop the criminal ID wasnt known (needed for dashNameTD)
	{
	    if(pInfo[i][pRoomID] == roomid)
	    {
	        ShowDashTextdraw(i);
	    }
	}
	
	SetTimerEx("UnfreezeRoomPlayers", 5000, false, "i", roomid);
	SetTimerEx("HideDash", 10*1000, false, "i", roomid);
}
I would really appreciate if someone could help me find out the reason. I have put a lot of effort into this gamemode and it bothers the players a lot when they crash.
Reply
#2

Another crash with code 0x6BD: https://pastebin.com/YEHWPTGv

It happened when the player touched my car with his car. Very weird crashes.. anyone?
Reply
#3

AddStaticVehicleEx can be only used in OnGameModeInit()
I don't know if that will help you but, there is what this OPCode means: https://gtagmodding.com/opcode-database/opcode/06BD/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)