01.04.2010, 16:20
i have a problem, i dont know why the checkpoint wont destroy
pawn Код:
forward CPCheck();
public CPCheck()
{
//Creates CP
foreach(Player, i)
{
if(CPCreated[i] == 0)
{
for(new zone = 0; zone < sizeof(CPLocations); zone++)
{
if(IsPlayerInRangeOfPoint(i,50.0,CPLocations[zone][0],CPLocations[zone][1],CPLocations[zone][2]) && CPCreated[i] == 0)
{
if(InPrototypeVehicle[i] == 0)
{
if(InCP[i] == -1)
{
if(CPCreated[i] == 0)
{
SetPlayerCheckpoint(i,CPLocations[zone][0],CPLocations[zone][1],CPLocations[zone][2],3.0);
InCP[i] = zone;
CPCreated[i] = 1;
}
}
}
}
//Destroys the CP
if(!IsPlayerInRangeOfPoint(i,50.0,CPLocations[zone][0],CPLocations[zone][1],CPLocations[zone][2]) && CPCreated[i] == 1)
{
DisablePlayerCheckpoint(i);
InCP[i] = -1;
CPCreated[i] = 0;
}
}
}
}
return 1;
}