innovation gaming Posted April 21, 2010 Share Posted April 21, 2010 hello I don't find a script to auto kill AFK after few seconds for my serv mta inline Thanks for help Link to comment
COOKIE2 Posted April 21, 2010 Share Posted April 21, 2010 well im not sure if it works but local checkTime = 20 -- in seconds local afk_timer = nil local keyAlreadyHit = false local function checkAFK() afk_timer = nil if not keyAlreadyHit then triggerServerEvent("onPlayerAfk", getLocalPlayer()) else afk_timer = setTimer(checkAFK, checkTime * 1000, 1) end keyAlreadyHit = false end addEvent("afkStartTimer", true) addEventHandler("afkStartTimer", getRootElement(), function() if afk_timer then killTimer(afk_timer) afk_timer = nil end afk_timer = setTimer(checkAFK, checkTime * 1000, 1) keyAlreadyHit = false end) addEvent("afkStopTimer", true) addEventHandler("afkStopTimer", getRootElement(), function() if afk_timer then killTimer(afk_timer) afk_timer = nil end keyAlreadyHit = false end) local function keyHit() keyAlreadyHit = true end for k, v in pairs{"backspace","tab","lshift","rshift","lctrl","rctrl","lalt","ralt","pause","capslock","enter","space","pgup","pgdn","end","home","arrow_l","arrow_u","arrow_r","arrow_d","insert","delete","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","num_0","num_1","num_2","num_3","num_4","num_5","num_6","num_7","num_8","num_9","num_mul","num_add","num_sep","num_sub","num_dec","num_div","F1","F2","F3","F4","F5","F6","F7","F9","F10","F11","F12","scroll",";","=",",","-",".","/","'","[","\\","]"} do bindKey(v, "down", keyHit) bindKey(v, "up", keyHit) end Link to comment
eAi Posted April 21, 2010 Share Posted April 21, 2010 That isn't your script. Credit your source. Link to comment
COOKIE2 Posted April 21, 2010 Share Posted April 21, 2010 lol cuz u care so damn much i tell it a admin of my server gave me source happy now Link to comment
Jason_Gregory Posted April 21, 2010 Share Posted April 21, 2010 No we wont be happy about Stealer cause it suckZ. It isnt your Script, theres still missing the Serverside one Idiot. So stop posting Clientside Downloaded Scripts eAi knows what he´s talking about . Link to comment
COOKIE2 Posted April 21, 2010 Share Posted April 21, 2010 calm down 1: where did i wrote it was mine?? 2: i told you not mine 3: ahahah ur wrong Link to comment
Jason_Gregory Posted April 22, 2010 Share Posted April 22, 2010 Dude... 1: where did i wrote it was mine??2: i told you not mine 3: ahahah ur wrong 1. Learn the difference between Clientside/Serverside Scripts first, cause everybody can see that this isnt the full Script. You are trying to trigger a Serverside Function, but you haven´t post it, because its not yours = dont post it. Here mine hope it works, if not post the Issue afkKeys = {"arrow_l", "arrow_u", "arrow_r", "arrow_d" } afkTimer = nil afkTime = 10000 -- 10 Seconds function pushKey( key, state ) if ( state == "down" ) then if isTimer(afkTimer) then killTimer(afkTimer) afkTimer = setTimer(function() triggerServerEvent ( "onAfkEvent", getLocalPlayer(), afkTime) end, afkTime, 1) else afkTimer = setTimer(function() triggerServerEvent ( "onAfkEvent", getLocalPlayer(), afkTime) end, afkTime, 1) end end end addEventHandler ( "onClientPlayerJoin", getRootElement(), function AfkBinds() setElementData(getLocalPlayer(), "idletime", 0) for key,keyNames in pairs(afkKeys) do bindKey(keynames, "both", pushKey) end end) Serverside MaxAfkTime = 60 -- 1 Minute AfkKickReason = "Afk for "..MaxAfkTime .." Seconds" function onAfkEvent(afkTime) if client then setElementData(client , "idletime", tonumber(getElementData(client , "idletime")+tonumber(afkTime))) afkTime = AfkTime/1000 outputChatBox (getPlayerName(client).." is "..afkTime .." Seconds Afk, fucking Dumbhead >:]", getRootElement()) if afkTime > MaxAfkTime then setElementData(client, "idletime", 0) kickPlayer ( client, "Afk-Script", AfkKickReason ) end end end addEvent( "onAfkEvent", true ) addEventHandler( "onAfkEvent", getRootElement(), onAfkEvent) @Inovationgaming you can find the Key Names here https://wiki.multitheftauto.com/wiki/Key_names Link to comment
dzek (varez) Posted April 22, 2010 Share Posted April 22, 2010 i'm voting for banning COOKIE2, or something.. Why we still supporting person that constantly STEAL, is RUDE, and playing "DA MAN" here? Sorry for little off topic. Link to comment
COOKIE2 Posted April 22, 2010 Share Posted April 22, 2010 this is mine but not made by me!! a admin from my server gavve me it i thought i was a little helpful by posting it here Link to comment
dzek (varez) Posted April 22, 2010 Share Posted April 22, 2010 this is mine but not made by me!! a admin from my server gavve me iti thought i was a little helpful by posting it here you posted part of it.. that part that can be stolen.. and the "hidden" part (server side, that cannot be stolen)- you didnt post it and you already stolen one script, and posted 2 or 3 topics about that, even if the last ones was locked.. your excuses aren't good Link to comment
karlis Posted April 22, 2010 Share Posted April 22, 2010 soz for offtopic, but /voteban COOKIE lil ontopic:there were topic like this some tiem before too, search it Link to comment
COOKIE2 Posted April 22, 2010 Share Posted April 22, 2010 uhm ok... how do i say this nice you all cant read?? not mine not caring about what u say after this post and IM TRYING TO HELP THIS GUY stop argueing and help him Link to comment
dzek (varez) Posted April 22, 2010 Share Posted April 22, 2010 he got his help already, thats why we doing offtop stealing somebody's work to help other ppl? some kind of Robin Hood? you can also go outside, find some poor people, steal new BMW, and give the car to that ppl Link to comment
COOKIE2 Posted April 22, 2010 Share Posted April 22, 2010 omfg ty im gonna steal a bmw but idk where u live somewere in carton box? Link to comment
dzek (varez) Posted April 22, 2010 Share Posted April 22, 2010 omfg ty im gonna steal a bmw but idk where u live somewere in carton box? I'd better stay silent now, as I'm tired of flaming with you Link to comment
Taalasmaa Posted April 22, 2010 Share Posted April 22, 2010 omfg ty im gonna steal a bmw but idk where u live somewere in carton box? I'd better stay silent now, as I'm tired of flaming with you Agreed varez. Link to comment
Dark Dragon Posted April 22, 2010 Share Posted April 22, 2010 please keep this on topic. if the problem has been solved there's no need to continue posting 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