I've got the following code
Code: Select all
class eco.Vehicle {
vehicle_id = null;
engine_id = null;
constructor(vehicle_id) {
this.vehicle_id = vehicle_id;
}
function GetLocation() {
local tile_index = GSVehicle.GetLocation(vehicle_id);
local tile = Tile(tile_index);
return tile;
}
function GetOwner() {
return GSVehicle.GetOwner(vehicle_id);
}
function Clone(depot_tile_index) {
local company = GSCompanyMode(GetOwner());
local id = GSVehicle.CloneVehicle(depot_tile_index, vehicle_id, true );
GSLog.Info( "isvalid: " +GSVehicle.IsValidVehicle(id));
}
}
The line GSLog.Info( "isvalid: " +GSVehicle.IsValidVehicle(id)); says it(the vehiclle) is valid but no real effect. I've tried also using GSExecMode() with nothing happening.
Any suggestions and help would be appreciated.