OnResourceStart

From Multi Theft Auto: Wiki
Revision as of 14:03, 7 March 2007 by EAi (talk | contribs)
Jump to navigation Jump to search

This event is triggered when a resource is loaded.

Important: It is important to note that this event is called when any resource starts, not just the resource your script is running inside. As such, most of the time you will want to check that the name of the resource passed to this event matches the name returned by getThisResource before doing anything.

Syntax

void onResourceStart ( string name )

Variables

  • The source of this event refers to the loaded resource.
  • name: A string representing the name of the resource

Example

This example displays a message in the textbox when you load a map containing this lua

addEventHandler ( "onResourceStart", getRootElement(), "mapLoadChatBoxOutput" )
function mapLoadChatBoxOutput ( name )
	outputChatBox ( "Map "..name.." Loaded", root, 255, 255, 255 )
end

See Also