Skip to content

Instantly share code, notes, and snippets.

@morsik
Created February 21, 2012 20:18
Show Gist options
  • Save morsik/1878633 to your computer and use it in GitHub Desktop.
Save morsik/1878633 to your computer and use it in GitHub Desktop.
this mod allows to autoset panzerwar or sniperwar on specified maps
--
-- autosettings.lua
-- Author: morsik
--
-- this mod allows to autoset panzerwar or sniperwar
-- on specified map
--
-- CONFIG BEGIN
SNIPERMAPS = {
'CS_pirate_sniper'
}
PANZERMAPS = {
'UJE_bathroom_sniper'
}
-- CONFIG END
custommap = 0
function et_InitGame(leveltime, randoomseed, restart)
currentMap = et.trap_Cvar_Get('mapname')
for n,m in pairs(PANZERMAPS) do
if (currentMap == m) then
et.SendConsoleCommand(et.EXEC_APPEND, '!panzerwar 1')
custommap = 1
end
end
for n,m in pairs(SNIPERMAPS) do
if (currentMap == m) then
et.SendConsoleCommand(et.EXEC_APPEND, '!sniperwar 1')
custommap = 2
end
end
if (custommap == 1) then
et.SendConsoleCommand(et.EXEC_APPEND, '!panzerwar 0')
custommap = 0
end
if (custommap == 2) then
et.SendConsoleCommand(et.EXEC_APPEND, '!sniperwar 0')
custommap = 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment