arezu Posted February 13, 2012 Share Posted February 13, 2012 It says: attempt to call global 'getPedAnimationData' (a nil value).. here is how i tried it: local x, y, z = getElementPosition(getLocalPlayer()) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimationData(npc.shop.ped) does it exist, but wiki is outdated and the function has different arguments? Link to comment
unknooooown Posted February 13, 2012 Share Posted February 13, 2012 It says: attempt to call global 'getPedAnimationData' (a nil value)..here is how i tried it: local x, y, z = getElementPosition(getLocalPlayer()) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimationData(npc.shop.ped) does it exist, but wiki is outdated and the function has different arguments? It's because getPedAnimationData is a Clientside function. In your xml file you should add: type="client" Example: I am 110% sure that the problem is caused by that. Without the "type="client"", the script will run as a serverside script. Link to comment
arezu Posted February 13, 2012 Author Share Posted February 13, 2012 It says: attempt to call global 'getPedAnimationData' (a nil value)..here is how i tried it: local x, y, z = getElementPosition(getLocalPlayer()) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimationData(npc.shop.ped) does it exist, but wiki is outdated and the function has different arguments? It's because getPedAnimationData is a Clientside function. In your xml file you should add: type="client" Example: I am 110% sure that the problem is caused by that. Without the "type="client"", the script will run as a serverside script. it is : , otherwise it would say error on 'getLocalPlayer()' too Link to comment
Evil-Cod3r Posted February 13, 2012 Share Posted February 13, 2012 try this local x, y, z = getElementPosition(source) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimationData(npc.shop.ped) Link to comment
Thelastride Posted February 13, 2012 Share Posted February 13, 2012 try this local x, y, z = getElementPosition(source) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimationData(npc.shop.ped) Works for me Link to comment
arezu Posted February 13, 2012 Author Share Posted February 13, 2012 try this local x, y, z = getElementPosition(source) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimationData(npc.shop.ped) The only problem is at getPedAnimationData! i can see the ped at the position i set it and with the animation i set it to, no problem there, but getPedAnimationData is the only thing that doesn't work Link to comment
Evil-Cod3r Posted February 13, 2012 Share Posted February 13, 2012 try this then local x, y, z = getElementPosition(source) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimation(npc.shop.ped) Link to comment
arezu Posted February 13, 2012 Author Share Posted February 13, 2012 try this then local x, y, z = getElementPosition(source) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimation(npc.shop.ped) getPedAnimation only returns the current playing animation block and animation name, not these: time: float - duration of the animation start_time: float - starting point finished: boolean - has animation finished playing? i tested it anyways and wiki was correct on getPedAnimation, so it didn't work. Link to comment
Evil-Cod3r Posted February 13, 2012 Share Posted February 13, 2012 you have to wait some one else then me iam not good scripter Link to comment
drk Posted February 13, 2012 Share Posted February 13, 2012 I think this function no longer exists.. Link to comment
Agon Posted February 13, 2012 Share Posted February 13, 2012 Note: This function doesn't exist in 1.0.1 --50p 22:06, 9 October 2009 (UTC) Link to comment
arezu Posted February 13, 2012 Author Share Posted February 13, 2012 Note: This function doesn't exist in 1.0.1 --50p 22:06, 9 October 2009 (UTC) thats just confusing.. if he meant from 1.0.1 onwards then it should say so, or just delete the page. Link to comment
unknooooown Posted February 13, 2012 Share Posted February 13, 2012 It says: attempt to call global 'getPedAnimationData' (a nil value)..here is how i tried it: local x, y, z = getElementPosition(getLocalPlayer()) local npc = {} npc.shop = {} npc.shop.ped = createPed(171, x + 3, y + 5, z) setPedAnimation(npc.shop.ped, "BAR", "Barserve_loop", -1, true, false, true, false) local name, block_name, loop, update_position, iterruptible, time, start_time, finished = getPedAnimationData(npc.shop.ped) does it exist, but wiki is outdated and the function has different arguments? It's because getPedAnimationData is a Clientside function. In your xml file you should add: type="client" Example: I am 110% sure that the problem is caused by that. Without the "type="client"", the script will run as a serverside script. it is : , otherwise it would say error on 'getLocalPlayer()' too Oh yeah, forgot the ".lua" part O_o 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