swag_k_dog Posted October 10, 2016 Share Posted October 10, 2016 local batped = createPed(30, 2767.5, -1617, 11) setPedRotation(batped, -45) givePedWeapon(batped, 5, 1, true) setPedAnimation(batped, "dildo", "dildo_idle") the ped spawns with his animation but it the "givePedWeapon" line does not work at all. help? Link to comment
Gravestone Posted October 10, 2016 Share Posted October 10, 2016 setPedRotation is a deprecated function so you'll have to use setElementRotation instead. And for the weapon not being given, it's actually given, I don't know why it's not visible. I tried it with this server sided code: addCommandHandler("createped", function() batped = createPed(30, 2767.5, -1617, 11) setElementRotation(batped, 0, 0, -45) setPedAnimation(batped, "dildo", "dildo_idle") giveWeapon(batped, 5, 1, true) end ) addCommandHandler("wp", function() outputChatBox(getPedWeapon(batped)) end ) It outputs ID 5 i.e baseball bat. An MTA bug perhaps? Link to comment
swag_k_dog Posted October 10, 2016 Author Share Posted October 10, 2016 4 minutes ago, Gravestone said: setPedRotation is a deprecated function so you'll have to use setElementRotation instead. And for the weapon not being given, it's actually given, I don't know why it's not visible. I tried it with this server sided code: addCommandHandler("createped", function() batped = createPed(30, 2767.5, -1617, 11) setElementRotation(batped, 0, 0, -45) setPedAnimation(batped, "dildo", "dildo_idle") giveWeapon(batped, 5, 1, true) end ) addCommandHandler("wp", function() outputChatBox(getPedWeapon(batped)) end ) It outputs ID 5 i.e baseball bat. An MTA bug perhaps? here is a pic of the ped being spawned without a weapon: Link to comment
Gravestone Posted October 10, 2016 Share Posted October 10, 2016 Read my post again. 6 minutes ago, Gravestone said: it's actually given, I don't know why it's not visible. I tried it with this server sided code: Link to comment
Walid Posted October 10, 2016 Share Posted October 10, 2016 it's very easy just added a timer that's all addCommandHandler("createped", function() local batped = createPed(30, 1210.6025390625, 1343.564453125, 6.734375) setElementRotation(batped, 0, 0, -45) setPedAnimation(batped, "dildo", "dildo_idle") setTimer(giveWeapon,500,1,batped, 5, 1, true) end ) Link to comment
swag_k_dog Posted October 10, 2016 Author Share Posted October 10, 2016 (edited) 16 minutes ago, Walid said: it's very easy just added a timer that's all addCommandHandler("createped", function() local batped = createPed(30, 1210.6025390625, 1343.564453125, 6.734375) setElementRotation(batped, 0, 0, -45) setPedAnimation(batped, "dildo", "dildo_idle") setTimer(giveWeapon,500,1,batped, 5, 1, true) end ) still doesnt work, I just tried Edit: nevermind its "givePedWeapon" not "giveWeapon". got it!!! thanks Edited October 10, 2016 by swag_k_dog Link to comment
swag_k_dog Posted October 10, 2016 Author Share Posted October 10, 2016 (edited) X Edited October 10, 2016 by swag_k_dog Link to comment
Walid Posted October 10, 2016 Share Posted October 10, 2016 (edited) 1 hour ago, swag_k_dog said: still doesnt work, I just tried Edit: nevermind its "givePedWeapon" not "giveWeapon". got it!!! thanks Use my code server side . givePedWeapon: Client side function. giveWeapon: Server side function. Edited October 10, 2016 by Walid 1 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