Difference between revisions of "OnResourceStart"

From GTA Connected
Jump to navigation Jump to search
m (Typo: resouce -> resource)
 
Line 9: Line 9:
 
|notes = This event can be used with [[bindEventHandler|bindEventHandler]].
 
|notes = This event can be used with [[bindEventHandler|bindEventHandler]].
 
|exampleLua = addEventHandler("OnResourceStart", function(event,resource)
 
|exampleLua = addEventHandler("OnResourceStart", function(event,resource)
outputChatBox("Resource ".. resouce.name .." has started.", COLOUR_RED)
+
outputChatBox("Resource ".. resource.name .." has started.", COLOUR_RED)
 
end)
 
end)
 
}}
 
}}

Latest revision as of 20:25, 12 May 2020

Event Server and Client All Games Online and Offline

Server 1.0.0, Client 1.0.0

function(Event event, Resource resource)

Description

The onResourceStart event is invoked when a resource starts.

Parameters

Type Name Description
Event
event The event object for this event.
Resource
resource
The resource which has started.

Cancellable

This event can be cancelled using event.preventDefault.

Notes

Examples

Example 1 - Lua:

addEventHandler("OnResourceStart", function(event,resource)
    outputChatBox("Resource ".. resource.name .." has started.", COLOUR_RED)
end)

Compatibility

There isn't any compatibility information for this event.

Related

Server Related

OnResourceStart
OnResourceStop


Client Related

OnResourceReady
OnResourceStart
OnResourceStop