11.10.2011, 05:50
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:
This is just telling the script to use this streamer.
Now onto creating the checkpoint.
First add
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:
This is the syntax:
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.
So there you go! The most basic tutorial about checkpoints.
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>
Now onto creating the checkpoint.
First add
pawn Code:
new Checkpoint [MAX_PLAYERS];
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);
pawn Code:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1,Float:distance = 100.0);
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
}
}