[saco] Implement and match CPlayerPed::GetCurrentWeapon()

This commit is contained in:
RD42
2024-05-05 18:52:08 +08:00
parent 1ff732c35c
commit f7ff8d45df
3 changed files with 16 additions and 0 deletions
+13
View File
@@ -123,6 +123,19 @@ void CPlayerPed::SetCurrentAim(CAMERA_AIM *pAim)
GameStoreRemotePlayerAim(m_bytePlayerNumber, pAim);
}
//-----------------------------------------------------------
BYTE CPlayerPed::GetCurrentWeapon()
{
if(!m_pPed) return 0;
if(GamePool_Ped_GetAt(m_dwGTAId) == 0) return 0;
DWORD dwRetVal;
ScriptCommand(&get_actor_armed_weapon,m_dwGTAId,&dwRetVal);
return (BYTE)dwRetVal;
}
//-----------------------------------------------------------
void CPlayerPed::GiveWeapon(int iWeaponID, int iAmmo)
{
if(!m_pPed) return;
+2
View File
@@ -24,6 +24,8 @@ public:
CAMERA_AIM * GetCurrentAim();
void SetCurrentAim(CAMERA_AIM *pAim);
BYTE GetCurrentWeapon();
WORD GetAmmo();
void GiveWeapon(int iWeaponID, int iAmmo);
+1
View File
@@ -42,6 +42,7 @@ const SCRIPT_COMMAND add_to_player_money = { 0x0109, "ii" }; // PLAYER_CHAR,
const SCRIPT_COMMAND destroy_racing_checkpoint = { 0x06d6, "i" };
const SCRIPT_COMMAND set_actor_armed_weapon = { 0x01b9, "ii" };
const SCRIPT_COMMAND get_actor_armed_weapon = { 0x0470, "iv" };
const SCRIPT_COMMAND set_actor_can_be_decapitated = { 0x0446, "ii" };