• How to remove the TTT crosshair serverside?
    8 replies, posted
I want to remove the TTT crosshair and make my own. What file can I remove the TTT crosshair, I can't seem to find it.
You can't remove the TTT crosshair serverside. It's all drawn on the client. Remove the code in the TTT weapon base's code then replace it with your own. Beware that if there are features that the original crosshair had that you want to override, you'll need to remove a bit more code in other functions, to prevent unnecessary calls (saying this because I assume you're new to this stuff).
[QUOTE=MaximLaHaxim;49424090]You can't remove the TTT crosshair serverside. It's all drawn on the client.[/QUOTE] Duh thats what I meant by serverside. Removing the actual code from the server files so it wont get drawn on the client. Also I'm not new to this stuff.
[QUOTE=Klaes4Zaugen;49424113]Duh thats what I meant by serverside. Removing the actual code from the server files so it wont get drawn on the client. Also I'm not new to this stuff.[/QUOTE] [URL="https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua#L138-L172"]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua#L138-L172[/URL] just remove this part
[QUOTE=Klaes4Zaugen;49424113]Duh thats what I meant by serverside. Removing the actual code from the server files so it wont get drawn on the client. Also I'm not new to this stuff.[/QUOTE] You're very arrogant. He was just helping you so you don't need to be rude, and if you're not new to 'this stuff' then you'd know the difference between serverside and clientside lua states.
[QUOTE=HappyGhetto;49426178]You're very arrogant. He was just helping you so you don't need to be rude, and if you're not new to 'this stuff' then you'd know the difference between serverside and clientside lua states.[/QUOTE] I know the difference. The crosshair is removeable by the client with a convar. By serverside I meant removing the crosshair VIA the server not client.
[QUOTE=Klaes4Zaugen;49426656]I know the difference. The crosshair is removeable by the client with a convar. By serverside I meant removing the crosshair VIA the server not client.[/QUOTE] That still doesn't make sense. In NO way is the crosshair controlled on the server. EVERYTHING for the crosshair is done on the client. [editline]31st December 2015[/editline] If you mean "having the server communicate with the client to tell it to disable the crosshair" then look into the net library.
[QUOTE=MaximLaHaxim;49426726]That still doesn't make sense. In NO way is the crosshair controlled on the server. EVERYTHING for the crosshair is done on the client. [editline]31st December 2015[/editline] If you mean "having the server communicate with the client to tell it to disable the crosshair" then look into the net library.[/QUOTE] I think he means the files on the server.
I changed the following code on the server in garrysmod/gamemodes/terrortown/entities/weapons/weapon_tttbase.lua to make the crosshair invisible. It's still there and no code that uses it will be affected because it's only visual to us HUMONS. Changing the alpha to 0 means it's 100% transparent. I just tested on my server and it works. if client.IsTraitor and client:IsTraitor() then          surface.SetDrawColor(255 * bright,                               50 * bright,                               50 * bright,                               0 * alpha) //previously 255       else          surface.SetDrawColor(0,                               255 * bright,                               0,                               0 * alpha) //previously 255       end
Sorry, you need to Log In to post a reply to this thread.