Hallöchen,
ich hab mal wieder ein Problemchen...
Es geht um ein Dialog...
Also ich möchte machen das man /fbuycar schreibt, sich ein Dialog öffnet und man dort seine SlotID eingibt danach kann man auswählen welches Fahrzeug man
kaufen will und auf diesescar die Slotid drauf kommt Code:
So wird es eigentlich gemacht:
ocmd:fbuycar(playerid,params[])
{
new
Autoname[32],
slot;
if(sscanf(params,"si", Autoname,slot))
{
if(PlayerInfo[playerid][pLeader] == 1){
SendClientMessage(playerid, COLOR_GOLD, "|__________________ Befehlshilfe _________________|");
SendClientMessage(playerid, COLOR_GOLD, "Benutzung: /fbuycar [AutoName] [Slot 0-24] || Namen:Streifenwagen-60k, Ranger-80k,");//596,599
return SendClientMessage(playerid, COLOR_GOLD, "Enforcer-130k, Wasserwerfer-200k, Helikopter-800k, Truck-180k, Motorrad-40k");//427,601,497,528,523
}
}
new Float:x, Float:y, Float:z;
new platestring[8];
GetPlayerPos(playerid, x, y, z);
if(PlayerInfo[playerid][pLeader] == 1)
{
if(slot >= 0 && slot < 40)
{
if (!strcmp(Autoname, "enforcer", true))
{
if(GetPlayerMoney(playerid) >= FcarEnforcer)
{
DestroyVehicle(PolizeiVehs[slot]);
PolizeiVehs[slot] = CreateVehicle(427, x+1.5, y+1.5, z+1.5, 0, 79, 1, 900);
GivePlayerMoney(playerid, -FcarEnforcer);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
else if (!strcmp(Autoname, "Streifenwagen", true))
{
if(GetPlayerMoney(playerid) >= FcarStreifenwagen)
{
DestroyVehicle(PolizeiVehs[slot]);
PolizeiVehs[slot] = CreateVehicle(596, x+1.5, y+1.5, z+1.5, 0, 79, 1, 900);
GivePlayerMoney(playerid, -FcarStreifenwagen);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
format(platestring, sizeof(platestring), "SAPD %i", slot);
SetVehicleNumberPlate(PolizeiVehs[slot],platestring);
SendClientMessage(playerid, COLOR_GOLD, "Fahrzeug gespawnt /fpark nicht vergessen sonst wird es nicht gespeichert!");
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Ungültiger Slot !");
}
return 1;
}
soweit bin ich:
ocmd:fbuycar(playerid,params[])
{
if(PlayerInfo[playerid][pLeader] == 14){
//ShowPlayerDialog(playerid,DIALOG_BALLAS,DIALOG_STYLE_LIST,"Fraktionsautohaus","Majestic-45k\nHuntley-100k\nTurismo-1,2mio\nSultan-280k\nSavanna-100k\nNRG-1,6mio\nBurrito-70k\nHelikopter -800.000$","Kaufen","Abbrechen");
format(Autoslot,256,"Gebe hier die Slot-ID ein für das Fahrzeug");
ShowPlayerDialog(playerid,DIALOG_BALLASSLOT,DIALOG_STYLE_INPUT,"Kauf für ein Fahrzeug",Autoslot,"Absenden","Beenden");
}
}
if(dialogid == DIALOG_BALLASSLOT)
{
if(response && strlen(inputtext) > 0)
{
if(slot >= 0 && slot < 40)
{
ShowPlayerDialog(playerid,DIALOG_BALLAS,DIALOG_STYLE_LIST,"Fraktionsautohaus","Majestic-45k\nHuntley-100k\nTurismo-1,2mio\nSultan-280k\nSavanna-100k\nNRG-1,6mio\nBurrito-70k\nHelikopter -800.000$","Kaufen","Abbrechen");
}
else
{
SendClientMessage(playerid,COLOR_RED,"Du musst einen Slot von 0-40 eingeben...");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Frakautomenu Verlassen");
}
return 1;
}
if(dialogid == DIALOG_BALLAS)
{
if(response)
{
if(listitem == 0) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarMajestic)
{
BallasVehs[slot] = CreateVehicle(517, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarMajestic);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
if(listitem == 1) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarHuntley)
{
BallasVehs[slot] = CreateVehicle(579, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarHuntley);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
if(listitem == 2) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarTurismo)
{
BallasVehs[slot] = CreateVehicle(451, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarTurismo);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
if(listitem == 3) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarSultan)
{
BallasVehs[slot] = CreateVehicle(560, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarSultan);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
if(listitem == 4) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarSavanna)
{
BallasVehs[slot] = CreateVehicle(567, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarSavanna);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
if(listitem == 5) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarNRG)
{
BallasVehs[slot] = CreateVehicle(522, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarNRG);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
if(listitem == 6) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarBurrito)
{
BallasVehs[slot] = CreateVehicle(482, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarBurrito);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
if(listitem == 7) // WAFFEN
{
new Float:x, Float:y, Float:z;
new slot;
GetPlayerPos(playerid, x, y, z);
if(GetPlayerMoney(playerid) >= FcarHelikopter)
{
BallasVehs[slot] = CreateVehicle(469, x+1.5, y+1.5, z+1.5, 0, 22, 22, 900);
GivePlayerMoney(playerid, -FcarHelikopter);
}
else
{
return SendClientMessage(playerid, COLOR_GOLD, "Du hast nicht genügend Geld");
}
}
}
}
Hoffe es kann mir einer helfen
LG
Moritz