Checkpoints
#5

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:

pawn Код:
//at the top of ur script
new CheckPoint[MAX_PLAYERS];

enum
{
cp1,
cp2,
cp3,
cp4,
//and so on...
}
Now you have to create the cp's:
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
}
hope that helps.
Reply


Messages In This Thread
Checkpoints - by Darien - 25.02.2011, 15:51
Re: Checkpoints - by BlackWolf120 - 25.02.2011, 15:56
Re: Checkpoints - by Darien - 25.02.2011, 16:04
Re: Checkpoints - by Mean - 25.02.2011, 19:33
Re: Checkpoints - by BlackWolf120 - 25.02.2011, 20:28
Re: Checkpoints - by Darien - 26.02.2011, 14:45
Re: Checkpoints - by MP2 - 26.02.2011, 15:28
Re: Checkpoints - by Darien - 26.02.2011, 17:13

Forum Jump:


Users browsing this thread: 3 Guest(s)