mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 19:53:04 +08:00
[saco] Implement and match CPlayerPed::GetCurrentWeapon()
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -24,6 +24,8 @@ public:
|
||||
CAMERA_AIM * GetCurrentAim();
|
||||
void SetCurrentAim(CAMERA_AIM *pAim);
|
||||
|
||||
BYTE GetCurrentWeapon();
|
||||
|
||||
WORD GetAmmo();
|
||||
|
||||
void GiveWeapon(int iWeaponID, int iAmmo);
|
||||
|
||||
@@ -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" };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user