SA-MP Forums Archive
OnDialogResponse - 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: OnDialogResponse (/showthread.php?tid=359634)



OnDialogResponse - kbalor - 14.07.2012

Код:
CMD:t(playerid, params[])
{
    if(gCommandsDisabled[playerid]==true)
	{
THIS LINE->ShowPlayerDialog(playerid, DIALOG_CANT, DIALOG_STYLE_MSGBOX, "Error", "You are in DM. You can't use teleport", "Leave", "Stay"); <----------------- This line
	return 1;
	}
    ShowPlayerDialog(playerid, DIALOG_TELES, DIALOG_STYLE_LIST, "Teleport Menu", "Los Santos (/ls)\nSan Fiero (/sf)\nLas Venturas (/lv)\nTuning \nAirports \nStunts \nDeathMatches", "Choose", "Cancel");
	return 1;
}
If player press "Leave" - He will die (And respawn again normally)
If player press "Stay" - Dialog will close(No changes)

How to make this a dialogresponse
Код:
ShowPlayerDialog(playerid, DIALOG_CANT, DIALOG_STYLE_MSGBOX, "Error", "You are in DM. You can't use teleport", "Leave", "Stay");
Even if its in a command. If possible.


Re: OnDialogResponse - kbalor - 14.07.2012

I just Solved:

Код:
if(dialogid == DIALOG_EVADE)
    {
        if(response)
        {
            SetPlayerHealth(playerid, 0);
        }
        else
        {

        }
        return 1;
    }

    return 1;
}