[HELP]About Dialogs
#1

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?
Reply
#2

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)