30.06.2012, 17:23
If I understood you, you can do:
Then in OnDialogResponse, you can do:
This code would output Infernus and Bullet in a dialog.
Also, you can use arrays for vehicle slots, but it's not needed.
pawn Код:
// let's say you define vehicle slots
new vehicle1[15];
new vehicle2[15];
// then you assign vehicles to slots
vehicle1 = "Infernus";
vehicle2 = "Bullet";
// then you can do:
new str[128];
format(str, sizeof str, "%s\n%s", vehicle1, vehicle2);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Vehicle", str, "Spawn", "Cancel");
pawn Код:
if(listitem == 0) { // vehicle slot 1
if(!strcmp(vehicle1, "Infernus", true)) {
// If slot 1 is infernus, you do stuff here.
}
}
Also, you can use arrays for vehicle slots, but it's not needed.