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;
}
new slot;
if(sscanf(params, "s[32]ii", option, slot, amount))
okey thats fine, and how i can add the ammo to the house and -ammo from the player?
|
GivePlayerWeapon(playerid, -ammo);
HouseInfo[idx][hGun][amount] += ammo;
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;
}