Dialog problems
#1

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.

Код:
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;
}
This shows the dialog list type. Then:

Код:
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);
        }
    }
Thanks!
Reply


Messages In This Thread
Dialog problems - by HidroDF - 31.08.2016, 17:31
Re: Dialog problems - by Kaliber - 31.08.2016, 18:06
Respuesta: Dialog problems - by HidroDF - 31.08.2016, 18:11
Re: Dialog problems - by Kaliber - 31.08.2016, 18:25

Forum Jump:


Users browsing this thread: 1 Guest(s)