knightscript Posted January 20, 2016 Share Posted January 20, 2016 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
killeryoyo Posted January 20, 2016 Share Posted January 20, 2016 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. Link to comment
knightscript Posted January 20, 2016 Author Share Posted January 20, 2016 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
killeryoyo Posted January 20, 2016 Share Posted January 20, 2016 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
tosfera Posted January 20, 2016 Share Posted January 20, 2016 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now