Hey dear devs,
im working like most people with workshop download for my playermodel pointshop stuff..
But i dont want that they download the workshop while joining.. they could to !workshop for the collection.. (long join times for mch playermodels)
Im searching for a function that i can use for clients if they see other Players with Error.mdl get replaced for them with Kleiner.mdl for example so i mean.
if ply dont get the valid mdl.
clientsidemodel = kleiner
so just work for clients so no ply:setmodel stuff..
does someone know which functions and hooks i should use for this..
(i dont need a finished code just hooks that should work and the clientsidemodel funciton maybe some explainations of it..)
thanks a lot
I'm pretty sure setmodel works for the client and the server.
If you're okay with using setmodel (which works for the client) then use these steps:
You need a server and client script
After you get those, use the hook GM/PlayerSpawn to send a precached net message to all connected clients with the ply who joined as an argument
After you send a message to the client, make the client receive it using net.Receive
Next, use Entity/GetModel to get the model of player
Then. check if the model is an error model, if it is then use Entity/SetModel to set the model of player who just spawned
Make sure to precache the kleiner model by using util.PrecacheModel .
i'm pretty sure Entity.GetModel will still return the model that the player can't see, it doesn't replace the model's path when it can't find it.
i think the only solution would be to just either send the models to connecting clients or have less playermodels.
If what SweptThrone said is true, you can try using this
util.IsValidModel
util.PrecacheModel( modelpath )
if !util.IsValidModel(player:GetModel()) then
player:SetModel( modelpath )
end
I will try your suggestions. hopefully he replace all error models for the client... so it must be that
Player X without Workshop Addons joins see other Playermodels as error
The net message gets to the player .
Player X models that he sees gets replaced as kleiner for him but the other just see their original model
Sorry, you need to Log In to post a reply to this thread.