mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[saco] Implement/match CPlayerPed::GetKeys(...)
This commit is contained in:
parent
3e5f6d3379
commit
f6f40b4309
@ -78,6 +78,63 @@ void CPlayerPed::SetInitialState()
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
WORD CPlayerPed::GetKeys(WORD * lrAnalog, WORD * udAnalog)
|
||||
{
|
||||
WORD wRet=0;
|
||||
GTA_CONTROLSET *pInternalKeys = GameGetInternalKeys();
|
||||
|
||||
*lrAnalog = pInternalKeys->wKeys1[0]; // left/right analog
|
||||
*udAnalog = pInternalKeys->wKeys1[1]; // up/down analog
|
||||
|
||||
if(((short)pInternalKeys->wKeys1[2]) > 0) wRet |= 1; // analog2 L
|
||||
wRet <<= 1;
|
||||
|
||||
if(((short)pInternalKeys->wKeys1[2]) < 0) wRet |= 1; // analog2 R
|
||||
wRet <<= 1;
|
||||
|
||||
if(((short)pInternalKeys->wKeys1[3]) > 0) wRet |= 1; // analog2 D
|
||||
wRet <<= 1;
|
||||
|
||||
if(((short)pInternalKeys->wKeys1[3]) < 0) wRet |= 1; // analog2 U
|
||||
wRet <<= 1;
|
||||
|
||||
if(pInternalKeys->wKeys1[21]) wRet |= 1; // walking
|
||||
wRet <<= 1;
|
||||
|
||||
if(pInternalKeys->wKeys1[19]) wRet |= 1; // submission
|
||||
wRet <<= 1;
|
||||
|
||||
if(IsInVehicle() && pInternalKeys->wKeys1[5]) wRet |= 1; // incar look left
|
||||
wRet <<= 1;
|
||||
|
||||
if(pInternalKeys->wKeys1[6]) wRet |= 1; // incar handbrake / target
|
||||
wRet <<= 1;
|
||||
|
||||
if(IsInVehicle() && pInternalKeys->wKeys1[7]) wRet |= 1; // incar look right
|
||||
wRet <<= 1;
|
||||
|
||||
if(pInternalKeys->wKeys1[14]) wRet |= 1; // jump
|
||||
wRet <<= 1;
|
||||
|
||||
if(!IsInJetpackMode() && pInternalKeys->wKeys1[15]) wRet |= 1; // secondary onfoot attack
|
||||
wRet <<= 1;
|
||||
|
||||
if(pInternalKeys->wKeys1[16]) wRet |= 1; // sprint
|
||||
wRet <<= 1;
|
||||
|
||||
if(HasAmmoForCurrentWeapon() && pInternalKeys->wKeys1[17]) wRet |= 1; // fire
|
||||
wRet <<= 1;
|
||||
|
||||
if(pInternalKeys->wKeys1[18]) wRet |= 1; // crouch
|
||||
wRet <<= 1;
|
||||
|
||||
if(pInternalKeys->wKeys1[4]) wRet |= 1; // secondary fire
|
||||
|
||||
return wRet;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
BYTE CPlayerPed::GetSpecialKey()
|
||||
{
|
||||
GTA_CONTROLSET *pInternalKeys = GameGetInternalKeys();
|
||||
|
@ -19,6 +19,8 @@ public:
|
||||
void ResetPointers();
|
||||
void SetInitialState();
|
||||
|
||||
WORD GetKeys(WORD * lrAnalog, WORD * udAnalog);
|
||||
|
||||
BYTE GetSpecialKey();
|
||||
|
||||
CAMERA_AIM * GetCurrentAim();
|
||||
|
Loading…
Reference in New Issue
Block a user