Setting Dialog Names.
#1

What im meaning is in the following Code:

Код:
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Vehicle", "Vehicle One\nVehicle Two\nVehicle Three\nVehicle Four\nVehicle Five\nVehicle Six\n", "Spawn", "Cancel");
My system would identify the vehicle that is in Vehicle One's Slot, Then set it to Lets say Infernus. So when i do my command, Vehicle One will be Identified as "Infernus"?


its pretty confusing to understand this... Ask for me to re-explain and ill do so.
Reply
#2

If I understood you, you can do:
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");
Then in OnDialogResponse, you can do:
pawn Код:
if(listitem == 0) { // vehicle slot 1
    if(!strcmp(vehicle1, "Infernus", true)) {
        // If slot 1 is infernus, you do stuff here.
    }
}
This code would output Infernus and Bullet in a dialog.
Also, you can use arrays for vehicle slots, but it's not needed.
Reply
#3

I have this,

Код:
CMD:storage(playerid,params[])
{
	new VehicleOne = OneModel[playerid];
    new Fstring[24+MAX_PLAYER_NAME]; 
	format(Fstring, sizeof(Fstring), "1. %s\n", GetVehicleName(VehicleOne));
	ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Vehicles",Fstring,"(De)Spawn","Cancel");
	return 1;
}
Yet when i use it in game, Im getting:

Unkown Command..
Reply
#4

What's "OneMode[playerid]"? How do you assign it?

Also, the command seems fine overall, no idea why it gives you "Unknown command".
Reply
#5

I've created a Dynamic Vehicle Storing System, and OneModel is the model of the vehicle in the Storage slot one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)