Jump to content

Plz help createPed


yMassai

Recommended Posts

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

Link to comment
  
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. :wink:

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

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

And instead of this

addEventHandler ( "onClientPedDamage", ped, 
    function ( ) 
        cancelEvent ( ) 
    end 
) 

Can create this

  
addEventHandler ( "onClientPedDamage", ped, cancelEvent ) 
  

Link to comment
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 :wink:

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

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