SA-MP Forums Archive
Checkpoint help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Checkpoint help (/showthread.php?tid=419728)



Checkpoint help - Gaurav_Rawat - 02.03.2013

When i enter first CP the next cp doesn't appear..
Mind telling me why..maybe i made mistake :/

PHP Code:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
CPP[playerid] == 1// Drivers License Test
    
{
        if(
IsPlayerInRangeOfPoint(playerid,5,-2047.0905,-78.3515,34.9040)) // Checkpoint 1
        
{
        
              
SetPlayerCheckpoint(playerid,-2498.0962,-45.2208,25.3028,5);
        }
        else if(
IsPlayerInRangeOfPoint(playerid,5,-2498.0962,-45.2208,25.3028)) // Checkpoint 2
        
{
            
SetPlayerCheckpoint(playerid,-2708.8442,-57.1813,3.9125,5);
        }
        else if(
IsPlayerInRangeOfPoint(playerid,5,-2708.8442,-57.1813,3.9125)) // Checkpoint 3
        
{
            
SetPlayerCheckpoint(playerid,-2790.4324,-213.4636,6.7723,5);
        }
        else if(
IsPlayerInRangeOfPoint(playerid,5,-2790.4324,-213.4636,6.7723)) // Checkpoint 4
        
{
            
SetPlayerCheckpoint(playerid,-2263.2546,-90.4397,34.9045,5);
        }
        else if(
IsPlayerInRangeOfPoint(playerid,5,-2263.2546,-90.4397,34.9045)) // Checkpoint 5
        
{
            
SetPlayerCheckpoint(playerid,-2152.2449,-73.2008,34.9064,5);
        }
        else if(
IsPlayerInRangeOfPoint(playerid,5,-2152.2449,-73.2008,34.9064)) // Checkpoint 6
        
{
            
SetPlayerCheckpoint(playerid,-2067.7107,-97.8147,34.9002,5);
        } 



Re: Checkpoint help - =WoR=Varth - 02.03.2013

First, try to increase the range inside IsPlayerInRangeOfPoint (And check for the first coordinate whether it's right or not).


Re: Checkpoint help - Gaurav_Rawat - 02.03.2013

the first checkpoint arrives..then
Nothing D:


Re: Checkpoint help - JaKe Elite - 03.03.2013

First off all, Do you make sure you exactly in the position in order to appear the other checkpoints?


Re: Checkpoint help - Gaurav_Rawat - 03.03.2013

Yes i do..
The first Cp appears..but then no CP..


Re: Checkpoint help - L.Hudson - 03.03.2013

Try disabling the CPs you passed

pawn Code:
if(CPP[playerid] == 1) // Drivers License Test
    {
        if(IsPlayerInRangeOfPoint(playerid,5,-2047.0905,-78.3515,34.9040)) // Checkpoint 1
        {
              DisablePlayerCheckPoint(playerid);
              SetPlayerCheckpoint(playerid,-2498.0962,-45.2208,25.3028,5);
        }
        else if(IsPlayerInRangeOfPoint(playerid,5,-2498.0962,-45.2208,25.3028)) // Checkpoint 2
        {
            DisablePlayerCheckPoint(playerid);
            SetPlayerCheckpoint(playerid,-2708.8442,-57.1813,3.9125,5);
        }
        else if(IsPlayerInRangeOfPoint(playerid,5,-2708.8442,-57.1813,3.9125)) // Checkpoint 3
        {
            DisablePlayerCheckPoint(playerid);
            SetPlayerCheckpoint(playerid,-2790.4324,-213.4636,6.7723,5);
        }
        else if(IsPlayerInRangeOfPoint(playerid,5,-2790.4324,-213.4636,6.7723)) // Checkpoint 4
        {
            DisablePlayerCheckPoint(playerid);
            SetPlayerCheckpoint(playerid,-2263.2546,-90.4397,34.9045,5);
        }
        else if(IsPlayerInRangeOfPoint(playerid,5,-2263.2546,-90.4397,34.9045)) // Checkpoint 5
        {
            DisablePlayerCheckPoint(playerid);
            SetPlayerCheckpoint(playerid,-2152.2449,-73.2008,34.9064,5);
        }
        else if(IsPlayerInRangeOfPoint(playerid,5,-2152.2449,-73.2008,34.9064)) // Checkpoint 6
        {
            DisablePlayerCheckPoint(playerid);
            SetPlayerCheckpoint(playerid,-2067.7107,-97.8147,34.9002,5);
        }



Re: Checkpoint help - Gaurav_Rawat - 03.03.2013

@L.Hudson - I don't see the point there :/
Coz the only point i can see is
PHP Code:
        if(IsPlayerInRangeOfPoint(playerid,5,-2047.0905,-78.3515,34.9040)) // Checkpoint 1 



Re: Checkpoint help - L.Hudson - 03.03.2013

I also had this problem in the past... Try disabling the checkpoints... If you have already tried try making a value for each CheckPoints like new cp1[playerid]... etc


Re: Checkpoint help - Gaurav_Rawat - 04.03.2013

Imma try
CP1 ..CP2 one


Re: Checkpoint help - Threshold - 04.03.2013

DynamicCheckpoints would be easier because it handles checkpointids...
https://sampforum.blast.hk/showthread.php?tid=102865