Menu Dialogs
#1

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
Reply
#2

use ShowPlayerDialog and under the OnDialogResponse use something like this:
PHP код:
if(dialogid == DIALOGID)
{
    if(
response)
    {
        switch(
listitem)
        {
            case 
0: return cmd_yourcmdfordm(playeridparams);
            case 
1: return ....
        }
    }

Reply
#3

Totally dont understand
Reply
#4

Example:

PHP код:
CMD:dmlist(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOGIDDIALOG_STYLE_LIST"Deathmatch List""DM1 \nDM2 \nDM3""Select""Cancel");
    return 
1;
}
// OnDialogResponse
if(dialogid == DIALOGID)
{
    if(
response)
    {
        switch(
listitem)
        {
            case 
0: return cmd_dm1cmd(playeridparams[]); // This for the DM1 in the list up there
            
case 1: return cmd_dm2cmd(playeridparams[]); // This for the DM2 in the list up there
            
case 2: return cmd_dm3cmd(playeridparams[]); // This for the DM3 in the list up there
        
}
    }
    return 
1;

Reply
#5

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.
Reply
#6

Copied From SATDM I hope this helps you Rep+ :P

http://pastebin.com/LeYXuGqr
Reply
#7

Thank you so much. I made it
Reply
#8

Quote:
Originally Posted by TorresxD
Посмотреть сообщение
Copied From SATDM I hope this helps you Rep+ :P

http://pastebin.com/LeYXuGqr
This way is just for copy the same code twice, useless and waste of time ...
I prefer return the command instead of this way.
Reply
#9

In last few threads i asked for directions and for help when i had errors. 0Ma37 gave me directions so...
Reply
#10

Код:
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)