#1

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;
    }
Reply
#2

You'll have to make another integer in that enum that you are using and you need to save that integer when player puts weapons in house.
Reply
#3

I didn't understand what you meant.
~bump
Reply
#4

pawn Код:
new slot;
if(sscanf(params, "s[32]ii", option, slot, amount))
Reply
#5

okey thats fine, and how i can add the ammo to the house and -ammo from the player?
Reply
#6

Quote:
Originally Posted by Rabea
Посмотреть сообщение
okey thats fine, and how i can add the ammo to the house and -ammo from the player?
pawn Код:
GivePlayerWeapon(playerid, -ammo);
For house:
pawn Код:
HouseInfo[idx][hGun][amount] += ammo;
Reply
#7

lel, i meant +ammo for player and -ammo from house
edit this code please
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;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)