Hallo,
wenn ich ingame ein command eingebe erscheint ein Dialog Menü.
Wenn ich dann eins auswähle verschwindet es.
Hier noch die Zeilen:
if (strcmp(cmdtext, "/vmenu", true) == 0) // befehl
{
ShowPlayerDialog(playerid, vmenu, DIALOG_STYLE_LIST, "Vehicle Menu", "Motorrad \nPolizei \nMilitär \nHubschrauber\nSportwagen", "Auswählen", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
pInt = GetPlayerInterior(playerid);
if(dialogid == DIALOG_VMENU)
{
if(response==0)
{
SendClientMessage(playerid,blau,"Du hast den Vorgang abgebrochen.");
return 1;
}
if (response==1)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,502,DIALOG_STYLE_LIST,"Motorrad","Nrg-500\nPCJ-600\nFreeway","Auswählen", "Abbrechen");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid,503,DIALOG_STYLE_LIST,"Polizei","LSPD\nSFPD\nLVPD\nEnforcer\nHPV1000","Auswählen", "Abbrechen");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid,504,DIALOG_STYLE_LIST,"Militär","Cargobob\nHunter\nRhino\nBarracks","Auswählen", "Abbrechen");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid,505,DIALOG_STYLE_LIST,"Helikopter","Cargobob\nHunter\nHydra","Auswählen", "Abbrechen");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid,506,DIALOG_STYLE_LIST,"Sportwagen","Banshee\nBullet\nHotring Racer\nInfernus\nSuper GT\n Turismo","Auswählen", "Abbrechen");
}
}
}
switch(502)
{
case 1: //Motorrad
{
if(!response)
{
SendClientMessage(playerid, blau, "Du hast den Vorgang abgebrochen.");
return 1;
}
switch(listitem)
{
case 0: // Listitems start with 0, not 1
{
CreateVehicle(522, X+5, Y, Z+1, Angle, random(100), random(100), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid), pInt);
}
case 1:
{
CreateVehicle(461, X+5, Y, Z+1, Angle, random(100), random(100), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid), pInt);
}
case 2:
{
CreateVehicle(463, X+5, Y, Z+1, Angle, random(100), random(100), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid), pInt);
}
}
}
case 2: //Polizei
{
if(!response)
{
SendClientMessage(playerid, blau, "Du hast den Vorgang abgebrochen.");
return 1;
}
switch(listitem)
{
case 0:
{
CreateVehicle(522, X+5, Y, Z+1, Angle, random(100), random(100), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid), pInt);
}
case 1:
{
CreateVehicle(461, X+5, Y, Z+1, Angle, random(100), random(100), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid), pInt);
}
case 2:
{
CreateVehicle(463, X+5, Y, Z+1, Angle, random(100), random(100), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid), pInt);
}
}
}
}