OnPlayerInteractionState

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

onPlayerInteractionState

Triggered for every replicated general interaction-state update.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerInteractionState(playerId, kind, active, phase, actionId, serverStartTimeMs)

Parameters

Name Type Description
playerId int The interacting player ID.
kind string The interaction kind, such as mining or sitting.
active bool Whether the interaction is active.
phase string The replicated interaction phase.
actionId int The replicated action ID.
serverStartTimeMs int Server time at which the action began.

Examples

Handle the event:

addEventHandler("onPlayerInteractionState", root, function(playerId, kind, active, phase, actionId, serverStartTimeMs)
    outputDebugString("onPlayerInteractionState: player=" .. playerId .. " kind=" .. kind)
end)

Notes

  • Use the specialized mining and sitting events when the interaction type matters.