OnResourceLoad: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
This event is triggered when a map is loaded.
This event is triggered when a resource is loaded.


==Syntax==  
==Syntax==  
Line 7: Line 7:


==Variables==
==Variables==
* The source of this event refers to the loaded map.
* The source of this event refers to the loaded resource.
*'''name''': A string representing the name of the map
*'''name''': A string representing the name of the resource


==Example==
==Example==

Revision as of 20:36, 25 January 2007

This event is triggered when a resource is loaded.

Syntax

void onResourceLoad ( 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 ( "onResourceLoad", getRootElement(), "mapLoadChatBoxOutput" )
function mapLoadChatBoxOutput ( name )
	outputChatBox ( "Map "..name.." Loaded", root, 255, 255, 255 )
end

See Also

Shared