[PEDIDO] Armas por dialog
#10

Nгo sub tipow o codigo que eu tinha era mais complexo mais grande e ele usava no codigo o /comprararma do GF ja que meu gm й GF tipow dae vc escolhia a eagle no listeam e ja aparecia o inputtext ae se escolhe as ballas e preзo ja via definido pq ele usava o /comprararma do GF vo passa o meu comprararma


Quote:

if (strcmp(cmd, "/comprararma", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerGP(playerid) < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo tem o dinheiro suficiente com vocк !");
return 1;
}
new gun;
new gunid[16];

new infostring[256];
new guncharge;
new ammocharge;
new location = PlayerInfo[playerid][pLocal];
if(location == 99 || location == 100 || location == 102)
{
new mod = 100;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "DICA: /comprararma [NomeDaArma] [NumeroDeBalas]");
SendClientMessage(playerid, COLOR_GREEN,"_____________________________________ __");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"*** Armas: ***");
SendClientMessage(playerid, COLOR_YELLOW2,"Pistola: Silenciadora e Eagle");
SendClientMessage(playerid, COLOR_YELLOW2,"Combat: Shotgun");
SendClientMessage(playerid, COLOR_YELLOW2,"Metralhadora: MP5");
SendClientMessage(playerid, COLOR_YELLOW2,"Fuzil: Ak47 e M4");
SendClientMessage(playerid, COLOR_YELLOW2,"Rifles: Rifle");
SendClientMessage(playerid, COLOR_GREEN,"_____________________________________ __");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "DICA: /comprararma [NomeDaArma] [NumeroDeBalas]");
return 1;
}
new ammo = strval(tmp);
if(ammo < 1 || ammo > 999) { SendClientMessage(playerid, COLOR_GREY, " Muniзгo entre 1 e 999 !"); return 1; }
if (strcmp(gunid, "silenciadora", true, strlen(gunid)) == 0)
{
gun = 23; guncharge = GunPrice[13][0]/100*mod; ammocharge = GunPrice[25][0]*ammo;
PlayerInfo[playerid][pGun2] = 23; PlayerInfo[playerid][pAmmo2] = ammo;
}
else if (strcmp(gunid, "eagle", true, strlen(gunid)) == 0)
{
gun = 24; guncharge = GunPrice[15][0]/100*mod; ammocharge = GunPrice[25][0]*ammo;
PlayerInfo[playerid][pGun2] = 24; PlayerInfo[playerid][pAmmo2] = ammo;
}
else if (strcmp(gunid, "mp5", true, strlen(gunid)) == 0)
{
gun = 29; guncharge = GunPrice[18][0]/100*mod; ammocharge = GunPrice[27][0]*ammo;
PlayerInfo[playerid][pGun3] = 29; PlayerInfo[playerid][pAmmo3] = ammo;
}
else if (strcmp(gunid, "shotgun", true, strlen(gunid)) == 0)
{
gun = 25; guncharge = GunPrice[19][0]/100*mod; ammocharge = GunPrice[26][0]*ammo;
PlayerInfo[playerid][pGun3] = 25; PlayerInfo[playerid][pAmmo3] = ammo;
}
else if (strcmp(gunid, "ak47", true, strlen(gunid)) == 0)
{
gun = 30; guncharge = GunPrice[22][0]/100*mod; ammocharge = GunPrice[28][0]*ammo;
PlayerInfo[playerid][pGun4] = 30; PlayerInfo[playerid][pAmmo4] = ammo;
}
else if (strcmp(gunid, "m4", true, strlen(gunid)) == 0)
{
gun = 31; guncharge = GunPrice[23][0]/100*mod; ammocharge = GunPrice[28][0]*ammo;
PlayerInfo[playerid][pGun4] = 31; PlayerInfo[playerid][pAmmo4] = ammo;
}
else if (strcmp(gunid, "rifle", true, strlen(gunid)) == 0)
{
gun = 33; guncharge = GunPrice[24][0]/100*mod; ammocharge = GunPrice[29][0]*ammo;
PlayerInfo[playerid][pGun4] = 33; PlayerInfo[playerid][pAmmo4] = ammo;
}
else
{
SendClientMessage(playerid, COLOR_GRAD6, "Lojista diz: Eu nunca ouvi falar dessa arma.");
return 1;
}
if((guncharge+ammocharge) > GetPlayerGP(playerid))
{
format(infostring, 256, " Vocк nгo tem R$ %d !",guncharge+ammocharge);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
return 1;
}
if(GetPlayerGP(playerid) < (guncharge+ammocharge))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo pode pagar !");
return 1;
}
new payout = guncharge + ammocharge;
format(infostring, 256, "Vocк comprou uma %s com %d balas pelo custo de R$ %d",gunid,ammo,payout);
SendClientMessage(playerid, COLOR_GRAD3, infostring);
if(location == 102 && IsACop(playerid)) { }
else { GivePlayerGP(playerid, - payout); }
BizzInfo[location-99][bTill] += payout;
ExtortionBiz(location-99, payout);
BizzInfo[location-99][bProducts]--;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GivePlayerWeapon(playerid, gun, ammo);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s comprou armas por R$ %d na empresa %d", sendername, payout, location-99);
printf("%s", string);
PayLog(string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE,"Vocк nгo estб em uma loja de armas.");
return 1;
}
}
return 1;
}

Reply


Messages In This Thread
[PEDIDO] Armas por dialog - by Sasuke_Gyn - 08.05.2010, 13:59
Re: [PEDIDO] Armas por dialog - by FrozzenxXx - 08.05.2010, 14:20
Re: [PEDIDO] Armas por dialog - by andmeida10 - 08.05.2010, 14:30
Re: [PEDIDO] Armas por dialog - by FrozzenxXx - 08.05.2010, 14:31
Re: [PEDIDO] Armas por dialog - by Sasuke_Gyn - 08.05.2010, 14:34
Re: [PEDIDO] Armas por dialog - by SuB_ZeRo0_ - 08.05.2010, 22:06
Re: [PEDIDO] Armas por dialog - by andmeida10 - 09.05.2010, 07:34
Re: [PEDIDO] Armas por dialog - by SuB_ZeRo0_ - 09.05.2010, 12:25
Re: [PEDIDO] Armas por dialog - by andmeida10 - 09.05.2010, 12:55
Re: [PEDIDO] Armas por dialog - by Sasuke_Gyn - 09.05.2010, 13:13

Forum Jump:


Users browsing this thread: 2 Guest(s)