OnMapLoad: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
{{Delete|This event no longer exists.}}


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", root, "onMapLoad" )
function mapLoadChatBoxOutput ( name )
function onMapLoad ()
outputChatBox ( "Map "..name.." Loaded", root, 255, 255, 255 )
outputChatBox ( "Map Loaded", root, 255, 255, 255 )
end
end
</syntaxhighlight>


</syntaxhighlight>
==See Also==
{{Map_functions}}

Latest revision as of 07:51, 5 November 2023

Edit-delete.png This page is marked for deletion.

Reason: This event no longer exists.
Actions: Delete (Administrators) - Discuss - What links here - Category


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