Jump to content

givePedWeapon does not work


swag_k_dog

Recommended Posts

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
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:

W5ZZZgS.jpg

Link to comment

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
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 by swag_k_dog
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...