OnResourceStart: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 4: Line 4:
|type = event
|type = event
|games = iii vc sa iv
|games = iii vc sa iv
|desc = a resource starts
|desc = a resource has started. The event is triggered after all script files have been ran in the resource's meta.xml file.
|arg1 = Resource resource The resource which has started.
|arg1 = Resource resource The resource which has started.
|note = This event can be used with [[bindEventHandler|bindEventHandler]].
|note = This event can be used with [[bindEventHandler|bindEventHandler]].

Latest revision as of 03:12, 26 February 2024

Event Server and Client icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline Cancellable

Available since Server 1.0.0, Client 1.0.0

onResourceStart(Event event, Resource resource)

The onResourceStart event is invoked when a resource has started. The event is triggered after all script files have been ran in the resource's meta.xml file.

Parameters

1) Event event The event object for this event.
2) Resource resource The resource which has started.

Attributes

cancellable This event can be cancelled, by 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

icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnResourceStart
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnResourceStop


Client Related

icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnResourceReady
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnResourceStart
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnResourceStop