public IVehicle CreateVehicle(uint model, Position pos, Rotation rotation) { unsafe { CheckIfCallIsValid(); CheckIfThreadIsValid(); ushort id = default; var ptr = Library.Server.Core_CreateVehicle(NativePointer, model, pos, rotation, &id); if (ptr == IntPtr.Zero) { return(null); } return(VehiclePool.Create(this, ptr, id)); } }
public IVehicle CreateVehicle(uint model, Position pos, Rotation rotation) { var ptr = MockEntities.GetNextPtr(out var entityId); var vehicle = VehiclePool.Create(this, ptr, entityId); vehicle.Position = pos; if (vehicle is MockVehicle mockVehicle) { mockVehicle.Position = pos; mockVehicle.Rotation = rotation; mockVehicle.Model = model; } Alt.CoreImpl.OnCreateVehicle(ptr, entityId); return(vehicle); }