OnPlayerChangeDimension: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Event|Server|1.2.2}} {{FuncDescription|Event called when a player instance changes dimensions from SetPlayerDimension.}} {{FuncSyntax|OnPlayerChangeDimension(obje..."
 
No edit summary
 
Line 3: Line 3:
{{FuncDescription|Event called when a player instance changes dimensions from [[SetPlayerDimension]].}}
{{FuncDescription|Event called when a player instance changes dimensions from [[SetPlayerDimension]].}}


{{FuncSyntax|OnPlayerChangeDimension(object, old_dimension, new_dimension)}}
{{FuncSyntax|OnPlayerChangeDimension(player, old_dimension, new_dimension)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|object|The object which changed dimension.}}
{{FuncParam|player|The player which changed dimension.}}
{{FuncParam|old_dimension|The old dimension.}}
{{FuncParam|old_dimension|The old dimension.}}
{{FuncParam|new_dimension|The new dimension.}}
{{FuncParam|new_dimension|The new dimension.}}
Line 12: Line 12:
== Example ==
== Example ==
<syntaxhighlight lang="Lua">
<syntaxhighlight lang="Lua">
AddEvent("OnObjectChangeDimension", function(object, old_dimension, new_dimension)
AddEvent("OnPlayerChangeDimension", function(player, old_dimension, new_dimension)
print("Object "..object.." changed dimensions")
print("Player "..player.." changed dimensions")
end)
end)
</syntaxhighlight>
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{ObjectServerEvents}}
{{PlayerServerEvents}}

Latest revision as of 10:09, 19 September 2020

OnPlayerChangeDimension

Type: Event
Context: Server
Introduced: v1.2.2

Description

Event called when a player instance changes dimensions from SetPlayerDimension.

Syntax

OnPlayerChangeDimension(player, old_dimension, new_dimension)

Parameters

  • player
    The player which changed dimension.
  • old_dimension
    The old dimension.
  • new_dimension
    The new dimension.

Example

AddEvent("OnPlayerChangeDimension", function(player, old_dimension, new_dimension)
	print("Player "..player.." changed dimensions")
end)

See also