SA-MP Forums Archive
Dialog error - 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 error (/showthread.php?tid=299530)



Dialog error - MathijsS - 26.11.2011

Hey, i have made a dialog, my first time, butt it does'nt work. My code:
Код:
		if(dialogid==700 && response==1)
		{
			SendRconCommand("gmx");
			SendClientMessageToAll(COLOR_RED,"[SERVER]: Herstarten...");
			return 1;
		}
		if(dialogid==701 && response==1)
		{
			SendRconCommand("exit");
			SendClientMessageToAll(COLOR_RED,"[SERVER]: Afsluiten...");
			return 1;
  		}
he does'nt close/restart. i don't now why.

mathijss


Re: Dialog error - eDz0r - 26.11.2011

follow this tutorial


Re: Dialog error - MathijsS - 26.11.2011

Quote:
Originally Posted by eDz0r
Посмотреть сообщение
follow this tutorial
i did, butt i have a DIALOG_STYLE_MSGBOX and it does'nt work, can anyone tell me why?


Re: Dialog error - Rob_Maate - 26.11.2011

Oh that's easy, use list, not MSGBOX.
That way you can individually detect one command or the other with a switch.


Re: Dialog error - MathijsS - 26.11.2011

Quote:
Originally Posted by Rob_Maate
Посмотреть сообщение
Post the code you use to display the dialogs.


Код:
	if(strcmp(cmdtext,"/sc",true)==0)
	{
	    ShowPlayerDialog(playerid,500,DIALOG_STYLE_LIST,"Server Control:","Tijd\nWeer\nZwaartekracht\nSkins\nGeld\nServer Herstarten\nSever Afsluiten","Kies","Annuleren");
	    return 1;
	}
Код:
	if(dialogid==500 && response==1)
	{
    	switch(listitem)
    	{
        	case 0:
        	{
	    		ShowPlayerDialog(playerid,501,DIALOG_STYLE_LIST,"Tijd:","00:00\n03:00\n06:00\n09:00\n12:00\n15:00\n18:00\n21:00","Kies","Annuleren");
        	}
        	case 1:
        	{
	    		ShowPlayerDialog(playerid,502,DIALOG_STYLE_LIST,"Weer:","Storm\nMistig\nheet\nZandstorm\nGrijsachtig\nRegen","Kies","Annuleren");
        	}
        	case 2:
        	{
	    		ShowPlayerDialog(playerid,503,DIALOG_STYLE_LIST,"Zwaartekracht:","-0.004\n0.000\n0.004\n0.008 (Standaart)\n0.012\n0.016\n0.018\n0.032","Kies","Annuleren");
        	}
        	case 3:
        	{
	    		ShowPlayerDialog(playerid,504,DIALOG_STYLE_LIST,"Skin:","Skin 1\nSkin 2\nSkin 3\nSkin 4\nSkin 5\nSkin 6\nSkin 7\nSkin 8\nSkin 9\nSkin 10","Kies","Annuleren");
        	}
        	case 4:
        	{
				ShowPlayerDialog(playerid,505,DIALOG_STYLE_LIST,"Geld:","$100\n$1000\n$10000\n$100000\n$1000000\n$10000000","Kies","Annuleren");
        	}
			case 5:
			{
    			ShowPlayerDialog(playerid,700,DIALOG_STYLE_MSGBOX,"Server Herstarten","Weet je zeker dat je de server wilt herstarten?","Ja","Nee");
			}
			case 6:
			{
	    		ShowPlayerDialog(playerid,701,DIALOG_STYLE_MSGBOX,"Server Afsluiten","Weet je zeker dat je de server wilt afsluiten?","Ja","Nee");
			}
    	}
	}
everyting works only that not


Re: Dialog error - MathijsS - 26.11.2011

can anyone help?


Re: Dialog error - Unte99 - 26.11.2011

Is it in your gamemode or filterscript ?


Re: Dialog error - MathijsS - 26.11.2011

Quote:
Originally Posted by Unte99
Посмотреть сообщение
Is it in your gamemode or filterscript ?
my gamemode.