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



Dialog problem - LocMax - 02.02.2014

So I've made it so that player needs to confirm he likes what team, class and world he chose.

Код:
if(ChosenClass[playerid] == true && ChosenTeam[playerid] == true &&  ChosenWorld[playerid] == true && Confirmed[playerid] == false)
	{
	    CancelSelectTextDraw(playerid);
	    new str[180];
	    format(str,sizeof(str), "{FFFFFF}Please confirm that you want to spawn with the following settings:\n{30E633}Team: {FFFFFF}%s(%d)\n{30E633}Class: {FFFFFF}%s(%d)\n{30E633}Map: {FFFFFF}%s(%d)", TeamName(playerid), PlayerTeam[playerid], ClassName(playerid), PlayerClass[playerid], WorldName(playerid), PlayerWorld[playerid]);
	    ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX, "{30E633}Confirmation required", str, "Confirm", "Reselect");
	    str = "\0";
	}
but the problem is, if I click on 'Reselect' option in dialog, the dialog won't disappear, I need to click on 'Reselect' 2 times to get it removed, why?

Here is the response:

Код:
if(dialogid == 4)
 	{
  		ChosenClass[playerid] = false, ChosenTeam[playerid] = false, ChosenWorld[playerid] = false;
    	for(new x=0; x < sizeof(OutLook); x++) TextDrawHideForPlayer(playerid, OutLook[x]);
	    for(new x=0; x < sizeof(Teams); x++) TextDrawHideForPlayer(playerid, Teams[x]);
    	for(new x=0; x < sizeof(Classes); x++) TextDrawHideForPlayer(playerid, Classes[x]);
    	for(new x=0; x < sizeof(Worlds); x++) TextDrawHideForPlayer(playerid, Worlds[x]);
 	    if(response)
 	    {
			if(PlayerTeam[playerid] == TEAM_MARINE) SetSpawnInfo(playerid, PlayerTeam[playerid], ClassSkin[PlayerTeam[playerid]][PlayerClass[playerid]], 2602.0532, -1847.0956, 11.4688, 0, 0, 0, 0, 0, 0, 0);
			else if(PlayerTeam[playerid] == TEAM_REBEL) SetSpawnInfo(playerid, PlayerTeam[playerid], ClassSkin[PlayerTeam[playerid]][PlayerClass[playerid]], 726.0723, -1474.7169, 17.6891, 0, 0, 0, 0, 0, 0, 0);
	    	TogglePlayerSpectating(playerid, false);
	    	Confirmed[playerid] = true;
 	    }
 	    else if(!response)
 	    {
	    	for(new x=0; x < sizeof(OutLook); x++) TextDrawShowForPlayer(playerid, OutLook[x]);
		    for(new x=0; x < sizeof(Teams); x++) TextDrawShowForPlayer(playerid, Teams[x]);
		    for(new x=0; x < sizeof(Classes); x++) TextDrawShowForPlayer(playerid, Classes[x]);
		    for(new x=0; x < sizeof(Worlds); x++) TextDrawShowForPlayer(playerid, Worlds[x]);
			SelectTextDraw(playerid, 0xFF0000FF);
 	    }
 	}



Re: Dialog problem - LocMax - 02.02.2014

anyone?