yMassai Posted March 25, 2012 Share Posted March 25, 2012 createPed ( skin id, x, y, z) With it to create a puppet, but gets a single problem in this method of husbandry, the doll may die and can move. Someone could tell me how can I do for him not to die and not move? And also do not know how to turn it to the side that I want. Please take it easy with me. Link to comment
CapY Posted March 25, 2012 Share Posted March 25, 2012 createPed ( skin id, x, y, z) With it to create a puppet, but gets a single problem in this method of husbandry, the doll may die and can move. Someone could tell me how can I do for him not to die and not move? And also do not know how to turn it to the side that I want. Please take it easy with me. cancelEvent on onPlayerDamage event and setElementFrozen to freeze the ped Also, createPed ( int modelid, float x, float y, float z , float rot = 0.0 ) 5th argument is rotation. Link to comment
yMassai Posted March 25, 2012 Author Share Posted March 25, 2012 thank you. I will say that I do not understand very well not to be in doubt. you spoke to cancel something and freeze I dont know do it friend. you know you explain? Link to comment
CapY Posted March 25, 2012 Share Posted March 25, 2012 thank you.I will say that I do not understand very well not to be in doubt. you spoke to cancel something and freeze I dont know do it friend. you know you explain? local skinID = 155 local ped = createPed ( skinID, 20,30,2, 15 ) setElementFrozen ( ped, true ) addEventHandler ( "onPlayerDamage", root, function ( ) if source == ped then cancelEvent ( ) end end ) Haven't tested it, but it should work. Link to comment
Kenix Posted March 25, 2012 Share Posted March 25, 2012 It's wrong code. Only onClientPlayerDamage can be canceled. Link to comment
CapY Posted March 25, 2012 Share Posted March 25, 2012 It's wrong code. Only onClientPlayerDamage can be canceled. Then just replace onPlayerDamage with onClientPlayerDamage. Thanks for that information, Kenix. Link to comment
Kenix Posted March 25, 2012 Share Posted March 25, 2012 My bad.Not read all posts Client local skinID = 155 local ped = createPed ( skinID, 20,30,2, 15 ) setElementFrozen ( ped, true ) addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) onClientPlayerDamage/onPlayerDamage used only for players ( not for peds ). Also better attach element ped to event handler.( not if ped == source then ).It's faster And instead of this addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) Can create this addEventHandler ( "onClientPedDamage", ped, cancelEvent ) Link to comment
CapY Posted March 25, 2012 Share Posted March 25, 2012 My bad.Not read all posts Client local skinID = 155 local ped = createPed ( skinID, 20,30,2, 15 ) setElementFrozen ( ped, true ) addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) onClientPlayerDamage/onPlayerDamage used only for players ( not for peds ). Also better attach element ped to event handler.( not if ped == source then ).It's faster And instead of this addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) Can create this addEventHandler ( "onClientPedDamage", ped, cancelEvent ) But mine would also work, eh. P.S. I didn't know there's "onClientPedDamage" event. Link to comment
Castillo Posted March 25, 2012 Share Posted March 25, 2012 Yours wouldn't have worked, player and ped is not the same thing, so if you want to cancel a ped damage you use onClientPedDamage. 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