targetid Posted May 8, 2020 Posted May 8, 2020 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...
targetid Posted May 9, 2020 Author Posted May 9, 2020 vor 3 Stunden schrieb Doroftei: https://imgur.com/gallery/WgV8h73 help Picture doesnt exit ...
targetid Posted May 9, 2020 Author Posted May 9, 2020 vor 27 Minuten schrieb Doroftei: and how it is in relation to my problem? My Problem is when i execute the NAPI.Marker.CreateMarker Function that it cannot convert to another data type, and this exeception comes already ... when i execute the function without filling the function response to var or not, only the execution give me the top described exception.
Temka193 Posted June 11, 2020 Posted June 11, 2020 (edited) also this problem and this Edited June 11, 2020 by Temka193
SenseiFeet Posted June 12, 2020 Posted June 12, 2020 Am 8.5.2020 um 22:02 schrieb targetid: 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... For this one you should use the handle of the Marker, the NetworkMethods Class always use NetHandle try marker.Handle
Temka193 Posted June 12, 2020 Posted June 12, 2020 (edited) 1 hour ago, SenseiFeet said: For this one you should use the handle of the Marker, the NetworkMethods Class always use NetHandle try marker.Handle exception throws inside NAPI.Marker.CreateMarker method, this is a bug 😥 Edited June 12, 2020 by Temka193
targetid Posted June 13, 2020 Author Posted June 13, 2020 Am 12.6.2020 um 07:12 schrieb SenseiFeet: For this one you should use the handle of the Marker, the NetworkMethods Class always use NetHandle try marker.Handle I tried it... casting to Nethandle give me the same error.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now