OnPlayerResourceStart: Difference between revisions
Jump to navigation
Jump to search
(Initial page creation) |
m (Update version) |
||
Line 1: | Line 1: | ||
{{Server event}} | {{Server event}} | ||
{{Added feature/item|3.0159|1.5. | {{Added feature/item|3.0159|1.5.8|1.5.8|20957|This event is triggered when a [[resource]] is loaded clientside for a [[player]]}} | ||
__NOTOC__ | __NOTOC__ | ||
==Parameters== | ==Parameters== |
Revision as of 15:24, 20 September 2021
20957
Parameters
resource loadedResource
- loadedResource: The resource that was loaded on the client
Source
The source of this event is the player who loaded the resource.
Example
This example shows how you can trigger a custom event clientside defined in the same resource as soon as the player is ready (resource loaded on client).
addEventHandler("onPlayerResourceStart", root, function(loadedResource) outputChatBox(getResourceName(loadedResource) .. " started for " .. getPlayerName(source)) -- Trigger a custom clientside event defined in this resource if (getResourceRootElement(loadedResource) == resourceRoot) then triggerClientEvent(source, "onClientCustomEvent", source) end end)
Requirements
This template will be deleted.
See Also
Resource events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled