Jump to content

Recommended Posts

Posted
Code:
Error: Exception has been thrown by the target of an invocation.
UNHANDLED EXCEPTION IN COMMAND vehc FOR RESOURCE TranquilityGameMode
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.TypeLoadException: Could not load type 'GTANetworkAPI.Vector3' from assembly 'TranquilityGameMode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' due to value type mismatch.
   at void TranquilityGameMode.A_Commands.Commands.CMD_createVehicleCustom(Player player, string name)
   --- End of inner exception stack trace ---
   at object RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions)
   at object System.Reflection.RuntimeMethodInfo.Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
   at bool GTANetworkInternals.CommandParser.Parse(Player sender, string cmdRaw, string ourcmd, string[] args)
[Command("vehc")]
public static void CMD_createVehicleCustom(Player player, string name)
{
	try
	{
		VehicleHash vh = (VehicleHash)NAPI.Util.GetHashKey(name);
		if (vh == 0) throw null;
		var veh = NAPI.Vehicle.CreateVehicle(vh, player.Position, player.Rotation.Z, 0, 0);
		veh.Dimension = player.Dimension;
		veh.NumberPlate = "ADMIN";
		veh.SetData("ACCESS", "ADMIN");
		veh.SetData("BY", player.Name);
		Log.Debug($"vehc {name}");
	}
	catch { }
}
Posted (edited)

Remove the Bootstrapper. Dll dependency from your list of dependencies and install it again using Nuget package manager make sure it's the latest version

Edited by hash_

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...