[bot] Implement/match n_GetPlayerKeys(...)

* Implement/match `CNetGame::GetPlayerKeys(...)`
This commit is contained in:
RD42 committed 2024-07-06 22:45:04 +08:00
1 parent 71204c1c49
commit 148efc2fa6
3 files changed
+48 -1

No files matched your search

+15 -1
View File
@@ -231,7 +231,21 @@ static cell AMX_NATIVE_CALL n_IsVehicleStreamedIn(AMX *amx, cell *params)
// native GetPlayerKeys(playerid, &keys, &updown, &leftright)
static cell AMX_NATIVE_CALL n_GetPlayerKeys(AMX *amx, cell *params)
{
// TODO: n_GetPlayerKeys
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
WORD wKeys=0, udAnalog=0, lrAnalog=0;
if(pPlayerPool->GetSlotState((PLAYERID)params[1]) &&
pNetGame->GetPlayerKeys((PLAYERID)params[1], &udAnalog, &lrAnalog, &wKeys))
{
cell* cptr;
amx_GetAddr(amx, params[2], &cptr);
*cptr = (cell)wKeys;
amx_GetAddr(amx, params[3], &cptr);
*cptr = (short)udAnalog;
amx_GetAddr(amx, params[4], &cptr);
*cptr = (short)lrAnalog;
return 1;
}
return 0;
}