SetCloudDensity: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 33: Line 33:
A density of 0 hides the clouds on the first cloud layer.
A density of 0 hides the clouds on the first cloud layer.


[[File:CloudDensity0.jpg|600px]]
[[File:CloudDensity0.jpg|700px]]


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


[[File:CloudDensity4.jpg|600px]]
[[File:CloudDensity4.jpg|700px]]


{{RelatedFunctions}}
{{RelatedFunctions}}
* [[GetTime]]
* [[GetTime]]
* [[GetCloudDensity]]

Latest revision as of 09:46, 1 September 2020

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