Any way that I can have a command that hides the pointshop trails clientside?
Not asking for you the code, but can someone lead me the right direction to get it going.
Having never looked at the code for the pointshop trails... I'd go into the code for pointshops, and set a clientconvar to check before it draws/creates/doeswhatever to make the trails (something like "if !NoTrail then return end")
Then have a setting, check box or chat command that allows a player to change their convar.
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index0eb7.html[/url]
This would done in a clientside file, and the checking for the convar would be done inside wherever the trail is drawn. You can return a client convar with the method "player:GetInfoNum( "convar", defaultvalueofconvar )
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index6c81.html[/url]
That should point you in the right direction. Good luck!
Impossible.
[QUOTE=Robotboy655;42945230]Impossible.[/QUOTE]
If the trail is an actual entity then yeah, it'd be impossible.
It's very possible.
[lua]
hook.Add("Think", "HideTrails", function()
for k, v in pairs(ents.FindByClass("env_spritetrail")) do
if LocalPlayer().HideTrails then
if v:GetOwner() != nil and type(v:GetParent()) == "Player" then
v:Remove()
elseif v:GetParent() != nil and type(v:GetParent()) == "Player" then
v:Remove()
end
end
end
end)
[/lua]
If for some odd reason remove doesn't work. Just set the value of the trails alpha to 0 and it will be invisible.
[QUOTE=Aide;42945671]
[lua]
hook.Add("Think", "HideTrails", function()
for k, v in pairs(ents.FindByClass("env_spritetrail")) do
if LocalPlayer().HideTrails then
if v:GetOwner() != nil and type(v:GetParent()) == "Player" then
v:Remove()
elseif v:GetParent() != nil and type(v:GetParent()) == "Player" then
v:Remove()
end
end
end
end)
[/lua]
[/QUOTE]
Please, don't run it every think...
Run it once and then use the OnEntityCreated hook.
You can't remove server created entities. It will just error on you.
Instead, create the entities clientside so you can control them and remove clientside easily.
Sorry, you need to Log In to post a reply to this thread.