SA-MP Forums Archive
Setting Dialog Names. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Setting Dialog Names. (/showthread.php?tid=355602)



Setting Dialog Names. - Shockey HD - 30.06.2012

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.


Re: Setting Dialog Names. - Mean - 30.06.2012

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.


Re: Setting Dialog Names. - Shockey HD - 30.06.2012

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..


Re: Setting Dialog Names. - Mean - 30.06.2012

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

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


Re: Setting Dialog Names. - Shockey HD - 30.06.2012

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