Wenn ich /linie eingebe soll der Spieler auf "BusDuty" gesetzt werden. Dies funktioniert auch soweit. Nur wenn der Busfahrer den ersten Checkpoint befährt, wird der Bus gelöscht und es kommt die Meldung "Du bist nicht im Dienst" Hat jemand eine Lösung?
if(strcmp(cmd, "/linie", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Spieler[playerid][Job] == 2)
{
if(BusDuty[playerid] == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
for(new i=0;i {
if(vehicleid == buscars[i])
{
BusDuty[playerid] = 1;
SendClientMessage(playerid, COLOR_WHITE, "Bitte bewege dich nun mit deinem in die Checkpoints auf der Karte.");
SendClientMessage(playerid, COLOR_RED, "Bitte denke daran, dass wenn du aussteigst, und den Checkpoint ohne Bus");
SendClientMessage(playerid, COLOR_RED, "vervollständigst, dass die Arbeit abgebrochen wird.");
pCP[playerid] = CHECKPOINT_BUSSTART;
SetPlayerCheckpoint(playerid, 1203.0599,-934.3010,42.3596, 5.0);
LockCar(vehicleid);
return 1;
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist in keinem Bus.");
return 1;
}
}
else if(BusDuty[playerid] == 1)
{
BusDuty[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "Du bist nun nichtmehr im Dienst.");
DisablePlayerCheckpoint(playerid);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist kein Busfahrer.");
return 1;
}
}
return 1;
}
public BusUpdate(playerid)
{
if(IsPlayerConnected(playerid))
{
if(Spieler[playerid][Job] == 2)
{
if(pCP[playerid] == CHECKPOINT_BUSSTART)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS1;
SetPlayerCheckpoint(playerid, 794.1573,-1096.1975,23.5284, 10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Vinewood.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS1)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS2;
SetPlayerCheckpoint(playerid, 742.7133,-1393.4297,13.0455, 10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Vinewood - Intercars.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS2)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS3;
SetPlayerCheckpoint(playerid,301.2852,-1397.0028,13.5145,10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Rodeo.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS3)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS4;
SetPlayerCheckpoint(playerid,354.8143,-1648.1133,32.4861,10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Rodeo.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS4)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS5;
SetPlayerCheckpoint(playerid,678.2159,-1760.6434,12.9662,10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Marina");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS5)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS6;
SetPlayerCheckpoint(playerid,1153.5178,-1714.3553,13.4061,10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Conference Center.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS6)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS7;
SetPlayerCheckpoint(playerid,1479.6708,-1735.2942,13.0075,10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Commerce.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS7)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUS8;
SetPlayerCheckpoint(playerid,1442.5582,-1524.2251,13.0075,10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Commerce.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUS8)
{
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_BUSENDE;
SetPlayerCheckpoint(playerid,1483.9996,-1065.5348,23.2813,10.0);
SendClientMessage(playerid, COLOR_GREEN, "[INFORMATION]: Nächste Haltestelle: Mulholland Intersection.");
KillTimer(bustimer[playerid]);
}
else if(pCP[playerid] == CHECKPOINT_BUSENDE)
{
GivePlayerCash(playerid,3000);
pCP[playerid] = CHECKPOINT_NONE;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du hast 3000$ verdient.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bus-Erfahrungspunkte sind um 5 aufgestiegen.");
Spieler[playerid][BusExp] += 5;
KillTimer(bustimer[playerid]);
}
}
KillTimer(bustimer[playerid]);
}
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSSTART)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1;
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS1)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1;
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS2)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1;
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS3)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1; //BUSDUTY OFF
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS4)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1; //BUSDUTY OFF
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS5)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1; //BUSDUTY OFF
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS6)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1; //BUSDUTY OFF
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS7)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1; //BUSDUTY OFF
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUS8)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1; //BUSDUTY OFF
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}
else if(pCP[playerid] == CHECKPOINT_BUSENDE)
{
new vID = GetPlayerVehicleID(playerid);
for(new i=0;i {
if(BusDuty[playerid] == 1)
{
if(vID == buscars[i])
{
bustimer[playerid] = SetTimerEx("BusUpdate", 10000, 0, "i", playerid);
GameTextForPlayer(playerid, "~r~Warte auf Passagiere ...~n~", 10000, 5);
FreezePlayer(playerid);
return 1; //BUSDUTY OFF
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht im Dienst.");
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(vID);
UnfreezePlayer(playerid);
pCP[playerid] = CHECKPOINT_NONE;
return 1;
}