Menu Dialogs - 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: Menu Dialogs (
/showthread.php?tid=606066)
Menu Dialogs -
Micko123 - 29.04.2016
Hey guys. I wanted to ask you can someone help me with this problem. So i made DM zones and i want when player types /dm that dialog for DM zones is showsn. And when he click on dm zone he wanted it will teleport him to that DM zone. Can someone help me with this. I want to use DIALOG_STYLE_LIST. Thank you
Re: Menu Dialogs -
oMa37 - 29.04.2016
use ShowPlayerDialog and under the OnDialogResponse use something like this:
PHP код:
if(dialogid == DIALOGID)
{
if(response)
{
switch(listitem)
{
case 0: return cmd_yourcmdfordm(playerid, params);
case 1: return ....
}
}
}
Re: Menu Dialogs -
Micko123 - 29.04.2016
Totally dont understand
Re: Menu Dialogs -
oMa37 - 29.04.2016
Example:
PHP код:
CMD:dmlist(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Deathmatch List", "DM1 \nDM2 \nDM3", "Select", "Cancel");
return 1;
}
// OnDialogResponse
if(dialogid == DIALOGID)
{
if(response)
{
switch(listitem)
{
case 0: return cmd_dm1cmd(playerid, params[]); // This for the DM1 in the list up there
case 1: return cmd_dm2cmd(playerid, params[]); // This for the DM2 in the list up there
case 2: return cmd_dm3cmd(playerid, params[]); // This for the DM3 in the list up there
}
}
return 1;
}
Re: Menu Dialogs -
Ritzy2K - 29.04.2016
In your past few threads, you don't attempt to write the code yourself. But keep on asking other to write for you. This is scripting help section, Not scripting REQUEST.
Re: Menu Dialogs -
TorresxD - 29.04.2016
Copied From SATDM I hope this helps you Rep+ :P
http://pastebin.com/LeYXuGqr
Re: Menu Dialogs -
Micko123 - 29.04.2016
Thank you so much. I made it
Re: Menu Dialogs -
oMa37 - 29.04.2016
Quote:
Originally Posted by TorresxD
|
This way is just for copy the same code twice, useless and waste of time ...
I prefer return the command instead of this way.
Re: Menu Dialogs -
Micko123 - 29.04.2016
In last few threads i asked for directions and for help when i had errors. 0Ma37 gave me directions so...
Re: Menu Dialogs -
Micko123 - 29.04.2016
Код:
if(dialogid == DIALOG_DM)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(PlayerJoinedDMZone[playerid] == 1)
{
SCM(playerid, 0xF81414, "Vec ste u DM zoni. Prvo kucajte /napustidm");
return 1;
}
PlayerJoinedDMZone[playerid] = 1;
new randomcoords = random(sizeof(DMSpawn));
SPP(playerid, DMSpawn[randomcoords][0], DMSpawn[randomcoords][1], DMSpawn[randomcoords][2]);
GivePlayerWeapon(playerid, 24, 100); //Deagle
GivePlayerWeapon(playerid, 25, 100); //Shotgun
GivePlayerWeapon(playerid, 26, 100); //Shawn Fff
GivePlayerWeapon(playerid, 28, 500); //Uzi
GivePlayerWeapon(playerid, 30, 100); //Ak 47
GivePlayerWeapon(playerid, 31, 50); //M4
SetPlayerArmour(playerid, 100);
SPH(playerid, 100);
SCM(playerid, 0xF81414, "Dobrodosli u DM zonu. Srecno :)");
}
case 1:
{
if(PlayerJoinedDMZone2[playerid] == 1)
{
SCM(playerid, 0xF81414, "Vec ste u DM zoni. Prvo kucajte /napustidm");
return 1;
}
PlayerJoinedDMZone2[playerid] = 1;
new randomcoords = random(sizeof(DMSpawn2));
SPP(playerid, DMSpawn2[randomcoords][0], DMSpawn2[randomcoords][1], DMSpawn2[randomcoords][2]);
GivePlayerWeapon(playerid, 24, 100); //Deagle
GivePlayerWeapon(playerid, 25, 100); //Shotgun
GivePlayerWeapon(playerid, 26, 100); //Shawn Fff
GivePlayerWeapon(playerid, 28, 500); //Uzi
GivePlayerWeapon(playerid, 30, 100); //Ak 47
GivePlayerWeapon(playerid, 31, 50); //M4
SetPlayerArmour(playerid, 100);
SPH(playerid, 100);
SCM(playerid, 0xF81414, "Dobrodosli u DM zonu. Srecno :)");
}
}
}
}
return 1;
}
Here it is. And it works perfect. And player can't rejoin the DM while he is in it unless he types /napustidm (/leavedm). Thank you guys