[miLKy_wAy] Posted May 2, 2010 Share Posted May 2, 2010 Hey, I don't really know anything about LUA, and I have a question. Would it be possible to script something that your look is like in an ego-shooter ? And if it is, would it be possible to script sometthing that you can still see your arms and weapons then ? Would be nice if someone answers ;P Link to comment
SATAN Posted May 2, 2010 Share Posted May 2, 2010 it's possible .. i'm not quit sure, but i think mr.hankey worked on such a script. Link to comment
`Dmz Posted May 2, 2010 Share Posted May 2, 2010 If you are talking about first person look, then I have to say that is possible. This function is in GTA-MP Zombie Infestation server, you just need to write /fp and test it. I think it was done by setting player's camera position, but I dunno indeed. Link to comment
[miLKy_wAy] Posted May 2, 2010 Author Share Posted May 2, 2010 If you are talking about first person look, then I have to say that is possible. This function is in GTA-MP Zombie Infestation server, you just need to write /fp and test it. I think it was done by setting player's camera position, but I dunno indeed. I don't know if thats what i mean, cause i can't play on this server....somehow after downloading i'm not able to spawn. Link to comment
Antibird Posted May 2, 2010 Share Posted May 2, 2010 Here's a very basic script to show the idea of how things can be done. However you can't aim with your weapon when camera is not following the player in it's "typical" way. You can make a separate client-side script file out of it. local x, y, z, x1, y1, z1 local fpcam = false local PLAYER = getLocalPlayer() bindKey( "F1", "down", function() if fpcam then setCameraTarget( PLAYER, PLAYER ) end fpcam = not fpcam end ) addEventHandler( "onClientPreRender", root, function() if fpcam then x, y, z = getPedBonePosition( PLAYER, 6 ) setCameraMatrix( x, y, z, x + x1, y + y1, z + z1 ) end end ) addEventHandler( "onClientCursorMove", root, function( _, _, _, _, wx, wy, wz ) local cx, cy, cz = getCameraMatrix() x1 = ( wx - cx ) / 300 y1 = ( wy - cy ) / 300 z1 = ( wz - cz ) / 300 end ) Link to comment
[miLKy_wAy] Posted May 3, 2010 Author Share Posted May 3, 2010 Here's a very basic script to show the idea of how things can be done. However you can't aim with your weapon when camera is not following the player in it's "typical" way. You can make a separate client-side script file out of it. local x, y, z, x1, y1, z1 local fpcam = false local PLAYER = getLocalPlayer() bindKey( "F1", "down", function() if fpcam then setCameraTarget( PLAYER, PLAYER ) end fpcam = not fpcam end ) addEventHandler( "onClientPreRender", root, function() if fpcam then x, y, z = getPedBonePosition( PLAYER, 6 ) setCameraMatrix( x, y, z, x + x1, y + y1, z + z1 ) end end ) addEventHandler( "onClientCursorMove", root, function( _, _, _, _, wx, wy, wz ) local cx, cy, cz = getCameraMatrix() x1 = ( wx - cx ) / 300 y1 = ( wy - cy ) / 300 z1 = ( wz - cz ) / 300 end ) What do you mean with "when camera is not following the player in it's "typical" way" Link to comment
Antibird Posted May 3, 2010 Share Posted May 3, 2010 It's like in single player. An ordinary default camera "attached" to the Cj and following him wherever he moves. setCameraMatrix() makes your camera loose it's target ( your player ), in this case you can't aim with weapon like usually. setCameraTarget() return aiming ability and bounds the camera back to player, into it's "typical", unmodified state. Link to comment
[miLKy_wAy] Posted May 3, 2010 Author Share Posted May 3, 2010 It's like in single player. An ordinary default camera "attached" to the Cj and following him wherever he moves. setCameraMatrix() makes your camera loose it's target ( your player ), in this case you can't aim with weapon like usually. setCameraTarget() return aiming ability and bounds the camera back to player, into it's "typical", unmodified state. and there are no other possibilities like having a crosshair in the middle and moving your camera with this? Link to comment
Antibird Posted May 4, 2010 Share Posted May 4, 2010 and there are no other possibilities like having a crosshair in the middle and moving your camera with this? There are. It's a matter of scripting only. The first thing comes on my mind is to switch camera back to "normal" view on player press aim button and when he releases - set it to first person again. Link to comment
dzek (varez) Posted May 4, 2010 Share Posted May 4, 2010 very strange.. walking in first person, and aiming in third person Link to comment
Dark Dragon Posted May 4, 2010 Share Posted May 4, 2010 evil geniz achieved this by attaching an object to the player so the camera gets moved very close to the head of cj, then simply set the ped alpha to 0. haven't seen it done better than that yet. at least for combat this works quite well. 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