From 25cd6aa9c457c44f136e2b822d63b8fa8f399e09 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Wed, 9 Oct 2024 23:42:27 +0800 Subject: [PATCH] [saco] Implement `n_GetPlayerFacingAngle(...)` --- bot/scrcustom.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bot/scrcustom.cpp b/bot/scrcustom.cpp index e1891b6..fe6adc5 100644 --- a/bot/scrcustom.cpp +++ b/bot/scrcustom.cpp @@ -260,6 +260,18 @@ static cell AMX_NATIVE_CALL n_GetPlayerKeys(AMX *amx, cell *params) return 0; } +// native GetPlayerFacingAngle(playerid,&Float:ang); +static cell AMX_NATIVE_CALL n_GetPlayerFacingAngle(AMX *amx, cell *params) +{ + if(!pNetGame->GetPlayerPool()->GetSlotState((PLAYERID)params[1])) return 0; + + cell* cptr; + amx_GetAddr(amx, params[2], &cptr); + float fZAngle = pNetGame->GetPlayerFacingAngle((PLAYERID)params[1]); + *cptr = amx_ftoc(fZAngle); + + return 1; +} // native GetMyPos(&Float:x, &Float:y, &Float:z) static cell AMX_NATIVE_CALL n_GetMyPos(AMX *amx, cell *params)