18.02.2019, 23:47
(
Последний раз редактировалось RenanMsV; 19.02.2019 в 00:41.
)
Its me again. Sorry.
But how to I show a Dialog ? or a Textdraw? theres no info in the docs about it.
Edit found it for dialog:
Still figuring out how to handle the response.
Edit2 got it working, is this the right way?
This is what i get as response
------
Another question, when the user miss an argument to the command it will show him an error message "Usage /kick [player]", but what if i want to change the language of this error message?
But how to I show a Dialog ? or a Textdraw? theres no info in the docs about it.
Edit found it for dialog:
Still figuring out how to handle the response.
Edit2 got it working, is this the right way?
PHP код:
[Command("help",Shortcut = "h")]
public static bool help(BasePlayer _sender)
{
_sender.SendClientMessage("Opening help dialog");
MessageDialog diag = new MessageDialog($"This dialog caption with your name: {_sender.Name}", "This info Line 1\nNow its the line2\nThis is a really really really long giga max3turbo string", "Accept", "Reject");
diag.Response += HelpDiagResponse;
diag.Show(_sender);
return true;
}
private static void HelpDiagResponse(object sender, DialogResponseEventArgs e)
{
BasePlayer _sender = e.Player;
_sender.SendClientMessage($"Dialog response: Button: {e.DialogButton} , DialogId: {e.DialogId} , e.Player.Name : {e.Player.Name} , ListItem: {e.ListItem} , InputText: {e.InputText} .");
}
Код HTML:
Dialog response : Button : Right , DialogId: 10000 , e.Player.Name : MyName , ListItem: -1 , InputText
Another question, when the user miss an argument to the command it will show him an error message "Usage /kick [player]", but what if i want to change the language of this error message?