• AFK Slay Addon
    11 replies, posted
Like Breakpoints AFK Slay, I want to slay people if they are AFK for 15 seconds. Maybe if a notifications says AFK slay in x minutes (BTW i am using evolve and i am running a fretta server)
Overv made an AFK kicker fro evolve: [url]http://evolve.overvprojects.nl/plugins/sv_afkkicker.lua[/url] You can edit it to make it slay instead
thanks, can you help with changing the kicking to slaying?
[lua] if ( gatekeeper ) then gatekeeper.Drop( pl:UserID(), "AFK" ) else pl:Kick( "AFK" ) end [/lua] Change to: [lua] pl:Kill(); [/lua]
Replace this: [lua] if ( gatekeeper ) then gatekeeper.Drop( pl:UserID(), "AFK" ) else pl:Kick( "AFK" )[/lua] end with this: [lua] pl:Kill() [/lua]You can also use pl:KillSilent() if you don't want a ragdoll or anything etc. Edit: Wtf, you edited your post Chessnut! :D, ninja'd.
NVM You changed it
Also, if you want it to be called from Evolve, change pl:Kill() to [lua] game.ConsoleCommand("ev slay "..pl:Nick()); [/lua] Sorry about the edit, hehe didn't see that link.
thnks [editline]18th September 2011[/editline] [QUOTE=Chessnut;32367720][lua] if ( gatekeeper ) then gatekeeper.Drop( pl:UserID(), "AFK" ) else pl:Kick( "AFK" ) end [/lua] Change to: [lua] pl:Kill(); [/lua][/QUOTE] doesnt work
[QUOTE=camcole1;32367813]thnks [editline]18th September 2011[/editline] doesnt work[/QUOTE]There is no way that wouldn't work. Show the whole file you used.
well, i am going to retry today, BTW i am testing it on myself in my fretta server, it should work right?
If you have the owner rank you might have immunity to the AFK slayer. try ranking yourself to guest first, or get someone else to try it.
[lua] /*------------------------------------------------------------------------------------------------------------------------- AFK Kicker -------------------------------------------------------------------------------------------------------------------------*/ local PLUGIN = {} PLUGIN.Title = "AFK Slayer" PLUGIN.Description = "Slays people who seem to be AFK." PLUGIN.Author = "#" PLUGIN.Privileges = { "Not AFK slayed" } function PLUGIN:PlayerSpawn( ply ) ply.EV_AFKTime = os.time() end function PLUGIN:KeyPress( ply ) ply.EV_AFKTime = os.time() end function PLUGIN:PlayerSay( ply ) ply.EV_AFKTime = os.time() end function PLUGIN:Think() for _, pl in ipairs( player.GetAll() ) do if ( pl:GetAngles() != pl.EV_AFKAngles ) then pl.EV_AFKTime = os.time() pl.EV_AFKAngles = pl:GetAngles() end if ( !pl:EV_HasPrivilege( "Not AFK slayed" ) and pl.EV_AFKTime and os.time() - pl.EV_AFKTime > 300 ) then pl:Kill(); end end end evolve:RegisterPlugin( PLUGIN ) [/lua] Is what i made
Sorry, you need to Log In to post a reply to this thread.