OnMapLoad: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
[[ | {{Needs_Checking|What is the source of this event? Also is "name" a string? I just guessed --[[User:Talidan2|Talidan2]] 09:42, 2 December 2006 (CST)}} | ||
This event is triggered when a map is loaded. | This event is triggered when a map is loaded. | ||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
void onMapLoad ( string name ) | |||
</syntaxhighlight> | |||
==Variables== | |||
* The source of this event refers to the loaded map. | |||
*'''name''': A string representing the name of the map | |||
==Example== | ==Example== | ||
This example displays a message in the textbox when you load a map containing this lua | This example displays a message in the textbox when you load a map containing this lua | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler ( "onMapLoad", getRootElement(), "mapLoadChatBoxOutput" ) | |||
addEventHandler ( "onMapLoad", | function mapLoadChatBoxOutput ( name ) | ||
function | outputChatBox ( "Map "..name.." Loaded", root, 255, 255, 255 ) | ||
outputChatBox ( "Map Loaded", root, 255, 255, 255 ) | |||
end | end | ||
</syntaxhighlight> | |||
==See Also== | |||
{{Event_functions}} |
Revision as of 15:42, 2 December 2006
This article needs checking. | |
Reason(s): What is the source of this event? Also is "name" a string? I just guessed --Talidan2 09:42, 2 December 2006 (CST) |
This event is triggered when a map is loaded.
Syntax
void onMapLoad ( string name )
Variables
- The source of this event refers to the loaded map.
- name: A string representing the name of the map
Example
This example displays a message in the textbox when you load a map containing this lua
addEventHandler ( "onMapLoad", getRootElement(), "mapLoadChatBoxOutput" ) function mapLoadChatBoxOutput ( name ) outputChatBox ( "Map "..name.." Loaded", root, 255, 255, 255 ) end
See Also
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled