mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 01:38:17 +08:00
[saco] Implement CPlayerPed::StartGoggles()
This commit is contained in:
1 parent
f6211221c4
commit
9894fd3ec7
2 files changed
+15
No files matched your search
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user