SA-MP Forums Archive
Dialog cancel and select button - 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 cancel and select button (/showthread.php?tid=407322)



Dialog cancel and select button - NicholasA - 13.01.2013

Guys how do i make the select and cancel button work correctly?
Currently: press select; spawn you, press cancel; kick you
What I want: press select; buy the weapon if enough money, press cancel; close dialog
script: http://pastebin.com/v7yHH7fj


Re: Dialog cancel and select button - geohareas - 13.01.2013

Like a login dialogue?


Re: Dialog cancel and select button - LarzI - 13.01.2013

response = 1 if you press the left button, and response = 0 if you press the right one.

If you have the buttons "Select" and "Cancel", you would have to do the code for "Select" when response == 1, and the code for "Cancel" when response == 0.

In your code you already do the check if( response ) - which checks if it's 1. If you want to close it when a player presses "Cancel", simply add this after the if( response )-statement has ended:
pawn Код:
else
{
    return true;
}