Dialog problem
#1

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);
 	    }
 	}
Reply
#2

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)