[debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[21:09:01] [debug] Stack pointer (STK) is 0x1E15D8, heap pointer (HEA) is 0x1E159C
[21:09:01] [debug] AMX backtrace:
[21:09:01] [debug] #0 00006c30 in ?? (1155075585, 1153515636, 1093425110, 1156347637, 1157746794, 1093476339) from server.amx
[21:09:01] [debug] #1 00031f78 in public GetEndLocation (0) from server.amx
[21:09:01] [debug] #2 00032020 in public GetEndLocation (0) from server.amx
public GetEndLocation(playerid)
{
//0 - None
//1 - Andro
//2 - AT400
//3 - Shamal
//4 - Dodo
if(TypeFlight[playerid] == 1) //Andromada
{
new Float:DistanceCheck;
new rand = random(sizeof(ALocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", ALocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the cargo goods.", ALocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = ALocations[rand][LocX]; Pos22[playerid] = ALocations[rand][LocY]; Pos32[playerid] = ALocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 2) //at-400
{
new Float:DistanceCheck;
new rand = random(sizeof(ALocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", ALocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passengers.", ALocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = ALocations[rand][LocX]; Pos22[playerid] = ALocations[rand][LocY]; Pos32[playerid] = ALocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 3) //shamal
{
new Float:DistanceCheck;
new rand = random(sizeof(DSLocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", DSLocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passengers.", DSLocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = DSLocations[rand][LocX]; Pos22[playerid] = DSLocations[rand][LocY]; Pos32[playerid] = DSLocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 4) //dodo
{
new Float:DistanceCheck;
new rand = random(sizeof(DSLocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", DSLocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passenger.", DSLocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = DSLocations[rand][LocX]; Pos22[playerid] = DSLocations[rand][LocY]; Pos32[playerid] = DSLocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 5) //nevada - skydivers
{
new Float:DistanceCheck;
new rand = random(sizeof(NLocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],NLocations[rand][LocX],NLocations[rand][LocY],NLocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,NLocations[rand][LocX],NLocations[rand][LocY],NLocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerRaceCheckpoint(playerid, 4, NLocations[rand][LocX], NLocations[rand][LocY], NLocations[rand][LocZ], 0,0,0, 10.0);
//SetPlayerFlightCheckpoint(playerid, NLocations[rand][LocX],NLocations[rand][LocY],NLocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", NLocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the skydivers in mid-air.", NLocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = NLocations[rand][LocX]; Pos22[playerid] = NLocations[rand][LocY]; Pos32[playerid] = NLocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 6) //maverick
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passengers.", HELILocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocations[rand][LocX]; Pos22[playerid] = HELILocations[rand][LocY]; Pos32[playerid] = HELILocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 7) //news maverick
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocatio));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocatio[rand][LocX],HELILocatio[rand][LocY],HELILocatio[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocatio[rand][LocX],HELILocatio[rand][LocY],HELILocatio[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 900)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocatio[rand][LocX],HELILocatio[rand][LocY],HELILocatio[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocatio[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passengers.", HELILocatio[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocatio[rand][LocX]; Pos22[playerid] = HELILocatio[rand][LocY]; Pos32[playerid] = HELILocatio[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 8) //police maverick
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocation));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocation[rand][LocX],HELILocation[rand][LocY],HELILocation[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocation[rand][LocX],HELILocation[rand][LocY],HELILocation[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocation[rand][LocX],HELILocation[rand][LocY],HELILocation[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocation[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and unload Goods.", HELILocation[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocation[rand][LocX]; Pos22[playerid] = HELILocation[rand][LocY]; Pos32[playerid] = HELILocation[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 9) //leviathan
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passenger.", HELILocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocations[rand][LocX]; Pos22[playerid] = HELILocations[rand][LocY]; Pos32[playerid] = HELILocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 10) //seasparrow
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passenger.", HELILocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocations[rand][LocX]; Pos22[playerid] = HELILocations[rand][LocY]; Pos32[playerid] = HELILocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 11) //sparrow
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passenger.", HELILocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocations[rand][LocX]; Pos22[playerid] = HELILocations[rand][LocY]; Pos32[playerid] = HELILocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 12) //Cargobob
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the cargo.", HELILocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocations[rand][LocX]; Pos22[playerid] = HELILocations[rand][LocY]; Pos32[playerid] = HELILocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 13) //raindance
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passenger.", HELILocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocations[rand][LocX]; Pos22[playerid] = HELILocations[rand][LocY]; Pos32[playerid] = HELILocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 14) //hunter
{
new Float:DistanceCheck;
new rand = random(sizeof(HELILocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HELILocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the ammunition.", HELILocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HELILocations[rand][LocX]; Pos22[playerid] = HELILocations[rand][LocY]; Pos32[playerid] = HELILocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 15) //skimmer
{
new Float:DistanceCheck;
new rand = random(sizeof(BOATLocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],BOATLocations[rand][LocX],BOATLocations[rand][LocY],BOATLocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,BOATLocations[rand][LocX],BOATLocations[rand][LocY],BOATLocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerFlightCheckpoint(playerid, BOATLocations[rand][LocX],BOATLocations[rand][LocY],BOATLocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", BOATLocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop off the passenger.", BOATLocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = BOATLocations[rand][LocX]; Pos22[playerid] = BOATLocations[rand][LocY]; Pos32[playerid] = BOATLocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 16) //cropduster
{
new Float:DistanceCheck;
new rand = random(sizeof(CD2Locations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],CD2Locations[rand][LocX],CD2Locations[rand][LocY],CD2Locations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,CD2Locations[rand][LocX],CD2Locations[rand][LocY],CD2Locations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerRaceCheckpoint(playerid, 4, CD2Locations[rand][LocX], CD2Locations[rand][LocY], CD2Locations[rand][LocZ], 0,0,0, 10.0);
//SetPlayerFlightCheckpoint(playerid, CD2Locations[rand][LocX],CD2Locations[rand][LocY],CD2Locations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", CD2Locations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and scatter the seeds onto the farmland.", CD2Locations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = CD2Locations[rand][LocX]; Pos22[playerid] = CD2Locations[rand][LocY]; Pos32[playerid] = CD2Locations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 17) //Beagle
{
new Float:DistanceCheck;
new rand = random(sizeof(CARGOLocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],CARGOLocations[rand][LocX],CARGOLocations[rand][LocY],CARGOLocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,CARGOLocations[rand][LocX],CARGOLocations[rand][LocY],CARGOLocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
SetPlayerRaceCheckpoint(playerid, 4, CARGOLocations[rand][LocX], CARGOLocations[rand][LocY], CARGOLocations[rand][LocZ], 0,0,0, 10.0);
//SetPlayerFlightCheckpoint(playerid, CD2Locations[rand][LocX],CD2Locations[rand][LocY],CD2Locations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", CARGOLocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and drop the cargo.", CARGOLocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = CARGOLocations[rand][LocX]; Pos22[playerid] = CARGOLocations[rand][LocY]; Pos32[playerid] = CARGOLocations[rand][LocZ];
return 1;
}
}
if(TypeFlight[playerid] == 18) //Hydra
{
new Float:DistanceCheck;
new rand = random(sizeof(HYDRALocations));
DistanceCheck = GetDistanceBetweenPoints(Pos1[playerid],Pos2[playerid],Pos3[playerid],HYDRALocations[rand][LocX],HYDRALocations[rand][LocY],HYDRALocations[rand][LocZ]);
WorkPay[playerid] = floatround(DistanceCheck, floatround_round);
new Float:DistanceCheck2;
new Float:P1, Float:P2, Float:P3;
GetPlayerPos(playerid, P1, P2, P3);
DistanceCheck2 = GetDistanceBetweenPoints(P1, P2, P3,HYDRALocations[rand][LocX],HYDRALocations[rand][LocY],HYDRALocations[rand][LocZ]);
DistanceFlown2[playerid] = floatround(DistanceCheck2, floatround_round);
if(WorkPay[playerid] < 3000)
{
GetEndLocation(playerid);
return 1;
}
else
{
new Float:X,Float:Y,Float:Z, szString[128];
GetPlayerPos(playerid, X, Y, Z);
MissionStage[playerid] = 2;
TogglePlayerControllable(playerid, 1); //unfreeze.
new string2[65];
//SetPlayerRaceCheckpoint(playerid, 4, HYDRALocations[rand][LocX], HYDRALocations[rand][LocY], HYDRALocations[rand][LocZ], 0,0,0, 10.0);
SetPlayerFlightCheckpoint(playerid, HYDRALocations[rand][LocX],HYDRALocations[rand][LocY],HYDRALocations[rand][LocZ], 15.0);
format(string2, sizeof(string2), "%s", HYDRALocations[rand][LocationName]); //PASSWORD
strmid(FinalAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
format(szString, 128, "Head to {1B8AE4}%s {FFFFFF}and deliver the warheads.", HYDRALocations[rand][LocationName]);
SendClientMessage(playerid, COLOR_WHITE, szString);
Pos12[playerid] = HYDRALocations[rand][LocX]; Pos22[playerid] = HYDRALocations[rand][LocY]; Pos32[playerid] = HYDRALocations[rand][LocZ];
return 1;
}
}
return 1;
}
if(WorkPay[playerid] < 1000)
{
GetEndLocation(playerid);
return 1;
}
Why you call this function again...this calls it again..and again...and again...and again
...think about..what you are doing there >.< |
I'd say make that function, not call itself, and make it return an error saying to try again, being there's "no jobs".
See if it is that causing the error, or if it's something else. |