onResourceLoadStateChange | Multi Theft Auto: Wiki Skip to content

onResourceLoadStateChange

Client-side
Server-side
Shared

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

Parameters

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.

Source

element: The source of this event is the root element.

Code Examples

server

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))
end
addEventHandler ("onResourceLoadStateChange", root, onResourceLoadStateChange)