25.01.2015, 16:09
how i can /hwithdraw weapon slot and the amount of bullets? example /hwithdraw weapon 3 250 this will give me a gun from slot 3 with 250 bullets.
pawn Код:
else if(!strcmp(option, "weapon", true, 4))
{
if(sscanf(params, "s[32]i", option, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hwithdraw weapon [slot]");
if(amount < 1 || amount > 5) return SendClientMessage(playerid, COLOR_GREY, "Weapon slots are between 1 and 5.");
amount = amount-1;
if(!HouseInfo[idx][hGun][amount]) return SendClientMessage(playerid, COLOR_GREY, "You don't have a weapon in this slot.");
GiveZaiatWeapon(playerid, HouseInfo[idx][hGun][amount], HouseInfo[idx][hGunAmmo][amount]);
format(string, sizeof(string), "* %s opens their vault, takes a %s closes it.", RPN(playerid), RWN(HouseInfo[idx][hGun][amount]));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
HouseInfo[idx][hGun][amount] = 0;
HouseInfo[idx][hGunAmmo][amount] = 0;
}