Server Problem when entering Cp
#1

When i Enter cp to Load Passenger my server freezes

here is the errors i saw in crashdetect

PHP код:
[debugRun time error 3"Stack/heap collision (insufficient stack size)"
[21:09:01] [debug]  Stack pointer (STKis 0x1E15D8heap pointer (HEAis 0x1E159C
[21:09:01] [debugAMX 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 
Reply
#2

show us public GetEndLocation
Reply
#3

Quote:
Originally Posted by Younes44
Посмотреть сообщение
show us public GetEndLocation
here u go
PHP код:
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"ALocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the cargo goods."ALocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,ALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridALocations[rand][LocX],ALocations[rand][LocY],ALocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"ALocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passengers."ALocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridDSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"DSLocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passengers."DSLocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridDSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"DSLocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passenger."DSLocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,NLocations[rand][LocX],NLocations[rand][LocY],NLocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerRaceCheckpoint(playerid4NLocations[rand][LocX], NLocations[rand][LocY], NLocations[rand][LocZ], 0,0,010.0);
            
//SetPlayerFlightCheckpoint(playerid, NLocations[rand][LocX],NLocations[rand][LocY],NLocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"NLocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the skydivers in mid-air."NLocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passengers."HELILocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocatio[rand][LocX],HELILocatio[rand][LocY],HELILocatio[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 900)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocatio[rand][LocX],HELILocatio[rand][LocY],HELILocatio[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocatio[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passengers."HELILocatio[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocation[rand][LocX],HELILocation[rand][LocY],HELILocation[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocation[rand][LocX],HELILocation[rand][LocY],HELILocation[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocation[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and unload Goods."HELILocation[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passenger."HELILocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passenger."HELILocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passenger."HELILocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the cargo."HELILocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passenger."HELILocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridHELILocations[rand][LocX],HELILocations[rand][LocY],HELILocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HELILocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the ammunition."HELILocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,BOATLocations[rand][LocX],BOATLocations[rand][LocY],BOATLocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerFlightCheckpoint(playeridBOATLocations[rand][LocX],BOATLocations[rand][LocY],BOATLocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"BOATLocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop off the passenger."BOATLocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,CD2Locations[rand][LocX],CD2Locations[rand][LocY],CD2Locations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerRaceCheckpoint(playerid4CD2Locations[rand][LocX], CD2Locations[rand][LocY], CD2Locations[rand][LocZ], 0,0,010.0);
            
//SetPlayerFlightCheckpoint(playerid, CD2Locations[rand][LocX],CD2Locations[rand][LocY],CD2Locations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"CD2Locations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and scatter the seeds onto the farmland."CD2Locations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,CARGOLocations[rand][LocX],CARGOLocations[rand][LocY],CARGOLocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 1000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
SetPlayerRaceCheckpoint(playerid4CARGOLocations[rand][LocX], CARGOLocations[rand][LocY], CARGOLocations[rand][LocZ], 0,0,010.0);
            
//SetPlayerFlightCheckpoint(playerid, CD2Locations[rand][LocX],CD2Locations[rand][LocY],CD2Locations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"CARGOLocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and drop the cargo."CARGOLocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
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(DistanceCheckfloatround_round);
        new 
Float:DistanceCheck2;
        new 
Float:P1Float:P2Float:P3;
        
GetPlayerPos(playeridP1P2P3);
        
DistanceCheck2 GetDistanceBetweenPoints(P1P2P3,HYDRALocations[rand][LocX],HYDRALocations[rand][LocY],HYDRALocations[rand][LocZ]);
        
DistanceFlown2[playerid] = floatround(DistanceCheck2floatround_round);
        if(
WorkPay[playerid] < 3000)
        {
            
GetEndLocation(playerid);
            return 
1;
        }
        else
        {
              new 
Float:X,Float:Y,Float:ZszString[128];
               
GetPlayerPos(playeridXYZ);
            
MissionStage[playerid] = 2;
            
TogglePlayerControllable(playerid1); //unfreeze.
            
new string2[65];
            
//SetPlayerRaceCheckpoint(playerid, 4, HYDRALocations[rand][LocX], HYDRALocations[rand][LocY], HYDRALocations[rand][LocZ], 0,0,0, 10.0);
            
SetPlayerFlightCheckpoint(playeridHYDRALocations[rand][LocX],HYDRALocations[rand][LocY],HYDRALocations[rand][LocZ], 15.0);
            
format(string2sizeof(string2), "%s"HYDRALocations[rand][LocationName]); //PASSWORD
            
strmid(FinalAPName[playerid], string20strlen(string2), 128); //PASSWORD
            
format(szString128"Head to {1B8AE4}%s {FFFFFF}and deliver the warheads."HYDRALocations[rand][LocationName]);
            
SendClientMessage(playeridCOLOR_WHITEszString);
            
Pos12[playerid] = HYDRALocations[rand][LocX]; Pos22[playerid] = HYDRALocations[rand][LocY]; Pos32[playerid] = HYDRALocations[rand][LocZ];
            return 
1;
        }
    }
    return 
1;

Reply
#4

You do an infinite recursion

Look for example at this:

PHP код:
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 >.<
Reply
#5

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Why you call this function again...this calls it again..and again...and again...and again

...think about..what you are doing there >.<
What I think he was intending was to make sure that the job delivery isn't close. Something like it will find a destination, check the distance, then reallocate a destination due to it being too short.
Reply
#6

inorder to prevent short loading i am using it
Reply
#7

is there any problem related to this in connection with many string functions?
my gm has many strings
Reply
#8

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.
Reply
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
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.
Not working that idea still giving errors is there any other idea ?
Reply
#10

can u guys give me a example plz ??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)