OnResourceStart: Difference between revisions
Jump to navigation
Jump to search
PerikiyoXD (talk | contribs) m (Typo: resouce -> resource) |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | {{ScriptItem2 | ||
| | |name = onResourceStart | ||
|side = shared | |||
|type = event | |type = event | ||
| | |games = iii vc sa iv | ||
| | |desc = a resource starts | ||
| | |arg1 = Resource resource The resource which has started. | ||
|note = This event can be used with [[bindEventHandler|bindEventHandler]]. | |||
|cancel = true | |||
| | |||
|exampleLua = addEventHandler("OnResourceStart", function(event,resource) | |exampleLua = addEventHandler("OnResourceStart", function(event,resource) | ||
outputChatBox("Resource ".. resource.name .." has started.", COLOUR_RED) | outputChatBox("Resource ".. resource.name .." has started.", COLOUR_RED) | ||
end) | end) | ||
}} | }} |
Revision as of 20:28, 19 November 2022
Event
Server and Client
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 starts.
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
- This event can be used with bindEventHandler.
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