Example #1
0
        public async Task Spawn(bool respawnNew = false) => await AltAsync.Do(async() =>
        {
            if (respawnNew)
            {
                Save(true);
            }

            ColShape = Alt.CreateColShapeCylinder(new Position(DbModel.PosX, DbModel.PosY, DbModel.PosZ), 1f, 2f);

            MarkerModel = new MarkerModel()
            {
                Type         = 27,
                Dimension    = 0,
                PosX         = DbModel.PosX,
                PosY         = DbModel.PosY,
                PosZ         = DbModel.PosZ,
                DirX         = 0,
                DirY         = 0,
                DirZ         = 0,
                RotX         = 0,
                RotY         = 0,
                RotZ         = 0,
                ScaleX       = 1f,
                ScaleY       = 1f,
                ScaleZ       = 1f,
                Red          = 0,
                Green        = 153,
                Blue         = 0,
                Alpha        = 100,
                BobUpAndDown = false,
                FaceCamera   = false,
                P19          = 2,
                Rotate       = false,
                TextureDict  = null,
                TextureName  = null,
                DrawOnEnts   = false,
                UniqueID     = $"ATM_MARKER{DbModel.Id}"
            };

            BlipModel = new BlipModel()
            {
                PosX       = DbModel.PosX,
                PosY       = DbModel.PosY,
                PosZ       = DbModel.PosZ + 1,
                Blip       = 277,
                Color      = 25,
                Size       = EBlipSize.Medium,
                Name       = "ATM",
                ShortRange = true,
                UniqueID   = $"ATM{DbModel.Id}"
            };

            await MarkerHelper.CreateGlobalMarker(MarkerModel);
            await BlipHelper.CreateGlobalBlip(BlipModel);

            ColShape.SetData("atm:data", this);

            EntityHelper.Add(this);
        });
Example #2
0
        public async Task Spawn() => await AltAsync.Do(async() =>
        {
            ColShape = Alt.CreateColShapeCylinder(new Position(DbModel.PosX, DbModel.PosY, DbModel.PosZ - 0.9f), 1f, 2f);

            MarkerModel = new MarkerModel()
            {
                Type         = 27,
                Dimension    = 0,
                PosX         = DbModel.PosX,
                PosY         = DbModel.PosY,
                PosZ         = DbModel.PosZ - 0.9f,
                DirX         = 0,
                DirY         = 0,
                DirZ         = 0,
                RotX         = 0,
                RotY         = 0,
                RotZ         = 0,
                ScaleX       = 1f,
                ScaleY       = 1f,
                ScaleZ       = 1f,
                Red          = 0,
                Green        = 153,
                Blue         = 0,
                Alpha        = 100,
                BobUpAndDown = false,
                FaceCamera   = false,
                P19          = 2,
                Rotate       = false,
                TextureDict  = null,
                TextureName  = null,
                DrawOnEnts   = false,
                UniqueID     = $"SHOP{DbModel.Id}"
            };

            BlipModel = new BlipModel()
            {
                PosX       = DbModel.PosX,
                PosY       = DbModel.PosY,
                PosZ       = DbModel.PosZ + 1,
                Blip       = 52,
                Color      = 38,
                Size       = EBlipSize.Medium,
                Name       = ShopEntityFactory.CreateShopName(DbModel.ShopEntityType),
                ShortRange = true,
                UniqueID   = $"SHOP{DbModel.Id}"
            };

            await MarkerHelper.CreateGlobalMarker(MarkerModel);
            await BlipHelper.CreateGlobalBlip(BlipModel);
            EntityHelper.Add(this);
            ColShape.SetData("shop:data", this);
        });
Example #3
0
        public async Task Spawn()
        {
            InteriorColshape           = Alt.CreateColShapeCylinder(new Position(DbModel.InternalPickupPositionX, DbModel.InternalPickupPositionY, DbModel.InternalPickupPositionZ - 0.9f), 1f, 2f);
            ExteriorColshape           = Alt.CreateColShapeCylinder(new Position(DbModel.ExternalPickupPositionX, DbModel.ExternalPickupPositionY, DbModel.ExternalPickupPositionZ - 0.9f), 1f, 2f);
            ExteriorColshape.Dimension = DbModel.Id;

            InteriorMarker = new MarkerModel()
            {
                Type         = 1,
                Dimension    = 0,
                PosX         = DbModel.InternalPickupPositionX,
                PosY         = DbModel.InternalPickupPositionY,
                PosZ         = DbModel.InternalPickupPositionZ - 0.9f,
                DirX         = 0,
                DirY         = 0,
                DirZ         = 0,
                RotX         = 0,
                RotY         = 0,
                RotZ         = 0,
                ScaleX       = 1f,
                ScaleY       = 1f,
                ScaleZ       = 1f,
                Red          = 0,
                Green        = 153,
                Blue         = 0,
                Alpha        = 100,
                BobUpAndDown = false,
                FaceCamera   = false,
                P19          = 2,
                Rotate       = false,
                TextureDict  = null,
                TextureName  = null,
                DrawOnEnts   = false,
                UniqueID     = $"BUILDING_MARKER{DbModel.Id}"
            };

            ExteriorMarker = new MarkerModel()
            {
                Type         = 1,
                Dimension    = DbModel.Id,
                PosX         = DbModel.ExternalPickupPositionX,
                PosY         = DbModel.ExternalPickupPositionY,
                PosZ         = DbModel.ExternalPickupPositionZ - 0.9f,
                DirX         = 0,
                DirY         = 0,
                DirZ         = 0,
                RotX         = 0,
                RotY         = 0,
                RotZ         = 0,
                ScaleX       = 1f,
                ScaleY       = 1f,
                ScaleZ       = 1f,
                Red          = 0,
                Green        = 153,
                Blue         = 0,
                Alpha        = 100,
                BobUpAndDown = false,
                FaceCamera   = false,
                P19          = 2,
                Rotate       = false,
                TextureDict  = null,
                TextureName  = null,
                DrawOnEnts   = false,
                UniqueID     = $"BUILDING_MARKER{DbModel.Id}"
            };

            await MarkerHelper.CreateGlobalMarker(InteriorMarker);

            await MarkerHelper.CreateGlobalMarker(ExteriorMarker);

            // Później to zmienić i dodać do bazy może, ale to się zobaczy
            if (DbModel.BuildingType == BuildingType.Apartament)
            {
                BlipVisable = false;
            }


            if (BlipVisable)
            {
                string blipName = BuildingFactory.CreateName(DbModel.BuildingType);
                int    blip     = BuildingFactory.CreateBlip(DbModel.BuildingType, DbModel.OnSale);
                int    color    = BuildingFactory.CreateColor(DbModel.OnSale, DbModel.BuildingType);
                Blip = new BlipModel()
                {
                    PosX       = DbModel.InternalPickupPositionX,
                    PosY       = DbModel.InternalPickupPositionY,
                    PosZ       = DbModel.InternalPickupPositionZ + 1,
                    Blip       = blip,
                    Color      = color, // Kolor pózniej do zmiany jak budynek będzie kupiony
                    Size       = EBlipSize.Medium,
                    Name       = blipName,
                    ShortRange = true,
                    UniqueID   = $"BUILDING{DbModel.Id}"
                };
                Alt.Log("Tworze blipa z budynkiem");
                await BlipHelper.CreateGlobalBlip(Blip);
            }
            EntityHelper.Add(this);
            InteriorColshape.SetData("building:data", this);
            ExteriorColshape.SetData("building:data", this);
        }