14/12/2020 15:52
Cara, vou deixar um código bem antigo que usei no meu primeiro servidor. Código ta meio ruim, mas é o que tem kk
Ao iniciar você deve colocar:
Public OnPlayerEnterRaceCheckpoint(playerid)
Código PHP:
new ComecouCarteiraTerrestre[MAX_PLAYERS] = 0;
Código PHP:
new Float:CheckpointsCarteiraT2[16][6] =
{
{-2054.7466,-117.9747,35.0076},
{-2074.4041,-143.4989,35.0248},
{-2073.7131,-171.9132,35.0246},
{-2063.3127,-195.2678,35.0246},
{-2072.3586,-215.6519,35.0246},
{-2084.5308,-230.8809,35.0246},
{-2072.6116,-265.0951,35.0246},
{-2036.9750,-266.3614,35.0246},
{-2031.5457,-246.4296,35.0245},
{-2034.1534,-237.7120,35.0274},
{-2020.5184,-218.2533,35.0246},
{-2032.8102,-207.4968,35.0246},
{-2041.4893,-175.7419,35.0302},
{-2031.4407,-158.3242,35.0314},
{-2021.2344,-146.7923,35.0276},
{-2039.3888,-129.8898,34.9603}
};
Ao iniciar você deve colocar:
Código PHP:
SetPlayerRaceCheckpoint(playerid, 2, CheckpointsCarteiraT2[0][0], CheckpointsCarteiraT2[0][1], CheckpointsCarteiraT2[0][2], CheckpointsCarteiraT2[0][3], CheckpointsCarteiraT2[0][4], CheckpointsCarteiraT2[0][5], CHECK_RACER_SIZE);
SetTimerEx("DestogglePlayerDynamicRaceCP", 200, false, "dd", playerid, CheckpointCarteiraT[playerid][0]);
Public OnPlayerEnterRaceCheckpoint(playerid)
Código PHP:
switch(ComecouCarteiraTerrestre[playerid])
{
case 1:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 2, CheckpointsCarteiraT2[1][0], CheckpointsCarteiraT2[1][1], CheckpointsCarteiraT2[1][2], CheckpointsCarteiraT2[1][3], CheckpointsCarteiraT2[1][4], CheckpointsCarteiraT2[1][5], CHECK_RACER_SIZE);
ComecouCarteiraTerrestre[playerid] = 2;
return true;
}
case 2:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 2, CheckpointsCarteiraT2[2][0], CheckpointsCarteiraT2[2][1], CheckpointsCarteiraT2[2][2], CheckpointsCarteiraT2[2][3], CheckpointsCarteiraT2[2][4], CheckpointsCarteiraT2[2][5], CHECK_RACER_SIZE);
ComecouCarteiraTerrestre[playerid] = 3;
return true;
}
case 3:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 2, CheckpointsCarteiraT2[3][0], CheckpointsCarteiraT2[3][1], CheckpointsCarteiraT2[3][2], CheckpointsCarteiraT2[3][3], CheckpointsCarteiraT2[3][4], CheckpointsCarteiraT2[3][5], CHECK_RACER_SIZE);
ComecouCarteiraTerrestre[playerid] = 4;
return true;
}
}
Código PHP:
forward DestogglePlayerDynamicRaceCP(playerid, checkpointid);
public DestogglePlayerDynamicRaceCP(playerid, checkpointid)
{
TogglePlayerDynamicRaceCP(playerid, checkpointid, true);
return true;
}