example update

This commit is contained in:
Evil Factory
2021-05-30 16:29:21 -03:00
parent 07658676c9
commit 9546c4e7c7
3 changed files with 20 additions and 3 deletions

View File

@@ -203,6 +203,8 @@ traitormod.assignNormalTraitors = function(amount)
for key, va in pairs(traitormod.selectedCodeResponses) do
mess = mess .. "\"" .. va .. "\" "
end
mess = mess .. "\n(You can type in local chat !traitor, to check this information again.)"
end
Game.Log(value.name ..
@@ -266,7 +268,7 @@ Hook.Add("roundStart", "traitor_start", function()
local rng = Random.Range(0, 100)
if rng < config.traitorShipChance and config.traitorShipEnabled == true then
if (rng < config.traitorShipChance and config.traitorShipEnabled == true) and Game.GetRespawnSub() ~= nil then
local amount = config.getAmountShipTraitors(#util.GetValidPlayers())
Game.Log("Infiltraition Gamemode selected, Random = " .. rng, 6)
@@ -281,7 +283,11 @@ Hook.Add("roundStart", "traitor_start", function()
table.insert(traitormod.gamemodes, "Assasination")
if config.traitorShipEnabled then
traitormod.spawnTraitorShipAndHide()
if Game.GetRespawnSub() == nil then
Game.SendMessage("TraitorMod Warning: Traitor Ship enabled but respawn shuttle disabled!", 1)
else
traitormod.spawnTraitorShipAndHide()
end
end
end
@@ -486,6 +492,14 @@ Hook.Add("chatMessage", "chatcommands", function(msg, client)
return true
end
if msg == "!help" then
traitormod.sendTraitorMessage("\nCommands\n!help\n!traitor\n!traitors\n!percentage\n!percentages\n!toggletraitorship", client)
return true
end
if util.stringstarts(msg, "!traitor") then
if util.characterIsTraitor(client.Character, traitormod.roundtraitors) then
local msg = "You are a traitor. "

View File

@@ -42,6 +42,7 @@ Hook.Add("roundEnd", "traitorShipRemove", function()
end)
traitormod.spawnTraitorShipAndHide = function()
Game.SetRespawnSubTeam(2)
Game.DispatchRespawnSub()
@@ -115,6 +116,8 @@ traitormod.traitorShipRoundStart = function(maxplayers)
mess = mess .. "\"" .. va .. "\" "
end
mess = mess .. "\n\n(You can type in local chat !traitor, to check this information again.)"
Game.Log(value.name .. " Was assigned to be Ship traitor", 6)
local cl = util.clientChar(value)

View File

@@ -16,7 +16,7 @@ config.traitorSpawnDelay = 60
config.nextMissionDelay = 60
config.traitorShipEnabled = true -- set this to false for the respawn shuttles to work
config.traitorShipChance = 18
config.traitorShipChance = 15
config.traitorShipGodModeDistance = 4000
config.enableCommunicationsOffline = true