Pivity

Pointshop 1 Hiding items clientsided for performance

Last read Never
#1

Greetings,


Wondering if it's possible or not to allow the client to hide pointshop items, for example trails which may cause performance loss.

For example, "blahblah convar" would hide any models, trails or hats on all players.


I started by creating a clientconvar and tried using pointshop player meta functions that send items data to the player but I cannot seem to work it

My example code is not important as I was editing pointshop core files.


Any help or answers are much appreciated.

#2
CreateClientConVar( "trails_disable", "0", true, false)

hook.Add("OnEntityCreated","HideTrails",function(ent) 
if !(ent:GetClass() == "env_spritetrail") then return end 
if GetConVar("trails_disable"):GetBool() then
ent:SetNoDraw(true)
end
end)


something like this should work, not fully tested as I can only confirm that it hides sprite trails from me, don't have anyone else available at the moment to test if they can still see them

Shouldn't affect anyone else as long as you ensure this only runs clientside


Note: any trails created while a player has their convar set to true will not be visible until after the trail has been recreated (on round reset for example)

#3

similarly any existing trails wont be hidden until after they're recreated

#4

Thank you for this ! That makes much sense :)

Users viewing this thread
Nobody