SA-MP Forums Archive
Checkpoints - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Checkpoints (/showthread.php?tid=470307)



Checkpoints - venomlivno8 - 17.10.2013

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?


Re: Checkpoints - ]Rafaellos[ - 17.10.2013

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


Re: Checkpoints - venomlivno8 - 17.10.2013

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


Re: Checkpoints - ]Rafaellos[ - 17.10.2013

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;



Re: Checkpoints - venomlivno8 - 17.10.2013

you don't get me