From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This event is triggered when a resource load state is changed.


resource changedResource, string oldState, string newState
  • changedResource: The resource that was either loaded, reloaded or is unloading.
  • oldState: The state the resource was in before it changed.
  • newState: The state the resource has changed to.


The source of this event is the root element.


This code will output the state of resource when it's state will be changed:

function onResourceLoadStateChange (resource, oldState, newState)
    print ("Resource "..getResourceName (resource).." has changed it's state from "..tostring (oldState).." to "..tostring (newState))

addEventHandler ("onResourceLoadStateChange", root, onResourceLoadStateChange)


Minimum server version 1.5.8-9.20809
Minimum client version n/a

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.5.8-9.20809" />

See Also

Resource events

Event functions