[HELP]About Dialogs - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]About Dialogs (
/showthread.php?tid=258381)
[HELP]About Dialogs -
Nightmare[TR] - 30.05.2011
I have created a dialog but you know,dialogs have two buttons.I want to make a script like this :
Код:
if(PlayerPressedSecondButton)
How can i make it?I asked to my friends,they told me something about if(response) can someone teach me how can i use it?
Re: [HELP]About Dialogs -
antonio112 - 30.05.2011
Well, that`s how it`s done, with
if(response).
You can use either:
pawn Код:
if(response)
{
if(listitem == 0) // If the player clicked on the first dialog line
{
//bla bla, your code here
}
else if(listitem == 1) // If the player clicked on the second dialog line
{
//bla bla
}
}
That`s the case for dialogs with 'items' in it. If you, for example want a rules dialog, which has only "OK" and "CANCEL" button, try:
pawn Код:
if(response) // If he clicks First button
{
SendClientMessage(playerid, -1, "Have fun on our server");
}
else // If he clicks Second Button
{
SendClientMessage(playerid, -1, "You must accept our rules to play on this server");
Kick(playerid);
}
Re: [HELP]About Dialogs -
Nightmare[TR] - 30.05.2011
Quote:
Originally Posted by antonio112
pawn Код:
if(response) // If he clicks First button { SendClientMessage(playerid, -1, "Have fun on our server"); } else // If he clicks Second Button { SendClientMessage(playerid, -1, "You must accept our rules to play on this server"); Kick(playerid); }
|
This works,thanks a lot.