Jump to content

LightScr

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by LightScr

  1. Maybe you need to copy System.IO.dll? Also I would recommend to create postbuild script which will copy DLLs after every build.

    Add this to your projectName.csproj before </Project>

    <Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
        <Exec Command="call postbuild.bat $(ConfigurationName)" />
    </Target>

    in the same folder create file and adjust my script to your needs - postbuild.bat

    echo Build type: %1
    
    cd /d %~dp0 
    xcopy bin\%1\netcoreapp3.1\en-GB ..\..\runtime\en-GB /e /i /Y
    xcopy bin\%1\netcoreapp3.1\en-GB bin\%1\netcoreapp3.1 /e /i /Y
    
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\..\runtime\Microsoft.Extensions.DependencyInjection.Abstractions.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.DependencyInjection.dll ..\..\runtime\Microsoft.Extensions.DependencyInjection.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.Logging.Abstractions.dll ..\..\runtime\Microsoft.Extensions.Logging.Abstractions.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.Logging.dll ..\..\runtime\Microsoft.Extensions.Logging.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.Caching.Abstractions.dll ..\..\runtime\Microsoft.Extensions.Caching.Abstractions.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.Options.dll ..\..\runtime\Microsoft.Extensions.Options.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.Caching.Memory.dll ..\..\runtime\Microsoft.Extensions.Caching.Memory.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.Primitives.dll ..\..\runtime\Microsoft.Extensions.Primitives.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Bcl.HashCode.dll ..\..\runtime\Microsoft.Bcl.HashCode.dll /Y
    copy bin\%1\netcoreapp3.1\Pomelo.JsonObject.dll ..\..\runtime\Pomelo.JsonObject.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.Extensions.Configuration.Abstractions.dll ..\..\runtime\Microsoft.Extensions.Configuration.Abstractions.dll /Y
    
    copy bin\%1\netcoreapp3.1\System.ComponentModel.Annotations.dll ..\..\runtime\System.ComponentModel.Annotations.dll /Y
    copy bin\%1\netcoreapp3.1\System.Diagnostics.DiagnosticSource.dll ..\..\runtime\System.Diagnostics.DiagnosticSource.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.EntityFrameworkCore.dll ..\..\runtime\Microsoft.EntityFrameworkCore.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.EntityFrameworkCore.Relational.dll ..\..\runtime\Microsoft.EntityFrameworkCore.Relational.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.EntityFrameworkCore.Abstractions.dll ..\..\runtime\Microsoft.EntityFrameworkCore.Abstractions.dll /Y
    copy bin\%1\netcoreapp3.1\Microsoft.EntityFrameworkCore.Design.dll ..\..\runtime\Microsoft.EntityFrameworkCore.Design.dll /Y
    copy bin\%1\netcoreapp3.1\MySqlConnector.dll ..\..\runtime\MySqlConnector.dll /Y
    copy bin\%1\netcoreapp3.1\Pomelo.EntityFrameworkCore.MySql.dll ..\..\runtime\Pomelo.EntityFrameworkCore.MySql.dll /Y
    copy bin\%1\netcoreapp3.1\Newtonsoft.Json.dll ..\..\runtime\Newtonsoft.Json.dll /Y
    EXIT /B 0

     

  2. Maybe there is better solution, but I would do that something like this

    // check for type
    int entityType = RAGE.Game.Entity.GetEntityType(entity);
    // then depending on type get element
    Vehicle theVehicle = RAGE.Elements.Entities.Vehicles.GetAtHandle(entity);
    Player thePlayer = RAGE.Elements.Entities.Players.GetAtHandle(entity);
    MapObject theObject = RAGE.Elements.Entities.Objects.GetAtHandle(entity);

     

  3. Does anyone has working example how to edit vehicle handling? I have one, but that isn't perfect,  because  handling only changes when vehicle goes out of stream and then back. For example, every time when I edit handling I need to teleport away from vehicle and then back.

    mp.events.add('UpdateVehicleHandling', (json, save = false) => {
    	//mp.gui.chat.push("json " + json);
    	if (json == null || json == "" || json == "[]") { return; }
    	var obj = JSON.parse(json);
    	for (var key in obj) {
    		var value = obj[key];
    		if(key.toString() == "maxSpeed") {
    			mp.players.local.vehicle.setMaxSpeed(value);
    		}
    		else {
    			mp.players.local.vehicle.setHandling(key.toString(), value);
    		}
    	}
    	mp.players.local.vehicle.model = mp.players.local.vehicle.model
    	
    	if(save == true) {
    		mp.events.callRemote("saveDealerVehicleHandling", json);
    	}
    });

     

  4. Probably because ragemp have bug. If you trigger from client side server side event and in server side has function in which you create vehicle then this vehicle is invisible, you need reconnect to server if you want to see that vehicle.

×
×
  • Create New...