I'm trying to hook ShouldCollide with this code
Syntax: Select all
from entities.entity import Entity
from entities.hooks import EntityCondition, EntityPreHook
from memory import make_object
from memory import Convention
from memory import DataType
@EntityPreHook(
EntityCondition.is_player,
lambda player: player.make_virtual_function(
16,
Convention.THISCALL,
(DataType.POINTER, DataType.INT, DataType.INT),
DataType.BOOL
)
)
def pre_should_collide(args):
return False
1. The hook itself works as I can read the arguments (entity, collisiongroup and coliisionmask) but returning False does not work.
Edit: It seems to work now, not sure what changed. My other questions still apply :)
2. Is there a way to check for the colliding entity?
3. The "gliding" through is pretty rough, is there any ways to make it smoother? Sourcemod uses sendproxy which SourcePython seems to have too. Maybe you could explain to me how to use that.
Thanks!
Edit: The goal would be to have player specific block. e.g. Player1 only collides with Player3 but not Player4 and Player5.