Hey Breadfish Community,
Ich habe ein paar Probleme.
Undzwar gibts folgendes Problem:
Der erste der in einen Bus steigt(Busfahrerjob) und /linie eintippt, kann gemütlich die Tour fahren. Alle weiteren jedoch nicht.
Bei denen läuft dann der Timer nicht mehr. Sprich es kann nur einer fahren. Woran liegt das? Hier der Code:
if(BusCP[playerid] == 1 && IsPlayerInRangeOfPoint(playerid,10.0,1172.5632,-1825.8101,13.4959))
{
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
SetTimer("buscptimer",10000,false);
}
else if(BusCP[playerid] == 2 && IsPlayerInRangeOfPoint(playerid,10.0,1418.6473,-1735.3706,13.4756))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 3 && IsPlayerInRangeOfPoint(playerid,10.0,1824.1571,-1682.3333,13.4831))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 4 && IsPlayerInRangeOfPoint(playerid,10.0,2247.0315,-1659.6012,15.3885))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 5 && IsPlayerInRangeOfPoint(playerid,10.0,1518.0142,-1296.6259,14.9331))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 6 && IsPlayerInRangeOfPoint(playerid,10.0,1451.6093,-1030.6503,23.7575))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 7 && IsPlayerInRangeOfPoint(playerid,10.0,1191.4989,-935.3619,42.8408))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 8 && IsPlayerInRangeOfPoint(playerid,10.0,793.8809,-1368.1193,13.4941))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 9 && IsPlayerInRangeOfPoint(playerid,10.0,347.4862,-1647.2340,33.0931))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
else if(BusCP[playerid] == 10 && IsPlayerInRangeOfPoint(playerid,10.0,347.4862,-1647.2340,33.0931))
{
SetTimer("buscptimer",10000,false);
SendClientMessage(playerid,GREEN,"Bitte warte 10 Sekunden, da die Fahrt sonst nicht weitergeht !");
}
Hier was passiert, wenn der Timer abgelaufen ist:
forward buscptimer(playerid);
public buscptimer(playerid)
{
if(BusCP[playerid] == 1 && IsPlayerInRangeOfPoint(playerid,10.0,1172.5632,-1825.8101,13.4959))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Stadthalle");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1418.6473,-1735.3706,13.4756, 5.0);
BusCP[playerid] = 2;
}
else if(BusCP[playerid] == 2 && IsPlayerInRangeOfPoint(playerid,10.0,1418.6473,-1735.3706,13.4756))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Alhambra");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1824.1571,-1682.3333,13.4831, 5.0);
BusCP[playerid] = 3;
}
else if(BusCP[playerid] == 3 && IsPlayerInRangeOfPoint(playerid,10.0,1824.1571,-1682.3333,13.4831))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Binco");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,2247.0315,-1659.6012,15.3885, 5.0);
BusCP[playerid] = 4;
}
else if(BusCP[playerid] == 4 && IsPlayerInRangeOfPoint(playerid,10.0,2247.0315,-1659.6012,15.3885))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Startower");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1518.0142,-1296.6259,14.9331, 5.0);
BusCP[playerid] = 5;
}
else if(BusCP[playerid] == 5 && IsPlayerInRangeOfPoint(playerid,10.0,1518.0142,-1296.6259,14.9331))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Bank LS");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1451.6093,-1030.6503,23.7575, 5.0);
BusCP[playerid] = 6;
}
else if(BusCP[playerid] == 6 && IsPlayerInRangeOfPoint(playerid,10.0,1451.6093,-1030.6503,23.7575))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: BSN");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1191.4989,-935.3619,42.8408, 5.0);
BusCP[playerid] = 7;
}
else if(BusCP[playerid] == 7 && IsPlayerInRangeOfPoint(playerid,10.0,1191.4989,-935.3619,42.8408))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Intercars Premium");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,793.8809,-1368.1193,13.4941, 5.0);
BusCP[playerid] = 8;
}
else if(BusCP[playerid] == 8 && IsPlayerInRangeOfPoint(playerid,10.0,793.8809,-1368.1193,13.4941))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Angel Steg");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,347.4862,-1647.2340,33.0931, 5.0);
BusCP[playerid] = 9;
}
else if(BusCP[playerid] == 9 && IsPlayerInRangeOfPoint(playerid,10.0,347.4862,-1647.2340,33.0931))
{
SendClientMessage(playerid,GREEN, "** Nächste Station: Busbahnhof");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1172.5632,-1825.8101,13.4959, 5.0);
BusCP[playerid] == 10;
}
else if(BusCP[playerid] == 10 && IsPlayerInRangeOfPoint(playerid,10.0,1172.5632,-1825.8101,13.4959))
{
SendClientMessage(playerid,GREEN, "** Fahrt Beendet **");
SendClientMessage(playerid,GREEN, "** Du hast 2.900$ und 1 EXP erhalten **");
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid,2900);
PlayerInfo[playerid][pBusexp] +=1;
}
}
Hier der Befeh "/linie":
if(strcmp(cmd, "/linie", true) == 0)
{
ShowPlayerDialog(playerid,DIALOG_BUSLINIEN,DIALOG_STYLE_LIST,"Willkommen im BVG AG Linien System, wähle eine Linie","Linie 1 Innenstadt [Skill 0]","Starten","Logout");
return 1;
}
Dazu der OnDialogResponse:
if(dialogid == DIALOG_BUSLINIEN)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid,GREEN,"Nächste Station: Busbahnhof");
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid,1172.5632,-1825.8101,13.4959, 5.0);
BusCP[playerid] = 1;
}
}
}
Ich hoffe mir kann jmd helfen.
Thx schonmal im vorraus