Getting Eye Angle of player
Getting Eye Angle of player
What I would like to do is compare the eye angle of two players to determine if a player is behind another. I'm not seeing any properties in PlayerEntity for this, and was wondering if the functionality exists.
You can use the links in this thread to see the "sp dump server_classes" output for the given games (though some might need updating). Just because we don't have the send property assigned to PlayerEntity doesn't mean it doesn't exist. That just means we haven't added support for in the BaseEntity structure.
Would I have to scan the signature for "float m_angEyeAngles[0] (offset 8404)" in CCSPlayer, or is there a way to interact directly with CCSPlayer in Python?
Tried using:
Tried using:
Syntax: Select all
PlayerEntity(player)._get_property('m_angEyeAngles[0]')
PlayerEntity(player)._get_property('m_angEyeAngles')[0]
You could either access the eye angle by using (<edict>.get_prop_float('m_angEyeAngles[0]'), <edict>.get_prop_float('m_angEyeAngles[1]'), <edict>.get_prop_float('m_angEyeAngles[2]')) or by using PlayerEntity.
We have not added eye_angle_z, because it's always 0 (I think).
Syntax: Select all
from players.entity import PlayerEntity
player = PlayerEntity(<index>)
print((player.eye_angle_x, player.eye_angle_y))
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 76 guests