SetPlayerViewLock

Category: Player / View
Since engine version: 1.0 OC

Description

Disabled or enabled locked view for one or all players. If the view is locked, the player cannot scroll around to explore the map.

Syntax

bool SetPlayerViewLock(int player, bool locked);

Parameters

player:
Player whose view lock is to be turned on or off. NO_OWNER for all players.
locked:
If the view is to be locked (true) or unlocked (false).

Example

func InitializePlayer(int plr)
{
  SetPlayerZoomByViewRange(plr, 1000, 0, PLRZOOM_LimitMin);
  SetPlayerZoomByViewRange(plr, 1000, 0, PLRZOOM_LimitMax);
  SetPlayerViewLock(plr, true);
  return true;
}
Code for a scenario script: Players can see exactly 1000 pixels wide around their Clonk and cannot scroll further.
See also: SetFoW, SetLightRange, SetPlayerZoomByViewRange, SetPlrView
Sven2, 2010-09