Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Florin Calinescu on Apr 02, 2015, 03:52 PM

Title: Vertical rotation
Post by: Florin Calinescu on Apr 02, 2015, 03:52 PM
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?
Title: Re: Vertical rotation
Post by: Thijn on Apr 02, 2015, 04:09 PM
Vertical angle? The ped can only rotate along the horizontal axis. Or do you mean where the camera is looking at?
Title: Re: Vertical rotation
Post by: Sebastian on Apr 02, 2015, 04:34 PM
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 ?
Title: Re: Vertical rotation
Post by: Florin Calinescu on Apr 02, 2015, 04:56 PM
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.
Title: Re: Vertical rotation
Post by: aXXo on Apr 02, 2015, 05:51 PM
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.
Title: Re: Vertical rotation
Post by: Florin Calinescu on Apr 02, 2015, 06:31 PM
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.
Title: Re: Vertical rotation
Post by: . on Apr 02, 2015, 06:40 PM
Try updating your squirrel module (https://bitbucket.org/stormeus/0.4-squirrel/downloads).
Title: Re: Vertical rotation
Post by: Sebastian on Apr 02, 2015, 08:32 PM
AimPos is bugged. Doesn't give the correct position.  (http://forum.vc-mp.org/?topic=324.0)
Title: Re: Vertical rotation
Post by: Florin Calinescu on Apr 03, 2015, 07:52 AM
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. :(
Title: Re: Vertical rotation
Post by: Sebastian 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)
Title: Re: Vertical rotation
Post by: Florin Calinescu on Apr 03, 2015, 03:22 PM
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 :'(
Title: Re: Vertical rotation
Post by: Thijn on Apr 04, 2015, 01:58 PM
Are you using it as a function? i.e. player.GetPlayerAimPos()
Title: Re: Vertical rotation
Post by: . on Apr 04, 2015, 02:25 PM
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`
Title: Re: Vertical rotation
Post by: Sebastian on Apr 04, 2015, 03:27 PM
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.
Title: Re: Vertical rotation
Post by: . on Apr 04, 2015, 03:37 PM
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.
Title: Re: Vertical rotation
Post by: Thijn on Apr 04, 2015, 03:44 PM
Quote from: S.L.C on Apr 04, 2015, 03:37 PM
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.
I didn't look it up, so I didn't :P Thanks for clearing that up.
Title: Re: Vertical rotation
Post by: Florin Calinescu on Apr 05, 2015, 05:15 PM
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