Jump to content

spawn event


Recommended Posts

Posted
local ped = createPed(1,1,1,1) 
if ( ped ) then 

Now, this is the part where you'd want to check if your element is created/spawned or whatever..

if ( ped ) then 

Posted
_createPed = createPed -- save the function 
createPed = function(x,y,z,rot,syn) 
      if x and y and z then 
    local rot = rot or 0 
        local syn = syn or true 
        local  thePed = _createPed (x,y,z,rot,syn) -- now we'll call it 
      if thePed then 
     return  thePed 
    triggerEvent (thePed,"onPedSpawn",thePed) -- lets trigger it  
          end 
     end 
end 
  

Usage:

 _createPed (0,0,0) 
  

So your new event is "onPedSpawn" and the source of this event is the ped that was created.

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