diff --git a/api/AltV.Net.Async/AltAsync.BaseObject.cs b/api/AltV.Net.Async/AltAsync.BaseObject.cs index c2e1d0315..655d82d7f 100644 --- a/api/AltV.Net.Async/AltAsync.BaseObject.cs +++ b/api/AltV.Net.Async/AltAsync.BaseObject.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using AltV.Net.Elements.Args; using AltV.Net.Elements.Entities; @@ -7,12 +8,15 @@ namespace AltV.Net.Async //TODO: allocate position, rotation, rgba structs in task thread an pass them to the main thread instead of creating them in the main thread public partial class AltAsync { + [Obsolete("Use async entities instead")] public static Task ExistsAsync(this IBaseObject baseObject) => AltVAsync.Schedule(() => baseObject.Exists); + [Obsolete("Use async entities instead")] public static Task GetTypeAsync(this IBaseObject baseObject) => AltVAsync.Schedule(() => baseObject.Type); + [Obsolete("Use async entities instead")] public static async Task SetMetaDataAsync(this IBaseObject baseObject, string key, object value) { Alt.Core.CreateMValue(out var mValue, value); @@ -20,6 +24,7 @@ public static async Task SetMetaDataAsync(this IBaseObject baseObject, string ke mValue.Dispose(); } + [Obsolete("Use async entities instead")] public static Task GetMetaDataAsync(this IBaseObject baseObject, string key) => AltVAsync.Schedule(() => { diff --git a/api/AltV.Net.Async/AltAsync.Blip.cs b/api/AltV.Net.Async/AltAsync.Blip.cs index d0055d496..9725df07c 100644 --- a/api/AltV.Net.Async/AltAsync.Blip.cs +++ b/api/AltV.Net.Async/AltAsync.Blip.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using AltV.Net.Data; using AltV.Net.Elements.Entities; @@ -30,30 +31,39 @@ public static Task CreateBlip(BlipType type, Position pos) => public static Task CreateBlip(BlipType type, IEntity entityAttach) => AltVAsync.Schedule(() => Alt.CreateBlip(type, entityAttach)); + [Obsolete("Use async entities instead")] public static Task IsGlobalAsync(this IBlip blip) => AltVAsync.Schedule(() => blip.IsGlobal); + [Obsolete("Use async entities instead")] public static Task IsAttachedAsync(this IBlip blip) => AltVAsync.Schedule(() => blip.IsAttached); + [Obsolete("Use async entities instead")] public static Task AttachedToAsync(this IBlip blip) => AltVAsync.Schedule(() => blip.AttachedTo); + [Obsolete("Use async entities instead")] public static Task GetBlipTypeAsync(this IBlip blip) => AltVAsync.Schedule(() => (BlipType) blip.BlipType); + [Obsolete("Use async entities instead")] public static Task SetSpriteAsync(this IBlip blip, ushort sprite) => AltVAsync.Schedule(() => blip.Sprite = sprite); + [Obsolete("Use async entities instead")] public static Task SetColorAsync(this IBlip blip, byte color) => AltVAsync.Schedule(() => blip.Color = color); + [Obsolete("Use async entities instead")] public static Task SetRouteAsync(this IBlip blip, bool route) => AltVAsync.Schedule(() => blip.Route = route); + [Obsolete("Use async entities instead")] public static Task SetRouteColorAsync(this IBlip blip, Rgba color) => AltVAsync.Schedule(() => blip.RouteColor = color); + [Obsolete("Use async entities instead")] public static Task RemoveAsync(this IBlip blip) => AltVAsync.Schedule(blip.RemoveAsync); } diff --git a/api/AltV.Net.Async/AltAsync.Checkpoint.cs b/api/AltV.Net.Async/AltAsync.Checkpoint.cs index 217ced4d2..6859f3863 100644 --- a/api/AltV.Net.Async/AltAsync.Checkpoint.cs +++ b/api/AltV.Net.Async/AltAsync.Checkpoint.cs @@ -17,30 +17,36 @@ public static Task CreateCheckpoint(CheckpointType type, Position p Rgba color) => AltVAsync.Schedule(() => Alt.CreateCheckpoint(type, pos, radius, height, color)); + [Obsolete("Use async entities instead")] public static Task GetCheckpointTypeAsync(this ICheckpoint checkpoint) => AltVAsync.Schedule(() => (CheckpointType) checkpoint.CheckpointType); + [Obsolete("Use async entities instead")] public static Task GetHeightAsync(this ICheckpoint checkpoint) => AltVAsync.Schedule(() => checkpoint.Height); + [Obsolete("Use async entities instead")] public static Task GetRadiusAsync(this ICheckpoint checkpoint) => AltVAsync.Schedule(() => checkpoint.Radius); + [Obsolete("Use async entities instead")] public static Task GetColorAsync(this ICheckpoint checkpoint) => AltVAsync.Schedule(() => checkpoint.Color); - [Obsolete("Use Checkpoint.IsEntityInAsync instead")] + [Obsolete("Use Checkpoint.IsEntityIn on async entity instead")] public static Task IsPlayerInAsync(this ICheckpoint checkpoint, IPlayer player) => AltVAsync.Schedule(() => checkpoint.IsPlayerIn(player)); - [Obsolete("Use Checkpoint.IsEntityInAsync instead")] + [Obsolete("Use Checkpoint.IsEntityIn on async entity instead")] public static Task IsVehicleInAsync(this ICheckpoint checkpoint, IVehicle vehicle) => AltVAsync.Schedule(() => checkpoint.IsVehicleIn(vehicle)); + [Obsolete("Use async entities instead")] public static Task IsEntityInAsync(this ICheckpoint checkpoint, IEntity entity) => AltVAsync.Schedule(() => checkpoint.IsEntityIn(entity)); + [Obsolete("Use async entities instead")] public static Task RemoveAsync(this ICheckpoint checkpoint) => AltVAsync.Schedule(checkpoint.Remove); } diff --git a/api/AltV.Net.Async/AltAsync.Entity.cs b/api/AltV.Net.Async/AltAsync.Entity.cs index 04f87141f..83f0ec3eb 100644 --- a/api/AltV.Net.Async/AltAsync.Entity.cs +++ b/api/AltV.Net.Async/AltAsync.Entity.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using AltV.Net.Data; using AltV.Net.Elements.Args; @@ -8,15 +9,19 @@ namespace AltV.Net.Async //TODO: allocate position, rotation, rgba structs in task thread an pass them to the main thread instead of creating them in the main thread public partial class AltAsync { + [Obsolete("Use async entities instead")] public static Task GetModelAsync(this IEntity entity) => AltVAsync.Schedule(() => entity.Model); + [Obsolete("Use async entities instead")] public static Task SetRotationAsync(this IEntity entity, Rotation rotation) => AltVAsync.Schedule(() => entity.Rotation = rotation); + [Obsolete("Use async entities instead")] public static Task GetRotationAsync(this IEntity entity) => AltVAsync.Schedule(() => entity.Rotation); + [Obsolete("Use async entities instead")] public static async Task SetSyncedMetaDataAsync(this IEntity entity, string key, object value) { Alt.Core.CreateMValue(out var mValue, value); @@ -24,6 +29,7 @@ public static async Task SetSyncedMetaDataAsync(this IEntity entity, string key, mValue.Dispose(); } + [Obsolete("Use async entities instead")] public static Task GetSyncedMetaDataAsync(this IEntity entity, string key) => AltVAsync.Schedule(() => { @@ -31,6 +37,7 @@ public static Task GetSyncedMetaDataAsync(this IEntity entity, string key) return value; }); + [Obsolete("Use async entities instead")] public static async Task SetStreamSyncedMetaDataAsync(this IEntity entity, string key, object value) { Alt.Core.CreateMValue(out var mValue, value); @@ -38,6 +45,7 @@ public static async Task SetStreamSyncedMetaDataAsync(this IEntity entity, strin mValue.Dispose(); } + [Obsolete("Use async entities instead")] public static Task GetStreamSyncedMetaDataAsync(this IEntity entity, string key) => AltVAsync.Schedule(() => { @@ -45,9 +53,11 @@ public static Task GetStreamSyncedMetaDataAsync(this IEntity entity, strin return value; }); + [Obsolete("Use async entities instead")] public static Task DeleteSyncedMetaDataAsync(this IEntity entity, string key) => AltVAsync.Schedule(() => entity.DeleteSyncedMetaData(key)); + [Obsolete("Use async entities instead")] public static Task DeleteStreamSyncedMetaDataAsync(this IEntity entity, string key) => AltVAsync.Schedule(() => entity.DeleteStreamSyncedMetaData(key)); } diff --git a/api/AltV.Net.Async/AltAsync.Player.cs b/api/AltV.Net.Async/AltAsync.Player.cs index 0f5fd9184..a64e33965 100644 --- a/api/AltV.Net.Async/AltAsync.Player.cs +++ b/api/AltV.Net.Async/AltAsync.Player.cs @@ -11,57 +11,75 @@ namespace AltV.Net.Async { public static partial class AltAsync { + [Obsolete("Use async entities instead")] public static Task IsConnectedAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsConnected); + [Obsolete("Use async entities instead")] public static Task SetModelAsync(this IPlayer player, uint model) => AltVAsync.Schedule(() => player.Model = model); + [Obsolete("Use async entities instead")] public static async Task GetNameAsync(this IPlayer player) => await AltVAsync.Schedule( () => player.Name); + [Obsolete("Use async entities instead")] public static Task GetHealthAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Health); + [Obsolete("Use async entities instead")] public static Task SetHealthAsync(this IPlayer player, ushort health) => AltVAsync.Schedule(() => player.Health = health); + [Obsolete("Use async entities instead")] public static Task IsDeadAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsDead); + [Obsolete("Use async entities instead")] public static Task IsJumpingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsJumping); + [Obsolete("Use async entities instead")] public static Task IsInRagdollAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsInRagdoll); + [Obsolete("Use async entities instead")] public static Task IsAimingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsAiming); + [Obsolete("Use async entities instead")] public static Task IsShootingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsShooting); + [Obsolete("Use async entities instead")] public static Task IsReloadingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsReloading); + [Obsolete("Use async entities instead")] public static Task GetArmorAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Armor); + [Obsolete("Use async entities instead")] public static Task SetArmorAsync(this IPlayer player, ushort armor) => AltVAsync.Schedule(() => player.Armor = armor); + [Obsolete("Use async entities instead")] public static Task GetMoveSpeedAsync(this IPlayer player) => AltVAsync.Schedule(() => player.MoveSpeed); + [Obsolete("Use async entities instead")] public static Task GetAimPositionAsync(this IPlayer player) => AltVAsync.Schedule(() => player.AimPosition); + [Obsolete("Use async entities instead")] public static Task GetHeadRotationAsync(this IPlayer player) => AltVAsync.Schedule(() => player.HeadRotation); + [Obsolete("Use async entities instead")] public static Task IsInVehicleAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsInVehicle); + [Obsolete("Use async entities instead")] public static async Task GetVehicleAsync(this IPlayer player) { return await AltVAsync.Schedule(() => @@ -75,46 +93,60 @@ public static async Task GetVehicleAsync(this IPlayer player) }); } + [Obsolete("Use async entities instead")] public static Task GetSeatAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Seat); + [Obsolete("Use async entities instead")] public static Task GetPingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Ping); + [Obsolete("Use async entities instead")] public static Task SpawnAsync(this IPlayer player, Position position, uint delayMs = 0) => AltVAsync.Schedule(() => player.Spawn(position, delayMs)); + [Obsolete("Use async entities instead")] public static Task DespawnAsync(this IPlayer player) => AltVAsync.Schedule(player.Despawn); + [Obsolete("Use async entities instead")] public static Task SetDateTimeAsync(this IPlayer player, int day, int month, int year, int hour, int minute, int second) => AltVAsync.Schedule(() => player.SetDateTime(day, month, year, hour, minute, second)); + [Obsolete("Use async entities instead")] public static Task SetDateTimeAsync(this IPlayer player, DateTime dateTime) => AltVAsync.Schedule(() => player.SetDateTime(dateTime)); + [Obsolete("Use async entities instead")] public static Task SetWeatherAsync(this IPlayer player, uint weather) => AltVAsync.Schedule(() => player.SetWeather(weather)); + [Obsolete("Use async entities instead")] public static Task GiveWeaponAsync(this IPlayer player, uint weapon, int ammo, bool selectWeapon) => AltVAsync.Schedule(() => player.GiveWeapon(weapon, ammo, selectWeapon)); + [Obsolete("Use async entities instead")] public static Task RemoveWeaponAsync(this IPlayer player, uint weapon) => AltVAsync.Schedule(() => player.RemoveWeapon(weapon)); + [Obsolete("Use async entities instead")] public static Task RemoveAllWeaponsAsync(this IPlayer player) => AltVAsync.Schedule(player.RemoveAllWeapons); + [Obsolete("Use async entities instead")] public static Task SetMaxHealthAsync(this IPlayer player, ushort maxhealth) => AltVAsync.Schedule(() => player.MaxHealth = maxhealth); + [Obsolete("Use async entities instead")] public static Task SetMaxArmorAsync(this IPlayer player, ushort maxarmor) => AltVAsync.Schedule(() => player.MaxArmor = maxarmor); + [Obsolete("Use async entities instead")] public static Task SetCurrentWeaponAsync(this IPlayer player, uint weapon) => AltVAsync.Schedule(() => player.CurrentWeapon = weapon); + [Obsolete("Use async entities instead")] public static async Task KickAsync(this IPlayer player, string reason) { var reasonPtr = AltNative.StringUtils.StringToHGlobalUtf8(reason); @@ -129,6 +161,7 @@ await AltVAsync.Schedule(() => Marshal.FreeHGlobal(reasonPtr); } + [Obsolete("Use async entities instead")] public static async Task EmitAsync(this IPlayer player, string eventName, params object[] args) { var size = args.Length; @@ -147,134 +180,176 @@ await AltVAsync.Schedule(() => } } + [Obsolete("Use async entities instead")] public static Task GetVisibleAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Visible); + [Obsolete("Use async entities instead")] public static Task SetVisibleAsync(this IPlayer player, bool visibility) => AltVAsync.Schedule(() => player.Visible = visibility); + [Obsolete("Use async entities instead")] public static Task GetStreamedAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Streamed); + [Obsolete("Use async entities instead")] public static Task SetStreamedAsync(this IPlayer player, bool isStreamed) => AltVAsync.Schedule(() => player.Streamed = isStreamed); + [Obsolete("Use async entities instead")] public static Task GetAuthTokenAsync(this IPlayer player) => AltVAsync.Schedule(() => player.AuthToken); + [Obsolete("Use async entities instead")] public static Task GetCurrentWeaponAsync(this IPlayer player) => AltVAsync.Schedule(() => player.CurrentWeapon); + [Obsolete("Use async entities instead")] public static Task GetEntityAimingAtAsync(this IPlayer player) => AltVAsync.Schedule(() => player.EntityAimingAt); + [Obsolete("Use async entities instead")] public static Task GetEntityAimOffsetAsync(this IPlayer player) => AltVAsync.Schedule(() => player.EntityAimOffset); + [Obsolete("Use async entities instead")] public static Task GetHardwareIdHashAsync(this IPlayer player) => AltVAsync.Schedule(() => player.HardwareIdHash); + [Obsolete("Use async entities instead")] public static Task GetHardwareIdExHashAsync(this IPlayer player) => AltVAsync.Schedule(() => player.HardwareIdExHash); + [Obsolete("Use async entities instead")] public static Task GetIpAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Ip); + [Obsolete("Use async entities instead")] public static Task IsFlashlightActiveAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsFlashlightActive); + [Obsolete("Use async entities instead")] public static Task GetMaxArmorAsync(this IPlayer player) => AltVAsync.Schedule(() => player.MaxArmor); + [Obsolete("Use async entities instead")] public static Task GetMaxHealthAsync(this IPlayer player) => AltVAsync.Schedule(() => player.MaxHealth); + [Obsolete("Use async entities instead")] public static Task GetSocialClubIdAsync(this IPlayer player) => AltVAsync.Schedule(() => player.SocialClubId); + [Obsolete("Use async entities instead")] public static Task AddWeaponComponentAsync(this IPlayer player, uint weapon, uint weaponComponent) => AltVAsync.Schedule(() => player.AddWeaponComponent(weapon, weaponComponent)); + [Obsolete("Use async entities instead")] public static Task AddWeaponComponentAsync(this IPlayer player, WeaponModel weaponModel, uint weaponComponent) => AltVAsync.Schedule(() => player.AddWeaponComponent(weaponModel, weaponComponent)); + [Obsolete("Use async entities instead")] public static Task AttachToEntityAsync(this IPlayer player, IEntity entity, short otherBone, short ownBone, Position position, Rotation rotation, bool collision, bool noFixedRotation) => AltVAsync.Schedule(() => player.AttachToEntity(entity, otherBone, ownBone, position, rotation, collision, noFixedRotation)); + [Obsolete("Use async entities instead")] public static Task ClearBloodDamageAsync(this IPlayer player) => AltVAsync.Schedule(player.ClearBloodDamage); + [Obsolete("Use async entities instead")] public static Task ClearPropsAsync(this IPlayer player, byte component) => AltVAsync.Schedule(() => player.ClearProps(component)); + [Obsolete("Use async entities instead")] public static Task DetachAsync(this IPlayer player) => AltVAsync.Schedule(player.Detach); + [Obsolete("Use async entities instead")] public static Task GetClothesAsync(this IPlayer player, byte component) => AltVAsync.Schedule(() => player.GetClothes(component)); + [Obsolete("Use async entities instead")] public static Task GetCurrentWeaponTintIndexAsync(this IPlayer player) => AltVAsync.Schedule(player.GetCurrentWeaponTintIndex); + [Obsolete("Use async entities instead")] public static Task GetDlcClothesAsync(this IPlayer player, byte component) => AltVAsync.Schedule(() => player.GetDlcClothes(component)); + [Obsolete("Use async entities instead")] public static Task GetDlcPropsAsync(this IPlayer player, byte component) => AltVAsync.Schedule(() => player.GetDlcProps(component)); + [Obsolete("Use async entities instead")] public static Task GetPropsAsync(this IPlayer player, byte component) => AltVAsync.Schedule(() => player.GetProps(component)); + [Obsolete("Use async entities instead")] public static Task GetWeaponTintIndexAsync(this IPlayer player, uint weapon) => AltVAsync.Schedule(() => player.GetWeaponTintIndex(weapon)); + [Obsolete("Use async entities instead")] public static Task IsEntityInStreamingRangeAsync(this IPlayer player, IEntity entity) => AltVAsync.Schedule(() => player.IsEntityInStreamingRange(entity)); + [Obsolete("Use async entities instead")] public static Task RemoveWeaponComponentAsync(this IPlayer player, uint weapon, uint weaponComponent) => AltVAsync.Schedule(() => player.RemoveWeaponComponent(weapon, weaponComponent)); + [Obsolete("Use async entities instead")] public static Task SetClothesAsync(this IPlayer player, byte component, ushort drawable, byte texture, byte palette) => AltVAsync.Schedule(() => player.SetClothes(component, drawable, texture, palette)); + [Obsolete("Use async entities instead")] public static Task SetDlcClothesAsync(this IPlayer player, byte component, ushort drawable, byte texture, byte palette, uint dlc) => AltVAsync.Schedule(() => player.SetDlcClothes(component, drawable, texture, palette, dlc)); + [Obsolete("Use async entities instead")] public static Task SetPropsAsync(this IPlayer player, byte component, ushort drawable, byte texture) => AltVAsync.Schedule(() => player.SetProps(component, drawable, texture)); + [Obsolete("Use async entities instead")] public static Task SetDlcPropsAsync(this IPlayer player, byte component, ushort drawable, byte texture, uint dlc) => AltVAsync.Schedule(() => player.SetDlcProps(component, drawable, texture, dlc)); + [Obsolete("Use async entities instead")] public static Task SetWeaponTintIndexAsync(this IPlayer player, uint weapon, byte tintIndex) => AltVAsync.Schedule(() => player.SetWeaponTintIndex(weapon, tintIndex)); + [Obsolete("Use async entities instead")] public static Task SetWeaponTintIndexAsync(this IPlayer player, WeaponModel weaponModel, byte tintIndex) => AltVAsync.Schedule(() => player.SetWeaponTintIndex(weaponModel, tintIndex)); + [Obsolete("Use async entities instead")] public static Task GetInvincibleAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Invincible); + [Obsolete("Use async entities instead")] public static Task SetInvincibleAsync(this IPlayer player, bool isInvincible) => AltVAsync.Schedule(() => player.Invincible = isInvincible); + [Obsolete("Use async entities instead")] public static Task SetIntoVehicleAsync(this IPlayer player, IVehicle vehicle, byte seat) => AltVAsync.Schedule(() => player.SetIntoVehicle(vehicle, seat)); + [Obsolete("Use async entities instead")] public static Task IsSuperJumpEnabledAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsSuperJumpEnabled); + [Obsolete("Use async entities instead")] public static Task IsCrouchingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsCrouching); + [Obsolete("Use async entities instead")] public static Task IsStealthyAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsStealthy); + [Obsolete("Use async entities instead")] public static Task PlayAmbientSpeechAsync(this IPlayer player, string speechName, string speechParam, uint speechDictHash) => AltVAsync.Schedule(() => player.PlayAmbientSpeech(speechName, speechParam, speechDictHash)); } diff --git a/api/AltV.Net.Async/AltAsync.Vehicle.cs b/api/AltV.Net.Async/AltAsync.Vehicle.cs index f2c7e5394..d528603c1 100644 --- a/api/AltV.Net.Async/AltAsync.Vehicle.cs +++ b/api/AltV.Net.Async/AltAsync.Vehicle.cs @@ -33,105 +33,139 @@ public static IVehicleBuilder CreateVehicleBuilder(VehicleModel model, Position public static IVehicleBuilder CreateVehicleBuilder(string model, Position pos, Rotation rot) => new VehicleBuilder(Alt.Hash(model), pos, rot); + [Obsolete("Use async entities instead")] public static Task GetDriverAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => !vehicle.Exists ? null : vehicle.Driver); + [Obsolete("Use async entities instead")] public static Task GetModKitAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.ModKit); + [Obsolete("Use async entities instead")] public static Task SetModKitAsync(this IVehicle vehicle, byte modKit) => AltVAsync.Schedule(() => vehicle.ModKit = modKit); + [Obsolete("Use async entities instead")] public static Task IsPrimaryColorRgbAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsPrimaryColorRgb); + [Obsolete("Use async entities instead")] public static Task GetPrimaryColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.PrimaryColor); + [Obsolete("Use async entities instead")] public static Task SetPrimaryColorAsync(this IVehicle vehicle, byte primaryColor) => AltVAsync.Schedule(() => vehicle.PrimaryColor = primaryColor); + [Obsolete("Use async entities instead")] public static Task GetPrimaryColorRgbAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.PrimaryColorRgb); + [Obsolete("Use async entities instead")] public static Task SetPrimaryColorRgbAsync(this IVehicle vehicle, Rgba primaryColor) => AltVAsync.Schedule(() => vehicle.PrimaryColorRgb = primaryColor); + [Obsolete("Use async entities instead")] public static Task IsSecondaryColorRgbAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsSecondaryColorRgb); + [Obsolete("Use async entities instead")] public static Task GetSecondaryColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.SecondaryColor); + [Obsolete("Use async entities instead")] public static Task SetSecondaryColorAsync(this IVehicle vehicle, byte secondaryColor) => AltVAsync.Schedule(() => vehicle.SecondaryColor = secondaryColor); + [Obsolete("Use async entities instead")] public static Task GetSecondaryColorRgbAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.SecondaryColorRgb); + [Obsolete("Use async entities instead")] public static Task SetSecondaryColorRgbAsync(this IVehicle vehicle, Rgba secondaryColor) => AltVAsync.Schedule(() => vehicle.SecondaryColorRgb = secondaryColor); + [Obsolete("Use async entities instead")] public static Task IsTireSmokeColorCustomAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsTireSmokeColorCustom); + [Obsolete("Use async entities instead")] public static Task GetPearlColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.PearlColor); + [Obsolete("Use async entities instead")] public static Task SetPearlColorAsync(this IVehicle vehicle, byte pearlColor) => AltVAsync.Schedule(() => vehicle.PearlColor = pearlColor); + [Obsolete("Use async entities instead")] public static Task GetWheelColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.WheelColor); + [Obsolete("Use async entities instead")] public static Task SetWheelColorAsync(this IVehicle vehicle, byte wheelColor) => AltVAsync.Schedule(() => vehicle.WheelColor = wheelColor); + [Obsolete("Use async entities instead")] public static Task GetInteriorColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.InteriorColor); + [Obsolete("Use async entities instead")] public static Task SetInteriorColorAsync(this IVehicle vehicle, byte interiorColor) => AltVAsync.Schedule(() => vehicle.InteriorColor = interiorColor); + [Obsolete("Use async entities instead")] public static Task GetDashboardColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.DashboardColor); + [Obsolete("Use async entities instead")] public static Task SetDashboardColorAsync(this IVehicle vehicle, byte dashboardColor) => AltVAsync.Schedule(() => vehicle.DashboardColor = dashboardColor); + [Obsolete("Use async entities instead")] public static Task GetTireSmokeColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.TireSmokeColor); + [Obsolete("Use async entities instead")] public static Task SetTireSmokeColorAsync(this IVehicle vehicle, Rgba tireSmokeColor) => AltVAsync.Schedule(() => vehicle.TireSmokeColor = tireSmokeColor); + [Obsolete("Use async entities instead")] public static Task GetWheelTypeAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.WheelType); + [Obsolete("Use async entities instead")] public static Task GetWheelVariationAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.WheelVariation); + [Obsolete("Use async entities instead")] public static Task HasCustomTiresAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.CustomTires); + [Obsolete("Use async entities instead")] public static Task SetCustomTiresAsync(this IVehicle vehicle, bool customTires) => AltVAsync.Schedule(() => vehicle.CustomTires = customTires); + [Obsolete("Use async entities instead")] public static Task GetSpecialDarknessAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.SpecialDarkness); + [Obsolete("Use async entities instead")] public static Task SetSpecialDarknessAsync(this IVehicle vehicle, byte specialDarkness) => AltVAsync.Schedule(() => vehicle.SpecialDarkness = specialDarkness); + [Obsolete("Use async entities instead")] public static Task GetNumberplateIndexAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.NumberplateIndex); + [Obsolete("Use async entities instead")] public static Task SetNumberplateIndexAsync(this IVehicle vehicle, uint numberPlateIndex) => AltVAsync.Schedule(() => vehicle.NumberplateIndex = numberPlateIndex); + [Obsolete("Use async entities instead")] public static async Task GetNumberplateTextAsync(this IVehicle vehicle) => await AltVAsync.Schedule( () => vehicle.NumberplateText); + [Obsolete("Use async entities instead")] public static async Task SetNumberplateTextAsync(this IVehicle vehicle, string numberPlateText) { var numberPlateTextPtr = AltNative.StringUtils.StringToHGlobalUtf8(numberPlateText); @@ -146,250 +180,332 @@ await AltVAsync.Schedule(() => Marshal.FreeHGlobal(numberPlateTextPtr); } + [Obsolete("Use async entities instead")] public static Task GetWindowTintAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.WindowTint); + [Obsolete("Use async entities instead")] public static Task SetWindowTintAsync(this IVehicle vehicle, byte windowTint) => AltVAsync.Schedule(() => vehicle.WindowTint = windowTint); + [Obsolete("Use async entities instead")] public static Task GetDirtLevelAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.DirtLevel); + [Obsolete("Use async entities instead")] public static Task SetDirtLevelAsync(this IVehicle vehicle, byte dirtLevel) => AltVAsync.Schedule(() => vehicle.DirtLevel = dirtLevel); + [Obsolete("Use async entities instead")] public static Task GetNeonColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.NeonColor); + [Obsolete("Use async entities instead")] public static Task SetNeonColorAsync(this IVehicle vehicle, Rgba neonColor) => AltVAsync.Schedule(() => vehicle.NeonColor = neonColor); + [Obsolete("Use async entities instead")] public static Task GetHealthDataAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.HealthData); + [Obsolete("Use async entities instead")] public static Task SetHealthDataAsync(this IVehicle vehicle, string healthData) => AltVAsync.Schedule(() => vehicle.HealthData = healthData); + [Obsolete("Use async entities instead")] public static Task IsEngineOnAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.EngineOn); + [Obsolete("Use async entities instead")] public static Task SetEngineOnAsync(this IVehicle vehicle, bool engineOn) => AltVAsync.Schedule(() => vehicle.EngineOn = engineOn); + [Obsolete("Use async entities instead")] public static Task GetBodyAdditionalHealthAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.BodyAdditionalHealth); + [Obsolete("Use async entities instead")] public static Task SetBodyAdditionalHealthAsync(this IVehicle vehicle, uint bodyAdditionalHealth) => AltVAsync.Schedule(() => vehicle.BodyAdditionalHealth = bodyAdditionalHealth); + [Obsolete("Use async entities instead")] public static Task GetBodyHealthAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.BodyHealth); + [Obsolete("Use async entities instead")] public static Task SetBodyHealthAsync(this IVehicle vehicle, uint bodyHealth) => AltVAsync.Schedule(() => vehicle.BodyHealth = bodyHealth); + [Obsolete("Use async entities instead")] public static Task GetRepairsCountAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.RepairsCount); + [Obsolete("Use async entities instead")] public static Task GetWheelsCountAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.WheelsCount); + [Obsolete("Use async entities instead")] public static Task GetPetrolTankHealthAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.PetrolTankHealth); + [Obsolete("Use async entities instead")] public static Task SetPetrolTankHealthAsync(this IVehicle vehicle, int petrolTankHealth) => AltVAsync.Schedule(() => vehicle.PetrolTankHealth = petrolTankHealth); + [Obsolete("Use async entities instead")] public static Task GetEngineHealthAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.EngineHealth); + [Obsolete("Use async entities instead")] public static Task SetEngineHealthAsync(this IVehicle vehicle, int engineHealth) => AltVAsync.Schedule(() => vehicle.EngineHealth = engineHealth); + [Obsolete("Use async entities instead")] public static Task IsNeonActiveAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsNeonActive); + [Obsolete("Use async entities instead")] public static Task GetStateAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.State); + [Obsolete("Use async entities instead")] public static Task SetStateAsync(this IVehicle vehicle, string state) => AltVAsync.Schedule(() => vehicle.State = state); + [Obsolete("Use async entities instead")] public static Task GetRoofStateAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.RoofState); + [Obsolete("Use async entities instead")] public static Task SetRoofStateAsync(this IVehicle vehicle, byte roofState) => AltVAsync.Schedule(() => vehicle.RoofState = roofState); + [Obsolete("Use async entities instead")] public static Task GetDoorStateAsync(this IVehicle vehicle, byte doorId) => AltVAsync.Schedule(() => vehicle.GetDoorState(doorId)); + [Obsolete("Use async entities instead")] public static Task SetDoorStateAsync(this IVehicle vehicle, byte doorId, byte state) => AltVAsync.Schedule(() => vehicle.SetDoorState(doorId, state)); + [Obsolete("Use async entities instead")] public static Task GetDoorStateAsync(this IVehicle vehicle, VehicleDoor door) => AltVAsync.Schedule(() => vehicle.GetDoorStateExt(door)); + [Obsolete("Use async entities instead")] public static Task SetDoorStateAsync(this IVehicle vehicle, VehicleDoor door, VehicleDoorState state) => AltVAsync.Schedule(() => vehicle.SetDoorStateExt(door, state)); + [Obsolete("Use async entities instead")] public static Task IsWindowOpenedAsync(this IVehicle vehicle, byte windowId) => AltVAsync.Schedule(() => vehicle.IsWindowOpened(windowId)); + [Obsolete("Use async entities instead")] public static Task SetWindowOpenedAsync(this IVehicle vehicle, byte windowId, bool state) => AltVAsync.Schedule(() => vehicle.SetWindowOpened(windowId, state)); + [Obsolete("Use async entities instead")] public static Task IsNightlightOnAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsNightlightOn); + [Obsolete("Use async entities instead")] public static Task IsDaylightOnAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsDaylightOn); + [Obsolete("Use async entities instead")] public static Task GetLockStateAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.LockState); + [Obsolete("Use async entities instead")] public static Task SetLockStateAsync(this IVehicle vehicle, VehicleLockState lockState) => AltVAsync.Schedule(() => vehicle.LockState = lockState); + [Obsolete("Use async entities instead")] public static Task IsSirenActiveAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.SirenActive); + [Obsolete("Use async entities instead")] public static Task SetSirenActiveAsync(this IVehicle vehicle, bool sirenActive) => AltVAsync.Schedule(() => vehicle.SirenActive = sirenActive); + [Obsolete("Use async entities instead")] public static Task GetHeadlightColorAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.HeadlightColor); + [Obsolete("Use async entities instead")] public static Task SetHeadlightColorAsync(this IVehicle vehicle, byte headlightColor) => AltVAsync.Schedule(() => vehicle.HeadlightColor = headlightColor); + [Obsolete("Use async entities instead")] public static Task IsHandbrakeActiveAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsHandbrakeActive); + [Obsolete("Use async entities instead")] public static Task IsFlamethrowerActiveAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsFlamethrowerActive); + [Obsolete("Use async entities instead")] public static Task HasArmoredWindowsAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.HasArmoredWindows); + [Obsolete("Use async entities instead")] public static Task SetSpecialLightDamagedAsync(this IVehicle vehicle, byte specialLightId, bool isDamaged) => AltVAsync.Schedule(() => vehicle.SetSpecialLightDamaged(specialLightId, isDamaged)); + [Obsolete("Use async entities instead")] public static Task IsSpecialLightDamagedAsync(this IVehicle vehicle, byte specialLightId) => AltVAsync.Schedule(() => vehicle.IsSpecialLightDamaged(specialLightId)); + [Obsolete("Use async entities instead")] public static Task SetWindowDamagedAsync(this IVehicle vehicle, byte windowId, bool isDamaged) => AltVAsync.Schedule(() => vehicle.SetWindowDamaged(windowId, isDamaged)); + [Obsolete("Use async entities instead")] public static Task IsWindowDamagedAsync(this IVehicle vehicle, byte windowId) => AltVAsync.Schedule(() => vehicle.IsWindowDamaged(windowId)); + [Obsolete("Use async entities instead")] public static Task IsLightDamagedAsync(this IVehicle vehicle, byte lightId) => AltVAsync.Schedule(() => vehicle.IsLightDamaged(lightId)); + [Obsolete("Use async entities instead")] public static Task SetLightDamagedAsync(this IVehicle vehicle, byte lightId, bool isDamaged) => AltVAsync.Schedule(() => vehicle.SetLightDamaged(lightId, isDamaged)); + [Obsolete("Use async entities instead")] public static Task GetPartBulletHolesAsync(this IVehicle vehicle, byte partId) => AltVAsync.Schedule(() => vehicle.GetPartBulletHoles(partId)); + [Obsolete("Use async entities instead")] public static Task SetPartBulletHolesAsync(this IVehicle vehicle, byte partId, byte shootsCount) => AltVAsync.Schedule(() => vehicle.SetPartBulletHoles(partId, shootsCount)); + [Obsolete("Use async entities instead")] public static Task GetPartBulletHolesExtAsync(this IVehicle vehicle, VehiclePart part) => AltVAsync.Schedule(() => vehicle.GetPartBulletHolesExt(part)); + [Obsolete("Use async entities instead")] public static Task SetPartBulletHolesExtAsync(this IVehicle vehicle, VehiclePart part, byte shootsCount) => AltVAsync.Schedule(() => vehicle.SetPartBulletHolesExt(part, shootsCount)); + [Obsolete("Use async entities instead")] public static Task GetPartDamageLevelAsync(this IVehicle vehicle, byte partId) => AltVAsync.Schedule(() => vehicle.GetPartDamageLevel(partId)); + [Obsolete("Use async entities instead")] public static Task SetPartDamageLevelAsync(this IVehicle vehicle, byte partId, byte damage) => AltVAsync.Schedule(() => vehicle.SetPartDamageLevel(partId, damage)); + [Obsolete("Use async entities instead")] public static Task GetPartDamageLevelExtAsync(this IVehicle vehicle, VehiclePart part) => AltVAsync.Schedule(() => vehicle.GetPartDamageLevelExt(part)); + [Obsolete("Use async entities instead")] public static Task SetPartDamageLevelExtAsync(this IVehicle vehicle, VehiclePart part, byte damage) => AltVAsync.Schedule(() => vehicle.SetPartDamageLevelExt(part, damage)); + [Obsolete("Use async entities instead")] public static Task GetArmoredWindowHealthAsync(this IVehicle vehicle, byte windowId) => AltVAsync.Schedule(() => vehicle.GetArmoredWindowHealth(windowId)); + [Obsolete("Use async entities instead")] public static Task SetArmoredWindowHealthAsync(this IVehicle vehicle, byte windowId, float health) => AltVAsync.Schedule(() => vehicle.SetArmoredWindowHealth(windowId, health)); + [Obsolete("Use async entities instead")] public static Task GetArmoredWindowShootCountAsync(this IVehicle vehicle, byte windowId) => AltVAsync.Schedule(() => vehicle.GetArmoredWindowShootCount(windowId)); + [Obsolete("Use async entities instead")] public static Task SetArmoredWindowShootCountAsync(this IVehicle vehicle, byte windowId, byte count) => AltVAsync.Schedule(() => vehicle.SetArmoredWindowShootCount(windowId, count)); + [Obsolete("Use async entities instead")] public static Task GetBumperDamageLevelAsync(this IVehicle vehicle, byte bumperId) => AltVAsync.Schedule(() => vehicle.GetBumperDamageLevel(bumperId)); + [Obsolete("Use async entities instead")] public static Task SetBumperDamageLevelAsync(this IVehicle vehicle, byte bumperId, byte damageLevel) => AltVAsync.Schedule(() => vehicle.SetBumperDamageLevel(bumperId, damageLevel)); + [Obsolete("Use async entities instead")] public static Task GetBumperDamageLevelExtAsync(this IVehicle vehicle, VehicleBumper bumper) => AltVAsync.Schedule(() => vehicle.GetBumperDamageLevelExt(bumper)); + [Obsolete("Use async entities instead")] public static Task SetBumperDamageLevelExtAsync(this IVehicle vehicle, VehicleBumper bumper, VehicleBumperDamage bumperDamage) => AltVAsync.Schedule(() => vehicle.SetBumperDamageLevelExt(bumper, bumperDamage)); + [Obsolete("Use async entities instead")] public static Task GetDamageDataAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.DamageData); + [Obsolete("Use async entities instead")] public static Task SetDamageDataAsync(this IVehicle vehicle, string damageData) => AltVAsync.Schedule(() => vehicle.DamageData = damageData); + [Obsolete("Use async entities instead")] public static Task GetModAsync(this IVehicle vehicle, byte category) => AltVAsync.Schedule(() => vehicle.GetMod(category)); + [Obsolete("Use async entities instead")] public static Task GetModsCountAsync(this IVehicle vehicle, byte category) => AltVAsync.Schedule(() => vehicle.GetModsCount(category)); + [Obsolete("Use async entities instead")] public static Task SetModAsync(this IVehicle vehicle, byte category, byte id) => AltVAsync.Schedule(() => vehicle.SetMod(category, id)); + [Obsolete("Use async entities instead")] public static Task GetModKitsCountAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.ModKitsCount); + [Obsolete("Use async entities instead")] public static Task SetWheelsAsync(this IVehicle vehicle, byte type, byte variation) => AltVAsync.Schedule(() => vehicle.SetWheels(type, variation)); - + + [Obsolete("Use async entities instead")] public static Task SetRearWheelAsync(this IVehicle vehicle, byte variation) => AltVAsync.Schedule(() => vehicle.RearWheel = variation); + [Obsolete("Use async entities instead")] public static Task GetRearWheelAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.RearWheel); + [Obsolete("Use async entities instead")] public static Task SetLiveryAsync(this IVehicle vehicle, byte livery) => AltVAsync.Schedule(() => vehicle.Livery = livery); + [Obsolete("Use async entities instead")] public static Task GetLiveryAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.Livery); + [Obsolete("Use async entities instead")] public static Task SetRoofLiveryAsync(this IVehicle vehicle, byte roofLivery) => AltVAsync.Schedule(() => vehicle.RoofLivery = roofLivery); + [Obsolete("Use async entities instead")] public static Task GetRoofLiveryAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.RoofLivery); + [Obsolete("Use async entities instead")] public static Task SetLightsMultiplierAsync(this IVehicle vehicle, float multiplier) => AltVAsync.Schedule(() => vehicle.LightsMultiplier = multiplier); + [Obsolete("Use async entities instead")] public static Task GetLightsMultiplierAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.LightsMultiplier); + [Obsolete("Use async entities instead")] public static Task IsExtraOnAsync(this IVehicle vehicle, byte extraId) => AltVAsync.Schedule(() => vehicle.IsExtraOn(extraId)); + [Obsolete("Use async entities instead")] public static Task ToggleExtraAsync(this IVehicle vehicle, byte extraId, bool state) => AltVAsync.Schedule(() => vehicle.ToggleExtra(extraId, state)); + [Obsolete("Use async entities instead")] public static Task> GetNeonActiveAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => { @@ -398,98 +514,129 @@ public static Task> GetNeonActiveAsync(this IVehic return new Tuple(left, right, front, back); }); + [Obsolete("Use async entities instead")] public static Task SetNeonActiveAsync(this IVehicle vehicle, bool left, bool right, bool front, bool back) => AltVAsync.Schedule(() => vehicle.SetNeonActive(left, right, front, back)); + [Obsolete("Use async entities instead")] public static Task GetAppearanceDataAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.AppearanceData); + [Obsolete("Use async entities instead")] public static Task SetAppearanceDataAsync(this IVehicle vehicle, string text) => AltVAsync.Schedule(() => vehicle.AppearanceData = text); + [Obsolete("Use async entities instead")] public static Task GetRadioStationAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.RadioStation); + [Obsolete("Use async entities instead")] public static Task SetRadioStationAsync(this IVehicle vehicle, uint radioStation) => AltVAsync.Schedule(() => vehicle.RadioStation = radioStation); + [Obsolete("Use async entities instead")] public static Task GetManualEngineControlAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.ManualEngineControl); + [Obsolete("Use async entities instead")] public static Task SetManualEngineControlAsync(this IVehicle vehicle, bool state) => AltVAsync.Schedule(() => vehicle.ManualEngineControl = state); + [Obsolete("Use async entities instead")] public static Task GetScriptDataAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.ScriptData); + [Obsolete("Use async entities instead")] public static Task SetScriptDataAsync(this IVehicle vehicle, string text) => AltVAsync.Schedule(() => vehicle.ScriptData = text); + [Obsolete("Use async entities instead")] public static Task RemoveAsync(this IVehicle vehicle) => AltVAsync.Schedule(vehicle.Remove); + [Obsolete("Use async entities instead")] public static Task GetVisibleAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.Visible); + [Obsolete("Use async entities instead")] public static Task SetVisibleAsync(this IVehicle vehicle, bool visibility) => AltVAsync.Schedule(() => vehicle.Visible = visibility); + [Obsolete("Use async entities instead")] public static Task GetStreamedAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.Streamed); + [Obsolete("Use async entities instead")] public static Task SetStreamedAsync(this IVehicle vehicle, bool isStreamed) => AltVAsync.Schedule(() => vehicle.Streamed = isStreamed); + [Obsolete("Use async entities instead")] public static Task IsDestroyedAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.IsDestroyed); + [Obsolete("Use async entities instead")] public static Task AttachedAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.Attached); + [Obsolete("Use async entities instead")] public static Task AttachedToAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.AttachedTo); + [Obsolete("Use async entities instead")] public static Task AttachToEntityAsync(this IVehicle vehicle, IEntity entity, short otherBone, short ownBone, Position position, Rotation rotation, bool collision, bool noFixedRotation) => AltVAsync.Schedule(() => vehicle.AttachToEntity(entity, otherBone, ownBone, position, rotation, collision, noFixedRotation)); + [Obsolete("Use async entities instead")] public static Task DetachAsync(this IVehicle vehicle) => AltVAsync.Schedule(vehicle.Detach); + [Obsolete("Use async entities instead")] public static Task DoesWheelHasTireAsync(this IVehicle vehicle, byte wheelId) => AltVAsync.Schedule(() => vehicle.DoesWheelHasTire(wheelId)); + [Obsolete("Use async entities instead")] public static Task GetWheelHealthAsync(this IVehicle vehicle, byte wheelId) => AltVAsync.Schedule(() => vehicle.GetWheelHealth(wheelId)); + [Obsolete("Use async entities instead")] public static Task SetWheelHealthAsync(this IVehicle vehicle, byte wheelId, float health) => AltVAsync.Schedule(() => vehicle.SetWheelHealth(wheelId, health)); + [Obsolete("Use async entities instead")] public static Task RepairAsync(this IVehicle vehicle) => AltVAsync.Schedule(vehicle.Repair); + [Obsolete("Use async entities instead")] public static Task IsWheelBurstAsync(this IVehicle vehicle, byte wheelId) => AltVAsync.Schedule(() => vehicle.IsWheelBurst(wheelId)); + [Obsolete("Use async entities instead")] public static Task SetWheelBurstAsync(this IVehicle vehicle, byte wheelId, bool state) => AltVAsync.Schedule(() => vehicle.SetWheelBurst(wheelId, state)); + [Obsolete("Use async entities instead")] public static Task IsWheelDetachedAsync(this IVehicle vehicle, byte wheelId) => AltVAsync.Schedule(() => vehicle.IsWheelDetached(wheelId)); + [Obsolete("Use async entities instead")] public static Task SetWheelDetachedAsync(this IVehicle vehicle, byte wheelId, bool state) => AltVAsync.Schedule(() => vehicle.SetWheelDetached(wheelId, state)); + [Obsolete("Use async entities instead")] public static Task IsWheelOnFireAsync(this IVehicle vehicle, byte wheelId) => AltVAsync.Schedule(() => vehicle.IsWheelOnFire(wheelId)); + [Obsolete("Use async entities instead")] public static Task SetWheelOnFireAsync(this IVehicle vehicle, byte wheelId, bool state) => AltVAsync.Schedule(() => vehicle.SetWheelOnFire(wheelId, state)); + [Obsolete("Use async entities instead")] public static Task SetWheelHasTireAsync(this IVehicle vehicle, byte wheelId, bool state) => AltVAsync.Schedule(() => vehicle.SetWheelHasTire(wheelId, state)); + [Obsolete("Use async entities instead")] public static Task GetVelocityAsync(this IVehicle vehicle) => AltVAsync.Schedule(() => vehicle.Velocity); } diff --git a/api/AltV.Net.Async/AltAsync.WorldObject.cs b/api/AltV.Net.Async/AltAsync.WorldObject.cs index 208882052..a8e5496c3 100644 --- a/api/AltV.Net.Async/AltAsync.WorldObject.cs +++ b/api/AltV.Net.Async/AltAsync.WorldObject.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using AltV.Net.Data; using AltV.Net.Elements.Entities; @@ -7,24 +8,31 @@ namespace AltV.Net.Async //TODO: allocate position, rotation, rgba structs in task thread an pass them to the main thread instead of creating them in the main thread public partial class AltAsync { + [Obsolete("Use async entities instead")] public static Task SetPositionAsync(this IWorldObject worldObject, Position position) => AltVAsync.Schedule(() => worldObject.Position = position); + [Obsolete("Use async entities instead")] public static Task SetPositionAsync(this IWorldObject worldObject, float x, float y, float z) => AltVAsync.Schedule(() => worldObject.SetPosition(x, y, z)); + [Obsolete("Use async entities instead")] public static Task SetPositionAsync(this IWorldObject worldObject, (float X, float Y, float Z) position) => AltVAsync.Schedule(() => worldObject.SetPosition(position)); + [Obsolete("Use async entities instead")] public static Task GetPositionAsync(this IWorldObject worldObject) => AltVAsync.Schedule(() => worldObject.Position); + [Obsolete("Use async entities instead")] public static Task<(float X, float Y, float Z)> GetPositionTupleAsync(this IWorldObject worldObject) => AltVAsync.Schedule(worldObject.GetPosition); + [Obsolete("Use async entities instead")] public static Task SetDimensionAsync(this IWorldObject worldObject, int dimension) => AltVAsync.Schedule(() => worldObject.Dimension = dimension); + [Obsolete("Use async entities instead")] public static Task GetDimensionAsync(this IWorldObject worldObject) => AltVAsync.Schedule(() => worldObject.Dimension); }