SA-MP Forums Archive
dialog shortcut - 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: dialog shortcut (/showthread.php?tid=627975)



dialog shortcut - rakinz - 04.02.2017

PHP код:
for(new 10001015i++)
{
if(
dialogid == i)
{
if(
response)
{
if(
listitem == 0)
ShowPlayerDialog(playerid,DIALOG_VEHICLES,DIALOG_STYLE_LIST,"{FFFFFF}Vehicle Menu","{F5F50A}VIP Vehicles\n{FFFFFF}Airplanes\nHelicopters\nBikes\nConvertibles\nIndustrial\nOff Road\nPublic Service Vehicles\nSaloons\nSport Vehicles\nStation Wagons\nBoats\nTrailers\nUnique Vehicles\nRC Vehicles\n","Select","Cancel");
}
}
return 
1;

I wishes to make a shortcut for "Cancel" key to get you back the main dialog.
There is a way to make this really work ingame?
If someone could fix it I'll be thankful with a rep!

Regards, rakinz.


Re: dialog shortcut - BiosMarcel - 04.02.2017

Some tips:

1. Indent your code
2. Try to avoid using magic numbers or explain them

Anyways, just make a function like this:

PHP код:
showVehicleMainDialog(playerid)
{
    
ShowPlayerDialog(playerid, ......);