16.10.2015, 22:43
(
Последний раз редактировалось Spmn; 17.10.2015 в 15:05.
)
I've just reverse-engineered an aimbot cheat and I'm trying to develop a detection tool. Everything went fine until I ran into trigonometry.
I want to get players' Camera Rotation X. (GTA SA Address: 0xB6F258) After some testing, I found out that Cam Rot X is however proportional to GetPlayerCameraFrontVector X and Y Pos.
Any info or snippets are welcomed.
Edit: This and this are what I'm looking for. (delete these links if they are against the rules)
Edit 2: I used this function:
to calculate camera facing angle from Cam Rot X and I found something nice:
Cam Rot X = -PI/2 => Camera Facing Angle = 0
Cam Rot X = 0.0 => Camera Facing Angle = 90
Cam Rot X = PI/2 => Camera Facing Angle = 180
Cam Rot X = PI => Camera Facing Angle = 270
Edit 3:
Finally resolved it thanks to Hiddos:
I want to get players' Camera Rotation X. (GTA SA Address: 0xB6F258) After some testing, I found out that Cam Rot X is however proportional to GetPlayerCameraFrontVector X and Y Pos.
Any info or snippets are welcomed.
Edit: This and this are what I'm looking for. (delete these links if they are against the rules)
Edit 2: I used this function:
Код:
Float: GetPlayerCameraFacingAngle(playerid) // Pottus { new Float: vX, Float: vY; if(GetPlayerCameraFrontVector(playerid, vX, vY, Float: playerid)) { if((vX = -atan2(vX, vY)) < 0.0) return vX + 360.0; return vX; } return 0.0; }
Cam Rot X = -PI/2 => Camera Facing Angle = 0
Cam Rot X = 0.0 => Camera Facing Angle = 90
Cam Rot X = PI/2 => Camera Facing Angle = 180
Cam Rot X = PI => Camera Facing Angle = 270
Edit 3:
Finally resolved it thanks to Hiddos:
Quote:
Hiddos: Subtract 90 from the facing angle Hiddos: Then multiply it with pi/180 |