Hello guys,
i updated my project (serverside C#) with the actual gtanetwork.api 1.1.0-DP1 from git, it work fine, but when i want to create a marker or some other nethandle/entity i got an exception that:
"Object of type 'GTANetworkAPI.Marker' cannot be converted to type 'GTANetworkAPI.NetHandle'."
And this happend by execute following line (marked with comment/arrow):
public static GTANetworkAPI.Marker CreateMarker(GTANetworkAPI.MarkerType markerType, Vector3 pos, Vector3 dir, Vector3 rot, float scale, Color color, bool bobUpAndDown = false, uint dimension = 0)
{
GTANetworkAPI.Marker markerID = NAPI.Marker.CreateMarker(markerType, pos, dir, rot, scale, color, bobUpAndDown, dimension);// <<---------------- THIS LINE
MarkerObject markerObject = new MarkerObject
{
MarkerType = markerType,
MarkerPos = pos,
MarkerDir = dir,
MarkerRot = rot,
MarkerScale = scale,
MarkerColor = new Color(color.Red,color.Green,color.Blue),
MarkerBoopAndDown = bobUpAndDown,
MarkerDimension = dimension
};
_markerProperties.Add(markerID, markerObject);
return markerID;
}
The Bug is that the NAPI Class implements static variable definitions to GTANetworkMethods.Marker but in the GTANetworkMethods.Marker class is the Function CreateMarker that respond me the Marker handle from created marker, but through the NAPI class it cannot convert to GTANetworkAPI.Marker.
public static class NAPI
{
public static readonly uint GlobalDimension;
public static readonly int MainThreadId;
public static World World;
public static GTANetworkMethods.Vehicle Vehicle;
public static Util Util;
public static GTANetworkMethods.DummyEntity DummyEntity;
public static GTANetworkMethods.TextLabel TextLabel;
public static Server Server;
public static Resource Resource;
public static Pools Pools;
public static GTANetworkMethods.Player Player;
public static GTANetworkMethods.Pickup Pickup;
public static GTANetworkMethods.Ped Ped;
public static Particle Particle;
public static GTANetworkMethods.Object Object;
public static Notification Notification;
public static Native Native;
public static GTANetworkMethods.Marker Marker;// <<--------------------------------------
public static Explosion Explosion;
public static GTANetworkMethods.Entity Entity;
public static Data Data;
public static GTANetworkMethods.ColShape ColShape;
public static Command Command;
public static ClientEventThreadSafe ClientEventThreadSafe;
public static LocalEvent LocalEvent;
public static ClientEvent ClientEvent;
public static GTANetworkMethods.Checkpoint Checkpoint;
public static Chat Chat;
public static GTANetworkMethods.Blip Blip;
public static ACL ACL;
public static Task Task;
public static Log Log;
[Dynamic]
public static dynamic Exported { get; }
}
So, the question is, how i can fix it?
I tried to call the CreateMarker Function directly in GTANetworkMethods.Marker class but i got the same error...