Skip to content

Instantly share code, notes, and snippets.

View Alf21's full-sized avatar
🎯
Focusing

Alf21

🎯
Focusing
View GitHub Profile
@Alf21
Alf21 / example.lua
Last active September 10, 2020 20:46
An example how to dynamically change (role's) language strings and the roles' & teams' icons. If you just wanna change the role's language strings, the code can be shrinked a lot! This code snippet also includes ConVar support (toggling this mode) as well as full ULX integration.
---
-- @author Alf21
-- @author Mineotopia
local iconTableNew = {
PIRATE_CAPTAIN = "vgui/ttt/dynamic/roles/icon_pirate2",
INFECTED = "vgui/ttt/dynamic/roles/icon_infected2"
}
-- if putting a new image to that not included in iconTableNew, you need to add this to FastDL (resource.AddFile(...))
@Alf21
Alf21 / fix.lua
Last active March 23, 2018 11:15
Possible Fix for TTT TOT Addon (untested)
-- Put this into '[SERVER]/garrysmod/lua/autorun/'
-- to toggle the survivalist role, type in chat "!tot_toggle_surv" as admin or in console "tot_toggle_sur 0"
-- add lua file
AddCSLuaFile()
-- add own CONVAR to toggle this survivalist de- / activation
CreateConVar("tot_toggle_sur", 1, {FCVAR_ARCHIVE, FCVAR_NOTIFY}, "Toggle survivalist role in Town of Terror addon")
-- add a command to toggle ingame