adamb Posted May 10, 2013 Posted May 10, 2013 Hey, i just got a problem while scripting this, and i would need help with it. It gives me this error: Bad arguement @ 'setElementParent' [Expected element at arguement 1, got nil] setTimer( function() victimblip = createBlip(Mx, My, Mz, 0, 0, 0, 0, 1) end, 1000, 0) setElementParent(victimblip, theMugPlace)
iPrestege Posted May 10, 2013 Posted May 10, 2013 You have to ' setElementParent' After 1 sec because the blip was not created yet .
K4stic Posted May 10, 2013 Posted May 10, 2013 and more easy to no use timer to create blip attacked to theMugPlace createBlipAttachedTo( theMugPlace, 0, 2, 0, 0, 0 )
adamb Posted May 10, 2013 Author Posted May 10, 2013 Thanks for the quick reply, Tho, i need to delay SetElementParent with a timer? Can you show me how? And i do need time to create the blip.
iPrestege Posted May 10, 2013 Posted May 10, 2013 setTimer(setElementParent,1000,0,victimblip,theMugPlace)
adamb Posted May 10, 2013 Author Posted May 10, 2013 Nope, that still gets me the same problem just repeated again and again and again.
iPrestege Posted May 10, 2013 Posted May 10, 2013 setTimer( function ( ) if isElement ( victimblip ) then setElementParent ( victimblip,theMugPlace ) end end,1000,0)
Castillo Posted May 10, 2013 Posted May 10, 2013 What's the point of that timer? you had one to create the blip, just add the setElementParent after you create it inside the same function.
adamb Posted May 10, 2013 Author Posted May 10, 2013 What's the point of that timer? you had one to create the blip, just add the setElementParent after you create it inside the same function. I'm making a police callout system, and i'm trying to make it as real as possible, so delaying it would make it more realistic, as real police doesn't get all their calls at the same time.
Castillo Posted May 10, 2013 Posted May 10, 2013 I'm not saying that you shouldn't use the timer to create it, I'm saying that you can use the same timer that creates it to set the parent.
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