Created
September 4, 2022 11:24
-
-
Save x0rnn/34bb1f4824acf1cc110210c08a4402d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spawnShield = 1 -- seconds | |
levelTime = 0 | |
hs_maps = {"purefrag", "et_headshot2_b2", "mp_sillyctf", "ctf_multi", "multi_huntplace", "badplace4_rc", "te_valhalla"} | |
flag = false | |
function has_value (tab, val) | |
for index, value in ipairs(tab) do | |
if value == val then | |
return true | |
end | |
end | |
return false | |
end | |
function et_InitGame(levelTime, randomSeed, restart) | |
et.RegisterModname("spawnshield.lua "..et.FindSelf()) | |
mapname = et.trap_Cvar_Get("mapname") | |
if has_value(hs_maps, string.lower(mapname)) then | |
flag = true | |
end | |
end | |
function et_RunFrame(lvltime) | |
levelTime = lvltime | |
end | |
function et_ClientSpawn(clientNum, revived) | |
if flag == true then | |
et.gentity_set(clientNum, "ps.powerups", 1, levelTime + spawnShield * 1000) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment