Model Color

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:

and

Just check if its above 255 R, G or B and if so then set it to default

Its good that you don’t just give the code, this is how I can learn a bit :smiley:

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]

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.

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]