2021-06-05, 04:50 AM
PHP Code:
stock SetPlayerFacingAngleToObject(playerid, objectid)
{
new Float:x1, Float:y1, Float:z1;
new Float:x2, Float:y2, Float:z2;
GetPlayerPos(playerid, x1, y1, z1);
GetObjectPos(objectid, x2, y2, z2);
new Float:angle = atan2(y2 - y1, x2 - x1) - 90.0;
SetPlayerFacingAngle(playerid, angle);
}
My nickname in-game is: [L]3O