Guten Morgen Breadfish.
Ich habe ein problem bei mein Busjob+Dialog für die linien.
Dialog#define:
#define DIALOG_Buslinien 5
Enum:
enum bus1Enum{
Float:g_x,
Float:g_y,
Float:g_z
}
new bust1cps[][bus1Enum]={
{1284.9320,-1383.4061,13.5436}, // 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 letzte
};
ocmd Befehl:
ocmd:buslinie(playerid,params[])
{
if(!IsPlayerInRangeOfPoint(playerid,5,1284.9320,-1383.4061,13.5436))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);
SetPlayerCheckpoint(playerid,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
SetPVarInt(playerid,"bus_cp",0);
SetPVarInt(playerid,"bus_job",1);
SendClientMessage(playerid,rot,"Du hast dein Routenplaner geöffnent.");
ShowPlayerDialog(playerid,DIALOG_Buslinien,DIALOG_STYLE_LIST,"Busstrecke.","Buslinie1\nBuslinie2\nBuslinie3\nBuslinie4","Annehmen","Abbrechen");
return 1;
}
checkpoints:
if(GetPVarInt(playerid,"bus_job"))
{
//wenn bus_job ausgeführt wird.
new bID = GetPVarInt(playerid,"bus_cp");
if(IsPlayerInRangeOfPoint(playerid,5,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[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z],5);
}
return 1;
}
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 bist nicht beim Busfahrerpunkt.");
}
else
{
SendClientMessage(playerid,rot,"Du hast keine Lininie ausgewählt.");
RemovePlayerFromVehicle(playerid);
return 1;
}
if(listitem== 1)
{
//Busliniet2
}
else
{
SendClientMessage(playerid,rot,"Du hast keine Lininie ausgewählt.");
RemovePlayerFromVehicle(playerid);
return 1;
}
if(listitem== 2)
{
//Buslinie3
}
else
{
SendClientMessage(playerid,rot,"Du hast keine Lininie ausgewählt.");
RemovePlayerFromVehicle(playerid);
return 1;
}
if(listitem== 3)
{
////Buslinie 4
}
else
{
SendClientMessage(playerid,rot,"Du hast keine Lininie ausgewählt.");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
was habe ich falsch gemacht das immer nur ausgeben wird:
"du hast keine Lininie ausgewählt"