Hi Leute ich habe ein kleines Problem mit Checkpoints...
Ich habe mehrere [13] Checkpoints gesaved und auch in das Script eingefügt.
Wenn ich Ingame gehe dann fahre ich aber nur den ersten Checkpoint ab kann mir da jemand Helfen?
Hier der Codeschnipsel:
new vehicleid = GetPlayerVehicleID(playerid);
if(IstEinFahrschulAuto(vehicleid))
{
if(FSCP[playerid][pmi_bAktiv]) {
FSCP[playerid][pmi_Checkpoint]++;
DisablePlayerCheckpoint(playerid);
new playercp = FSCP[playerid][pmi_Checkpoint];
if(playercp == sizeof(FSCheckpoints))
{
FSCP[playerid][pmi_bAktiv]=false;
SendClientMessage(playerid, COLOR_GREEN, "Super du hast deinen Schein Geschafft");
SetPVarInt(playerid,"Fuehrerschein",1);
}
else
{
SetPlayerCheckpoint(playerid,FSCheckpoints[0][M_fX],FSCheckpoints[0][M_fY],FSCheckpoints[0][M_fZ],FSCheckpoints[0][M_fRad]);
}
return 1;
}
}
if(IstEinFahrschulBike(vehicleid))
{
if(FSCP[playerid][pmi_bAktiv]) {
FSCP[playerid][pmi_Checkpoint]++;
DisablePlayerCheckpoint(playerid);
new playercp = FSCP[playerid][pmi_Checkpoint];
if(playercp == sizeof(FSCheckpoints))
{
FSCP[playerid][pmi_bAktiv]=false;
SendClientMessage(playerid, COLOR_GREEN, "Super du hast deinen Motorradschein Geschafft");
SetPVarInt(playerid,"Motorradschein",1);
}
else
{
SetPlayerCheckpoint(playerid,FSCheckpoints[0][M_fX],FSCheckpoints[0][M_fY],FSCheckpoints[0][M_fZ],FSCheckpoints[0][M_fRad]);
}
return 1;
}
}
Hier das wo die Checkpoints sind;
enum e_PlayerFSCheckpoint
{
bool:pmi_bAktiv,
pmi_Checkpoint
}
new FSCP[MAX_PLAYERS][e_PlayerFSCheckpoint];
enum e_CP {
Float:M_fX,
Float:M_fY,
Float:M_fZ,
Float:M_fRad
}
new
FSCheckpoints[13][e_CP] = {
{1273.3485, -1852.3755, 13.2578, 4.0},
{1571.2329, -1861.1578, 13.2578, 4.0},
{1548.9508, -1730.3286, 13.2578, 4.0},
{1511.4158, -1590.5206, 13.2578, 4.0},
{1438.3459, -1544.5933, 13.2457, 4.0},
{1372.2581, -1238.4722, 13.2578, 4.0},
{1344.4594, -1354.5946, 13.2579, 4.0},
{1051.9053, -1475.5338, 13.2594, 4.0},
{1033.9417, -1762.7871, 13.2502, 4.0},
{919.8412, -1730.5575, 13.2583, 4.0},
{1114.1508, -1574.8737, 13.2670, 4.0},
{1295.3976, -1830.0819, 13.2578, 4.0},
{1271.4042, -1822.5219, 13.2586, 4.0}
};