Jump to content

setFarClipDistance for 1 person only


knightscript

Recommended Posts

Posted

Hello, im trying to make a command to set view distance for the person who executed the command, i checked the wiki and it doesnt show there is an argument to set it to 1 client, my current code is the following:

  
  function viewdis() 
    setFarClipDistance(5000) -- We adjust visibility range to 3000 metres 
  end 
addCommandHandler("view1",viewdis) 
  

thanks guys

Posted

What do you want to view?

If u want to change camera view you can use this.

set the player's camera to a fixed position, looking at a fixed point 
     setCameraMatrix 
 

Or this one

setCameraTarget 

That's what I understood fro! You.

Posted

Hello Killeryoyo, what setFarClipDistance does is that it sets the whole server view distance, lets say if i set it to 10000, i can see the AREA51 mountains from the LS-LV bridge, what i want to do is to create a command that makes setFarClipDistance to only 1 person, lets say i have a high-end PC and want longer view distance.

Posted

Did you try to use getlocalplayer?

Like this an example.

function flashRed ( ) 
    -- fade out the local player's camera to red during a second 
    fadeCamera( false, 1.0, 255, 0, 0 ) 
    -- set a 500 ms (0.5 sec) timer to fade it back in before it has completely faded out 
    setTimer( fadeCamera, 500, 1, true, 1.0 ) 
end 
-- we attach our 'flashRed' function to be a handler of "onClientPlayerDamage" when its source (that is, the hit player) is the local player 
addEventHandler( "onClientPlayerDamage", getLocalPlayer ( ), flashRed ) 

Getlocal player is used to get the player who did the command.

Posted

To get it working on the client side, or just for the client ( however you want to say it ), you have to make the command client-sided. Add it in a client-sided file ( a file which has type="client" in the meta.xml ) and try it again.

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...