Pizzaboy Job Crash the server
#1

Hello i have added CMD For Pizza job But when i go to Get Pizza (/getpizza) The server get crash

All what i just added is

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

	new rand = random(MAX_HOUSES - 1);
	while(!(HouseInfo[rand][hExteriorZ] <= 100 && HouseInfo[rand][hExteriorX] > -2802.389648 && HouseInfo[rand][hExteriorX] < -1523.710327 && HouseInfo[rand][hExteriorY] < 1334.343750 && HouseInfo[rand][hExteriorY] > -216.298019))
	{
	    rand++;
	    if(rand == 1400) {
	    	rand = 1;
		}
	}
	SetPVarInt(playerid, "tpPizzaTimer", floatround((GetPizzaDistance(rand) / 80), floatround_round));
	SetPVarInt(playerid, "pizzaTotal", floatround((GetPizzaDistance(rand) / 10), floatround_round));
	SetPVarInt(playerid, "pizzaTimer", GetPVarInt(playerid, "pizzaTotal"));
 	SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPPIZZARUNTIMER);
 	SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_PIZZATIMER);
	new szMessage[128];
	format(szMessage, sizeof(szMessage), "You have picked up a pizza for %s. You have %d seconds to deliver it!", HouseInfo[rand][hOwner], GetPVarInt(playerid, "pizzaTotal"));
	SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
	SetPVarInt(playerid, "Pizza", rand);
	PizzaBar[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
	SetProgressBarValue(PizzaBar[playerid], 100.0);
	ShowProgressBarForPlayer(playerid, PizzaBar[playerid]);
	SetPlayerCheckpoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
	return 1;
}
Quote:

Float:GetPizzaDistance(houseid)
{
new Float: pDistance;
pDistance = GetDistance(-1713.961425, 1348.545166, 7.180452, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]);
return pDistance;
}

Reply


Messages In This Thread
Pizzaboy Job Crash the server - by Antonioh - 08.01.2013, 21:13
Re: Pizzaboy Job Crash the server - by RedCrossER - 08.01.2013, 21:16
Re: Pizzaboy Job Crash the server - by Antonioh - 08.01.2013, 21:17
Re: Pizzaboy Job Crash the server - by Antonioh - 09.01.2013, 10:44
Re: Pizzaboy Job Crash the server - by denNorske - 09.01.2013, 10:57
Re: Pizzaboy Job Crash the server - by Antonioh - 09.01.2013, 11:04
Re: Pizzaboy Job Crash the server - by Konstantinos - 09.01.2013, 11:06
Re: Pizzaboy Job Crash the server - by niconhan - 09.01.2013, 11:14
Re: Pizzaboy Job Crash the server - by denNorske - 09.01.2013, 11:18
Re: Pizzaboy Job Crash the server - by Antonioh - 09.01.2013, 12:24

Forum Jump:


Users browsing this thread: 2 Guest(s)