Hey, ich bräuchte nochmal eure hilfe. Bei meinem Busfahrer Job ist es so das man in einem Checkpoint steht und 10 Sekunden warten muss. Man wird aber nicht gefrezzet. Aber wen man den Checkpoint verlässt soll da stehen "Du hast die Haltestelle verpasst!" und der Checkpoint soll nicht weiter gehen. Ich weiß jetzt aber nicht genau wie man das macht.
Ich denke mal ich muss es hier mit machen nur das es unter OnPlayerLeaveCheckpoint kommt. Aber ich weiß nicht wie genau ich das machen soll.
if(Spieler[playerid][Job] == 2)
{
new vehicle = GetPlayerVehicleID(playerid);
for(new i; i != sizeof(buscars); i++)
{
if(vehicle == buscars[i])
{
if(pCP[playerid] == CHECKPOINT_BUSBERUF && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown[playerid] = SetTimerEx("BusCountdownTimer", 1000, false, "d", playerid);
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSBERUF2 && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown2[playerid] = SetTimerEx("BusCountdownTimer2", 1000, false, "d", playerid);
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSBERUF3 && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown3[playerid] = SetTimerEx("BusCountdownTimer3", 1000, false, "d", playerid);
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSBERUF4 && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown4[playerid] = SetTimerEx("BusCountdownTimer4", 1000, false, "d", playerid);
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSBERUF5 && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown5[playerid] = SetTimerEx("BusCountdownTimer5", 1000, false, "d", playerid);
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSBERUF6 && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown6[playerid] = SetTimerEx("BusCountdownTimer6", 1000, false, "d", playerid);
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSBERUF7 && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown7[playerid] = SetTimerEx("BusCountdownTimer7", 1000, false, "d", playerid);
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSBERUF8 && BusCP[playerid] > 0)
{
//TogglePlayerControllable(playerid, 0);
buscd[playerid] = 10;
GameTextForPlayer(playerid, "~w~haltestelle...~n~~b~10", 1000, 4);
BusCountdown8[playerid] = SetTimerEx("BusCountdownTimer8", 1000, false, "d", playerid);
return 1;
}
}
}
}
Und hier sind noch die Checkpoints.
new Float:BusCoordinates[][3] = {
{1173.1357,-1824.9971,13.8454},
{1428.5259,-1734.7346,13.8296},
{1824.1589,-1656.9386,13.8302},
{2259.4243,-1661.7031,15.7094},
{1547.1584,-1297.1689,16.7127},
{1461.6752,-1031.2505,24.1032},
{1189.0717,-935.9313,43.1936},
{794.7014,-1368.4231,13.8384},
{354.6964,-1648.4730,33.3069},
{1172.7273,-1825.7487,13.8454}
};
SetPlayerCheckpoint(playerid, BusCoordinates[0][0], BusCoordinates[0][1], BusCoordinates[0][2], 3);