OnElementStopSync

From Multi Theft Auto: Wiki
Revision as of 16:03, 27 March 2012 by FabioGNR (talk | contribs) (Example)

Dialog-warning.png Warning: In 1.1.x, Destroying the source of this event could crash the server!
Accessories-text-editor.png Script Example Missing Event OnElementStopSync needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.


This event is triggered when an element is no longer synced by a player.

Parameters

player oldSyncer
  • oldSyncer: player element representing the last player who was syncing the element

Source

The source of this event is the element which is no longer synced by a player.

Example

veh = createVehicle(520, 0,0,1) --  create our testing vehicle

function syncStop()
if source == veh then -- check if the element that stopped getting synced was our vehicle
outputChatBox("You stopped syncing the vehicle!!",oldSyncer) -- tell the player he stopped syncing the vehicle ( veh )
end
end

addEventHandler("onElementStopSync",getRootElement(),syncStop) --  onElementStopSync, the function syncStop gets called

See Also

Element events

Event functions