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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoint help (/showthread.php?tid=258005)



Checkpoint help - Wesley221 - 28.05.2011

Hey guys,

I'm kinda lost with checkpoints.

When you enter a checkpoint, im trying to make to destroy that checkpoint, and make another checkpoint appear at a different place. But now i dont know how to do that, im using Incognito's streamer. Can anyone give me a hand just how to make this?

Thanks!
~Wesley


Re: Checkpoint help - Kush - 28.05.2011

Read: https://sampwiki.blast.hk/wiki/DisablePlayerCheckpoint


Re: Checkpoint help - Wesley221 - 28.05.2011

That doesnt really help..

When i enter a checkpoint, that checkpoint needs to dissapear, and then a new checkpoint have to appear. Then when you enter that checkpoint, you get cash or something.


Re: Checkpoint help - Jay. - 28.05.2011

You can't have more than 1 checkpoint, you will have to use a streamer. or if you meant race checkpoints, use them.


Re: Checkpoint help - Wesley221 - 28.05.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
But now i dont know how to do that, im using Incognito's streamer.
I know i need a streamer.. I just dont know how to use it; thats why i ask in here


Re: Checkpoint help - sim_sima - 28.05.2011

Quote:
Originally Posted by Kush
Посмотреть сообщение
Not really helping to his question...


Re: Checkpoint help - Wesley221 - 29.05.2011

Quote:
Originally Posted by sim_sima
Посмотреть сообщение
Not really helping to his question...
Thats what i said aswell... Anyone could give me a little help with this?


Re: Checkpoint help - Ash. - 29.05.2011

You will only have 1 checkpoint visible?

ie:
pawn Код:
public OnPlayerSpawn(playerid) //Example
{
     SetPlayerCheckpoint(...); //First checkpoint
}

public OnPlayerEnterCheckpoint(playerid)
{
    DisablePlayerCheckpoint(playerid); //Disable the first checkpoint
    SetPlayerCheckpoint(...); //Second checkpoint
}



Re: Checkpoint help - Wesley221 - 29.05.2011

Then if you would go in the first, it destroys that one and let a new one appear; then if you enter the new one, it destroys and create a new checkpoint at the same position?

EDIT:
I've tried this:
pawn Код:
TCP[1] = CreateDynamicCP(1,2,3,5,-1,-1,playerid,1000);
            TogglePlayerDynamicCP(playerid, TCP[1], 1);
But that didnt show a checkpoint at all

EDIT of EDIT:
I've changed the range now, and it does display now.. (dumb me :S)
But now, when i go to the first checkpoint (TCP[1]), and enter it with vehicle, or outside a vehicle; it doesnt show up the next checkpoint

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == TCP[1])
    {
        TCP[2] = CreateDynamicCP(2562.2910,-2412.1013,13.6345,5,-1,-1,playerid,10000);
        TogglePlayerDynamicCP(playerid, TCP[2], 1);
        DestroyDynamicCP(TCP[1]);
        SendClientMessage(playerid, COLOR_GREEN,"You entered the checkpoint!!");
        return 1;
    }
   
    if(checkpointid == TCP[2])
    {
   
        SendClientMessage(playerid, COLOR_GREEN,"You delivered your goods, and got $5000!");
        GivePlayerMoney(playerid, 5000);
        return 1;
    }
    return 1;
}
Another edit... lol

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == TCP[1])
    {
        TCP[2] = CreateDynamicCP(2562.2910,-2412.1013,13.6345,5,-1,-1,playerid,10000);
        TogglePlayerDynamicCP(playerid, TCP[1], 0);
        TogglePlayerDynamicCP(playerid, TCP[2], 1);
        SendClientMessage(playerid, COLOR_GREEN,"You entered the checkpoint!!");
        return 1;
    }
   
    if(checkpointid == TCP[2])
    {
   
        SendClientMessage(playerid, COLOR_GREEN,"You delivered your goods, and got $5000!");
        GivePlayerMoney(playerid, 5000);
        TogglePlayerDynamicCP(playerid, TCP[1], 0);
        TogglePlayerDynamicCP(playerid, TCP[2], 0);
        return 1;
    }
    return 1;
}
I've made it like this now, and when im alone, i can enter the first checkpoint and then the second will appear. But now when im with 2 players, and we both do the same 'mission', then he can enter the checkpoint & let the other one appear, but when i go in it; the other one DOESNT appear..

He enter checkpoint > CP1 dissapears, CP2 appears
Me enter checkpoint > CP1 doesnt dissapear, CP2 doesnt appear

What to do? :$


Re: Checkpoint help - Wesley221 - 31.05.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Then if you would go in the first, it destroys that one and let a new one appear; then if you enter the new one, it destroys and create a new checkpoint at the same position?

EDIT:
I've tried this:
pawn Код:
TCP[1] = CreateDynamicCP(1,2,3,5,-1,-1,playerid,1000);
            TogglePlayerDynamicCP(playerid, TCP[1], 1);
But that didnt show a checkpoint at all

EDIT of EDIT:
I've changed the range now, and it does display now.. (dumb me :S)
But now, when i go to the first checkpoint (TCP[1]), and enter it with vehicle, or outside a vehicle; it doesnt show up the next checkpoint

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == TCP[1])
    {
        TCP[2] = CreateDynamicCP(2562.2910,-2412.1013,13.6345,5,-1,-1,playerid,10000);
        TogglePlayerDynamicCP(playerid, TCP[2], 1);
        DestroyDynamicCP(TCP[1]);
        SendClientMessage(playerid, COLOR_GREEN,"You entered the checkpoint!!");
        return 1;
    }
   
    if(checkpointid == TCP[2])
    {
   
        SendClientMessage(playerid, COLOR_GREEN,"You delivered your goods, and got $5000!");
        GivePlayerMoney(playerid, 5000);
        return 1;
    }
    return 1;
}
Another edit... lol

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == TCP[1])
    {
        TCP[2] = CreateDynamicCP(2562.2910,-2412.1013,13.6345,5,-1,-1,playerid,10000);
        TogglePlayerDynamicCP(playerid, TCP[1], 0);
        TogglePlayerDynamicCP(playerid, TCP[2], 1);
        SendClientMessage(playerid, COLOR_GREEN,"You entered the checkpoint!!");
        return 1;
    }
   
    if(checkpointid == TCP[2])
    {
   
        SendClientMessage(playerid, COLOR_GREEN,"You delivered your goods, and got $5000!");
        GivePlayerMoney(playerid, 5000);
        TogglePlayerDynamicCP(playerid, TCP[1], 0);
        TogglePlayerDynamicCP(playerid, TCP[2], 0);
        return 1;
    }
    return 1;
}
I've made it like this now, and when im alone, i can enter the first checkpoint and then the second will appear. But now when im with 2 players, and we both do the same 'mission', then he can enter the checkpoint & let the other one appear, but when i go in it; the other one DOESNT appear..

He enter checkpoint > CP1 dissapears, CP2 appears
Me enter checkpoint > CP1 doesnt dissapear, CP2 doesnt appear

What to do? :$
Still no-one knows what's wrong here?