Jump to content

Want to know something


Deltanic

Recommended Posts

Hi, I want to know something. Is it possible to create 2 resources which work together? Like resource 1 has an event, but resource 2 says when that event have to be triggered.

And when I use setElementData ( someElement, "someData", someValue ), can I use getElementData ( someElement, "someData" ) in another resource?

Link to comment

Okay :D

But I saw also something about exporting function. Is that for when i want to do this:

Resource 1 contains a function called function doSomethingLol( source ), and I want to trigger that in resource 2 when I spawn. Do I have to do something important or can I just do this?

Link to comment

Okay, thank you all ;)

So in fact, this is what I need to do?:

Resource 1:

addEventHandler("onPlayerWasted", getRootElement(),
function ( ammo, attacker, weapon, bodypart )
setElementData( source, "Status", "DEAD" ) --This
triggerEvent( "onMyEvent", getRootElement(), source ) --This
call(getResourceFromName("resource2"), "setSpectating", true , source) --This
end
)

Resource 2:

addEvent ( "onMyEvent", true )
function myEventHandler ( source )
--some code
end
addEventHandler ( "onMyEvent", getRootElement(), myEventHandler )
 
function setSpectating( theBool, source)
--some code
end

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