Here you are:
check = true
ff = 0
function et_InitGame(levelTime, randomSeed, restart)
ff = tonumber(et.trap_Cvar_Get( "g_friendlyfire" ))
et.trap_SendConsoleCommand(et.EXEC_APPEND, "g_friendlyfire 1\n")
check = true
end
function et_RunFrame( levelTime )
if tonumber(et.trap_Cvar_Get( "gamestate" )) == 0 and check == true then
et.trap_SendConsoleCommand(et.EXEC_APPEND, string.format("g_friendlyfire %d\n", ff))
check = false
end
end