[Tutorial] Creating checkpoint(s) for beginners.
#1

Hello.
This is my first tutorial.
------------------------------------------------------------------------------------------------------------------
I would like to create this for the newbies out there (like me), because I was originally having
issues with creating multiple checkpoints.
__________________________________________________ __________________________________________________

Let's start out by downloading Incognito's Streamer Plugin (which we will use for the checkpoints duh)

Next at the very top of your script add:
pawn Code:
#include <streamer>
This is just telling the script to use this streamer.


Now onto creating the checkpoint.

First add
pawn Code:
new Checkpoint [MAX_PLAYERS];
So you can later identify multiple checkpoints


Next you will have to get your cords for your actual checkpoint.
Go to the position you want your checkpoint ingame, and use /save.
Go to your documents and you will find savedpositions.txt, open
that up and find your saved coordinates.

Here are mine:
AddPlayerClass(179,-1392.8824,2641.5508,55.9545,272.0198,0,0,0,0,0,0); //

Now you will want to copy the first 6 numbers you see. (as bold above)

Now FINALLY, we will define the actual checkpoint.


Under "OnPlayerSpawn", add this:
pawn Code:
Checkpoint[0] = CreateDynamicCP(-1392.8824,2641.5508,55.9545, 2, -1, -1, -1, 100);
This is the syntax:
pawn Code:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1,Float:distance = 100.0);
Put the 2nd to first six numbers for float, float:y, and float:z.

You have created the checkpoint, but it is not assigned to anything. So if you enter it nothing will happen.

pawn Code:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[0]) //This checks what checkpoint it is before it continues
    {
        GameTextForPlayer(playerid, "You have entered this checkpoint", 4000, 5); //It will show this if a player steps in the checkpoint
    }
}
So there you go! The most basic tutorial about checkpoints.
Reply


Messages In This Thread
Creating checkpoint(s) for beginners. - by AgentBacon - 11.10.2011, 05:50
Re: Creating checkpoint(s) for beginners. - by [HiC]TheKiller - 11.10.2011, 06:01
Re: Creating checkpoint(s) for beginners. - by FireCat - 11.10.2011, 06:53
Re: Creating checkpoint(s) for beginners. - by Wesley221 - 11.10.2011, 06:54
Re: Creating checkpoint(s) for beginners. - by Mr.Dexter - 31.03.2013, 16:25
Re: Creating checkpoint(s) for beginners. - by iHaze. - 03.04.2013, 00:32
Re: Creating checkpoint(s) for beginners. - by Sixx - 03.04.2013, 13:45

Forum Jump:


Users browsing this thread: 1 Guest(s)