SA-MP Forums Setting player's velocity to move player to specific position?
 New Account Members List Search Today's Posts Mark Forums Read

 16/01/2018, 10:31 AM #1 5740 Little Clucker   Join Date: Feb 2017 Posts: 6 Reputation: 0 Setting player's velocity to move player to specific position? Ok. I know how to SET a player's back position using trigonometric function. Code: ```GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]); GetPlayerFacingAngle(playerid, angle); newpos[0] = oldpos[0] + (Radius * floatcos(angle - 90, degrees)); newpos[1] = oldpos[1] + (Radius * floatsin(angle - 90, degrees)); newpos[2] = oldpos[2]; //newpos is the player's front pos``` But you can see, this code is for SETTING player's position, NOT MOVING player's position. So I noticed only way to move player is setting player's velocity, not setting position. Now here is the question: Is there any way to set player velocity to move player to specific position? I tried to do this by myself, but I had know idea to move player to specific position using velocity..
 16/01/2018, 01:06 PM #2 Meller Gangsta     Join Date: Dec 2016 Posts: 638 Reputation: 132 Re: Setting player's velocity to move player to specific position? It really depends on the geographic location, is there objects blocking-- is the character in need of move up in order to pass? does the character need to go west or east, north or south? is there a clear way to move(straight line?) etc
31/01/2018, 11:50 AM   #3
5740
Little Clucker

Join Date: Feb 2017
Posts: 6
Reputation: 0
Re: Setting player's velocity to move player to specific position?

Quote:
 Originally Posted by Meller It really depends on the geographic location, is there objects blocking-- is the character in need of move up in order to pass? does the character need to go west or east, north or south? is there a clear way to move(straight line?) etc
Well..but that's why I'm trying to move player using velocity. Using velocity to move player won't move player to wrong position, just making speed(velocity) to move.

 15/02/2018, 12:06 PM #4 Slice High-roller   Join Date: Mar 2008 Location: Sweden Posts: 1,900 Reputation: 1586 Re: Setting player's velocity to move player to specific position? It's possible, but you won't be able to use standard formulas because there is a limitation on the Z velocity. How far do you want to move the player?

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post NeXoR Scripting Help 3 14/04/2016 09:10 AM YouServ Scripting Help 1 27/01/2016 03:59 PM Aerotactics Scripting Help 6 18/08/2014 06:29 PM D0os Scripting Help 2 16/06/2012 05:07 PM sekol Help Archive 4 21/10/2010 09:15 PM

All times are GMT. The time now is 02:51 PM.

 -- (EN) English -- (RU) Русски Contact Us - SA-MP - Archive - Top