Jump to content

silly question.


bandi94

Recommended Posts

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

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