Vertical rotation

Started by Florin Calinescu, Apr 02, 2015, 03:52 PM

Previous topic - Next topic

Florin Calinescu

As far as I know the horizontal axis rotation can be returned using "player.Angle".But,my question is,is it possible to return the vertical  axis rotation of the player?And if yes,can anybody please tell me how?

Thijn

Vertical angle? The ped can only rotate along the horizontal axis. Or do you mean where the camera is looking at?

Sebastian

#2
Your question, @marmota91, is as possible as setting the rotation of a pickup. :D
But I'm still curious, why do you need to set vertical rotation of a player ?

Florin Calinescu

Quote from: Thijn on Apr 02, 2015, 04:09 PMVertical angle? The ped can only rotate along the horizontal axis. Or do you mean where the camera is looking at?
Yeah the position of the camera.
Quote from: sseebbyy on Apr 02, 2015, 04:34 PMYour question, @marmota91, is as possible as setting the rotation of a pickup. :D
But I'm still curious, why do you need to set vertical rotation of a player ?
Well you'll see later.

aXXo

player.AimDir and player.AimPos might be of help, though I have not tested them personally.
They are supposed to return Vector(X, Y, Z) coords.

Florin Calinescu

Quote from: aXXo on Apr 02, 2015, 05:51 PMplayer.AimDir and player.AimPos might be of help, though I have not tested them personally.
They are supposed to return Vector(X, Y, Z) coords.
Didn't return a thing.I don't know if I was using them correctly and that's why I brought the code with me as well:
else if(cmd == "rot")
{
Message("" + player.Name + "'s aiming pos: " + player.AimDir + "" ) //  LINE 123
}

That's the error I get.

.

Try updating your squirrel module.
.

Sebastian


Florin Calinescu

Quote from: S.L.C on Apr 02, 2015, 06:40 PMTry updating your squirrel module.
Nope it still doesn't work. :(

Sebastian

Quote from: old forum, stormeusGetPlayerAimPos: returns the position that a player is aiming toward (only updated when shooting)
GetPlayerAimDir: returns the vector rotation of a player's aim (only updated when shooting)

Florin Calinescu

Quote from: sseebbyy on Apr 03, 2015, 08:58 AM
Quote from: old forum, stormeusGetPlayerAimPos: returns the position that a player is aiming toward (only updated when shooting)
GetPlayerAimDir: returns the vector rotation of a player's aim (only updated when shooting)
No it still doesn't work it says member variable not found :'(

Thijn

Are you using it as a function? i.e. player.GetPlayerAimPos()

.

Quote from: Thijn on Apr 04, 2015, 01:58 PMAre you using it as a function? i.e. player.GetPlayerAimPos()

Actually that name is in the plugin API On the script that's just `AimPos` as a member variable. like `player.AimPos.x`, `player.AimPos.y`, `player.AimPos.z`
.

Sebastian

Quote from: S.L.C on Apr 04, 2015, 02:25 PMActually that name is in the plugin API On the script that's just `AimPos` as a member variable. like `player.AimPos.x`, `player.AimPos.y`, `player.AimPos.z`

That's why Thijn asked that. :P
He tried to catch marmota91's mistake, I believe.

.

Quote from: sseebbyy on Apr 04, 2015, 03:27 PMThat's why Thijn asked that. :P
He tried to catch marmota91's mistake, I believe.

TBH I knew that. I just wanted to specify why it shouldn't be used like that.
.