You are not logged in.
Pages: 1
Hello guys !
I can not create a function that puts inactive players in spectator.
I don't know how to do it
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
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.
Offline
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 ?)
Offline
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
Pages: 1