Skip to main content

Overview

The Zyrix API provides comprehensive player state management functions for controlling player movement, freezing, and other behavioral states. These functions are essential for administrative control and event management.

FreezePlayer

Control player movement by freezing or unfreezing them.

Syntax

Parameters

  • staffId (number) - Server ID of the staff member performing the action
  • targetId (number) - Server ID of the player to freeze/unfreeze
  • freeze (boolean, optional) - true to freeze, false to unfreeze, nil to toggle

Returns

  • success (boolean) - Whether the action succeeded
  • status (string) - Status code: 'success', 'no_permission', 'player_not_found', 'invalid_target'
  • newState (boolean) - The player’s new freeze state

Example

SetPlayerInvincible

Make a player invincible or vulnerable to damage.

Syntax

Parameters

  • staffId (number) - Server ID of the staff member
  • targetId (number) - Server ID of the target player
  • invincible (boolean) - true for invincible, false for vulnerable

Returns

  • success (boolean) - Whether the action succeeded
  • status (string) - Status code

Example

Advanced Examples

Temporary Freeze System

Freeze Zone System

Player State Manager

Bulk State Management

Event Mode State Control

Error Handling

Handle common scenarios when managing player states:
Player state functions are powerful tools for server management. Use them responsibly and always provide clear communication to affected players.
Consider implementing automatic state restoration systems for temporary administrative actions to prevent players from being permanently stuck in modified states.