Need help! (+rep)
#1

So I came up with a way to "Hard Cap Ammo Capacity" on players. Problem is its not working.



pawn Код:
public IsAtAmmoLimit(playerid, gun, ammo)
{
    new weaponid, ammo2;
    GetPlayerWeaponData(playerid, gun, weaponid, ammo2);
    switch(gun)
    {
        case 0:
        {
            if(PlayerInfo[playerid][pGunAmmo0] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo0] == ammo2) { return 1; }
        }
        case 1:
        {
            if(PlayerInfo[playerid][pGunAmmo1] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo1] == ammo2) { return 1; }
        }
        case 2:
        {
            if(PlayerInfo[playerid][pGunAmmo2] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo2] == ammo2) { return 1; }
        }
        case 3:
        {
            if(PlayerInfo[playerid][pGunAmmo3] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo3] == ammo2) { return 1; }
        }
        case 4:
        {
            if(PlayerInfo[playerid][pGunAmmo4] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo4] == ammo2) { return 1; }
        }
        case 5:
        {
            if(PlayerInfo[playerid][pGunAmmo5] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo5] == ammo2) { return 1; }
        }
        case 6:
        {
            if(PlayerInfo[playerid][pGunAmmo6] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo6] == ammo2) { return 1; }
        }
        case 7:
        {
            if(PlayerInfo[playerid][pGunAmmo7] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo7] == ammo2) { return 1; }
        }
        case 8:
        {
            if(PlayerInfo[playerid][pGunAmmo8] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo8] == ammo2) { return 1; }
        }
        case 9:
        {
            if(PlayerInfo[playerid][pGunAmmo9] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo9] == ammo2) { return 1; }
        }
        case 10:
        {
            if(PlayerInfo[playerid][pGunAmmo10] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo10] == ammo2) { return 1; }
        }
        case 11:
        {
            if(PlayerInfo[playerid][pGunAmmo11] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo11] == ammo2) { return 1; }
        }
        case 12:
        {
            if(PlayerInfo[playerid][pGunAmmo12] + ammo <= 500 && PlayerInfo[playerid][pGunAmmo12] == ammo2) { return 1; }
        }
    }
    return 0;
}
pawn Код:
if(PlayerInfo[playerid][pArmsSkill] >= 0)
                {
                    if(PlayerInfo[playerid][pCarP] >= 125 && IsAtAmmoLimit(playerid, 22, 120) == 1)
                    {
                        SafeGivePlayerWeapon(playerid, 22, 120);
                        PlayerInfo[playerid][pCarP] -= 125;
                        PlayerInfo[playerid][pArmsSkill]++;
                        SendClientMessage(playerid, COLOR_LIGHTYELLOW, "[Legendary Gaming RolePlay]:");
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You successfully made a [ Pistol ] from the Gunsmith!");
                        if(PlayerInfo[playerid][pArmsSkill] == 50)
                        { SendClientMessage(playerid, COLOR_YELLOW, "* Weapon Crafter Skill is now Level 2, New Weapon Schematic: The Rifle."); }
                        else if(PlayerInfo[playerid][pArmsSkill] == 100)
                        { SendClientMessage(playerid, COLOR_YELLOW, "* Weapon Crafter Skill is now Level 3, New Weapon Schematic: The MP5."); }
                        else if(PlayerInfo[playerid][pArmsSkill] == 200)
                        { SendClientMessage(playerid, COLOR_YELLOW, "* Weapon Crafter Skill is now LVL 4, New Weapon Schematics: The Desert Eagle."); }
                        else if(PlayerInfo[playerid][pArmsSkill] == 500)
                        { SendClientMessage(playerid, COLOR_YELLOW, "* Maximumn Level Achieved!, New Weapon Schematic: The AK-47/M4."); }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have enough Car Parts!");
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "You lack the Weapon Crafting Level to Make That!");
                }
Its not creating the gun. Even with 0 Ammo/no gun in hand.
Reply


Messages In This Thread
Need help! (+rep) - by Medardo4Life - 12.05.2012, 04:09
Re: Need help! (+rep) - by HDFord - 12.05.2012, 06:31
Re: Need help! (+rep) - by Ballu Miaa - 12.05.2012, 06:35
Re: Need help! (+rep) - by [ABK]Antonio - 12.05.2012, 06:55
Re: Need help! (+rep) - by Medardo4Life - 12.05.2012, 07:42
Re: Need help! (+rep) - by [ABK]Antonio - 12.05.2012, 07:47
Re: Need help! (+rep) - by Medardo4Life - 12.05.2012, 07:58
Re: Need help! (+rep) - by [ABK]Antonio - 12.05.2012, 08:16
Re: Need help! (+rep) - by Medardo4Life - 12.05.2012, 08:24
Re: Need help! (+rep) - by [ABK]Antonio - 12.05.2012, 08:38

Forum Jump:


Users browsing this thread: 3 Guest(s)