setWaterColor | Multi Theft Auto: Wiki Skip to content

setWaterColor

Client-side
Server-side
Shared

Pair: getWaterColor

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function changes the water color of the GTA world.

Syntax

setWaterColor ( )

Code Examples

server

This example adds a commandwatercolorwith which a player can change the water colour.

function changeWaterColor ( commandName, red, green, blue, alpha )
-- if alpha is input, then include it too
alpha = tonumber ( alpha ) or 200
red = tonumber ( red )
green = tonumber ( green )
blue = tonumber ( blue )
-- check if the colour values for red, green and blue are valid
if red and green and blue then
setWaterColor ( red, green, blue, alpha )
else
outputChatBox ( "Failed to change the water colour!" )
end
end
addCommandHandler ( "watercolor", changeWaterColor )