Hey !
I'm a begineer at lua and I was wondering how I could make a code that'll modify players color on the server, I know that I'll probably need that : [url]https://wiki.garrysmod.com/page/Global/DrawColorModify[/url]
But I don't exactly how to use it and on what folder should I put the lua file, thanks for your help and sorry for my bad english.
DrawColorModify is the wrong way.
Use Entity:SetColor()
[url]https://wiki.garrysmod.com/page/Entity/SetColor[/url]
[QUOTE=Rasko;51222325]Hey !
I'm a begineer at lua and I was wondering how I could make a code that'll modify players color on the server, I know that I'll probably need that : [url]https://wiki.garrysmod.com/page/Global/DrawColorModify[/url]
But I don't exactly how to use it and on what folder should I put the lua file, thanks for your help and sorry for my bad english.[/QUOTE]
DrawColorModify is Color Correction, if you want to change the player's color you need to run SetColor as markusmarkusz posted above me.
Unless you are talking about [url]https://wiki.garrysmod.com/page/Player/SetPlayerColor[/url]
Which is like shirt color in hl2 citizens
Ho, I'm sorry I've made a mistake, I was talking about the colors that the players will see in game (Like when you go to Context Menu > Visual Effects > Shaders > Color Modification, to make the colors a bit better and increase the contrast, I've made that :
[CODE]function GM:ModifyColorCorrection(color)
if SERVER then
color["$pp_colour_brightness"] = 0
color["$pp_colour_contrast"] = 1.7
color["$pp_colour_addr"] = 0
color["$pp_colour_addg"] = 0
color["$pp_colour_addb"] = 0
color["$pp_colour_colour"] = 1.3
color["$pp_colour_mulr"] = 0
color["$pp_colour_mulg"] = 0
color["$pp_colour_mulb"] = 0
end
end
function GM:RenderScreenspaceEffects()
DrawColorModify( tab )
end[/CODE]
But it's working only if you enable the Color Modification (Again with Context Menu > Visual Effects > Shaders > Color Modification), I was wandering what should I change and where should I put the file, thanks for further replies !
GM:ModifyColorCorrection is not a real hook.
See the example in [url=https://wiki.garrysmod.com/page/Global/DrawColorModify]DrawColorModify[/url]
[QUOTE=Rasko;51225469]Ho, I'm sorry I've made a mistake, I was talking about the colors that the players will see in game (Like when you go to Context Menu > Visual Effects > Shaders > Color Modification, to make the colors a bit better and increase the contrast, I've made that :
[CODE]function GM:ModifyColorCorrection(color)
if SERVER then
color["$pp_colour_brightness"] = 0
color["$pp_colour_contrast"] = 1.7
color["$pp_colour_addr"] = 0
color["$pp_colour_addg"] = 0
color["$pp_colour_addb"] = 0
color["$pp_colour_colour"] = 1.3
color["$pp_colour_mulr"] = 0
color["$pp_colour_mulg"] = 0
color["$pp_colour_mulb"] = 0
end
end
function GM:RenderScreenspaceEffects()
DrawColorModify( tab )
end[/CODE]
But it's working only if you enable the Color Modification (Again with Context Menu > Visual Effects > Shaders > Color Modification), I was wandering what should I change and where should I put the file, thanks for further replies ![/QUOTE]
The hook is clientside and it must be a table just like shown in the example
[url]https://wiki.garrysmod.com/page/Global/DrawColorModify[/url]
Sorry, you need to Log In to post a reply to this thread.