nightborn

'GetAllResources' method throws error

Recommended Posts

Hi there, I'm new here on RageMP development, so I'm not sure if it's a newbie thing or not lol but well, I will ask. I have a problem while using the method "NAPI.Resource.GetAllResources()" from a C# script. The error is the following:

UNHANDLED EXCEPTION IN COMMAND resources FOR RESOURCE sgo_base
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\user\Documents\Rage MP\Servidor\resources'.
   at void System.IO.Win32FileSystemEnumerableIterator<TSource>.HandleError(int errorCode, string path)
   at void System.IO.Win32FileSystemEnumerableIterator<TSource>.CommonInit()
   at new System.IO.Win32FileSystemEnumerableIterator<TSource>(string path, string originalUserPath, string searchPattern, SearchOption searchOption, SearchResultHandler<TSource> resultHandler)
   at IEnumerable<string> System.IO.Win32FileSystemEnumerableFactory.CreateFileNameIterator(string path, string originalUserPath, string searchPattern, bool includeFiles, bool includeDirs, SearchOption searchOption)
   at IEnumerable<string> System.IO.Win32FileSystem.EnumeratePaths(string fullPath, string searchPattern, SearchOption searchOption, SearchTarget searchTarget)
   at string[] System.IO.Directory.InternalGetFileDirectoryNames(string path, string userPathOriginal, string searchPattern, bool includeFiles, bool includeDirs, SearchOption searchOption)
   at string[] System.IO.Directory.GetDirectories(string path)
   at string[] GTANetworkMethods.Resource.GetAllResources()
   at void sgo_base.SGOBase.resources(Client player) in C:\Users\user\Documents\Rage MP\Servidor\bridge\resources\ragemp_resources\sgo_base\SGOBase.cs:line 9
   --- End of inner exception stack trace ---
   at object RuntimeMethodHandle.InvokeMethod(object target, object[] arguments, Signature sig, bool constructor)
   at object System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(object obj, object[] parameters, object[] arguments)
   at bool GTANetworkInternals.CommandParser.Parse(Client sender, string cmdRaw, string ourcmd, string[] args)

As you can see, it says that the directory "resources" at the server folder doesn't exist (it means, the server ROOT folder, which must be wrong ???). Can I change the path somewhere or I am doing something wrong? Shouldn't be the folder path equals to "C:\Users\user\Documents\Rage MP\Servidor\bridge\resources"?

If you need more info tell me! Thx so much in advance

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.