Checkpoint won't destroy
#1

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;
}
Reply
#2

Remove the

pawn Код:
if(CPCreated[i] == 0)
check after foreach
Reply
#3

Quote:
Originally Posted by MadeMan
Remove the

pawn Код:
if(CPCreated[i] == 0)
check after foreach
don't work too

The checkpoint is created, but it won't destroy
Reply
#4

Maybe you have to go more far away from the checkpoint?
Reply
#5

I went to san fierro and the cp is in the desert ^.^
and if i do this:

pawn Код:
foreach(Player, i)
    {
      if(CPCreated[i] == 1)
      {
            for(new zone = 0; zone < sizeof(CPLocations); zone++)
            {
                if(InPrototypeVehicle[i] == 0)
                {
                    if(!IsPlayerInRangeOfPoint(i,50.0,CPLocations[zone][0],CPLocations[zone][1],CPLocations[zone][2]))
                    {
                        if(InCP[i] != -1)
                        {
                        DisablePlayerCheckpoint(i);
                        InCP[i] = -1;
                        CPCreated[i] = 0;
                        SendClientMessage(i,_COLOR_RED,"spammtest");
                        }
                    }
                }
            }
        }
    }
its destroy, BUT it spamms, because as test i made sendclientmessage.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)