Код:
#include <a_samp>
#define D_B 12111211 //dialog_base
#define info_color 0x4040FF
#define warning_color 0xFF0000
public OnFilterScriptInit()
{
print("\nSmoke and Drink Menu\nMade by Stery\nSuccessfully loaded!\n");
return 1;
}
public OnFilterScriptExit()
{
print("\nSmoke and Drink Menu\nMade by Stery\nSuccessfully unloaded!\n");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/sadmenu", true) == 0 || strcmp(cmdtext, "/smokeanddrinksmenu", true) == 0) {
ShowPlayerDialog(playerid, D_B, DIALOG_STYLE_LIST, "Smoke And Drinks Menu", "Cigar\nSprunk\nBeer\nWine", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //the callback
{
if (dialogid == D_B) //checking dialogid
{
if (response == 1) //select has been pressed
{
if(listitem == 0) //a switch, not going to explain it here
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
SendClientMessage(playerid, info_color, "[INFO] Ti-ai ales tigara. Poti fuma apasand LMB (Left Mouse Button)");
SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din fumat apasa tasta F sau ENTER");
} else if(listitem == 1) {
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
SendClientMessage(playerid, info_color, "[INFO] Ti-ai ales suc. Poti bea apasand LMB (Left Mouse Button)");
SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din a bea suc apasa tasta F sau ENTER");
} else if (listitem == 2) {
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SendClientMessage(playerid, info_color, "[INFO] Ti-ai ales bere. Poti bea apasand LMB (Left Mouse Button)");
SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din a bea bere apasa tasta F sau ENTER");
SendClientMessage(playerid, warning_color, "[Atentie!] Daca consumi excesiv aceasta bautura te vei imbata!");
SendClientMessage(playerid, warning_color, "[Atentie!] Caracterul tau nu va mai merge drept iar camera ti se va misca in toate partile!");
} else if(listitem == 3) {
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
SendClientMessage(playerid, info_color, "[INFO]Ti-ai ales vin. Poti bea apasand LMB(Left Mouse Button)");
SendClientMessage(playerid, info_color, "[INFO] Pentru a te opri din a blea vin apasa tasta F sau ENTER");
SendClientMessage(playerid, warning_color, "[Atentie!] Daca consumi excesiv aceasta bautura te vei imbata!");
SendClientMessage(playerid, warning_color, "[Atentie!] Caracterul tau nu va mai merge drept iar camera ti se va misca in toate partile!");
}
}
else //pressed cancel
{
}
return 1; //returns 1, it has been handled
}
return 0;
}
Can you help me please? I made it myself. The messages are in romanian I don't think if this matters.