Jump to content

[SLOVED]How to Smooth move Player to Ped?


Recommended Posts

i want to set Player position to ped smoothly

i try setElementPosition it warp player to ped, not moving smoothly, have any solution?

sloved

You can create object and set the alpha to zero and disable the collisions and attach the ped to the object and then you can use moveObject.

Edited by Guest
Link to comment
Do you mean like the screen fading out and set the player to the ped position and then fade in?
fadeCamera(player,false,3) 
setElementPosition(player,x,y,z) 
fadeCamera(player,true,3) 

No, I mean move player position by step until to finish position like moveObject function but it can't use with player.

Link to comment
Ex: for move player and edit it for ped :D

addCommandHandler('set', 
function(player) 
setTimer(function() 
local x,y,z = getElementPosition(player) 
setElementPosition(player,x,y-2,z) 
        end,50,0 
        ) 
    end 
) 

What is the player type?.

?? What ??

this code got the position and set the y -2 for the timer.

And 'player' it's defined in the event.

Link to comment
Sorry forget something

Is the ped far away from the player?.

And the correct function i was mean is:

local x,y,z = getElementPosition (player) 
setTimer(setElementPosition (player,x,y,z-2), 1000, 0) 

This function is move the player next to him every second.

Or use setPedWalkingStyle.

distance between ped and player is 5-10 and i have the both position

ex.

pedX,pedY,pedZ = getElementPosition(ped) 
X,Y,Z = getElementPosition(player) 

i try setTimer, but i don't know how to move player to ped's position

Link to comment
Do you mean like the screen fading out and set the player to the ped position and then fade in?
fadeCamera(player,false,3) 
setElementPosition(player,x,y,z) 
fadeCamera(player,true,3) 

No, I mean move player position by step until to finish position like moveObject function but it can't use with player.

You can create object and set the alpha to zero and disable the collisions and attach the ped to the object and then you can use moveObject.

Link to comment
You can create object and set the alpha to zero and disable the collisions and attach the ped to the object and then you can use moveObject.

Smart idea, but he said he want to move the player to the ped.

oh, i was mean player not ped how did i said ped, typo mistake. :|

Link to comment
You can create object and set the alpha to zero and disable the collisions and attach the ped to the object and then you can use moveObject.

Smart idea, but he said he want to move the player to the ped.

oh, i was mean player not ped how did i said ped, typo mistake. :|

wow, it's work! thanks you very much TAPL :D very good idea

i never know that player can attach -0-

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...