if(dialogid == DIALOG_MUNICOES)
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_COMPRARARMA, DIALOG_STYLE_LIST, "|_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______[ Loja de Armas ]_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______|", "Kit Vip\nSoco-Inglкs\nFaca\nTaco de Baseball\nGranada de Mгo\nGranada de Gбs\nDesert Eagle\nShotGun\nMp5\nAK-47\nColt M4a1\nSniper\nParaquedas", "Selecionar", "Sair");
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_MUNICOES, DIALOG_STYLE_INPUT, "|_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______[ Muniзхes ]_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______|", "Digite quantas muniзхes vocк deseja comprar!", "Confirmar", "Voltar");
new guncharge, ammocharge, mod = 100, ammo = inputtext, location = PlayerInfo[playerid][pLocal];
if(ammo < 1 || ammo > 999) return SendClientMessage(playerid, COLOR_GREY, "Muniзгo tem que ser entre 1 e 999 !");
if(ArmaID == 1) ArmaID = 1, guncharge = GunPrice[1][0]/100*mod, ammocharge = 0;
else if(ArmaID == 4) ArmaID = 4, guncharge = GunPrice[3][0]/100*mod, ammocharge = 0;
else if(ArmaID == 5) ArmaID = 5, guncharge = GunPrice[1][0]/100*mod, ammocharge = 0;
else if(ArmaID == 16) ArmaID = 16, guncharge = GunPrice[4][0]/100*mod, ammocharge = GunPrice[17][0]/100*ammo;
else if(ArmaID == 17) ArmaID = 17, guncharge = GunPrice[4][0]/100*mod, ammocharge = GunPrice[15][0]/100*ammo;
else if(ArmaID == 24) ArmaID = 24, guncharge = GunPrice[15][0]/100*mod, ammocharge = GunPrice[25][0]*ammo;
else if(ArmaID == 25) ArmaID = 25, guncharge = GunPrice[19][0]/100*mod, ammocharge = GunPrice[26][0]*ammo;
else if(ArmaID == 29) ArmaID = 29, guncharge = GunPrice[18][0]/100*mod, ammocharge = GunPrice[27][0]*ammo;
else if(ArmaID == 30) ArmaID = 30, guncharge = GunPrice[22][0]/100*mod, ammocharge = GunPrice[28][0]*ammo;
else if(ArmaID == 31) ArmaID = 31, guncharge = GunPrice[23][0]/100*mod, ammocharge = GunPrice[28][0]*ammo;
else if(ArmaID == 34) ArmaID = 34, guncharge = GunPrice[24][0]/100*mod, ammocharge = GunPrice[28][0]*ammo;
else if(ArmaID == 46) ArmaID = 46, guncharge = GunPrice[0][0]/100*mod, ammocharge = 0;
if((guncharge+ammocharge) > GetPlayerMoney(playerid))
{
format(Str, sizeof(Str), "Vocк nгo tem R$%d para pagar !", guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, Str);
return 1;
}
new payout = guncharge + ammocharge;
if(location != 102 && !IsACop(playerid)) GivePlayerMoney(playerid, - payout);
BizzInfo[location-99][bTill] += payout;
ExtortionBiz(location-99, payout);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GivePlayerWeapon(playerid, ArmaID, ammo);
format(Str, sizeof(Str), "Vocк comprou um(a) %s com %d bala(s) por R$%d", ArmaID, ammo, payout);
SendClientMessage(playerid, COLOR_GRAD3, Str);
format(Str, sizeof(Str), "%s comprou armas por R$%d na empresa %d", PlayerName(playerid), payout, location-99);
printf(Str);
TAInfo[playerid][PLojaA1] = 0;
TAInfo[playerid][PLojaA2] = 0;
TAInfo[playerid][ArmaLoja] = 0;
}
if(dialogid == DIALOG_MUNICOES)
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_COMPRARARMA, DIALOG_STYLE_LIST, "|_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______[ Loja de Armas ]_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______|", "Kit Vip\nSoco-Inglкs\nFaca\nTaco de Baseball\nGranada de Mгo\nGranada de Gбs\nDesert Eagle\nShotGun\nMp5\nAK-47\nColt M4a1\nSniper\nParaquedas", "Selecionar", "Sair");
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_MUNICOES, DIALOG_STYLE_INPUT, "|_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______[ Muniзхes ]_______{00FF00}B{FFFF00}L{0000FF}G{FFFFFF}_______|", "Digite quantas muniзхes vocк deseja comprar!", "Confirmar", "Voltar");
new guncharge, ammocharge, mod = 100, ammo = strval(inputtext), location = PlayerInfo[playerid][pLocal];
if(ammo < 1 || ammo > 999) return SendClientMessage(playerid, COLOR_GREY, "Muniзгo tem que ser entre 1 e 999 !");
if(ArmaID == 1) ArmaID = 1, guncharge = GunPrice[1][0]/100*mod, ammocharge = 0;
else if(ArmaID == 4) ArmaID = 4, guncharge = GunPrice[3][0]/100*mod, ammocharge = 0;
else if(ArmaID == 5) ArmaID = 5, guncharge = GunPrice[1][0]/100*mod, ammocharge = 0;
else if(ArmaID == 16) ArmaID = 16, guncharge = GunPrice[4][0]/100*mod, ammocharge = GunPrice[17][0]/100*ammo;
else if(ArmaID == 17) ArmaID = 17, guncharge = GunPrice[4][0]/100*mod, ammocharge = GunPrice[15][0]/100*ammo;
else if(ArmaID == 24) ArmaID = 24, guncharge = GunPrice[15][0]/100*mod, ammocharge = GunPrice[25][0]*ammo;
else if(ArmaID == 25) ArmaID = 25, guncharge = GunPrice[19][0]/100*mod, ammocharge = GunPrice[26][0]*ammo;
else if(ArmaID == 29) ArmaID = 29, guncharge = GunPrice[18][0]/100*mod, ammocharge = GunPrice[27][0]*ammo;
else if(ArmaID == 30) ArmaID = 30, guncharge = GunPrice[22][0]/100*mod, ammocharge = GunPrice[28][0]*ammo;
else if(ArmaID == 31) ArmaID = 31, guncharge = GunPrice[23][0]/100*mod, ammocharge = GunPrice[28][0]*ammo;
else if(ArmaID == 34) ArmaID = 34, guncharge = GunPrice[24][0]/100*mod, ammocharge = GunPrice[28][0]*ammo;
else if(ArmaID == 46) ArmaID = 46, guncharge = GunPrice[0][0]/100*mod, ammocharge = 0;
if((guncharge+ammocharge) > GetPlayerMoney(playerid))
{
format(Str, sizeof(Str), "Vocк nгo tem R$%d para pagar !", guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, Str);
return 1;
}
new payout = guncharge + ammocharge;
if(location != 102 && !IsACop(playerid)) GivePlayerMoney(playerid, - payout);
BizzInfo[location-99][bTill] += payout;
ExtortionBiz(location-99, payout);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GivePlayerWeapon(playerid, ArmaID, ammo);
format(Str, sizeof(Str), "Vocк comprou um(a) %s com %d bala(s) por R$%d", ArmaID, ammo, payout);
SendClientMessage(playerid, COLOR_GRAD3, Str);
format(Str, sizeof(Str), "%s comprou armas por R$%d na empresa %d", PlayerName(playerid), payout, location-99);
printf(Str);
TAInfo[playerid][PLojaA1] = 0;
TAInfo[playerid][PLojaA2] = 0;
TAInfo[playerid][ArmaLoja] = 0;
}
new guncharge, ammocharge, mod = 100, ammo = strval(inputtext), location = PlayerInfo[playerid][pLocal];
Tente:
pawn Код:
|