31.08.2016, 17:31
Hello, I'm creating a Vehicle System. I have a command that shows (in a dialog) all the cars the user owns.
But I'm having troubles. I can't detect which car is selecting the user, because onDialogResponse uses listitem. And the CarID is not the same as listitem.
This shows the dialog list type. Then:
Thanks!
But I'm having troubles. I can't detect which car is selecting the user, because onDialogResponse uses listitem. And the CarID is not the same as listitem.
Код:
CMD:vehs(playerid, params[]) { new string[240]; new stats[30]; for(new i=1;i<MAX_VEHICLES;i++) { if(strmatch(VehicleSystem[i][Owner],PlayerName(playerid))) { if (VehicleSystem[i][Stats] == 0) { stats = "Spawned"; } else if (VehicleSystem[i][Stats] == 1) { stats = "Saved"; } GetVehicleName(i); format(string,sizeof(string), "%s%s (%d) - %s - %s\n", string, VehicleSystem[i][Name],VehicleSystem[i][CarID],VehicleSystem[i][Plate], stats); } } ShowPlayerDialog(playerid, DIALOG_CARS, DIALOG_STYLE_LIST, "{FFFFFF}Mis coches", string, "Change", "Exit"); return 1; }
Код:
if (dialogid == DIALOG_CARS) { if(response) { new sel[300]; format(sel,sizeof(sel),"{FFFFFF}You have selected the CARID: {40D3FF}%d.", what_i_can_do_here?); ShowPlayerDialog(playerid, DIALOG_ALERT, DIALOG_STYLE_MSGBOX, "Message", sel, "", "Continue"); SaveStateCar(carid); } }