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?
Vertical angle? The ped can only rotate along the horizontal axis. Or do you mean where the camera is looking at?
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 ?
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.
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.
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
}
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FaewvkPe.png&hash=9acf2e3bb5946ee67c6d7e040cb5b951e2dee621)
That's the error I get.
Try updating your squirrel module (https://bitbucket.org/stormeus/0.4-squirrel/downloads).
AimPos is bugged. Doesn't give the correct position. (http://forum.vc-mp.org/?topic=324.0)
Quote from: S.L.C on Apr 02, 2015, 06:40 PMTry updating your squirrel module (https://bitbucket.org/stormeus/0.4-squirrel/downloads).
Nope it still doesn't work. :(
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)
Quote from: sseebbyy on Apr 03, 2015, 08:58 AMQuote 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 :'(
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`
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.
Quote from: S.L.C on Apr 04, 2015, 03:37 PMQuote 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.
I didn't look it up, so I didn't :P Thanks for clearing that up.
Quote from: Thijn on Apr 04, 2015, 01:58 PMAre you using it as a function? i.e. player.GetPlayerAimPos()
Yes.Is it wrong?If yes can you tell me what? :o