Jump to content

Another script... <_<


#Paper

Recommended Posts

Posted

This is MY afk killer, but don't work and no error is showed:

Server-Side:

  
local MaxAfkTime = 10  
local AfkKickReason = "Afk for "..MaxAfkTime .." Seconds" 
local afkKeys = {"arrow_l", "arrow_u", "arrow_r", "arrow_d", "w", "s", "d", "a" } 
local afkTimer = nil 
local afkTime = 25000 -- 25 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!", getRootElement()) 
        if afkTime > MaxAfkTime then  
             setElementData(client, "idletime", 0) 
             kickPed ( client, "Afk-Script", AfkKickReason ) 
        end 
    end 
end 
addEvent( "onAfkEvent", true ) 
addEventHandler( "onAfkEvent", getRootElement(), onAfkEvent) 
  
function pushKey( key, state ) 
  if ( state == "down" ) then 
     if isTimer(afkTime) then 
        killTimer(afkTime) 
     end 
  end 
end 
  
function AfkKeys() 
  setElementData(getLocalPlayer(), "idletime", 0) 
  for key,keyNames in pairs(afkKeys) do 
     bindKey(keynames, "both", pushKey) 
  end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), AfkKeys) 
  

Client-Side:

  
local afkTime = 25000 
local afkKeys = {"arrow_l", "arrow_u", "arrow_r", "arrow_d", "w", "s", "d", "a" } 
local img = guiCreateStaticImage(378,283,402,163,"images/warning.png",false) 
function showimg( ) 
    if afkTime then 
        guiCreateStaticImage(378,283,402,163,"images/warning.png",false) 
    end 
    if afkKeys then 
    guiSetVisible ( img , false ) 
    end 
end 
  

mtaubluascripter.png

My skype: skiper964

I helped you? Help me! ^^

Help me bro! ^^

Posted

If you CAN'T SCRIPT and you are TAKING (part of) somebody's else script - better take WHOLE.

Your client does NOT makes ANY sense.

Your server-side is partially copied from another topic.

Bad luck this time I think..

edit:

oh, i see, you are copied both client and server from Jason_Gregory's post and pasted as server-side

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)!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...