OnClientResourceStop: Difference between revisions
Jump to navigation
Jump to search
m (fixed typo: "was started" to "was stopped") |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Client event}} | {{Client event}} | ||
__NOTOC__ | __NOTOC__ | ||
This event is triggered when a [[resource]] is stopped. | This event is triggered when a [[resource]] is being stopped. | ||
==Parameters== | ==Parameters== | ||
Line 8: | Line 8: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''stoppedResource''': the [[resource]] that | *'''stoppedResource''': the [[resource]] that is about to get stopped. | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the | The [[event system#Event source|source]] of this event is the stopped resource [[root element]]. | ||
==Example== | ==Example== | ||
This example outputs name of resource that was | This example outputs name of resource that was stopped. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler( " | addEventHandler( "onClientResourceStop", getRootElement( ), | ||
function ( stoppedRes ) | function ( stoppedRes ) | ||
outputChatBox( "Resource stopped: " .. getResourceName( stoppedRes ) ); | outputChatBox( "Resource stopped: " .. getResourceName( stoppedRes ) ); |
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
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled