ETMods.net

N!tmod, a Wolfenstein: Enemy Territory Modification!

You are not logged in.

Announcement

You can donate to help us keeping services online.

#1 07-Feb-14 01:39:53

Doc
BETA Tester
Registered: 23-Feb-11
Posts: 24
Website

Players inactivity.

Hello guys !
I can not create a function that puts inactive players in spectator.

I don't know how to do it hmm

Basically I want to:
  - If the player is idle for "x" minutes > he go spectator.

I have actually :

function et_Runframe (leveltime)
    if tonumber(et.trap_Cvar_Get("g_inactivity")) then
		local inactivity = tonumber(et.gentity_get(i,"client.inactivityTime")/10000) - tonumber(et.trap_Cvar_Get("g_inactivity"))
		if inactivity then
				et.trap_SendConsoleCommand( et.EXEC_APPEND, "ref remove " .. i .. "\n" )
		end
    end
end

A small boost will not be rejected

Thx, cordially Doc !

Offline

#2 07-Feb-14 12:15:56

coolsquad
Member
Registered: 19-Nov-11
Posts: 21
Website

Re: Players inactivity.

Hi,

Why create a lua when a cvar exists for it...

g_inactivity

Delay in seconds before sending an inactive player (not moving/shooting) to spectators.
If enabled, a warning message is sent to the inactive player after half of the specified time.
See also g_spectatorInactivity and g_inactivityOptions.
Default: 0


I hope it will help you.


kool.png


papyrus_cs_nit_100_maps.gif

Offline

#3 07-Feb-14 17:54:21

N!trox*
Administrator
Registered: 30-Mar-10
Posts: 1,090

Re: Players inactivity.

coolsquad wrote:

Why create a lua when a cvar exists for it...

You're right, g_inactivity and g_spectatorInactivity were ETMain features, and exist in every ET mod (as far as I know... maybe someone decided to remove them for no reason ?)


iluvnitmod.png

Offline

#4 07-Feb-14 18:22:21

Doc
BETA Tester
Registered: 23-Feb-11
Posts: 24
Website

Re: Players inactivity.

Thx for reply.
I didn't see if these cvars exist ETPro ... i test.

Edit : "set g_spectatorInactivity" and "set g_inactivity" function in etpro.

Last edited by Doc (07-Feb-14 18:29:15)

Offline

Board footer

Powered by FluxBB