Jump to content

setFarClipDistance for 1 person only


knightscript

Recommended Posts

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

Link to comment

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.

Link to comment

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.

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