Hey, wie kann ich einen /carlist Befehl scripten?
Habe schon vieles ausprobiert, aber immer etwas falsch gemacht...
Man kann bis zu 15 Fahrzeuge haben.
Er soll die Fahrzeuge in einem Dialog anzeigen lassen. Dort sollen die Namen der Fahrzeuge stehen...
Kriege es einfach nicht hin :o
Kann mir jemand helfen?
Danke!
//Mein Befehl:
ocmd:carlist(playerid)
{
new string[512];
for(new i = 0;i < MAX_PLAYER_CARS;i++)
{
new Car[128];
format(Car,sizeof(Car),"/Car/%s's Auto %d.txt",SpielerName(playerid),i);
//if(!dini_Exists(Car))return SendClientMessage(playerid,Rot,"Du besitzt keine Fahrzeuge!");
switch(dini_Int(SD(playerid),"Carslots"))
{
case 1:format(string,512,"%s",VehicleNames[Autos[playerid][1][modelid] -400]);
case 2:format(string,512,"%s\n%s",VehicleNames[Autos[playerid][1][modelid] -400],VehicleNames[Autos[playerid][2][modelid] -400]);
case 3:format(string,512,"%s\n%s\n%s",VehicleNames[Autos[playerid][1][modelid] -400],VehicleNames[Autos[playerid][2][modelid] -400],VehicleNames[Autos[playerid][3][modelid] -400]);
case 4:format(string,512,"%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][1][modelid] -400],VehicleNames[Autos[playerid][2][modelid] -400],VehicleNames[Autos[playerid][3][modelid] -400],VehicleNames[Autos[playerid][4][modelid] -400]);
case 5:format(string,512,"%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 6:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 7:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 8:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 9:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 10:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 11:format(string,512,"%%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400]);
case 12:format(string,512,"%%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 13:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 14:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],
VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400],VehicleNames[Autos[playerid][i][modelid] -400]);
case 15:format(string,512,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",VehicleNames[Autos[playerid][0][modelid] -400],VehicleNames[Autos[playerid][1][modelid] -400],
VehicleNames[Autos[playerid][2][modelid] -400],VehicleNames[Autos[playerid][3][modelid] -400],VehicleNames[Autos[playerid][4][modelid] -400],VehicleNames[Autos[playerid][5][modelid] -400],
VehicleNames[Autos[playerid][6][modelid] -400],VehicleNames[Autos[playerid][7][modelid] -400],VehicleNames[Autos[playerid][8][modelid] -400],VehicleNames[Autos[playerid][9][modelid] -400],
VehicleNames[Autos[playerid][10][modelid] -400],VehicleNames[Autos[playerid][11][modelid] -400],VehicleNames[Autos[playerid][12][modelid] -400],VehicleNames[Autos[playerid][13][modelid] -400],VehicleNames[Autos[playerid][14][modelid] -400]);
}
ShowPlayerDialog(playerid,DIALOG_Carlist,DIALOG_STYLE_LIST,"Carlist",string,"Suchen","Abbrechen");
}
return 1;
}
Der geht aber nicht...
//
Bei manchen sind Zahlen, weil ich eben was testen wollte...