Miika Posted August 16, 2015 Posted August 16, 2015 (edited) ---- Code removed ---- Edited August 29, 2015 by Guest Real motorbike backflip / frontflip script: https://forum.mtasa.com/viewtopic.php?f=108&t=98191
t3wz Posted August 16, 2015 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
Miika Posted August 16, 2015 Author Posted August 16, 2015 Oops, same mistake always But thanks guy for helping! Real motorbike backflip / frontflip script: https://forum.mtasa.com/viewtopic.php?f=108&t=98191
ixjf Posted August 16, 2015 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". I used to know how to code, but then I took an arrow in the knee. Project Redivivus - Remaking Old School MTA With New Code MTA 0.6 Nightly 1 released
Miika Posted August 16, 2015 Author 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. Real motorbike backflip / frontflip script: https://forum.mtasa.com/viewtopic.php?f=108&t=98191
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