I tried also hooking pfnShouldCollide pre hook and setting the entity solid when a player is a CT and nonsolid for Terrorists, aswell created a hook with PM_Move Pre and set the entity to solid, it worked just fine, but when there are CTs and Ts beside it, or in it, it becomes glitchy...
And set the entity to solid in PM_Move Pre
Test code :-
PHP Code:
new g_ent;
public plugin_init() {
register_forward(FM_ShouldCollide, "ShouldCollide")
RegisterHookChain(RG_FM_Move, "Pm_Move")
}
public ShouldCollide(touched, passedict)
{
if(!(1 <= touched <= 32) && !(1 <= passedict<= 32))
return;
static player, ent;
if((1 <= touched<= 32))
{
player = touched;
ent = passedict;
}
else
{
player = passedict;
ent = touched;
}
if(g_ent != ent) return;
switch ( get_user_team(player) )
{
case 1: set_pev(ent, pev_solid, SOLID_NOT);
case 2: set_pev(ent, pev_solid, SOLID_BBOX);
}
}
public Pm_Move(id)
{
set_pev(g_ent, pev_solid, SOLID_BBOX);
}
I believe the best way is by hooking PM_PlayerTrace and altering/changing the entity solidity there...
__________________