Guten Morgen
Letzte woche ging meine Buslinie ohne probleme und jetzt ist es abgekackt:
Infos zum Script:
Dialogdefine:
#define DIALOG_Buslinien 5
Enum:
enum bus1Enum{
Float:g_x,
Float:g_y,
Float:g_z
}
enum bus2Enum{
Float:v_x,
Float:v_y,
Float:v_z
}
enum bus3Enum{
Float:n_x,
Float:n_y,
Float:n_z
}
enum bus4Enum{
Float:m_x,
Float:m_y,
Float:m_z
}
Teil2 vom Enum:
new bust1cps[][bus1Enum]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{1722.2972,-1599.5205,13.5478},//buscp 1
{1526.4220,-1660.5486,13.4871}, //buscp1
{1467.7390,-1728.8627,13.4710}, //buscp1
{1361.6545,-1285.1267,13.5398}, //buscp1
{1446.1191,-1029.5895,23.8441},//buscp 1
{1275.4427,-1380.3951,13.3839}, //buscp1
{1135.5480,-1693.4392,13.7931}
};
new bust2cps[][bus2Enum]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{1378.1691,-1876.8495,13.1888},
{1937.2477,-2171.4868,13.1890},
{2327.6970,-2054.9773,13.1441},
{2719.7451,-2029.7438,13.1351},
{2774.6575,-1942.9828,13.1381},
{2683.9724,-1871.7905,10.6911},
{2741.3979,-1610.1760,12.5695},
{2682.0027,-1459.3654,30.1905},
{2418.9873,-1251.8312,23.5439},
{2007.6500,-1455.2505,13.1968},
{1135.5480,-1693.4392,13.7931}
};
new bust3cps[][bus3Enum]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{1679.9683,-1293.2322,13.6465},
{1453.7729,-1029.0790,23.4661},
{1330.3799,-920.0157,36.3406},
{1208.4860,-930.5677,42.5413},
{1000.6902,-953.3558,41.7086},
{820.6417,-1032.6522,24.7459},
{792.3692,-1120.2891,23.4660},
{937.4135,-1202.0179,17.4626},
{1135.5480,-1693.4392,13.7931}
};
new bust4cps[][bus4Enum]={
{1135.5480,-1693.4392,13.7931}, // busstarten
{912.7061,-1544.2203,13.1864},
{1373.5081,-1737.3380,13.1889},
{1460.0719,-1386.0859,13.1890},
{1191.4703,-1472.5956,13.1890},
{1087.5948,-1707.3693,13.1890},
{978.7953,-1567.1348,13.2248},
{484.9120,-1577.5508,21.0505},
{454.7106,-1498.5461,30.7047},
{343.1253,-1523.9889,33.0096},
{280.3340,-1643.8889,33.0396},
{425.5682,-1696.6198,9.6370},
{237.6003,-1737.2343,3.8593},
{1135.5480,-1693.4392,13.7931}
};
ocmd:
ocmd:buslinie(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid,5,1135.5480,-1693.4392,13.7931))return
SendClientMessage(playerid,helblau,"Du kannst den Job hier nicht starten");
new Float:ox,Float:oy,Float:oz,Float:or;
GetPlayerPos(playerid,ox,oy,oz);
GetPlayerFacingAngle(playerid,or);
new vID = CreateVehicle(431,ox,oy,oz,or,-1,-1,-1);
SetPVarInt(playerid,"bus_car",vID);
SendClientMessage(playerid,rot,"Du hast dein Routenplaner geöffnent.");
PutPlayerInVehicle(playerid,vID,0);
ShowPlayerDialog(playerid,DIALOG_Buslinien,DIALOG_STYLE_LIST,"Busstrecke.","Buslinie1\nBuslinie2\nBuslinie3\nBuslinie4","Annehmen","Abbrechen");
SetPVarInt(playerid,"bus_cp",0);
SetPVarInt(playerid,"bus_job",1);
return 1;
}
PlayerEnterCheckpoints:
printf("bus_job: %d -> CP: %d", GetPVarInt(playerid,"bus_job"), GetPVarInt(playerid,"bus_cp"));
if(GetPVarInt(playerid,"bus_job") == 1)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z]))
{
bID++;
if(bID >= sizeof(bust1cps))
{
GivePlayerMoney(playerid,6000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 6.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust1cps[bID][g_x],bust1cps[bID][g_y],bust1cps[bID][g_z],5);
}
}
}
else if(GetPVarInt(playerid,"bus_job") == 2)
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z]))
{
bID++;
if(bID >= sizeof(bust2cps))
{
GivePlayerMoney(playerid,12000);
SetPVarInt(playerid,"bus_cp",0);
SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 12.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust2cps[bID][v_x],bust2cps[bID][v_y],bust2cps[bID][v_z],5);
}
}
}
else if (GetPVarInt(playerid,"bus_job") == 3)
{
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z]))
{
bID++;
if(bID >= sizeof(bust3cps))
{
GivePlayerMoney(playerid,15000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 15.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust3cps[bID][n_x],bust3cps[bID][n_y],bust3cps[bID][n_z],5);
}
}
}
else if(GetPVarInt(playerid,"bus_job") == 4)
{
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,7,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z]))
{
bID++;
if(bID >= sizeof(bust4cps))
{
GivePlayerMoney(playerid,30000);
SetPVarInt(playerid,"bus_cp",8);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
SendClientMessage(playerid,rot,"Du hast soeben 30.000$ verdient");
}
else
{
SetPVarInt(playerid,"bus_cp",bID);
SetPlayerCheckpoint(playerid,bust4cps[bID][m_x],bust4cps[bID][m_y],bust4cps[bID][m_z],5);
}
}
}
if(!IsPlayerInRangeOfPoint(playerid,4,2461.3162,1707.8856,10.4814))
{
SendClientMessage(playerid,grün,"Sie haben die Stadthalle erreicht!");
}
else
{
if(IsPlayerInRangeOfPoint(playerid,4,2461.3162,1707.8856,10.4814))
{
SendClientMessage(playerid,rot,"Du bist nicht am Checkpoint!");
}
}
if(!IsPlayerInRangeOfPoint(playerid,4,2461.3162,1707.8856,10.4814))
{
SendClientMessage(playerid,grün,"Sie haben das AutohausLV erreicht!");
DisablePlayerCheckpoint(playerid);
}
else
{
if(IsPlayerInRangeOfPoint(playerid,4,2461.3162,1707.8856,10.4814))
{
SendClientMessage(playerid,rot,"Du bist nicht am Checkpoint!");
}
}
if(!IsPlayerInRangeOfPoint(playerid,4,1129.1177,-1706.2179,13.2925))
{
SendClientMessage(playerid,grün,"Sie haben die Busstation erreicht!");
}
else
{
if(IsPlayerInRangeOfPoint(playerid,4,2461.3162,1707.8856,10.4814))
{
SendClientMessage(playerid,rot,"Du bist nicht am Checkpoint!");
}
}
if(!IsPlayerInRangeOfPoint(playerid,4,2082.0825,-2031.3174,13.2832))
{
SendClientMessage(playerid,grün,"Sie haben die Mülldeponie erreicht!");
}
else
{
if(IsPlayerInRangeOfPoint(playerid,4,2461.3162,1707.8856,10.4814))
{
SendClientMessage(playerid,rot,"Du bist nicht am Checkpoint!");
}
}
if(!IsPlayerInRangeOfPoint(playerid,4,1363.7589,-1280.4430,13.2370))
{
SendClientMessage(playerid,grün,"Sie haben den WaffenladenLS erreicht!");
}
else
{
if(IsPlayerInRangeOfPoint(playerid,4,2461.3162,1707.8856,10.4814))
{
SendClientMessage(playerid,rot,"Du bist nicht am Checkpoint!");
}
}
Dialog:
if(dialogid==DIALOG_Buslinien)
{
if(response)
{
if(listitem== 0)
{
if(!IsPlayerInRangeOfPoint(playerid,5,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
}
if(listitem== 1)
{
//Busliniet2
if(!IsPlayerInRangeOfPoint(playerid,5,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust2cps[0][v_x],bust2cps[0][v_y],bust2cps[0][v_z],5);
}
if(listitem== 2)
{
//Buslinie3
if(!IsPlayerInRangeOfPoint(playerid,5,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust3cps[0][n_x],bust3cps[0][n_y],bust3cps[0][n_z],5);
}
if(listitem== 3)
{
//Buslinie 4
if(!IsPlayerInRangeOfPoint(playerid,5,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
SetPlayerCheckpoint(playerid,bust4cps[0][m_x],bust4cps[0][m_y],bust4cps[0][m_z],5);
}
}
else
{
SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
RemovePlayerFromVehicle(playerid);
DestroyVehicle(431);
return 1;
}
}
ich weiss einfach nicht wieso er fehler ingame anzeigt und der Script-Compailer keine