SetPlayerBlurLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (typo)
mNo edit summary
Line 1: Line 1:
{{Server function}}
{{Server client function}}
__NOTOC__
__NOTOC__
Sets the motion blur level on the clients screen. Accepts a value between 0 and 255.
Sets the motion blur level on the clients screen. Accepts a value between 0 and 255.


==Syntax==
==Syntax==
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setPlayerBlurLevel ( player thePlayer, int level )
bool setPlayerBlurLevel ( player thePlayer, int level )
Line 11: Line 12:
*'''thePlayer:''' The [[player]] whose blur level will be changed.
*'''thePlayer:''' The [[player]] whose blur level will be changed.
*'''level:''' The level to set the blur to (default: 38)
*'''level:''' The level to set the blur to (default: 38)
</section>


==Example==  
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
bool setBlurLevel ( int level )
</syntaxhighlight>
 
===Required Arguments===
*'''level:''' The level to set the blur to (default: 38)
</section>
 
==Example==
<section name="Server" class="server" show="true">
This example allows the player to set their blur level via a command
This example allows the player to set their blur level via a command
<syntaxhighlight lang="lua">  
<syntaxhighlight lang="lua">  
function changeBlurLevel(playerSource,command,blur)
function changeBlurLevel ( playerSource, command, blur )
  if blur>255 or blur<0 then
    if blur > 255 or blur < 0 then
    outputChatBox("Enter a value between 0 - 255.", playerSource)
        outputChatBox ( "Enter a value between 0 - 255.", playerSource )
  else
    else
    setPlayerBlurLevel(playerSource, blur)
        setPlayerBlurLevel ( playerSource, blur )
    outputChatBox("Blur level set to: "..blur, playerSource)
        outputChatBox ( "Blur level set to: " .. blur, playerSource )
  end
    end
end
end


addCommandHandler("blur", changeBlurLevel)
addCommandHandler("blur", changeBlurLevel)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}

Revision as of 21:35, 28 March 2009

Sets the motion blur level on the clients screen. Accepts a value between 0 and 255.

Syntax

Click to collapse [-]
Server
bool setPlayerBlurLevel ( player thePlayer, int level )

Required Arguments

  • thePlayer: The player whose blur level will be changed.
  • level: The level to set the blur to (default: 38)
Click to collapse [-]
Client
bool setBlurLevel ( int level )

Required Arguments

  • level: The level to set the blur to (default: 38)

Example

Click to collapse [-]
Server

This example allows the player to set their blur level via a command

 
function changeBlurLevel ( playerSource, command, blur )
    if blur > 255 or blur < 0 then
        outputChatBox ( "Enter a value between 0 - 255.", playerSource )
    else
        setPlayerBlurLevel ( playerSource, blur )
        outputChatBox ( "Blur level set to: " .. blur, playerSource )
    end
end

addCommandHandler("blur", changeBlurLevel)

See Also