Checkpoints
#1

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(Bit16_Get(Checkpoint, playerid))
    {
        if(PlayerInfo[playerid][pDMV] == true) //neam blage koji je ID to ćemo editati
        {
            new cpos = Bit16_Get(Checkpoint, playerid);
            if((cpos+1) < KOLICINA_CPOVA) //Kolicinu CPova ćes ti urediti u DMVCPs variabli
            {
                DisablePlayerCheckpoint(playerid);
                SetPlayerCheckpoint(playerid, DMVCP[cpos+1][0], DMVCP[cpos+1][1], DMVCP[cpos+1][2], 5.0);
                cpos++;
            }
            else
            {
                DisablePlayerCheckpoint(playerid);
                // proso
            }
        }
    }
    return 1;
}
I need to fit 100 lines in this lines, so how can I get all my checkpoints in one variable and use this tiny code instead of using a 100 lines?
Reply
#2

Can you explain better? I don't understand what you mean.
Reply
#3

Look... I need to put CPs in a variable and when players go into one cp, some player variable goes up for one and it shows the next checkpoint in the global variable for checkpoints, something like this...
pawn Код:
new DMVCP
{
    x, y, z
    x, y, z
};
and when he gets into cp one it gives him the cp 2 coordinates
Reply
#4

You can use table. What I mean:

pawn Код:
new Float:CPX[MAX_CHECKPOINTS], Float:CPY[MAX_CHECKPOINTS], Float:CPZ[MAX_CHECKPOINTS];

//load them like that:
CPX[0] = 1477.484497;
CPY[0] = 1697.738769;
CPZ[0] = 10.320308;

CPX[1] = 1477.270751;
CPY[1] = 1624.968139;
CPZ[1] = 10.312500;
Reply
#5

you don't get me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)