Jump to content

[HELP] startResource doesnt work


Recommended Posts

hi all, i am trying to load an resource by script in my gamemode... script:

local res = getResourceFromName ( "test" )
outputChatBox ( "resource found: " ..tostring ( res ) )
local load = startResource ( res )
outputChatBox ( "resourceStart: " ..tostring ( load ) )

BUT here is one problem... it didnt load. log:

resource found: userdata: 02C323A8

resourceStart: nil

it dont write any error. I also have added my resource (the from which is this script) into ACL, in admin group

when I start resource in MTAserver window by "start test" it normaly load. if I change the "startResource" function to "restartResource", and then load "test" by admin panel, it normally restart it

Do you know where is the problem? If you need to know more, just ask. Thanks!

Link to comment
startResource returns false at failure. If nil is returned, it has to be blocked by ACL in some way. (If a function is blocked by ACL, nil is returned)

Also, you get warning or error message saying that in server console or debug window (/debugscript 2).

Link to comment

thank you for helping... so I never edited acl, i am not sure i did it right.

I have added this into acl.xml (while server off)

<group name="Admin">
       <acl name="Moderator" />
       <acl name="SuperModerator" />
       <acl name="Admin" />
       <acl name="RPC" />
       <object name="user.drifterCZ" />
       <object name="resource.admin" />
       <object name="resource.webadmin" />
     [color=#FF0000][b] <object name="resource.dd" />[/b][/color]

(my gamemode is called "dd")

Link to comment
OK, i have got the problem... its caused by ACL.xml

Knows someone why when I add into admin group, it gives the rights to other gamemode but not for my own?

You have weird problem there. Lets start from the beginning.. You have given your resource access to startResource, reloaded ACL and even restarted server.. That doesn't help? Does your script outputs error messages? Tried "refreshall" command?

Your resource is not special in any way and it should have access to startResource function if you add it to admin group in acl.xml.

Link to comment

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...