25.02.2011, 20:28
i think he wants to create a kind of race?
So he should use RaceCheckpoints?
But if u want to use playercp's itd look like this:
u have to store all cp id's in an enum first:
Now you have to create the cp's:
hope that helps.
So he should use RaceCheckpoints?
But if u want to use playercp's itd look like this:
u have to store all cp id's in an enum first:
pawn Код:
//at the top of ur script
new CheckPoint[MAX_PLAYERS];
enum
{
cp1,
cp2,
cp3,
cp4,
//and so on...
}
pawn Код:
//first a stock function to create the cp with ur wanted id's
stock SetPlayerCheckpointForAll(ID, playerid, Float:x, Float:y, Float:z, Float:size) // Creating a new function that includes an ID parameter
{
CheckPoint[playerid] = ID;
SetPlayerCheckpoint(playerid, x, y, z, size);
}
//now create the cp:
SetCheckpointForAll(cp1,681.3374,-463.3429,22.5705,2.0);//cp1
//now under the callback OnPlayerEnterCheckpoint u can set the action that shall be executed as soon as a player enters a specific cp.
public OnPlayerEnterCheckpoint(playerid)
{
//checkpointselect
switch(CheckPoint[playerid])
{
case cp1:
{
//function for the first cp.
e.g. u can disable the first cp with DisableCheckpointForAll();
and create the second one
SetCheckpointForAll(cp2,681.3374,-463.3429,22.5705,2.0);//cp2
}
case cp2:
{
//function for cp 2
}
case cp3:
{
//for cp 3
}
