Jump to content

[C#] [.NET] DrawMarker textureDict & textureName


Recommended Posts

Hello im still new in scripting and im still learning. Im trying to use DrawMarker as my first script mod and i want to draw something in front of a player. It's achievable but when i add textureDict and textureName parameter to the DrawMarker, the script was aborted. Fyi, im a frontend website developer and im familiar with Javascript.

This is my script:

Ped player = Game.Player.Character;
Vector3 position = player.GetOffsetPosition(new Vector3(0f, 3f, 0f));
position.Z = player.Position.Z - player.HeightAboveGround;
Vector3 direction = new Vector3(0f, 0f, 0f);
Vector3 rotation = new Vector3(0f, 0f, 0f);
Vector3 scale = new Vector3(2f, 2f, 2f);
bool bobUpAndDown = false;
bool faceCamera = true;
bool rotate = false;
string textureDict = "GolfPutting";
string textureName = "PuttingMarker";
World.DrawMarker(MarkerType.DebugSphere, position, direction, rotation, scale, Color.Green, bobUpAndDown, faceCamera, rotate, textureDict, textureName);

The "GolfPutting" and "PuttingMarker" I get an example from fiveM docs


This is the ScriptHookVDotNet log file

[14:36:24] [DEBUG] Loading API from .\ScriptHookVDotNet2.dll ...
[14:36:24] [DEBUG] Loading API from .\ScriptHookVDotNet3.dll ...
[14:36:24] [DEBUG] Loading scripts from C:\Program Files (x86)\Rockstar Games\Grand Theft Auto V\scripts ...
[14:36:24] [DEBUG] Loading assembly YouTubeTutorial.dll ...
[14:36:24] [INFO] Found 1 script(s) in YouTubeTutorial.dll resolved to API 3.6.0.
[14:36:24] [DEBUG] Instantiating script YouTubeTutorial ...
[14:36:24] [INFO] Started script YouTubeTutorial.
[14:36:29] [ERROR] Script YouTubeTutorial is not responding! Aborting ...
[14:36:34] [WARNING] Aborted script YouTubeTutorial.
   at Microsoft.Win32.Win32Native.CoTaskMemAlloc(UIntPtr cb)
   at System.Runtime.InteropServices.Marshal.AllocCoTaskMem(Int32 cb)
   at SHVDN.NativeMemory.StringToCoTaskMemUTF8(String s)
   at SHVDN.ScriptDomain.PinString(String str)
   at GTA.World.DrawMarker(MarkerType type, Vector3 pos, Vector3 dir, Vector3 rot, Vector3 scale, Color color, Boolean bobUpAndDown, Boolean faceCamera, Boolean rotateY, String textueDict, String textureName, Boolean drawOnEntity)
   at YouTubeTutorial.OnTick(Object sender, EventArgs e)
   at SHVDN.Script.DoTick()
   at SHVDN.Script.MainLoop()


May someone can advice on this issue? Or maybe someone got face this kind of error before

Thank you!

Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.