WASSIm. Posted May 9, 2014 Posted May 9, 2014 hi guys, i have question, any event can chuck on ped or vehicle spawned ?
justn Posted May 9, 2014 Posted May 9, 2014 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
WASSIm. Posted May 11, 2014 Author Posted May 11, 2014 i want event start on ped or vehicle spawned like onPlayerSpawn
Saml1er Posted May 11, 2014 Posted May 11, 2014 _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.
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