03.09.2016, 05:19
SA-MP Dialogs
Versгo: 0.1.0
Include para tornar sua vida utilizando dialogs mais facil e rбpida.Versгo: 0.1.0
Caracterнsticas:
- Retorno de chamada para dialogs.
- Criaзгo de dialogs dinвmicos e estбticos.
- Formatar info diretamente na funзгo de mostrar, sem necessidade de chamar format antes.
- Nova callback OnDialogPerformed, chamada antes do retorno da dialog.
Criando e mostrando dialogo para o player.
PHP Code:
CreateDialog:Dialog(playerid, style, caption[], info[], button1[], button2[])
{
style = DIALOG_STYLE_MSGBOX;
caption = "Hello World!";
button1 = "Hello";
button2 = "World";
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(info, sizeof(info), "Hello %s. What you think about?", name);
}
public OnPlayerConnect(playerid)
{
ShowDialog(playerid, Dialog);
}
Dialog:Dialog(playerid, dialogid, response, listitem, inputtext[])
{
SendClientMessage(playerid, -1, response ? "You clicked at button 1" : "You clicked at button 0");
return true;
}
Mostrando dialogo sem criaзгo:
PHP Code:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_MSGBOX, "Hello World!", "Hello %s. What you think about?", "Hello", "World", name);
}
Dialog:Dialog(playerid, dialogid, response, listitem, inputtext[])
{
SendClientMessage(playerid, -1, response ? "You clicked at button 1" : "You clicked at button 0");
return true;
}
Repositуrio: https://github.com/Dayvison/Dialogs-Samp