[DMC] Posted October 13, 2010 Posted October 13, 2010 hey, i got a script for the admins when i do /admins it says Level 10= level 9= etc but when i do this its saying stack overflow im not comfortable with posting this so im just asking what this error means
Callum Posted October 14, 2010 Posted October 14, 2010 That the stack has overflown. I've only ever reproduced this by calling a function from within itself, like; function a() a() end Retired
Castillo Posted October 14, 2010 Posted October 14, 2010 callum, i have seen his code if i'm right he is doing that San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Wojak Posted October 14, 2010 Posted October 14, 2010 hey,i got a script for the admins when i do /admins it says Level 10= level 9= etc but when i do this its saying stack overflow im not comfortable with posting this so im just asking what this error means there are at lest two ways to prevent this: 1) Proper Tail Call function a() return a() end Because a proper tail call uses no stack space, there is no limit on the number of "nested" tail calls that a program can make. For instance, we can call the following function with any number as argument; it will never overflow the stack. 2) setTimer function function a() setTimer (a,50,1) end i always use "setTimer" method myself, ofcourse the interval may be difrent than 50 (50 is minimum) create your teleports and interiors in MTA map editor want more excitment in your race map? - add a killer bot you may also add some peds (NPC) - CARMAGEDDON STYLE! 2paq MTA:SA Race Server
[DMC] Posted October 14, 2010 Author Posted October 14, 2010 gues im wasting your guys time cuz idk what you guys mean
dzek (varez) Posted October 14, 2010 Posted October 14, 2010 infinite loop/infinite recursion causes this. Wojak: -- this is infinite recursion too !! and will trigger stack overflow function a() return a() end Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Wojak Posted October 14, 2010 Posted October 14, 2010 i was bored in the work one day and i read the lua manual... this expresion function a() return a() end is a "Proper Tail Cal" and lua interpreter treats it like "GoTo" and do not use any stack space. No stack -> no stack overflow http://www.lua.org/pil/6.3.html of course every scripter should know how to prevent Infinite loops using conditions and i think this exemple may result in FPS drop. create your teleports and interiors in MTA map editor want more excitment in your race map? - add a killer bot you may also add some peds (NPC) - CARMAGEDDON STYLE! 2paq MTA:SA Race Server
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