SetColorFilter

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function is used to override the default color filtering values.

[[{{{image}}}|link=|]] Tip: Normally the game is adding these colors to a screen to simulate weather effects. Sometimes it can be important to disable these effects. You can get rid of the effects by calling this function with zero values.

Syntax

bool setColorFilter ( int aRed, int aGreen, int aBlue, int aAlpha, int bRed, int bGreen, int bBlue, int bAlpha  )

Required Arguments

  • aRed: The amount of red (0-255).
  • aGreen: The amount of green (0-255).
  • aBlue: The amount of blue (0-255).
  • aAlpha: The amount of alpha (0-255).
  • bRed: The amount of red (0-255).
  • bGreen: The amount of green (0-255).
  • bBlue: The amount of blue (0-255).
  • bAlpha: The amount of alpha (0-255).

Returns

Returns true if the color filter was set, false otherwise.

Example

This example lets any player disable the default color filtering:

function disableFilter ()
   setColorFilter (0, 0, 0, 0, 0, 0, 0, 0)
end

addCommandHandler ("disablecolorfilter", disableFilter) -- Add the command

Requirements

Minimum server version n/a
Minimum client version 1.5.8-9.20718

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.8-9.20718" />

See Also