Guten Morgen
Ich habe folgendes problem:
Wenn ich Ingame auf mein Server bin und den befehl /buslinie eintippe um mein Dialog für die Busrouten zu bekommen wird es auch angzeigt nur das problem ist wenn ich die 1Route auswähle zeigt er mir zwar den ersten Marker aber dann auch kein weiter mehr.
Damit ihr ein blick auf den Code werfen könnt:
Enum:
enum bus1Enum{
Float:g_x,
Float:g_y,
Float:g_z
}
Befehl:
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.");
SetPVarInt(playerid,"bus_cp",0);
SetPVarInt(playerid,"bus_job",1);
PutPlayerInVehicle(playerid,vID,0);
ShowPlayerDialog(playerid,DIALOG_Buslinien,DIALOG_STYLE_LIST,"Busstrecke.","Buslinie1\nBuslinie2\nBuslinie3\nBuslinie4","Annehmen","Abbrechen");
return 1;
}
OnPlayerEnterCheckpoint:
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid, "trash_job"))
{
//Wenn trash job ausgeführt wird
new cID = GetPVarInt(playerid, "trash_cp");
if(IsPlayerInRangeOfPoint(playerid, 5, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z]))
{
cID++;
if(cID >= sizeof(tCPs))
{
GivePlayerMoney(playerid, 3000);
SetPVarInt(playerid, "trash_cp", 0);
SetPlayerCheckpoint(playerid, tCPs[0][t_x], tCPs[0][t_y], tCPs[0][t_z], 5);
SendClientMessage(playerid,helblau,"Du hast soeben 3.000$ verdient");
}
else
{
SetPVarInt(playerid, "trash_cp", cID);
SetPlayerCheckpoint(playerid, tCPs[cID][t_x], tCPs[cID][t_y], tCPs[cID][t_z], 5);
}
return 1;
}
}
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[0][g_x],bust1cps[0][g_y],bust1cps[0][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);
}
}
}
DisablePlayerCheckpoint(playerid);
return 1;
}
zu guter letzt noch der Dialog:
public OnPasswordResponse(playerid)
{
new num_rows,num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows==1)
{
//passwort Richtig
sInfo[playerid][eingeloggt] = 1;
sInfo[playerid][level] = cache_get_field_content_int(0,"level",dbhandle);
SetPlayerScore(playerid,sInfo[playerid][level]);
sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
sInfo[playerid][spawnchange]= cache_get_field_content_int(0,"spawnchange",dbhandle);
loadPlayerCars(playerid);
}
else
{
//Passwort Falsch
SendClientMessage(playerid,grün,"Du hast dein Passwort falsch eingetippt. Versuche es nochmal!");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_AUTOHAUS)
{
if(response)
{
//Autoverkauf
new id=GetPVarInt(playerid,"buyCarID");
if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
{
SendClientMessage(playerid,gelb,"Du besitzt nicht das benötige Geld für das Fahrzeug");
RemovePlayerFromVehicle(playerid);
return 1;
}
GivePlayerMoney(playerid,-ahCars[id][c_preis]);
createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][v_x],ahInfo[ahCars[id][ah_id]][v_y],ahInfo[ahCars[id][ah_id]][v_z],ahInfo[ahCars[id][ah_id]][v_r]);
SendClientMessage(playerid,grün,"Sie haben sich erfolgreich ein Fahrzeug gekauft.");
RemovePlayerFromVehicle(playerid);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,türkis,"Du hast den Kaufvorgang abgebrochen.");
}
return 1;
}
if(dialogid==DIALOG_LOGIN)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>0)
{
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND passwort=MD5('%s')",name,passwort);
mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
}
else
{
//Keine Eingabe
SendClientMessage(playerid,grün,"Gibt bitte dein Passwort ein.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_REGISTER)
{
if(response)
{
new name[MAX_PLAYER_NAME],query[128],passwort[35];
GetPlayerName(playerid,name,sizeof(name));
if(strlen(inputtext)>5)
{
//Registrierungsfunktion
mysql_escape_string(inputtext,passwort,dbhandle);
format(query,sizeof(query),"INSERT INTO user (username,passwort) VALUES ('%s',MD5('%s')) ",name,passwort);
mysql_function_query(dbhandle,query,false,"","");
}
else
{
//Kleiner als 4 Zeichen
SendClientMessage(playerid,helblau,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Account Erstellung","Gebe bitte nun dein gewünschtes Passwort ein!","Erstellen","Abbrechen");
}
}
else
{
Kick(playerid);
}
return 1;
}
if(dialogid==DIALOG_TELEPORT)
{
if(response)
{
if(listitem==0)
{
//Autohaus
SetPlayerPos(playerid,2502.1106,1706.7172,10.8203);
SetPlayerFacingAngle(playerid,95.2747);
}
}
else
{
SendClientMessage(playerid,rot,"Vorgang abgebrochen.");
}
return 1;
}
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,bust1cps[0][g_x],bust1cps[0][g_y],bust1cps[0][g_z]))return
SendClientMessage(playerid,helblau,"Du hast die Busroute gestartet.");
}
if(listitem== 2)
{
//Buslinie3
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.");
}
if(listitem== 3)
{
//Buslinie 4
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.");
}
}
else
{
SendClientMessage(playerid,grün,"Du hast keine Buslinie ausgewählt.");
RemovePlayerFromVehicle(playerid);
DestroyVehicle(431);
return 1;
}
}
return 1;
}
da ich einfach den Fehler nicht finde brauche ich eure hilfe