• Model Color
    4 replies, posted
I host a succesful darkrp server, but my problem is, people are using the C menu, then go to model, and put 9999999999999 in one of the boxes of the player model or the weapon color, and this is kinda making it non-rp, how do i disable it and just add a command like: /weaponcolor <RGB>? E.g: /weaponcolor 255 0 0 Thank you!
You want to disable the annoying glow ? I did that on my server, you'll have to write a script for it using this: [url]http://wiki.garrysmod.com/page/Player/GetPlayerColor[/url] and [url]http://wiki.garrysmod.com/page/Player/SetPlayerColor[/url] Just check if its above 255 R, G or B and if so then set it to default
[QUOTE=Netheous;39783063]You want to disable the annoying glow ? I did that on my server, you'll have to write a script for it using this: [url]http://wiki.garrysmod.com/page/Player/GetPlayerColor[/url] and [url]http://wiki.garrysmod.com/page/Player/SetPlayerColor[/url] Just check if its above 255 R, G or B and if so then set it to default[/QUOTE] Its good that you don't just give the code, this is how I can learn a bit :D would this work in the lua/autorun/server folder? [lua]function GM:PlayerSpawn( ply ) if ply:GetPlayerColor() > Vector( 255, 255, 255) then ply:SetPlayerColor( Vector( 1,0,0 ) ) end[/lua]
[QUOTE=3nforc3r;39785238]Its good that you don't just give the code, this is how I can learn a bit :D would this work in the lua/autorun/server folder? [lua]function GM:PlayerSpawn( ply ) if ply:GetPlayerColor() > Vector( 255, 255, 255) then ply:SetPlayerColor( Vector( 1,0,0 ) ) end[/lua][/QUOTE] I suggest you compare Vectors separately. Like [lua] local clr = {} clr.r, clr.g, clr.b = ply:GetPlayerColor() if clr.r > 255 or clr.g > 255 or clr.b > 255 then --change color end [/lua] If it won't work, I'll fix it later as it's 4 at the night.
[QUOTE=Netheous;39790189]I suggest you compare Vectors separately. Like [lua] local clr = {} clr.r, clr.g, clr.b = ply:GetPlayerColor() if clr.r > 255 or clr.g > 255 or clr.b > 255 then --change color end [/lua] If it won't work, I'll fix it later as it's 4 at the night.[/QUOTE] So, maybe this: [lua]function GM:PlayerSpawn( ply ) local clr = {} clr.r, clr.g, clr.b = ply:GetPlayerColor() if clr.r > 255 or clr.g > 255 or clr.b > 255 then ply:SetPlayerColor( vector( 1, 1, 1 )) end[/lua]
Sorry, you need to Log In to post a reply to this thread.