Miika Posted August 16, 2015 Share Posted August 16, 2015 (edited) ---- Code removed ---- Edited August 29, 2015 by Guest Link to comment
t3wz Posted August 16, 2015 Share Posted August 16, 2015 in the line 3 you define a function called createPed and in the line 8 you call createPed(...), this cause an infinite loop. you could do something like this: defaultCreatePed = createPed function createPed() for i=1,#ped do if (isElement(worker[i])) then destroyElement(worker[i]) else worker[i] = defaultCreatePed (ped[i][5], ped[i][1], ped[i][2], ped[i][3], ped[i][4]) end end end Link to comment
Miika Posted August 16, 2015 Author Share Posted August 16, 2015 Oops, same mistake always But thanks guy for helping! Link to comment
ixjf Posted August 16, 2015 Share Posted August 16, 2015 in the line 3 you define a function called createPed and in the line 8 you call createPed(...), this cause an infinite loop.you could do something like this: defaultCreatePed = createPed function createPed() for i=1,#ped do if (isElement(worker[i])) then destroyElement(worker[i]) else worker[i] = defaultCreatePed (ped[i][5], ped[i][1], ped[i][2], ped[i][3], ped[i][4]) end end end Or you could avoid cancer code like that and simply not name your function "createPed". Link to comment
Miika Posted August 16, 2015 Author Share Posted August 16, 2015 in the line 3 you define a function called createPed and in the line 8 you call createPed(...), this cause an infinite loop.you could do something like this: defaultCreatePed = createPed function createPed() for i=1,#ped do if (isElement(worker[i])) then destroyElement(worker[i]) else worker[i] = defaultCreatePed (ped[i][5], ped[i][1], ped[i][2], ped[i][3], ped[i][4]) end end end Or you could avoid cancer code like that and simply not name your function "createPed". Yeah, i renamed the function. 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