mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-04 00:23:22 +08:00
[saco] Implement CPlayerPed::StartGoggles()
This commit is contained in:
parent
f6211221c4
commit
9894fd3ec7
@ -2,6 +2,7 @@
|
||||
#include "../main.h"
|
||||
#include "util.h"
|
||||
#include "keystuff.h"
|
||||
#include "task.h"
|
||||
|
||||
extern CGame *pGame;
|
||||
|
||||
@ -165,6 +166,19 @@ WEAPON_SLOT_TYPE * CPlayerPed::FindWeaponSlot(DWORD dwWeapon)
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CPlayerPed::StartGoggles()
|
||||
{
|
||||
if (HasGoggles()) return;
|
||||
if (FindWeaponSlot( 44 ) == NULL && FindWeaponSlot( 45 ) == NULL)
|
||||
GiveWeapon( 44, 1 ); // Prevents crashing due to lack of animations.
|
||||
|
||||
CTaskGoggles* pGoggles = new CTaskGoggles();
|
||||
pGoggles->ApplyToPed( this );
|
||||
m_bGoggleState = TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CPlayerPed::StopGoggles()
|
||||
{
|
||||
if (!m_pPed || !HasGoggles()) return;
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
WEAPON_SLOT_TYPE * GetCurrentWeaponSlot();
|
||||
WEAPON_SLOT_TYPE * FindWeaponSlot(DWORD dwWeapon);
|
||||
|
||||
void StartGoggles();
|
||||
void StopGoggles();
|
||||
BOOL HasGoggles();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user