Aded vehicle sync system (engines now have to be tuned on /off with N key)

This commit is contained in:
hydrant
2018-12-09 20:35:30 +01:00
parent 01bd291e81
commit d50ffa0556
7 changed files with 1005 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
using GTANetworkAPI;
using reallife_gamemode.Model;
using reallife_gamemode.Server.Extensions;
using reallife_gamemode.Server.Managers;
using reallife_gamemode.Server.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -34,6 +36,8 @@ namespace reallife_gamemode.Server.Entities
{
if (currentVeh != null) VehicleManager.DeleteVehicle(currentVeh);
Vehicle veh = NAPI.Vehicle.CreateVehicle(this.Model, this.Position, this.Heading, this.PrimaryColor, this.SecondaryColor, this.NumberPlate, locked: this.Locked, engine: false);
VehicleStreaming.SetEngineState(veh, false);
VehicleStreaming.SetLockStatus(veh, false);
VehicleManager.AddVehicle(this, veh);
string numberplate = $"{this.Id}";