stock IsPlayerInRobberyCheckpoint(playerid)
{
for(new i=0; i < sizeof(RobberyCPS); i++)
{
if(IsPlayerInDynamicCP(playerid, RobberyCPS[i]))
{
return 1;
}
}
return 0;
}
new Float:RobberyCPS[14][3] = //ROBBERY LEVEL 1
{
{312.1780,-165.7560,999.6010},
{162.6582,-83.7168,1001.8047},
{-22.0830,-55.0324,1003.5469},
{206.1702,-100.3265,1005.2578},
{374.6855,-119.1805,1001.4995},
{412.1748,-17.7801,1001.8047},
{-202.8483,-40.6346,1002.2734},
{202.9123,-43.7781,1001.8047},
{369.3495,-6.0167,1001.8516},
{376.3930,-67.6462,1001.5151},
{410.8336,-52.6126,1001.8984},
{206.3587,-129.1778,1003.5078},
{204.1029,-159.6707,1000.5234},
{206.6491,-8.2347,1001.2109}
};
IsPlayerInDynamicCP(playerid, checkpointid) { /* code */ }
new RobberyCheckpoints[14];
for(...) // for loop
{
RobberyCheckpoints[i] = CreateDynamicCheckpoint(RobberyCPs[i][0], RobberyCPs[i][1], RobberyCPs[i][2]...);
}
RobberyCheckpoints[...]
stock IsPlayerInRobberyCheckpoint(playerid)
{
for(new i=0; i < sizeof(RobberyCPS); i++)
{
if(IsPlayerInDynamicCP(playerid, RobberyCheckpoints[i]))
{
return 1;
}
}
return 0;
}
The IsPlayerInDynamicCP function is looking for a checkpointid value, not the location of the checkpoint.
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|
stock IsPlayerInRobberyCheckpoint(playerid)
{
if(IsPlayerInDynamicCP(playerid, sizeof(RobberyCPS)))
{
return 1;
}
return 0;
}
RobberyCheckpoints[i] = CreateDynamicCheckpoint(RobberyCPs[i][0], RobberyCPs[i][1], RobberyCPs[i][2]...);
Yeah that's not correct.
Where do you actually create the dynamic checkpoints? You must have code similar to this: pawn Код:
Just in case it looks confusing, RobberyCheckpoints does not refer to the array of floats you have (RobberyCPs). |