Пример #1
0
        /// <inheritdoc />
        public IVehicle CreateVehicle(
            Core.Natives.Samp.Vehicle model,
            Vector3 position,
            float rotation,
            int color1,
            int color2,
            TimeSpan respawnDelay,
            bool addSiren,
            IEntityPool <IVehicle> .RemoveEntityDelegate entityRemoval)
        {
            var vehicleId = this.sampNatives.AddStaticVehicleEx(
                (int)model,
                position.X,
                position.Y,
                position.Z,
                rotation,
                color1,
                color2,
                (int)respawnDelay.TotalSeconds,
                addSiren);

            if (vehicleId == SampConstants.InvalidVehicleId)
            {
                throw new EntityLimitReachedException(typeof(IVehicle));
            }

            return(new Vehicle(vehicleId, entityRemoval, this.vehiclesNatives));
        }
Пример #2
0
        /// <inheritdoc />
        public Vector3 GetVehicleModelInfo(Core.Natives.Samp.Vehicle model, VehicleModelInfo infoType)
        {
            this.vehiclesNatives.GetVehicleModelInfo((int)model, (int)infoType, out var x, out var y, out var z);

            return(new Vector3(x, y, z));
        }