isa_Khamdan Posted October 22, 2013 Posted October 22, 2013 Hello , I have created a vehicle on my code outside function and i added local so it will only exists on this resource and my question is how can i re-create the vehicle after it get destroyed? Else i want it to replace the old variable but it will have the same name. local Car = createVehicle(model ,x,y,z) function() ..... end
isa_Khamdan Posted October 22, 2013 Author Posted October 22, 2013 It doesn't respawn the vehicle if it get destroyed from admin panel local Car = createVehicle ( 547, 3108, -3178, 0 ) function Check() if not (isElement(Car)) then respawnVehicle ( Car ) end end setTimer ( Check, 1000, 0)
csiguusz Posted October 22, 2013 Posted October 22, 2013 It respawn only elements that has been blown up. If you destroy them with destroyElement then you have to re-create it with createVehicle. Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
isa_Khamdan Posted October 22, 2013 Author Posted October 22, 2013 It respawn only elements that has been blown up. If you destroy them with destroyElement then you have to re-create it with createVehicle. hmm I know how to do it but how can I make it exists on the whole resource not in the function only if I put local it will only exists on that function :
csiguusz Posted October 22, 2013 Posted October 22, 2013 Then just don't use local to make the variable global. Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
csiguusz Posted October 22, 2013 Posted October 22, 2013 You are welcome. Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
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