SA-MP Forums Archive
Server Crashes after typing cmd:getpizza - 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 Crashes after typing cmd:getpizza (/showthread.php?tid=488015)



Server Crashes after typing cmd:getpizza - Gregory00 - 16.01.2014

As title says..My server crashes when someone types /getpizza (It has "Range Of Point") ...

Here is the CMD:

Код:
CMD:getpizza(playerid, params[]) {
	if(PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21) {
		SendClientMessageEx(playerid,COLOR_GREY,"   You are not a Pizza Boy!");
	}
    else if(!IsAPizzaCar(GetPlayerVehicleID(playerid))) {
	    SendClientMessageEx(playerid,COLOR_GREY,"   You need to be driving a pizzaboy found at the side of the Pizza Stack!");
	}
	else if(GetPlayerSkin(playerid) != 155) {
	    SendClientMessageEx(playerid,COLOR_GREY,"   You need to be in the Pizza Stack uniform!");
	}
	else if(GetPVarType(playerid, "Pizza")) {
		SendClientMessageEx(playerid, COLOR_GREY, "   You are already delivering pizzas!");
	}
	else if(!IsPlayerInRangeOfPoint(playerid, 3.0, -1713.961425, 1348.545166, 7.180452)) {
		SendClientMessageEx(playerid,COLOR_GREY,"   You are not at the Pizza Stack pickup!");
	}
	else {

		new rand = random(MAX_HOUSES - 1);
		while(!(HouseInfo[rand][hOwned] && HouseInfo[rand][hExteriorZ] <= 100 && HouseInfo[rand][hExteriorX] > -2802.389648 && HouseInfo[rand][hExteriorX] < -1400.710327 && HouseInfo[rand][hExteriorY] < 2800 && HouseInfo[rand][hExteriorY] > -216.298019)) {
			if(++rand >= MAX_HOUSES) {
				rand = 0;
			}
		}

		new
			iDist = floatround(GetPlayerDistanceFromPoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ])),
			szMessage[86];

		SetPVarInt(playerid, "tpPizzaTimer", iDist / 80);
		SetPVarInt(playerid, "pizzaTotal", iDist / 10);
		SetPVarInt(playerid, "pizzaTimer", iDist / 10);
		SetPVarInt(playerid, "Pizza", rand);

		SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPPIZZARUNTIMER);
		SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_PIZZATIMER);

		format(szMessage, sizeof(szMessage), "You have picked up a pizza for %s. You have %d seconds to deliver it!", HouseInfo[rand][hOwner], iDist / 10);
		SendClientMessageEx(playerid, COLOR_WHITE, szMessage);

		SetPlayerCheckpoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
	}
	return 1;
}



Re: Server Crashes after typing cmd:getpizza - Gregory00 - 16.01.2014

someone?


Re: Server Crashes after typing cmd:getpizza - iPrivate - 16.01.2014

Remove bracket before the return 1;


Re: Server Crashes after typing cmd:getpizza - KhaledElkhourashi - 16.01.2014

Then you need Humburger better XD


Re: Server Crashes after typing cmd:getpizza - Blademaster680 - 16.01.2014

I think it has to many closing brackets. Try removing the one above "return 1;" and see if that helps.


Re: Server Crashes after typing cmd:getpizza - Konstantinos - 16.01.2014

Load crashdetect plugin: https://github.com/Zeex/samp-plugin-...ases/tag/v4.13
Compile with debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

Re-compile your scripts, start the server, use /getpizza command and if the server crashes again, then you'll need to post what it printed in the server log.

Quote:
Originally Posted by iPrivate
Посмотреть сообщение
Remove bracket before the return 1;
Quote:
Originally Posted by Blademaster680
Посмотреть сообщение
I think it has to many closing brackets. Try removing the one above "return 1;" and see if that helps.
COUNT! 9 opened and 9 closed brackets..