#include <a_samp> #include <zcmd> #define COLOR_GREEN 0x33AA33AA #define Acessorio 2728 #define Slot 2728 new bool:ComprouGlas1[MAX_PLAYERS]; new bool:ComprouGlas2[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) { CMD:Acessorios(playerid, params[]) { ShowPlayerDialog(playerid, Acessorio, DIALOG_STYLE_LIST, "Acessorios", "Oculos1\nOculos2", "Selecionar", "Sair"); return 1; } CMD:slots(playerid, params[]) { ShowPlayerDialog(playerid, Slot, DIALOG_STYLE_LIST, "Slots", "Oculos\nChapeu\nBandana\nBone", "Selecionar", "Sair"); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == Acessorio) { if(response) { if(listitem == 0) { SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos , digite /slot para usa-lo"); ComprouGlas1[playerid] = true; return 1; } else if(listitem == 1) { SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos, digite /slot para usa-lo."); ComprouGlas2[playerid] = true; } } } return 1; if(dialogid == Slot) { if(response) { if(listitem == 0) { if(ComprouGlas1[playerid] == true) { SendClientMessage(playerid, 0xAFAFAFAA, "Vocк colocou seus oculos"); SetPlayerAttachedObject(playerid, 2, 19006, 2, 0.09, 0.04, 0, 88, 75, 0); return true; } SendClientMessage(playerid, COLOR_GREEN, "[BSL]Vocк nгo possui oculos"); return 1; } else if(listitem == 1) { if(ComprouGlas2[playerid] == true) { SendClientMessage(playerid, COLOR_GREEN, "Vocк colocou seus oculos"); SetPlayerAttachedObject(playerid, 2, 19007, 2, 0.09, 0.04, 0, 88, 75, 0); return true; } SendClientMessage(playerid, COLOR_GREEN, "[BSL] Vocк nгo possui oculos"); return 1; } } } return 1; }
C:\Users\User4\Desktop\Acessorios e Slots.pwn(48) : warning 225: unreachable code C:\Users\User4\Desktop\Acessorios e Slots.pwn(71) : warning 217: loose indentation C:\Users\User4\Desktop\Acessorios e Slots.pwn(76) : warning 217: loose indentation
#include <a_samp>
#include <zcmd>
#define COLOR_GREEN 0x33AA33AA
#define Acessorio 2728
#define Slot 2728
new bool:ComprouGlas1[MAX_PLAYERS];
new bool:ComprouGlas2[MAX_PLAYERS];
CMD:Acessorios(playerid, params[])
{
ShowPlayerDialog(playerid, Acessorio, DIALOG_STYLE_LIST, "Acessorios", "Oculos1\nOculos2", "Selecionar", "Sair");
return 1;
}
CMD:slots(playerid, params[])
{
ShowPlayerDialog(playerid, Slot, DIALOG_STYLE_LIST, "Slots", "Oculos\nChapeu\nBandana\nBone", "Selecionar", "Sair");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Acessorio)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos , digite /slot para usa-lo");
ComprouGlas1[playerid] = true;
return 1;
}
else if(listitem == 1)
{
SendClientMessage(playerid, COLOR_GREEN, "[INFO] Vocк comprou seu oculos, digite /slot para usa-lo.");
ComprouGlas2[playerid] = true;
}
}
}
if(dialogid == Slot)
{
if(response)
{
if(listitem == 0)
{
if(ComprouGlas1[playerid] == true)
{
SendClientMessage(playerid, 0xAFAFAFAA, "Vocк colocou seus oculos");
SetPlayerAttachedObject(playerid, 2, 19006, 2, 0.09, 0.04, 0, 88, 75, 0);
return true;
}
SendClientMessage(playerid, COLOR_GREEN, "[BSL]Vocк nгo possui oculos");
return 1;
}
else if(listitem == 1)
{
if(ComprouGlas2[playerid] == true)
{
SendClientMessage(playerid, COLOR_GREEN, "Vocк colocou seus oculos");
SetPlayerAttachedObject(playerid, 2, 19007, 2, 0.09, 0.04, 0, 88, 75, 0);
return true;
}
SendClientMessage(playerid, COLOR_GREEN, "[BSL] Vocк nгo possui oculos");
return 1;
}
}
}
return 1;
}
Ambos dialogs, tem o mesmo ID
#define Acessorio 2728 #define Slot 2728 mude |
#define Acessorio 2728
#define Slot 2728
#define Acessorio 2728
#define Slot 2729