These are chat archives for ikkentim/SampSharp

Jan 2017
Jan 17 2017 01:36
i will try to change locale
Jan 17 2017 12:10
i have question about commands, if i need to create command for using itself, i need put the command outside BasePlayer (or subtype of BasePlayer) class, and this command should be a static?
Jan 17 2017 13:51
How to handle dialog response?
Tim Potze
Jan 17 2017 17:23
Yes, a command must be static if it's not in a player class. It must also have a BasePlayer (or your subclass of BasePlayer) as the first argument, this is the sender.
there are two ways of handling responses:
var dialog = new InputDialog("Potatoes", "How do you like your potatoes?", false, "Order", "Cancel");

// in sync
dialog.Response += (sender, e) => { 
    // handle response in sync

// async
var response = await dialog.ShowAsync(player);
// handle response here
The async way is the fanciest tho :)
Jan 17 2017 18:07
Thank you :)