SA-MP Forums Archive
CrashDetect - FarmStart - 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: CrashDetect - FarmStart (/showthread.php?tid=607360)



CrashDetect - FarmStart - Nin9r - 18.05.2016

My server was restarting and i received this in server_logs.txt:

Код HTML:
18:44:04] [debug] Server crashed while executing gm.amx
[18:44:04] [debug] AMX backtrace:
[18:44:04] [debug] #0 00000004 in public FarmStart (playerid=16) at <unknown file>:0
[18:44:04] [debug] Native backtrace:
[18:44:04] [debug] #0 f7418e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[18:44:04] [debug] #1 f7411bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[18:44:04] [debug] #2 f7412dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[18:44:04] [debug] #3 f7413226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[18:44:04] [debug] #4 f7418adc in ?? () from plugins/crashdetect.so
[18:44:04] [debug] #5 f7706410 in ?? ()
FarmStart Callback:

Код HTML:
forward FarmStart(playerid);
public FarmStart(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 200.0, jobVariables[6][jJobPosition][0], jobVariables[6][jJobPosition][1], jobVariables[6][jJobPosition][2]))
		{
		new car = GetPlayerVehicleID(playerid);

		if(PlayerData[playerid][pJob] == 1)
		{
		new Speed = GetVehicleSpeed(car);
		if(Speed > 24) //&& GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		{

				if(PlayerData[playerid][pCarID5] == car)
				{
						if(!IsPlayerPaused(playerid))
						{
								if(FarmMoney[playerid] >= 1)
								{
										FarmMoney[playerid] --;
										format(string128, sizeof(string128), "~w~Walk: ~y~ %d ~w~seconds...", FarmMoney[playerid]);
										TextDrawShowForPlayer(playerid, CPDT[playerid]);
										TextDrawSetString(CPDT[playerid], string128);
										if(FarmMoney[playerid] == 2)
										{
												FarmMoney[playerid] = 60;
												new cash = random(10000) + 30000;
												FarmMoneyF[playerid] = cash;
		        								KillTimer(farmtimer[playerid]);
		        								CP[playerid] = 394;
		        								TextDrawHideForPlayer(playerid,CPDT[playerid]);
		        								SetPlayerCheckpoint(playerid,businessVariables[28][bExteriorPos][0],businessVariables[28][bExteriorPos][1],businessVariables[28][bExteriorPos][2],4.0);
//												new Float: fDistance = GetPlayerDistanceFromPoint(playerid, businessVariables[28][bExteriorPos][0],businessVariables[28][bExteriorPos][1],businessVariables[28][bExteriorPos][2]);
    				 							distantax[playerid] = businessVariables[6][bExteriorPos][0];
                								distantay[playerid] = businessVariables[6][bExteriorPos][1];
                								GPSCurs[playerid] = 1;
												UpdateTimer[playerid] = SetTimerEx("distance_timerr", 750, true, "i", playerid);
										}
								}
							}
						}
				}
			}
		}
	return 1;
}
Help please?


Re: CrashDetect - FarmStart - Saliim - 18.05.2016

Hello, your TIMER is small, increase the TIMER.
Too small timer causes a restart


Re: CrashDetect - FarmStart - Nin9r - 18.05.2016

I am using "UpdateTimer[playerid] = SetTimerEx("distance_timerr", 750, true, "i", playerid);
}" in more commands and it works. Why?


Re: CrashDetect - FarmStart - Jefff - 18.05.2016

You are using KillTimer(UpdateTimer[playerid]); somewhere?


Re: CrashDetect - FarmStart - Nin9r - 19.05.2016

Sure. At OnPlayerDisconnect and in some commands like :killcp.


Re: CrashDetect - FarmStart - Saliim - 19.05.2016

Hi, edit that
Код:
UpdateTimer[playerid] = SetTimerEx("distance_timerr", 750, true, "i", playerid);
to
Код:
UpdateTimer[playerid] = SetTimerEx("distance_timerr", 1000, false, "i", playerid);
and test if he restart again


Re: CrashDetect - FarmStart - Nin9r - 19.05.2016

Are you sure about that ? Is it the problem for restarting even if i am using it on any commands and then the server doesn't restarting?


Re: CrashDetect - FarmStart - Saliim - 19.05.2016

for me the problem is too small timer, I already experience the problem. Then think about a check the WIKI
https://sampwiki.blast.hk/wiki/SetTimerEx


Re: CrashDetect - FarmStart - Nin9r - 19.05.2016

Ok. I will try. Thanks


Re: CrashDetect - FarmStart - Saliim - 19.05.2016

no problem