Update 29.10.2022
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using CitizenFX.Core.Native;
|
||||
using Mosleys.Shared.Models;
|
||||
|
||||
namespace Mosleys.Client.Extensions {
|
||||
public static class ExhibitVehicleExtensions {
|
||||
|
||||
public static string DisplayName(this ExhibitVehicle exhibit) =>
|
||||
API.GetDisplayNameFromVehicleModel(Convert.ToUInt32((exhibit.Vehicle as dynamic).model));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using CitizenFX.Core;
|
||||
|
||||
namespace Mosleys.Client.Extensions {
|
||||
public static class Vector4Extensions {
|
||||
|
||||
public static Vector3 ToVector3(this Vector4 vector) => new Vector3(vector.X, vector.Y, vector.Z);
|
||||
|
||||
}
|
||||
}
|
||||
23
C#/Mosleys/Mosleys.Client/Extensions/VehicleExtensions.cs
Normal file
23
C#/Mosleys/Mosleys.Client/Extensions/VehicleExtensions.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using CitizenFX.Core;
|
||||
using CitizenFX.Core.Native;
|
||||
|
||||
namespace Mosleys.Client.Extensions {
|
||||
public static class VehicleExtensions {
|
||||
|
||||
public static void Freeze(this Entity vehicle, bool toggle) => API.FreezeEntityPosition(vehicle.Handle, toggle);
|
||||
|
||||
public static void SetDoorLockStatus(this Vehicle vehicle, LockStatus status) => API.SetVehicleDoorsLocked(vehicle.Handle, (int)status);
|
||||
|
||||
}
|
||||
|
||||
public enum LockStatus {
|
||||
None,
|
||||
Unlocked,
|
||||
Locked,
|
||||
LockForPlayers,
|
||||
LockForInVehicle,
|
||||
LockedInitially,
|
||||
ForceShutDoors,
|
||||
LockedButCanBeDamaged
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user