Dynamic checkpoints
#2

pawn Код:
if(vmcheckpoints[playerid] == 0)
{
    DestroyDynamicRaceCP(checkpointid);
    SetPlayerCheckpoint(playerid,-2019.8148,-145.6181,35.3203, 6);
    CreateDynamicRaceCP(0,-2019.8148,-145.6181,35.3203,-2021.3827,-137.9689,35.3015, 3, 0, 0, playerid, 200.0);//1
    vmcheckpoints[playerid]++;
    GameTextForPlayer(playerid, "(1/31)", 3000, 3);
    return 1;

}
if(vmcheckpoints[playerid] == 1)
{
    DestroyDynamicRaceCP(checkpointid);
    SetPlayerCheckpoint(playerid,-2021.3827,-137.9689,35.3015, 6);
    CreateDynamicRaceCP(0,-2021.3827,-137.9689,35.3015,-2022.2931,-172.4966,35.3203, 3, 0, 0, playerid, 200.0);//1
    vmcheckpoints[playerid]++;
    GameTextForPlayer(playerid, "(2/31)", 3000, 3);
    return 1;

}
if(vmcheckpoints[playerid] == 2)
{
    DestroyDynamicRaceCP(checkpointid);
    SetPlayerCheckpoint(playerid,-2022.2931,-172.4966,35.3203, 6);
    CreateDynamicRaceCP(0,-2022.2931,-172.4966,35.3203,-2015.1947,-166.8497,35.3203, 3, 0, 0, playerid, 200.0);//1
    vmcheckpoints[playerid]++;
    GameTextForPlayer(playerid, "(3/31)", 3000, 3);
    return 1;

}
and make vmcheckpoints 1D.

also,you can make it much "pro":
pawn Код:
new const Float:checkpoints[][]=
{
{-2019.8148,-145.6181,35.320},
{-2021.3827,-137.9689,35.3015},
{-2022.2931,-172.4966,35.3203}
}
if(vmcheckpoints[playerid] >= 0)
{
    DestroyDynamicRaceCP(checkpointid);
    if(vmcheckpoints[playerid]!=sizeof(checkpoints))
    {
        SetPlayerCheckpoint(playerid,checkpoints[ vmcheckpoints[playerid] ][0],checkpoints[ vmcheckpoints[playerid] ][1],checkpoints[ vmcheckpoints[playerid] ][2] , 6);
        CreateDynamicRaceCP(0,checkpoints[ vmcheckpoints[playerid] ][0],checkpoints[ vmcheckpoints[playerid] ][1],checkpoints[ vmcheckpoints[playerid] ][2]
        ,checkpoints[ vmcheckpoints[playerid]+1][0],checkpoints[ vmcheckpoints[playerid]+1][1],checkpoints[ vmcheckpoints[playerid]+1][2], 3, 0, 0, playerid, 200.0);//1
        vmcheckpoints[playerid]++;
        new string[30];format(string,30,"(%d/%d)",vmcheckpoints[playerid],sizeof(checkpoints));
        GameTextForPlayer(playerid, string, 3000, 3);
    }
    return 1;

}
Reply


Messages In This Thread
Dynamic checkpoints - by ajwar - 29.12.2011, 11:17
Re: Dynamic checkpoints - by FarSe. - 29.12.2011, 11:29
Re: Dynamic checkpoints - by ajwar - 29.12.2011, 12:42
Re: Dynamic checkpoints - by ajwar - 29.12.2011, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)