ResetMapInfo: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 15: Line 15:


==Example==
==Example==
This page does not have an example.
This will reset all map info when the resource is stopped.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),
addEventHandler("onResourceStop", getResourceRootElement(getThisResource()),
-- Resource load event
-- Resource stop event
function()
function()
             resetMapInfo()
             resetMapInfo()

Revision as of 11:05, 30 August 2010

This function is used to reset the state of a player. It is intended to restore a player to his default state as if he had just joined the server, without any scripts affecting him.

Syntax

bool resetMapInfo ( [player thePlayer = getRootElement()] )

Optional Arguments

thePlayer: The specific player you wish to restore the state of. Not specifying this will result in all players map info being reset.

Returns

Returns true if the map info was reset successfully, otherwise false.

Example

This will reset all map info when the resource is stopped.

addEventHandler("onResourceStop", getResourceRootElement(getThisResource()),
	-- Resource stop event
	function()
            resetMapInfo()
        end
)

See Also