Пример #1
0
        public void WeaponImageReloadAmmoClip(coItemData thisobj, coShapeBase obj, int slot)
        {
            string ammoname = ((coItemData)thisobj["ammo"]).getName();

            if (thisobj != obj.getMountedImage(slot))
            {
                return;
            }

            if (!thisobj.isField("clip"))
            {
                return;
            }
            if (ShapeBaseShapeBaseGetInventory(obj, thisobj["clip"]) > 0)
            {
                ShapeBaseShapeBaseDecInventory(obj, thisobj["clip"], 1);

                ShapeBaseShapeBaseSetInventory(obj, thisobj["ammo"], thisobj["ammo.maxInventory"].AsInt());

                obj.setImageAmmo(slot, true);
            }
            else
            {
                int amountInPocket = obj["remaining" + ((coItem)thisobj["ammo"]).getName()].AsInt();
                if (amountInPocket > 0)
                {
                    obj["remaining" + ((coItem)thisobj["ammo"]).getName()] = "0";

                    ShapeBaseShapeBaseSetInventory(obj, thisobj["ammo"], amountInPocket);
                    obj.setImageAmmo(slot, true);
                }
            }
        }
Пример #2
0
        public void DeployableTurretWeaponImageOnMount(coShapeBaseImageData thisobj, coShapeBase obj, int slot)
        {
            obj.setImageAmmo(slot, true);

            int numTurrets = ShapeBaseShapeBaseGetInventory(obj, thisobj["item"]);

            if (obj["client"] != "" && obj["isAiControlled"].AsBool() == false)
            {
                ((coGameConnection)obj["client"]).call("RefreshWeaponHud", "1", thisobj["item.previewImage"], thisobj["item.reticle"], thisobj["item.zoomReticle"], numTurrets.AsString());
            }
        }