=KoG=Rouche Posted November 9, 2013 Share Posted November 9, 2013 Hi all ! I use a AFK killer script and i've a big problem. Some of my players play with a JoyPad ... and the afk script detect only keybord action. So when they play, the AFK kill them for afk. Is there a way to add JoyPad action to the script ? Link to comment
Gallardo9944 Posted November 9, 2013 Share Posted November 9, 2013 Try using onClientRender to reset the timer. getAnalogControlState Will help you with it. The code should look like this. function renderReset() local F = getAnalogControlState("accelerate") local B = getAnalogControlState("brake_reverse") local L = getAnalogControlState("vehicle_left") local R = getAnalogControlState("vehicle_right") if F > 0 or B > 0 or L > 0 or R > 0 then resetTimer() -- Reset your AFK timer here end end addEventHandler("onClientRender",getRootElement(),renderReset) Link to comment
=KoG=Rouche Posted November 9, 2013 Author Share Posted November 9, 2013 Thank for your help Link to comment
tosfera Posted November 9, 2013 Share Posted November 9, 2013 Keep in mind; this is a dirty way of fixing it. There are other ways, like binding your buttons or restarting the timer whenever a button has been pressed / moved with the JoyPad. 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