SetPlayerDimension
setPlayerDimension
AVAILABLE FROM UPDATE 0.1.8
This function is available in G1R:MP 0.1.8 and later. The contract below includes the compatibility guarantees introduced in that update.
Changes the server-authoritative dimension of a player.
Syntax
ok = setPlayerDimension(playerId, dimension)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
number |
yes | Numeric ID of the connected player. |
dimension |
number |
yes | Integer 0..2147483647. Strings, negative/fractional/non-finite values are rejected. |
Returns
true when accepted (also for an unchanged dimension); false when invalid, unavailable, busy or not permitted.
Examples
local ok = setPlayerDimension(playerId, 100)
if not ok then
outputDebugString("Dimension change rejected")
end
Notes
- Available from 0.1.8 / Protocol 40, currently in testing and not yet publicly released. Not included in public 0.1.7. Both client and server must update together.
- Server-side only. See Character dimensions for the complete scope, transition rules and character-creator example.
- Dimension 0 is the default; the ordinary streaming distance still applies. World objects, doors, gates and items remain shared.
- Use these exact lower-camel names; there is no client-side setter.
- An unchanged dimension returns true without emitting a change event or rebuilding characters.
- Server acceptance is not a client rendering acknowledgement. Re-entry/late join uses the existing complete character appearance/state replay.
- A pending transition/authoritative position change, active interaction/climb or owned mount lease can reject a change. Finish the activity, remove the owned mount if needed, and retry from your gamemode state machine.
- Does not reconnect, teleport, replace the local avatar or reset inventory/mana/ammunition. Old character attacks/projectiles are retired.
- Your gamemode owns creator-session allocation and restoration. Resource stop does not automatically restore player dimensions; reconnect starts at 0.