# SetPlayerZoomByViewRange

Player
View
5.1 OC
bool
int player Player whose zoom or zoom limits are to be adjusted. NO_OWNER for all players.
int range_x Horizontal range that should be covered by the zoom. Zero to use range_y only. If both range_x and range_y are zero, a default range is assumed for range_x.
int range_y Vertical range that should be covered by the zoom. Zero to use range_x only. If both range_x and range_y are nonzero, the number that yields the smaller zoom is used.
int flags Flags controlling function behaviour:

Flag
Description
PLRZOOM_Direct
The zoom does not scroll slowly towards the new value, but is set directly.
PLRZOOM_NoIncrease
The new zoom ranges are only to be set if they are smaller than the current values.
PLRZOOM_NoDecrease
The new zoom ranges are only to be set if they are greater than the current values.
PLRZOOM_LimitMin
Set the minimum limit for zooming. The player cannot zoom out further than this.
PLRZOOM_LimitMax
Set the maximum limit for zooming. The player cannot zoom in further than this.

Disabled or enabled locked view for one or all players. If the view is locked, the player cannot scroll around to explore the map.
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.
SetPlayerViewLock
SetPlrView
SetPlrViewRange
SetFoW
Sven2
2010-09