DIALOG_COLETES nгo estб funcionando -
eNtinityGaming - 21.08.2014
o dialog tem 2 opзхes: Armas e Coletes, o dialogid do colete nгo estб abrindo, por exemplo eu abro a o dialog armas e clico na arma q eu desejo, certo comprou atй ai tudo bem, ai eu vou na dialog dos coletes, clico em algum colete e nгo acontece nada, oq pode ser?
pawn Код:
if(dialogid == DIALOG_SHOP)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_ARMAS, DIALOG_STYLE_LIST, "{FB0000}Armas", "9mm 500$\n9mm Silenced 700$\nDesert Eagle 1000$\nShotgun 1500$\nSwanoff Shotgun 1700$\nCombat Shotgun 2000$\nMicro SMG/Uzi 1000$\nMP5 1250$\nAK-47 2000$\nM4 2250$\nTec-9 1000$\nCountry Rifle 1500$\nSniper Rifle 3000$", "Comprar", "Fechar");
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_COLETE, DIALOG_STYLE_LIST, "{FFFFFF}Colete", "Armor 25% 250$\nArmor 50% 500$\nArmor 75% 750$\nArmor 100% 1000$\nHealth Refill 1000$\nVibrator 250$\nDouble Dildo 500$\nBombs 2000$", "Comprar", "Fechar");
}
}
}
if(dialogid == DIALOG_ARMAS)
{
switch(listitem)
{
case 0: /* 9mm */
{
if(GetPlayerMoney(playerid) >=500)
{
GivePlayerWeapon(playerid, 22, 500);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a 9mm"); /* Successfull pourcheas message */
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!"); /* Not enough money message */
}
}
case 1: /* 9mm Silenced */
{
if(GetPlayerMoney(playerid) >=700)
{
GivePlayerWeapon(playerid, 23, 500);
GivePlayerMoney(playerid, -700);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a 9mm Silenced");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 2: /* Desert Eagle */
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerWeapon(playerid, 24, 107);
GivePlayerMoney(playerid,-1000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Desert Eagle");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 3: /* Shotgun */
{
if(GetPlayerMoney(playerid) >=1500)
{
GivePlayerWeapon(playerid, 25, 150);
GivePlayerMoney(playerid, -1500);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Shotgun");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 4: /* Sawnoff Shotgun */
{
if(GetPlayerMoney(playerid) >=1700)
{
GivePlayerWeapon(playerid, 26, 200);
GivePlayerMoney(playerid, -1700);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Sawnoff Shotgun");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 5: /* Combat Shotgun */
{
if(GetPlayerMoney(playerid) >=2000)
{
GivePlayerWeapon(playerid, 27, 200);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Combat Shotgun");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 6: /* Micro SMG/Uzi */
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerWeapon(playerid, 28, 500);
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Micro SMG/Uzi");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 7: /* MP-5 */
{
if(GetPlayerMoney(playerid) >=1250)
{
GivePlayerWeapon(playerid, 29, 250);
GivePlayerMoney(playerid, -1250);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a MP-5");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 8: /* AK-47 */
{
if(GetPlayerMoney(playerid) >=2000)
{
GivePlayerWeapon(playerid, 30, 300);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a AK-47");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 9: /* M4 */
{
if(GetPlayerMoney(playerid) >=2250)
{
GivePlayerWeapon(playerid, 31, 300);
GivePlayerMoney(playerid, -2250);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a M4");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 10: /* Tec-9 */
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerWeapon(playerid, 32, 500);
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Tec-9");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 11: /* Country Rifle */
{
if(GetPlayerMoney(playerid) >=1500)
{
GivePlayerWeapon(playerid, 33, 250);
GivePlayerMoney(playerid, -1500);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Country Rifle");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 12: /* Sniper Rifle */
{
if(GetPlayerMoney(playerid) >=3000)
{
GivePlayerWeapon(playerid, 34, 100);
GivePlayerMoney(playerid, -3000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Sniper Rifle");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
}
if(dialogid == DIALOG_COLETE)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) >=250) /* 25% Armor */
{
SetPlayerArmour(playerid, 25.0);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 25% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
case 1:
{
if(GetPlayerMoney(playerid) >=500) /* 50% Armor */
{
SetPlayerArmour(playerid, 50.0);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 50% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
case 2:
{
if(GetPlayerMoney(playerid) >=750) /* 75% Armor */
{
SetPlayerArmour(playerid, 75.0);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 75% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
case 3:
{
if(GetPlayerMoney(playerid) >=1000) /* 100% Armor */
{
SetPlayerArmour(playerid, 100.0);
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 100% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
}
}
}
Re: DIALOG_COLETES nгo estб funcionando -
Schocc - 21.08.2014
Vocк colocou o dialog do colete dentro de outro dialog.
pawn Код:
if(dialogid == DIALOG_SHOP)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_ARMAS, DIALOG_STYLE_LIST, "{FB0000}Armas", "9mm 500$\n9mm Silenced 700$\nDesert Eagle 1000$\nShotgun 1500$\nSwanoff Shotgun 1700$\nCombat Shotgun 2000$\nMicro SMG/Uzi 1000$\nMP5 1250$\nAK-47 2000$\nM4 2250$\nTec-9 1000$\nCountry Rifle 1500$\nSniper Rifle 3000$", "Comprar", "Fechar");
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_COLETE, DIALOG_STYLE_LIST, "{FFFFFF}Colete", "Armor 25% 250$\nArmor 50% 500$\nArmor 75% 750$\nArmor 100% 1000$\nHealth Refill 1000$\nVibrator 250$\nDouble Dildo 500$\nBombs 2000$", "Comprar", "Fechar");
}
}
}
if(dialogid == DIALOG_ARMAS)
{
switch(listitem)
{
case 0: /* 9mm */
{
if(GetPlayerMoney(playerid) >=500)
{
GivePlayerWeapon(playerid, 22, 500);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a 9mm"); /* Successfull pourcheas message */
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!"); /* Not enough money message */
}
}
case 1: /* 9mm Silenced */
{
if(GetPlayerMoney(playerid) >=700)
{
GivePlayerWeapon(playerid, 23, 500);
GivePlayerMoney(playerid, -700);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a 9mm Silenced");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 2: /* Desert Eagle */
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerWeapon(playerid, 24, 107);
GivePlayerMoney(playerid,-1000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Desert Eagle");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 3: /* Shotgun */
{
if(GetPlayerMoney(playerid) >=1500)
{
GivePlayerWeapon(playerid, 25, 150);
GivePlayerMoney(playerid, -1500);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Shotgun");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 4: /* Sawnoff Shotgun */
{
if(GetPlayerMoney(playerid) >=1700)
{
GivePlayerWeapon(playerid, 26, 200);
GivePlayerMoney(playerid, -1700);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Sawnoff Shotgun");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 5: /* Combat Shotgun */
{
if(GetPlayerMoney(playerid) >=2000)
{
GivePlayerWeapon(playerid, 27, 200);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Combat Shotgun");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 6: /* Micro SMG/Uzi */
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerWeapon(playerid, 28, 500);
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Micro SMG/Uzi");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 7: /* MP-5 */
{
if(GetPlayerMoney(playerid) >=1250)
{
GivePlayerWeapon(playerid, 29, 250);
GivePlayerMoney(playerid, -1250);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a MP-5");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 8: /* AK-47 */
{
if(GetPlayerMoney(playerid) >=2000)
{
GivePlayerWeapon(playerid, 30, 300);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a AK-47");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 9: /* M4 */
{
if(GetPlayerMoney(playerid) >=2250)
{
GivePlayerWeapon(playerid, 31, 300);
GivePlayerMoney(playerid, -2250);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a M4");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 10: /* Tec-9 */
{
if(GetPlayerMoney(playerid) >=1000)
{
GivePlayerWeapon(playerid, 32, 500);
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Tec-9");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 11: /* Country Rifle */
{
if(GetPlayerMoney(playerid) >=1500)
{
GivePlayerWeapon(playerid, 33, 250);
GivePlayerMoney(playerid, -1500);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Country Rifle");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
case 12: /* Sniper Rifle */
{
if(GetPlayerMoney(playerid) >=3000)
{
GivePlayerWeapon(playerid, 34, 100);
GivePlayerMoney(playerid, -3000);
SendClientMessage(playerid, AZUL_CLARO, "[WEAPONS] » Successfully bought a Sniper Rifle");
}
else
{
SendClientMessage(playerid, VERMELHO, "[WEAPONS] » You dont have enough money!");
}
}
}
}
if(dialogid == DIALOG_COLETE)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) >=250) /* 25% Armor */
{
SetPlayerArmour(playerid, 25.0);
GivePlayerMoney(playerid, -250);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 25% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
case 1:
{
if(GetPlayerMoney(playerid) >=500) /* 50% Armor */
{
SetPlayerArmour(playerid, 50.0);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 50% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
case 2:
{
if(GetPlayerMoney(playerid) >=750) /* 75% Armor */
{
SetPlayerArmour(playerid, 75.0);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 75% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
case 3:
{
if(GetPlayerMoney(playerid) >=1000) /* 100% Armor */
{
SetPlayerArmour(playerid, 100.0);
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, AZUL_CLARO, "[ELSE] » You successfully bought 100% Armor");
}
else
{
SendClientMessage(playerid, VERMELHO, "[ELSE] » You dont have enough money!");
}
}
}
}
Seu erro foi basicamente isso:
pawn Код:
if (dialogid == dialog_armas)
{
switch(listitem){
case 0:{}
case 1:{}
}
// Seu erro foi colocar um dialogID dentro de outro.
if (dialogid == dialog_colete){
}
}
Re: DIALOG_COLETES nгo estб funcionando -
eNtinityGaming - 21.08.2014
Valeu amigo !
Funcionou certinho