public JunkerJob(JobEntityModel jobEntityModel) : base(jobEntityModel) { foreach (TrashPointModel trash in TrashPoints) { IColShape trashColshape = Alt.CreateColShapeCylinder(new Position(trash.TrashPosition.X, trash.TrashPosition.Y, trash.TrashPosition.Z - 0.9f), 2f, 2f); trashColshape.SetData("trash:data", trash); } }
public void LoadGarage() { Database db = new Database(); float garageX = db.SelectFloat($"SELECT * FROM garage WHERE teamid={this.Id}", "pos_x"); float garageY = db.SelectFloat($"SELECT * FROM garage WHERE teamid={this.Id}", "pos_y"); float garageZ = db.SelectFloat($"SELECT * FROM garage WHERE teamid={this.Id}", "pos_z"); this.Garage = new Position(garageX, garageY, garageZ); this.GaragePed = db.SelectString($"SELECT * FROM garage WHERE teamid={this.Id}", "ped"); this.NPCHeading = db.SelectFloat($"SELECT * FROM garage WHERE teamid={this.Id}", "heading"); float spawnX = db.SelectFloat($"SELECT * FROM garages_spawns WHERE id={this.Id}", "spawn_x"); float spawnY = db.SelectFloat($"SELECT * FROM garages_spawns WHERE id={this.Id}", "spawn_y"); float spawnZ = db.SelectFloat($"SELECT * FROM garages_spawns WHERE id={this.Id}", "spawn_z"); this.GarageSpawn = new Position(spawnX, spawnY, spawnZ); this.GarageSpawnHeading = db.SelectFloat($"SELECT * FROM garages_spawns WHERE id={this.Id}", "spawn_heading"); IColShape shape = Alt.CreateColShapeCircle(this.Garage, 5f); shape.SetData("GARAGE", this.Id); }
public void OpenVehicleTrunkRequest(IPlayer player, IVehicle vehicle, string positionJson) { //IVehicle vehicle = (IVehicle)args[0]; Vector3 positionTrunk = JsonConvert.DeserializeObject <Vector3>(positionJson); Alt.Log("Doszedl event trunk"); Alt.Log($"xx: {positionTrunk.X} y: {positionTrunk.Y} z: {positionTrunk.Z}"); VehicleEntity vehicleEntity = vehicle.GetVehicleEntity(); if (vehicleEntity == null) { return; } IColShape trunkColShape = Alt.CreateColShapeCylinder(new Position(positionTrunk.X, positionTrunk.Y, positionTrunk.Z), 2f, 2f); trunkColShape.SetData("vehicle:trunk", vehicleEntity); vehicle.SetData("current:vehicle-trunks", trunkColShape); DrawTextModel drawTextModel = new DrawTextModel() { Text = "Kliknij ~g~E ~w~ aby otworzyć bagażnik", X = positionTrunk.X, Y = positionTrunk.Y, Z = positionTrunk.Z, Dimension = vehicle.Dimension, UniqueID = $"VEHICLE_TRUNK_DRAW_TEXT{vehicleEntity.DbModel.Id}" }; DrawTextHelper.CreateGlobalDrawText(drawTextModel); vehicleEntity.TrunkOpen = true; }