Jump to content

[Help]Ped anim Cigarette


Recommended Posts

function attach(thePlayer)
local x, y, z = getElementPosition (thePlayer)
cigar = createObject (3044, x, y, z)
local cash = getPlayerMoney (thePlayer)
if cash > 5000 then 
    setElementData (thePlayer, "cig", false)
    exports.bone:attachElementToBone(cigar, thePlayer, 11, 0, 0.05, 0.27, 90, 90, 90)
    	setPedAnimation (thePlayer, "SMOKING", "M_smklean_loop")
    outputChatBox ("Sigara İcmek 5000 TL.Almak icin /sigara .Biritmek icin /bitir", thePlayer, 0, 255, 0)
   takePlayerMoney (thePlayer, 5000)
else outputChatBox ("Sigara icecek paran yok.", thePlayer, 255, 0, 0)
end
end
addCommandHandler ("sigara", attach)

function detach(thePlayer)
    destroyElement (cigar)
	setPedAnimation (thePlayer, false)
end
addCommandHandler ("bitir", detach)

He is not taking the cigarette to his mouth .How can I hand over the cigarette?

 

r19LAB.png

4 minutes ago, Yurigarga said:

function attach(thePlayer)
local x, y, z = getElementPosition (thePlayer)
cigar = createObject (3044, x, y, z)
local cash = getPlayerMoney (thePlayer)
if cash > 5000 then 
    setElementData (thePlayer, "cig", false)
    exports.bone:attachElementToBone(cigar, thePlayer, 11, 0, 0.05, 0.27, 90, 90, 90)
    	setPedAnimation (thePlayer, "SMOKING", "M_smklean_loop")
    outputChatBox ("Sigara İcmek 5000 TL.Almak icin /sigara .Biritmek icin /bitir", thePlayer, 0, 255, 0)
   takePlayerMoney (thePlayer, 5000)
else outputChatBox ("Sigara icecek paran yok.", thePlayer, 255, 0, 0)
end
end
addCommandHandler ("sigara", attach)

function detach(thePlayer)
    destroyElement (cigar)
	setPedAnimation (thePlayer, false)
end
addCommandHandler ("bitir", detach)

He is not taking the cigarette to his mouth .How to combine cigarette animation?

 

r19LAB.png

 

Link to comment
function attach(thePlayer)
local x, y, z = getElementPosition (thePlayer)
cigar = createObject (3044, x, y, z)
local cash = getPlayerMoney (thePlayer)
if cash > 5000 then 
    setElementData (thePlayer, "cig", false)
    exports.bone:attachElementToBone(cigar, thePlayer, 11, 0, 0.05, 0.27, 90, 90, 90)
    	setPedAnimation (thePlayer, "SMOKING", "M_smk_drag")
    outputChatBox ("Sigara İcmek 5000 TL.Almak icin /sigara .Biritmek icin /bitir", thePlayer, 0, 255, 0)
   takePlayerMoney (thePlayer, 5000)
else outputChatBox ("Sigara icecek paran yok.", thePlayer, 255, 0, 0)
end
end
addCommandHandler ("sigara", attach)

function detach(thePlayer)
    destroyElement (cigar)
	setPedAnimation (thePlayer, false)
end
addCommandHandler ("bitir", detach)

Try That :) 

Link to comment
I want to hand the cigarette.
Smoking does not move with the hand .pls help
8 hours ago, MrKAREEM said:

Show Me The Debug :) 

But Did The Object Show Or Not

And The Problem In Anim or Object Beacause am not understand u directly !

Edited by Yurigarga
Link to comment

this is example from resource page:

ped = createPed(105,0,0,3)
burger = createObject(2880,0,0,0)
exports.bone_attach:attachElementToBone(burger,ped,12,0,0,0,0,-90,0)

try to change bone id: 11 -> 12 and change position + rotation of object

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