Jump to content

SetPlayerBlurLevel not working


Recommended Posts

Based in an example on the MTA:SA Wiki, I tried to make a client side to change player's blur level through a command, basically it's supposed to change the blur level to a value between 0 - 255 when the player types something like "/blur <0-255>" but the point is that I'm not sure I'm able to build this client side, so can someone tell me if it's possible to build it on the client side and if so what is wrong with my script?

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

Link to comment
function changeBlurLevel ( playerSource, command, blur ) 
    blur = tonumber(blur) 
    if not blur or 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) 

this example of wiki.

write in f8 ( console ) : blur ( number )

Link to comment

That's the example I was talking about, but the problem is that it's server side and I wanted to build it client side... But anyway, Motion blur is not the effect I wanted, I tested it and it's not good enough, I'll look for something else that looks like what I want... Thanks anyway

Link to comment
setPlayerBlurLevel 

This is a server-side function.

Use:

setBlurLevel 

(If you look at the Syntaxes you will see that they suddently say setBlurLevel by client, while setPlayerBlurLevel is set to both server and client. I don't understand why they did this either)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...