Fist Posted September 10, 2015 Posted September 10, 2015 Hello everyone. Just askin or it is possible to destroy function? Like if key Z is executed and it executes EXAMPLE function and if i press again Z it destroys that function, and over again same process.
JR10 Posted September 10, 2015 Posted September 10, 2015 Take a look at unbindKey Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Fist Posted September 10, 2015 Author Posted September 10, 2015 Take a look at unbindKey That would not fix my problem, i need exaclty what destroys function, cause i need it so in background doesnt run a useless gui when its not used.
Moderators IIYAMA Posted September 10, 2015 Moderators Posted September 10, 2015 function myFunctionName () end myFunctionName = nil -- delete Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Fist Posted September 10, 2015 Author Posted September 10, 2015 function myFunctionName () end myFunctionName = nil -- delete doesnt work.
JR10 Posted September 10, 2015 Posted September 10, 2015 There's no such thing as "destroying" a function. Once it's bound to a command or a key, even nullifying the function's variable won't stop its execution. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Fist Posted September 10, 2015 Author Posted September 10, 2015 There's no such thing as "destroying" a function. Once it's bound to a command or a key, even nullifying the function's variable won't stop its execution. Ok, thanks anyway.
ixjf Posted September 11, 2015 Posted September 11, 2015 As long as the function is referenced somewhere, Lua's garbage collector won't remove it. You'll have to unbind the key from that function to stop it. 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
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