SetColorFilter: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
{{New feature/item|3.0159|1.5.8|20718|This function is used to override the default color filtering values.}}
This function is used to override the default color filtering values.
 
{{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.}}  
{{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.}}  


Line 20: Line 21:


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


==Example==
==Example==
This example lets any player disable the default color filtering
This example lets any player disable the default color filtering:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function disableFilter()
function disableFilter ()
   setColorFilter(0, 0, 0, 0, 0, 0, 0, 0)
   setColorFilter (0, 0, 0, 0, 0, 0, 0, 0)
end
end
addCommandHandler("disable_filter", disableFilter) -- Add the command
 
addCommandHandler ("disablecolorfilter", disableFilter) -- Add the command
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|n/a|1.5.8-9.20718|}}


==See Also==
==See Also==
{{World functions}}
{{World functions}}

Revision as of 15:17, 19 September 2021

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