Drakath Posted January 1, 2015 Share Posted January 1, 2015 When I do: for i, ped in ipairs(getElementsByType("ped")) do end Is it possible that ped won't exist? Should I check it with isElement like so: for i, ped in ipairs(getElementsByType("ped")) do if isElement(ped) then end end ? Link to comment
MTA Team botder Posted January 1, 2015 MTA Team Share Posted January 1, 2015 you must replace it Stop that nonsense. @Drakath: The ped should exist in that server tick, when you script runs the loop. You can always use a isElement check if you want to be 100% sure. Link to comment
Drakath Posted January 1, 2015 Author Share Posted January 1, 2015 Alright but does that mean that there is no 100 % chance that the ped will exist in that loop? Link to comment
toxicsmoke11 Posted January 1, 2015 Share Posted January 1, 2015 in a milisecond it gets executed it will get all valid ped elements so you don't have to check if ped is element since chances of getting a ped which isn't an element are 0.0000000000000000000000001% Link to comment
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