GM:PlayerSpawnProp Workaround?

The Problem:

When using the GM:PlayerSpawnProp hook it is very easy and is working fine when I am running against a table to check that model and prevent it from spawning by returning false.

However even though this hook is supposedly ran before a prop is spawned the model is still getting added to the model precache table whether it is spawned or not.

Is there any possible way around this to stop this process happening? Any help would be greatly appreciated to help get around the model precache overflow.

Thanks :slight_smile:

Name: CCSpawnProp - player spawns a prop
function GMODSpawnProp( player, model, iSkin )

if ( !gamemode.Call( "PlayerSpawnProp", player, model ) ) then return end
local e = DoPlayerEntitySpawn( player, "prop_physics", model, iSkin )
gamemode.Call( "PlayerSpawnedProp", player, model, e )

// This didn't work out - todo: Find a better way.
//timer.Simple( 0.01, CheckPropSolid, e, COLLISION_GROUP_NONE, COLLISION_GROUP_WORLD )

FixInvalidPhysicsObject( e )

DoPropSpawnedEffect( e )

undo.Finish( "Prop ("..tostring(model)..")" )

player:AddCleanup( "props", e )


That’s the code sandbox use’s to check for prop spawning as you can see nothing happens before it checks so it obviously isn’t pre-caching now is it?