OnClientResourceStop: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Edited information, because onClientResourceStop can also be used to do a last action of it, so its actually triggering right before the resource actually stops)
m (fixed typo: "was started" to "was stopped")
 
Line 14: Line 14:


==Example==  
==Example==  
This example outputs name of resource that was started.
This example outputs name of resource that was stopped.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addEventHandler( "onClientResourceStop", getRootElement( ),
addEventHandler( "onClientResourceStop", getRootElement( ),

Latest revision as of 18:51, 9 September 2019

This event is triggered when a resource is being stopped.

Parameters

resource stoppedResource
  • stoppedResource: the resource that is about to get stopped.

Source

The source of this event is the stopped resource root element.

Example

This example outputs name of resource that was stopped.

addEventHandler( "onClientResourceStop", getRootElement( ),
    function ( stoppedRes )
        outputChatBox( "Resource stopped: " .. getResourceName( stoppedRes ) );
    end
);

See Also

Client resource events


Client event functions