Jump to content

givePedWeapon does not work


swag_k_dog

Recommended Posts

Posted

 

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?

Posted

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?

Clan war system http://sh.st/7r4nI

 

Posted
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

Posted

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
) 

 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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

Edited by Walid
  • Like 1

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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