01.09.2009, 11:31
pawn Код:
// TOP
#define CPCOUNT 5 // change this if you need more CP's
#define CP_SIZE 8.0 // CP size
#define CP_RANGE 50.0 // view distance
new CPID[CPCOUNT]; // this stores the CP id's
new Float:CPData[CPCOUNT][3] =
{
{0.0, 0.0, 0.0}, // add X, Y and Z coordinates
{10.0, 10.0, 10.0},
{20.0, 20.0, 20.0},
{30.0, 30.0, 30.0},
{40.0, 40.0, 40.0} // no comma needed here
}; // and this stores the CP positions (X Y Z)
// OnGameModeInit()
for (new i = 0; i < CPCOUNT; i++)
{
CPID[i] = SetStreamCheckpoint(CPData[i][0], CPData[i][1], CPData[i][2], CP_SIZE, CP_RANGE);
}
// [...]
OnPlayerEnterStreamCheckpoint(playerid, checkpointid)
{
switch (checkpointid)
{
case CPID[0]:
{
// what happens when you enter CP #0
}
case CPID[1]:
{
// what happens when you enter CP #1
}
// and so on
}
}