Jump to content

How to call function trough resources / export function?


vilhem

Recommended Posts

Hi.

this function resource "radar"

function render()

and not working in resource "account" this:

removeEventHandler ( "onClientRender", getRootElement(), render )

for disable Radar mod.

Link to post

you try to remove event that not exist in the current file

so you should use call functions

Call

if you already have exported the function so

make sure you have exported the function render and check the meta if you add the export in it
then then try again

 

Link to post

 

You can more easily use triggerEvent from one resource to another. Example:

1st resource:
function render()
your code here
end
addEventHandler("onClientRender", getRootElement(), render)

function hideRadar()
removeEventHandler("onClientRender", getRootElement(), render)
end
addEvent("hideRadar", true)
addEventHandler("hideRadar", root, hideRadar)

2nd resource:
function yourfunction()
triggerEvent("hideRadar", source)
end
addEventHandler("yourevent", getRootElement(), yourfunction)

https://wiki.multitheftauto.com/wiki/TriggerEvent

Link to post
  • Patrick changed the title to How to call function trough resources / export function?

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