SetCloudDensity: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Client|1.2.1}} {{FuncDescription|Sets the cloud density for this client.}} {{FuncSyntax|SetCloudDensity(density)}} {{FuncParameters}} {{FuncParam|density|De...")
 
No edit summary
Line 8: Line 8:
{{FuncParam|density|Density value between 0.0 and 4.0, default: 1.15}}
{{FuncParam|density|Density value between 0.0 and 4.0, default: 1.15}}


{{FuncReturnValue|Returns ''true''.}}
{{FuncReturnValue|Returns '''true'''.}}


== Example ==
== Example ==
Line 30: Line 30:
AddRemoteEvent("ClientSetCloudDensity", ClientSetCloudDensity)
AddRemoteEvent("ClientSetCloudDensity", ClientSetCloudDensity)
</syntaxhighlight>
</syntaxhighlight>
A density of 0 hides the clouds on the first cloud layer.
[[File:CloudDensity0.jpg|600px]]
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]]


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

Revision as of 09:29, 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