array help
#2

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
    }
}
But make sure YCP is installed properly before you use it!
Reply


Messages In This Thread
array help - by sggassasin - 01.09.2009, 09:56
Re: array help - by Clavius - 01.09.2009, 11:31
Re: array help - by sggassasin - 01.09.2009, 12:09
Re: array help - by Clavius - 01.09.2009, 14:12
Re: array help - by sggassasin - 01.09.2009, 15:28
Re: array help - by sggassasin - 02.09.2009, 06:47

Forum Jump:


Users browsing this thread: 1 Guest(s)