bandi94 Posted July 21, 2013 Share Posted July 21, 2013 I am working on a costum GUI resource. I have a lot of exported function , now i wanna destroy all element's when the creator resource is stoped. (like resource "X" called the costum GUI resource to create 4 element's , now when resource "X" is stoped i wanna destroy that 4 created element's) Now the way how i would make it that set on every Element the creator resource name.Now is any way to get the export calling resource name ?? Costum GUI function CreateElement(blabla,blalla) --then here something like local calling_resource = .... getCallingResource() or something like this ?? then getResourceName Resource X exports.GUI:]CreateElement(blla,bla) Or every time i export the function i need to pass the Resource Name a bit of work in + ? Link to comment
TAPL Posted July 21, 2013 Share Posted July 21, 2013 Have you read this topic before? https://forum.multitheftauto.com/viewtopic.php?f=91&t=39678 resource -- returns a resource element of the resource the snippet was executed in Link to comment
bandi94 Posted July 21, 2013 Author Share Posted July 21, 2013 Have you read this topic before?https://forum.multitheftauto.com/viewtopic.php?f=91&t=39678 resource -- returns a resource element of the resource the snippet was executed in That's not what i want. Let me say it short. I have Resource GUI and Resource X. Resource GUI have a lot of exported function's. Then in resource X i make "exports.GUI:function1(). This will trigger the function1() inside the GUI resource. Now in function1() i wanna a function that will return string "X" (the name of the resource witch called this function) "resource" will just return "GUI" not "X" bk the function was executed inside "GUI" resource but i wanna the caller resource name witch is "X" Link to comment
TAPL Posted July 21, 2013 Share Posted July 21, 2013 oh, this was simple lol. This is what you want: sourceResource - The resource that called the exported function https://wiki.multitheftauto.com/wiki/Call Link to comment
bandi94 Posted July 21, 2013 Author Share Posted July 21, 2013 yep that make'd the work THX. Link to comment
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