So, what I am trying to do is that when Player from CT team create a wall entity, only that player, and whole CT team can pass through that wall, and T team can't. Also, wall has to take damage from T team only.
Attempt #1
Here, everything works except T can't damage the wall. Reason: Wall can't take damage because it's SOLID_TRIGGER (don't know the fix tho)
// In wall creation function new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, PALLET_FUNC));
set_pev(ent,pev_classname,PALLET_CLASSNAME); set_pev(ent,pev_solid,SOLID_TRIGGER); // Because of this trigger, wall can't take damage set_pev(ent,pev_movetype,MOVETYPE_FLY);
// when player touches wall public touch_sandbags(ent, touched) { switch(g_IsZombie[touched]) { case true: { static Float:pos_force[3] static Float:pos_player[3]
for(new i = 0; i < 3; i++) { pos_player[i] -= pos_force[i] pos_player[i] *= 1.1 // Push player back, but just a bit so he still can keep hitting wall with the knife even when pushed away }
So insted of having maximum 50 created entities on the map, I should have 100? That's doesn't help to be honest. Is there any way to "drag" player through that wall? For example, if I am going at wall's direction, as long as I touch the wall, my position will be increased by 1.1 at the location where I am trying to go. I mean, to do something similar that Force Field grenade do with zombies when they touch it (It pushes them back), but in reverse.
Another thing that I have tried is to set team for that wall to CS_TEAM_CT (with pev_team) and "trick" this semiclip module https://forums.alliedmods.net/showthread.php?t=250891 to make it NOT solid for CT players, but didn't had luck with that.
(In semiclip module, settings are set so CT players can go through each other so I tought it will work with this wall to since it's the same team)
True, but than when stop touching the entity, it will still be NOT solid. Also, in the mid time, wall would't take any damage if CT is touching it because of it's SOLID_NOT flag.
So, I only came up with this poor way to do this, so if anyone got any other idea, I am open for suggestions/advices.