Halfmillz Posted July 23, 2013 Share Posted July 23, 2013 (edited) 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 July 24, 2013 by Guest Link to comment
Jaysds1 Posted July 23, 2013 Share Posted July 23, 2013 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) Link to comment
Halfmillz Posted July 23, 2013 Author Share Posted July 23, 2013 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
iMr.3a[Z]eF Posted July 24, 2013 Share Posted July 24, 2013 getElementPosition (player) setElementPosition (player,x,y,z-2) setTimer Link to comment
Halfmillz Posted July 24, 2013 Author Share Posted July 24, 2013 getElementPosition (player) setElementPosition (player,x,y,z-2) setTimer what is x y z come from , Now i have problem how to move player to the ped direction? It's move to wrong direction. Link to comment
iMr.3a[Z]eF Posted July 24, 2013 Share Posted July 24, 2013 (edited) 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. Edited July 24, 2013 by Guest Link to comment
فاّرس Posted July 24, 2013 Share Posted July 24, 2013 Ex: for move player and edit it for ped addCommandHandler('set', function(player) setTimer(function() local x,y,z = getElementPosition(player) setElementPosition(player,x,y-2,z) end,50,0 ) end ) Link to comment
iMr.3a[Z]eF Posted July 24, 2013 Share Posted July 24, 2013 Ex: for move player and edit it for ped 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?. Link to comment
فاّرس Posted July 24, 2013 Share Posted July 24, 2013 Ex: for move player and edit it for ped 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
iMr.3a[Z]eF Posted July 24, 2013 Share Posted July 24, 2013 What event are you talking about? You're using command handler. Link to comment
فاّرس Posted July 24, 2013 Share Posted July 24, 2013 What event are you talking about?You're using command handler. Test the code and tell me and please don't post before read the wiki. player playerSource, string commandName, [string arg1, string arg2, ...] Link to comment
Halfmillz Posted July 24, 2013 Author Share Posted July 24, 2013 Sorry forget somethingIs 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
TAPL Posted July 24, 2013 Share Posted July 24, 2013 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
iMr.3a[Z]eF Posted July 24, 2013 Share Posted July 24, 2013 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. Link to comment
TAPL Posted July 24, 2013 Share Posted July 24, 2013 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
Halfmillz Posted July 24, 2013 Author Share Posted July 24, 2013 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 very good idea i never know that player can attach -0- Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now