SetCloudDensity

From Onset Developer Wiki
Revision as of 09:46, 1 September 2020 by BlueMountains (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
SetCloudDensity

Type: Function
Context: Client
Introduced: v1.2.1

Description

Sets the cloud density for this client.

Syntax

SetCloudDensity(density)

Parameters

  • density
    Density value between 0.0 and 4.0, default: 1.15

Return Value

  • Returns true.

Example

-- server side
function cmd_clouddensity(player, density)
	if (density == nil) then
		return AddPlayerChat(player, "Usage: /clouddensity <density 0-4>")
	end
	
	density = tonumber(density)

	CallRemoteEvent(player, "ClientSetCloudDensity", density)
end
AddCommand("clouddensity", cmd_clouddensity)

-- client side
function ClientSetCloudDensity(density)
	SetCloudDensity(density)
end
AddRemoteEvent("ClientSetCloudDensity", ClientSetCloudDensity)

A density of 0 hides the clouds on the first cloud layer.

A density of 4 will cover the entire sky with clouds. This also has an effect on the lighting on the ground.

See also