Sendy Posted May 25, 2014 Share Posted May 25, 2014 Hello, please know this in order to make it work when it minimizes the MTA so it'll say "Sendy it now AFK" and when I come back in the game so it'll say "Sendy now in the game" ? please help me... This is the script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1521 Link to comment
xXMADEXx Posted May 25, 2014 Share Posted May 25, 2014 Use these events: onClientMinimize onClientRestore Link to comment
Sendy Posted May 25, 2014 Author Share Posted May 25, 2014 Use these events:onClientMinimize onClientRestore Please, you could not do it for me? I'm new here and I'm starting with .lua Link to comment
Chronic Posted May 25, 2014 Share Posted May 25, 2014 We are here to help you, not do it for you. If you post your code I will be able to see your problem and fix it. Link to comment
xXMADEXx Posted May 25, 2014 Share Posted May 25, 2014 It would basically be something like this: addEventHandler ( "onClientMinimize", root, function ( ) outputChatBox ( "Game minimized" ) end ) addEventHandler ( "onClientRestore", root, function ( ) outputChatBox ( "Game Restored" ) end ) Link to comment
Sendy Posted May 26, 2014 Author Share Posted May 26, 2014 It would basically be something like this: addEventHandler ( "onClientMinimize", root, function ( ) outputChatBox ( "Game minimized" ) end ) addEventHandler ( "onClientRestore", root, function ( ) outputChatBox ( "Game Restored" ) end ) and a function? the function name (...) or it is already a script? Link to comment
Chronic Posted May 26, 2014 Share Posted May 26, 2014 You don't name functions when you define it inside of addEventHandler I explained that terribly but here's an example function yo ( ) outputChatBox ( "yo" ) end addEventHandler ( "onClientRestore", root, yo ) addEventHandler ( "onClientRestore", root, function ( ) outputChatBox ( "yo" ) end ) Both would work, both would have the same result, but the second function cannot be called again later in the script. 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