SA-MP Forums Archive
Server Crash on Filterscript unload - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Crash on Filterscript unload (/showthread.php?tid=606187)



Server Crash on Filterscript unload - Lajko1 - 30.04.2016

While I'm trying to unload my filterscript via rcon cmd it just crash my server..
So the server log tells me the following:

Can someone translate it for me please? If you need anything from Actor.pwn just ask

Код:
[02:48:19]   Filterscript 'Actor.amx' unloaded.
[02:48:19] [debug] Run time error 7: "Stack underflow"
[02:48:19] [debug]  Stack pointer (STK) is 0x0, stack top (STP) is 0x0
[02:48:19] [debug] Server crashed due to an unknown error
[02:48:19] [debug] System backtrace:
[02:48:19] [debug] #0 f68350f3 in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[02:48:19] [debug] #1 f682cb61 in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[02:48:19] [debug] #2 f682f441 in _ZN11crashdetect15SystemExceptionEPv () from plugins/crashdetect.so
[02:48:19] [debug] #3 f6834c42 in ?? () from plugins/crashdetect.so
[02:48:19] [debug] #4 f76e6400 in ?? ()
[02:48:19] [debug] #5 f682bbcd in _ZN11crashdetectC1EP6tagAMX () from plugins/crashdetect.so
[02:48:19] [debug] #6 f682dbdc in _ZN11crashdetect11GetInstanceEP6tagAMX () from plugins/crashdetect.so
[02:48:19] [debug] #7 f6833242 in ?? () from plugins/crashdetect.so
[02:48:19] [debug] #8 080a1c92 in ?? () from ./samp03svr
[02:48:19] [debug] #9 080b134a in ?? () from ./samp03svr
[02:48:19] [debug] #10 08071d38 in ?? () from ./samp03svr
[02:48:19] [debug] #11 08071e32 in ?? () from ./samp03svr
[02:48:19] [debug] #12 0807bc20 in ?? () from ./samp03svr
[02:48:19] [debug] #13 080ae9fd in ?? () from ./samp03svr
[02:48:19] [debug] #14 080aebc2 in ?? () from ./samp03svr
[02:48:19] [debug] #15 080a9e9a in ?? () from ./samp03svr
[02:48:19] [debug] #16 f7440e46 in __libc_start_main () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[02:48:19] [debug] #17 0804b4e1 in ?? () from ./samp03svr



Re: Server Crash on Filterscript unload - Dayrion - 30.04.2016

Quote:
Originally Posted by ******
Посмотреть сообщение
Actually, I think stack underflows are caused by removing TOO MUCH stuff from the stack, which can't normally happen if you use the compiler.
https://sampforum.blast.hk/showthread.php?tid=298511

I don't know if this message can help you. Hope you will solve your problem


Re: Server Crash on Filterscript unload - DRIFT_HUNTER - 01.05.2016

How about OnFilterScriptExit code and what includes do you use?


Re: Server Crash on Filterscript unload - Lajko1 - 01.05.2016

OnFSInit
Код:
public OnFilterScriptInit()
{
    car_dealer = CreateActor(50,2114.6985,-1178.0482,24.1448, 84.6794);
    ApplyActorAnimation(car_dealer, "CAR","Fixn_Car_Loop",4.0, 1,0,0,1,10000); // fix car anim
	car_dealer_label = Create3DTextLabel(actor_names[2], -1, 2116.8110,-1178.1996,23.9974, 40.0, 0, 0);
	SetActorInvulnerable(car_dealer, true);
 	
 	//Mapping for actor
 	CreateDynamicObject(3594, 2117.70337, -1175.98926, 23.71290,   0.00000, 0.00000, 0.00000);
	CreateDynamicObject(1000, 2119.90503, -1179.86096, 23.05910,   0.00000, 0.00000, 40.00000);
	CreateDynamicObject(1009, 2115.63818, -1180.58069, 23.08100,   0.00000, 0.00000, -40.00000);
	CreateDynamicObject(1010, 2119.54102, -1178.49902, 23.06220,   0.00000, 0.00000, 0.00000);
	CreateDynamicObject(1034, 2116.17700, -1173.26392, 23.78080,   0.00000, 0.00000, 180.00000);
	CreateDynamicObject(1169, 2114.65649, -1179.17090, 23.36750,   0.00000, 0.00000, 120.00000);

// textdraws below only
Exit

Код:
public OnFilterScriptExit()
{
	DestroyActor(car_dealer);
	Delete3DTextLabel(car_dealer_label);
	DestroyVehicle(car_dealer_car[0]);
	return 1;
}
Actor and label / car
Код:
new car_dealer;
new Text3D:car_dealer_label;
new actor_names [] [] = { "bob", "1", "Darnell" };

new OnCarDelMission[MAX_PLAYERS];

new Text:TDEditor_TD[27];
new car_dealer_car[1];
most function used here:
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    //new on‌mission = GetPVarInt(playerid, "OnCarDelMission"); // car delivery mission pvar
    if(clickedid == TDEditor_TD[16]) // Accept
    {
    	SendClientMessage(playerid, 0xFFFFFFAA, "Find the vehicle in Dilliamore!");
    	
    	/*new engine,lights,alarm,doors,bonnet,boot,objective;
		GetVehicleParamsEx(car_dealer_car[0],engine,lights,alarm,doors,bonnet,boot,objective);
		SetVehicleParamsEx(car_dealer_car[0],1,0,0,1,0,0,1);*/
    	//new car_dealer_car[0] = CreateTempCar(475, 720.9147,-441.7868,16.1391,89.7415, 3, 3, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
    	
    	car_dealer_car[0] = CreateVehicle(475, 720.9147,-441.7868,16.1391,89.7415, 3, 3, -1);
    	MissionHide(playerid);
    	CancelSelectTextDraw(playerid);
    	OnCarDelMission[playerid] = 1;
    	for(new i=0; i < MAX_PLAYERS; i++)
   		{
            if(i == playerid && OnCarDelMission[playerid] == 1) continue;
            SetVehicleParamsForPlayer(car_dealer_car[0],i,1,0);
        }
    }
    if(clickedid == TDEditor_TD[17]) // Decline
    {
         SendClientMessage(playerid, -1, "You declined a mission");
         MissionHide(playerid);
         CancelSelectTextDraw(playerid);
    }
    if(clickedid == TDEditor_TD[26]) // Close
    {
    	CancelSelectTextDraw(playerid);
    	CarMissionCompleteHide(playerid);
    }
    return 1;
}
rest of code

Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    //new on‌mission = GetPVarInt(forplayerid, "OnCarDelMission"); // car delivery mission pvar
	if(vehicleid == car_dealer_car[0])
	{
		if(OnCarDelMission[forplayerid] == 1) //If player is in mission.
		{
  			SetVehicleParamsForPlayer(car_dealer_car[0], forplayerid, 1, 0); //Unlocks the vehicle.
		}
        else
        {
            SetVehicleParamsForPlayer(car_dealer_car[0], forplayerid, 1, 1); //Locks the vehicle.
		}
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
    {
        new vehicleid = GetPlayerVehicleID(playerid);
		if(vehicleid == car_dealer_car[0])
        {
            SendClientMessage(playerid, 0xFFFFFFAA, "Great you have found the vehicle, deliver the vehicle back to Darnell.");
            SetPlayerCheckpoint(playerid, 2120.2507,-1185.5532,24.0585, 4);
            return 1;
		}
    }
    return 1;
}
And few other functions like MissionHide(playerid); - all of them include just show and hide textdraws

Код:
MissionHide(playerid)
{
    TextDrawHideForPlayer(playerid, TDEditor_TD[0]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[1]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[2]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[3]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[4]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[5]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[6]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[7]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[8]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[9]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[10]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[11]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[12]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[13]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[14]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[15]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[16]);
    TextDrawHideForPlayer(playerid, TDEditor_TD[17]);
    return 1;
}



Re: Server Crash on Filterscript unload - Lajko1 - 01.05.2016

Bump