├── .gitignore ├── CMakeLists.txt ├── include ├── CAEAmbienceTrackManager.h ├── CAEAudioEntity.h ├── CAEAudioHardware.h ├── CAEAudioUtility.h ├── CAEPedSpeechAudioEntity.h ├── CAESound.h ├── CAnimBlendAssociation.h ├── CAnimBlendFrameData.h ├── CAnimBlendHierarchy.h ├── CAnimBlendNode.h ├── CAnimManager.h ├── CAtomicModelInfo.h ├── CAutomobile.h ├── CAutopilot.h ├── CBaseModelInfo.h ├── CBike.h ├── CBmx.h ├── CBoat.h ├── CCam.h ├── CCamera.h ├── CClock.h ├── CClumpModelInfo.h ├── CColPoint.h ├── CCopPed.h ├── CCutsceneObject.h ├── CEntity.h ├── CEntityScanner.h ├── CFileLoader.h ├── CFire.h ├── CFont.h ├── CGame.h ├── CHeli.h ├── CHud.h ├── CHudColours.h ├── CMakeLists.txt ├── CMatrix.h ├── CMatrixLink.h ├── CMessages.h ├── CModelInfo.h ├── CMonsterTruck.h ├── CNodeAddress.h ├── CObject.h ├── CObjectInfo.h ├── CPed.h ├── CPedIK.h ├── CPedIntelligence.h ├── CPedModelInfo.h ├── CPedStat.h ├── CPhysical.h ├── CPlaceable.h ├── CPlane.h ├── CPlayerData.h ├── CPlayerInfo.h ├── CPlayerSkin.h ├── CPool.h ├── CPools.h ├── CPopulation.h ├── CQuadBike.h ├── CQuaternion.h ├── CQueuedMode.h ├── CRGBA.h ├── CRadar.h ├── CRect.h ├── CReference.h ├── CRunningScript.h ├── CSimpleTransform.h ├── CSprite2d.h ├── CStreaming.h ├── CStreamingInfo.h ├── CTheScripts.h ├── CTheZones.h ├── CTimer.h ├── CTrailer.h ├── CTxdStore.h ├── CVector.h ├── CVector2D.h ├── CVehicle.h ├── CVehicleModelInfo.h ├── CWeapon.h ├── CWeaponInfo.h ├── CWeather.h ├── CWorld.h ├── FxPrtMult_c.h ├── FxSystemBP_c.h ├── FxSystem_c.h ├── ScriptCommandNames.h ├── ScriptCommands.h ├── eCamMode.h ├── eCopType.h ├── eWeaponType.h └── memory.hpp └── src ├── CAEAmbienceTrackManager.cpp ├── CAEAudioEntity.cpp ├── CAEAudioHardware.cpp ├── CAEAudioUtility.cpp ├── CAEPedSpeechAudioEntity.cpp ├── CAESound.cpp ├── CAnimBlendAssociation.cpp ├── CAnimBlendFrameData.cpp ├── CAnimBlendHierarchy.cpp ├── CAnimBlendNode.cpp ├── CAnimManager.cpp ├── CAtomicModelInfo.cpp ├── CAutomobile.cpp ├── CAutopilot.cpp ├── CBaseModelInfo.cpp ├── CBike.cpp ├── CBmx.cpp ├── CBoat.cpp ├── CCam.cpp ├── CCamera.cpp ├── CClock.cpp ├── CClumpModelInfo.cpp ├── CColPoint.cpp ├── CCopPed.cpp ├── CCutsceneObject.cpp ├── CEntity.cpp ├── CEntityScanner.cpp ├── CFileLoader.cpp ├── CFire.cpp ├── CFont.cpp ├── CGame.cpp ├── CHeli.cpp ├── CHud.cpp ├── CHudColours.cpp ├── CMakeLists.txt ├── CMatrix.cpp ├── CMatrixLink.cpp ├── CMessages.cpp ├── CModelInfo.cpp ├── CMonsterTruck.cpp ├── CNodeAddress.cpp ├── CObject.cpp ├── CPed.cpp ├── CPedIK.cpp ├── CPedIntelligence.cpp ├── CPedModelInfo.cpp ├── CPedStat.cpp ├── CPhysical.cpp ├── CPlaceable.cpp ├── CPlane.cpp ├── CPlayerData.cpp ├── CPlayerInfo.cpp ├── CPlayerSkin.cpp ├── CPool.cpp ├── CPools.cpp ├── CPopulation.cpp ├── CQuadBike.cpp ├── CQuaternion.cpp ├── CRGBA.cpp ├── CRadar.cpp ├── CRect.cpp ├── CReference.cpp ├── CRunningScript.cpp ├── CSimpleTransform.cpp ├── CStreaming.cpp ├── CStreamingInfo.cpp ├── CTheScripts.cpp ├── CTheZones.cpp ├── CTimer.cpp ├── CTrailer.cpp ├── CTxdStore.cpp ├── CVector.cpp ├── CVector2D.cpp ├── CVehicle.cpp ├── CVehicleModelInfo.cpp ├── CWeapon.cpp ├── CWeaponInfo.cpp ├── CWeather.cpp ├── CWorld.cpp ├── FxSystem_c.cpp └── ScriptCommands.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.25) 2 | 3 | project(TrilogySDK VERSION 0.1.6) 4 | 5 | add_library(TrilogySDK) 6 | 7 | add_subdirectory(include) 8 | add_subdirectory(src) 9 | 10 | get_target_property(SOURCES TrilogySDK SOURCES) 11 | source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${SOURCES}) 12 | 13 | target_compile_features(TrilogySDK PRIVATE cxx_std_17) 14 | target_include_directories(TrilogySDK 15 | PUBLIC 16 | $ 17 | $ 18 | PRIVATE 19 | ${CMAKE_CURRENT_SOURCE_DIR}/src 20 | ) 21 | -------------------------------------------------------------------------------- /include/CAEAmbienceTrackManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAEAmbienceTrackManager { 4 | public: 5 | 6 | void UpdateAmbienceTrackAndVolume(long a1, long a2, long a3); 7 | }; -------------------------------------------------------------------------------- /include/CAEAudioEntity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAEAudioEntity { 4 | public: 5 | static long &m_nAudioEventVolumes; 6 | }; -------------------------------------------------------------------------------- /include/CAEAudioHardware.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAEAudioHardware { 4 | public: 5 | long LoadSound(long a2, unsigned short a3, short a4); 6 | }; -------------------------------------------------------------------------------- /include/CAEAudioUtility.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVehicle.h" 3 | 4 | class CAEAudioUtility { 5 | public: 6 | bool ResolveProbability(float a1); 7 | int GetRandomNumberInRange(int l, int h); 8 | CVehicle* FindVehicleOfPlayer(); 9 | }; -------------------------------------------------------------------------------- /include/CAEPedSpeechAudioEntity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAEPedSpeechAudioEntity { 4 | public: 5 | static char &s_bAPlayerSpeaking; 6 | 7 | signed long CanWePlayGlobalSpeechContext(unsigned short a2); 8 | signed short GetSoundAndBankIDs(unsigned short phraseId, short *a3); 9 | long LoadAndPlaySpeech(int a2); 10 | long GetVoice(const char *name, short type); 11 | void StopCurrentSpeech(); 12 | }; -------------------------------------------------------------------------------- /include/CAESound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAESound { 4 | public: 5 | void StopSoundAndForget(); 6 | }; -------------------------------------------------------------------------------- /include/CAnimBlendAssociation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CAnimBlendHierarchy.h" 3 | 4 | class CAnimBlendAssociation { 5 | public: 6 | // CAnimBlendAssociation* CAnimBlendAssociation(); 7 | // CAnimBlendAssociation* CAnimBlendAssociation(CAnimBlendHierarchy *a2); 8 | unsigned long Init(int a1); 9 | char Start(float progress); 10 | CAnimBlendAssociation * CopyAnimation(int ID); 11 | }; -------------------------------------------------------------------------------- /include/CAnimBlendFrameData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | 4 | class CAnimBlendFrameData { 5 | public: 6 | unsigned __int8 m_nFlags; 7 | char _pad1[3]; 8 | CVector m_vecOffset; 9 | struct RpHAnimBlendInterpFrame* m_pIFrame; 10 | int m_nNodeId; 11 | }; -------------------------------------------------------------------------------- /include/CAnimBlendHierarchy.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAnimBlendHierarchy { 4 | public: 5 | char field_0[8]; 6 | short field_8; 7 | char field_A; 8 | char field_C; 9 | char field_E; 10 | short seqCount; 11 | char bRunningCompressed; 12 | char field_13; 13 | char field_14[4]; 14 | float fTotalTime; 15 | char field_1C[4]; 16 | char field_20[34]; 17 | short field_42; 18 | short field_44; 19 | char field_46[2]; 20 | long field_48; 21 | 22 | void RemoveUncompressedData(); 23 | }; -------------------------------------------------------------------------------- /include/CAnimBlendNode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAnimBlendNode { 4 | public: 5 | void CalcDeltas(); 6 | char FindKeyFrame(float a2); 7 | char SetupKeyFrameCompressed(); 8 | }; -------------------------------------------------------------------------------- /include/CAnimManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CAnimBlendHierarchy.h" 3 | #include "CAnimBlendAssociation.h" 4 | 5 | class CAnimManager { 6 | public: 7 | static long &ms_aAnimAssocGroups; 8 | 9 | void UncompressAnimation(CAnimBlendHierarchy *a1); 10 | CAnimBlendAssociation * AddAnimation(unsigned int animGroup, unsigned int animation); 11 | CAnimBlendAssociation * AddAnimation(long a1, CAnimManager *a2); 12 | CAnimBlendAssociation * BlendAnimation(long a1, CAnimBlendHierarchy *a2, unsigned int flags, float blendDelta); 13 | long LoadAnimFiles(); 14 | long LoadAnimFile(long stream, char a2, char *string); 15 | long CreateAnimAssocGroups(); 16 | }; -------------------------------------------------------------------------------- /include/CAtomicModelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CAtomicModelInfo { 4 | public: 5 | }; -------------------------------------------------------------------------------- /include/CAutomobile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CVehicle.h" 4 | 5 | enum eCarNodes { 6 | CAR_NODE_NONE = 0, 7 | CAR_CHASSIS = 1, 8 | CAR_WHEEL_RF = 2, 9 | CAR_WHEEL_RM = 3, 10 | CAR_WHEEL_RB = 4, 11 | CAR_WHEEL_LF = 5, 12 | CAR_WHEEL_LM = 6, 13 | CAR_WHEEL_LB = 7, 14 | CAR_DOOR_RF = 8, 15 | CAR_DOOR_RR = 9, 16 | CAR_DOOR_LF = 10, 17 | CAR_DOOR_LR = 11, 18 | CAR_BUMP_FRONT = 12, 19 | CAR_BUMP_REAR = 13, 20 | CAR_WING_RF = 14, 21 | CAR_WING_LF = 15, 22 | CAR_BONNET = 16, 23 | CAR_BOOT = 17, 24 | CAR_WINDSCREEN = 18, 25 | CAR_EXHAUST = 19, 26 | CAR_MISC_A = 20, 27 | CAR_MISC_B = 21, 28 | CAR_MISC_C = 22, 29 | CAR_MISC_D = 23, 30 | CAR_MISC_E = 24, 31 | CAR_NUM_NODES 32 | }; 33 | 34 | class CAutomobile : public CVehicle { 35 | public: 36 | char field_7B8[184]; 37 | int* m_aCarNodes[25]; 38 | char field_938[428]; 39 | short m_wMiscComponentAngle; 40 | short field_AE6; 41 | char field_AE8[300]; 42 | 43 | CAutomobile(); 44 | CAutomobile(int nModelIndex, unsigned char usageType, char bSetupSuspensionLines); 45 | void UpdateWheelMatrix(int nodeIndex, int flags); 46 | void PlaceOnRoadProperly(); 47 | }; -------------------------------------------------------------------------------- /include/CAutopilot.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CNodeAddress.h" 3 | 4 | class CAutopilot 5 | { 6 | public: 7 | CNodeAddress m_currentAddress; 8 | CNodeAddress m_startingRouteNode; 9 | CNodeAddress field_8; 10 | char field_0[20]; 11 | int m_nTimeToStartMission; 12 | char field_24[10]; 13 | char m_nCarMission; 14 | char field_2F[21]; 15 | char m_nCruiseSpeed; 16 | char field_48[71]; 17 | __int16 m_wPathFindNodesCount; 18 | char field_90[30]; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /include/CBaseModelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CBaseModelInfo 4 | { 5 | public: 6 | void* vtbl; 7 | int m_nKey; 8 | char field_C[22]; 9 | __int16 m_wUsageCount; 10 | char m_nAlpha; 11 | char m_n2dfxCount; 12 | __int16 m_w2dfxIndex; 13 | __int16 m_wObjectInfoIndex; 14 | unsigned __int16 m_nMdlFlags; 15 | char field_2C[4]; 16 | void* m_pColModel; 17 | float m_fDrawDistance; 18 | char field_3B[4]; 19 | void* m_pRwObject; 20 | }; -------------------------------------------------------------------------------- /include/CBike.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVehicle.h" 3 | 4 | class CBike : public CVehicle 5 | { 6 | public: 7 | char field_7B8[144]; 8 | char m_nDamageFlags; 9 | char field_849[655]; 10 | 11 | CBike(int nModelIndex, unsigned char nUsageType); 12 | void PlaceOnRoadProperly(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /include/CBmx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVehicle.h" 3 | 4 | class CBmx : public CVehicle 5 | { 6 | public: 7 | CBmx(int nModelIndex, unsigned char nUsageType); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /include/CBoat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CAutomobile.h" 3 | 4 | class CBoat : public CAutomobile 5 | { 6 | public: 7 | CBoat(int nModelIndex, unsigned char nUsageType); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /include/CCam.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CEntity.h" 3 | #include "eCamMode.h" 4 | #include "CQueuedMode.h" 5 | 6 | #pragma pack(push, 1) 7 | class CCam 8 | { 9 | public: 10 | char field_0[8]; 11 | float m_fFOV; 12 | char field_0C[4]; 13 | float m_fHorizontalAngle; 14 | float m_fBetaSpeed; 15 | float m_fDistance1; 16 | char field_4[4]; 17 | bool m_bCamLookingAtVector; 18 | bool m_bCollisionChecksOn; 19 | char field_2A[4]; 20 | bool m_bResetStatics; 21 | char field_27; 22 | eCamMode m_wMode; 23 | char field_28[2]; 24 | int m_nFinishTime; 25 | unsigned int m_dwDoCollisionChecksOnFrameNum; 26 | unsigned int m_dwDoCollisionCheckEveryNumOfFrames; 27 | int m_nFrameNumWereAt; 28 | unsigned int m_dwDirectionWasLooking; 29 | float m_fSyphonModeTargetZOffSet; 30 | char field_40[4]; 31 | float m_fVerticalAngle; 32 | float m_fAlphaSpeed; 33 | float m_fFOV1; 34 | float m_fFOVSpeed; 35 | float field_58; 36 | char field_5C[4]; 37 | float m_fTimeElapsedFloat; 38 | char field_72[16]; 39 | float m_fTrueAlpha; 40 | float m_fCameraHeightMultiplier; 41 | float m_fTargetZoomZCloseIn; 42 | float m_fMinRealGroundDist; 43 | char field_84[4]; 44 | float m_fX_Targetting; 45 | float m_fY_Targetting; 46 | char field_90[56]; 47 | CVector m_vecTargetCoorsForFudgeInter; 48 | CVector m_vecCamFixedModeVector; 49 | char field_E0[48]; 50 | CVector m_vFront; 51 | CVector m_vSource; 52 | CVector m_vSourceBeforeLookBehind; 53 | CVector m_vUp; 54 | CVector m_avPreviousVectors[2]; 55 | CVector m_avTargetHistoryPos[4]; 56 | unsigned int m_adwTargetHistoryTime[4]; 57 | unsigned int m_dwCurrentHistoryPoints; 58 | char field_19C[4]; 59 | CEntity* m_pCamTargetEntity; 60 | char field_1A8[8]; 61 | float m_fPlayerVelocity; 62 | char field_1B4[2]; 63 | }; 64 | #pragma pack(pop) 65 | -------------------------------------------------------------------------------- /include/CCamera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CPlaceable.h" 4 | #include "CMatrix.h" 5 | #include "CCam.h" 6 | #include "CEntity.h" 7 | #include "memory.hpp" 8 | 9 | 10 | struct CCamPathSplines 11 | { 12 | float* m_arr_PathData; 13 | }; 14 | 15 | struct CameraTweaks 16 | { 17 | int m_nModelIndex; 18 | float m_fDistance; 19 | float m_fAltitude; 20 | float m_fAngle; 21 | }; 22 | 23 | struct CCamera : public CPlaceable 24 | { 25 | char m_bAboveGroundTrainNodesLoaded; 26 | char m_bBelowGroundTrainNodesLoaded; 27 | char m_bCamDirectlyBehind; 28 | char m_bCamDirectlyInFront; 29 | char m_bCameraJustRestored; 30 | bool m_bCutsceneFinished; 31 | char field_24[4]; 32 | char m_bIgnoreFadingStuffForMusic; 33 | char m_bPlayerIsInGarage; 34 | char m_bPlayerWasOnBike; 35 | char m_bJustCameOutOfGarage; 36 | char m_bJust_Switched; 37 | char m_bLookingAtPlayer; 38 | char m_bLookingAtVector; 39 | char field_31[4]; 40 | char m_bUseNearClipScript; 41 | char m_bStartInterScript; 42 | char m_bStartingSpline; 43 | char m_bTargetJustCameOffTrain; 44 | char m_bUseSpecialFovTrain; 45 | char m_bUseTransitionBeta; 46 | char m_bUseScriptZoomValuePed; 47 | char m_bUseScriptZoomValueCar; 48 | char m_bWaitForInterpolToFinish; 49 | char m_bItsOkToLookJustAtThePlayer; 50 | char m_bWantsToSwitchWidescreenOff; 51 | char m_bWideScreenOn; 52 | char m_b1rstPersonRunCloseToAWall; 53 | char m_bHeadBob; 54 | char field_43[16]; 55 | char m_bScriptParametersSetForInterPol; 56 | char field_59[1]; 57 | char m_bMusicFadedOut; 58 | char field_5C[4]; 59 | bool m_bTransitionState; 60 | char m_nActiveCam; 61 | unsigned int m_nCamShakeStart; 62 | unsigned int m_dwFirstPersonCamLastInputTime; 63 | unsigned int m_dwLongestTimeInMill; 64 | char field_68[4]; 65 | unsigned int m_nTimeLastChange; 66 | char field_70[20]; 67 | unsigned int m_dwBlurBlue; 68 | unsigned int m_dwBlurGreen; 69 | unsigned int m_dwBlurRed; 70 | unsigned int m_dwBlurType; 71 | unsigned int m_dwWorkOutSpeedThisNumFrames; 72 | unsigned int m_dwNumFramesSoFar; 73 | unsigned int m_dwCurrentTrainCamNode; 74 | unsigned int m_dwMotionBlur; 75 | unsigned int m_dwMotionBlurAddAlpha; 76 | unsigned int m_dwCheckCullZoneThisNumFrames; 77 | char field_A4[4]; 78 | unsigned int m_dwWhoIsInControlOfTheCamera; 79 | char field_148[80]; 80 | double m_fLODDistMultiplier; 81 | char field_10C[48]; 82 | float m_fCamShakeForce; 83 | float m_fFovForTrain; 84 | float m_fFOV_Wide_Screen; 85 | float m_fNearClipScript; 86 | float m_fOldBetaDiff; 87 | float m_fPositionAlongSpline; 88 | float m_fScreenReductionPercentage; 89 | float m_fScreenReductionSpeed; 90 | float m_fAlphaForPlayerAnim1rstPerson; 91 | float m_fOrientation; 92 | float m_fPlayerExhaustion; 93 | float m_fSoundDistUp; 94 | float m_fSoundDistUpAsRead; 95 | float m_fSoundDistUpAsReadOld; 96 | float m_fAvoidTheGeometryProbsTimer; 97 | unsigned short m_wAvoidTheGeometryProbsDirn; 98 | unsigned short __padding1; 99 | float m_fWideScreenReductionAmount; 100 | char field_180[8]; 101 | CCam m_aCams[3]; 102 | void* m_pToGarageWeAreIn; 103 | void* m_pToGarageWeAreInForHackAvoidFirstPerson; 104 | CQueuedMode m_playerMode; 105 | CQueuedMode m_playerWeaponMode; 106 | CVector m_vPreviousCameraPosition; 107 | CVector m_vRealPreviousCameraPosition; 108 | CVector m_vAimingTargetCoors; 109 | CVector m_vFixedModeVector; 110 | CVector m_vFixedModeSource; 111 | CVector m_vFixedModeUpOffSet; 112 | CVector m_vCutSceneOffset; 113 | CVector m_vStartingSourceForInterPol; 114 | CVector m_vStartingTargetForInterPol; 115 | CVector m_vStartingUpForInterPol; 116 | CVector m_vSourceSpeedAtStartInter; 117 | CVector m_vTargetSpeedAtStartInter; 118 | CVector m_vUpSpeedAtStartInter; 119 | CVector m_vSourceWhenInterPol; 120 | CVector m_vTargetWhenInterPol; 121 | CVector m_vUpWhenInterPol; 122 | CVector m_vClearGeometryVec; 123 | CVector m_vGameCamPos; 124 | CVector m_vSourceDuringInter; 125 | CVector m_vTargetDuringInter; 126 | CVector m_vUpDuringInter; 127 | CVector m_vAttachedCamOffset; 128 | CVector m_vAttachedCamLookAt; 129 | float m_fAttachedCamAngle; 130 | void* m_pRwCamera; 131 | CEntity* m_pTargetEntity; 132 | void* m_pAttachedEntity; 133 | CCamPathSplines m_aPathArray[4]; 134 | char field_828[8]; 135 | CMatrix m_mCameraMatrix; 136 | CMatrix m_mCameraMatrixOld; 137 | CMatrix m_mViewMatrix; 138 | CMatrix m_mMatInverse; 139 | CMatrix m_mMatMirrorInverse; 140 | CMatrix m_mMatMirror; 141 | char field_880[220]; 142 | unsigned int field_AEC; 143 | unsigned short m_nMoveToGo; 144 | unsigned short field_AF2; 145 | unsigned short m_nTypeToSwitch; 146 | char field_AF8[34]; 147 | float field_B18; 148 | float field_B1C; 149 | char field_B20[24]; 150 | bool m_bTrackLinearWithEase; 151 | char field_C7D; 152 | char field_C7E; 153 | char field_C7F; 154 | CVector m_vecTrackLinear; 155 | char m_bVecTrackLinearProcessed; 156 | char field_C8D; 157 | char field_C8E; 158 | char field_C8F; 159 | float field_C90; 160 | float m_dwStartJiggleTime; 161 | float m_dwEndJiggleTime; 162 | int field_C9C; 163 | int m_nShakeType; 164 | float m_dwStartZoomTime; 165 | float m_dwEndZoomTime; 166 | float m_fZoomInFactor; 167 | float m_fZoomOutFactor; 168 | char m_nZoomMode; 169 | bool m_bFOVLerpProcessed; 170 | char field_CB6; 171 | char field_CB7; 172 | float m_fFOVNew; 173 | float m_fMoveLinearStartTime; 174 | float m_fMoveLinearEndTime; 175 | CVector m_vecMoveLinearPosnStart; 176 | CVector m_vecMoveLinearPosnEnd; 177 | bool m_bMoveLinearWithEase; 178 | char field_CDD; 179 | char field_CDE; 180 | char field_CDF; 181 | CVector m_vecMoveLinear; 182 | bool m_bVecMoveLinearProcessed; 183 | bool m_bBlockZoom; 184 | bool m_bCameraPersistPosition; 185 | bool m_bCameraPersistTrack; 186 | char m_bCinemaCamera; 187 | char field_CF1; 188 | char field_CF2; 189 | char field_CF3; 190 | CameraTweaks m_aCamTweak[5]; 191 | bool m_bCameraVehicleTweaksInitialized; 192 | char _padD45[3]; 193 | float m_fCurrentTweakDistance; 194 | float m_fCurrentTweakAltitude; 195 | float m_fCurrentTweakAngle; 196 | int field_D58; 197 | int field_D5C; 198 | int field_D60; 199 | int field_D64; 200 | int field_D68; 201 | int field_D6C; 202 | int field_D70; 203 | int field_D74; 204 | char field_C70[64]; 205 | 206 | void TakeControl(CEntity* target, short ModeToGoTo, short TypeOfSwitch, int WhoIsInControlOfTheCamera); 207 | void Restore(); 208 | void Process(); 209 | void Init(); 210 | void Fade(float fadeDuration, short FadeInOutFlag); 211 | void CamControl(); 212 | }; 213 | 214 | extern CCamera& TheCamera; -------------------------------------------------------------------------------- /include/CClock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CClock { 4 | public: 5 | static bool &bClockHasBeenStored; 6 | static unsigned short &ms_Stored_nGameClockSeconds; 7 | static unsigned char &ms_Stored_nGameClockMinutes; 8 | static unsigned char &ms_Stored_nGameClockHours; 9 | static unsigned char &ms_Stored_nGameClockDays; 10 | static unsigned char &ms_Stored_nGameClockMonths; 11 | static unsigned char &CurrentDay; 12 | static unsigned short &ms_nGameClockSeconds; 13 | static unsigned char &ms_nGameClockMinutes; 14 | static unsigned char &ms_nGameClockHours; 15 | static unsigned char &ms_nGameClockDays; 16 | static unsigned char &ms_nGameClockMonth; 17 | static unsigned int &ms_nLastClockTick; 18 | static unsigned int &ms_nMillisecondsPerGameMinute; 19 | }; -------------------------------------------------------------------------------- /include/CClumpModelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CBaseModelInfo.h" 3 | 4 | #pragma pack(push, 4) 5 | class CClumpModelInfo : public CBaseModelInfo 6 | { 7 | public: 8 | int m_nAnimFile; 9 | }; 10 | #pragma pack(pop) -------------------------------------------------------------------------------- /include/CColPoint.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | 4 | struct tColLighting 5 | { 6 | unsigned char day : 4; 7 | unsigned char night : 4; 8 | }; 9 | 10 | class CColPoint { 11 | public: 12 | CVector m_vecPoint; 13 | float field_C; 14 | CVector m_vecNormal; 15 | float field_1C; 16 | unsigned char m_nSurfaceTypeA; 17 | unsigned char m_nPieceTypeA; 18 | tColLighting m_nLightingA; 19 | private: 20 | char _pad; 21 | public: 22 | unsigned char m_nSurfaceTypeB; 23 | unsigned char m_nPieceTypeB; 24 | tColLighting m_nLightingB; 25 | private: 26 | char _pad2; 27 | public: 28 | float m_fDepth; 29 | }; -------------------------------------------------------------------------------- /include/CCopPed.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "eCopType.h" 3 | #include "CPed.h" 4 | 5 | class CCopPed : public CPed { 6 | public: 7 | char field_79C; 8 | char field_79D; 9 | char padding[2]; 10 | int m_copType; 11 | int field_7A4; 12 | CCopPed* m_pCopPartner; 13 | CPed* m_apCriminalsToKill[5]; 14 | char field_7C0; 15 | }; -------------------------------------------------------------------------------- /include/CCutsceneObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CCutsceneObject { 4 | public: 5 | 6 | }; -------------------------------------------------------------------------------- /include/CEntity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CPlaceable.h" 4 | #include "CReference.h" 5 | 6 | enum eEntityFlags 7 | { 8 | eEntityFlags_1 = 0x1, 9 | eEntityFlags_2 = 0x2, 10 | eEntityFlags_4 = 0x4, 11 | eEntityFlags_8 = 0x8, 12 | eEntityFlags_10 = 0x10, 13 | eEntityFlags_20 = 0x20, 14 | eEntityFlags_40 = 0x40, 15 | eEntityFlags_80 = 0x80, 16 | eEntityFlags_100 = 0x100, 17 | eEntityFlags_200 = 0x200, 18 | eEntityFlags_400 = 0x400, 19 | eEntityFlags_800 = 0x800, 20 | eEntityFlags_1000 = 0x1000, 21 | eEntityFlags_2000 = 0x2000, 22 | eEntityFlags_4000 = 0x4000, 23 | }; 24 | 25 | class CEntity : public CPlaceable { 26 | public: 27 | struct AGTAActor* m_pUE4Actor; 28 | char field_28[8]; 29 | eEntityFlags m_nFlags; 30 | char field_34[3]; 31 | unsigned __int16 m_nRandomSeed; 32 | unsigned __int16 m_nModelIndex; 33 | CReference* m_pReferences; 34 | char field_48[3]; 35 | char m_nbInterior; 36 | char field_4C[10]; 37 | char m_iplIndex; 38 | char field_57[3]; 39 | char m_nTypeStatus; 40 | char field_6B[5]; 41 | 42 | CEntity(); 43 | 44 | bool GetIsOnScreen(); 45 | //vtbl 46 | void SetModelIndex_vtbl(unsigned int nModelIndex); 47 | void SetModelIndexNoCreate(unsigned int nModelIndex); 48 | void DeleteRwObject(); 49 | }; -------------------------------------------------------------------------------- /include/CEntityScanner.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma pack(push, 1) 4 | class CEntityScanner 5 | { 6 | public: 7 | int __vmt; 8 | int field_4; 9 | int m_dwCount; 10 | struct _CEntity* m_apEntities[16]; 11 | struct _CPed* m_pClosestPedInRange; 12 | }; 13 | #pragma pack(pop) -------------------------------------------------------------------------------- /include/CFileLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CFileLoader { 4 | public: 5 | static void LoadAnimatedClumpObject(char const *line); 6 | static int LoadPedObject(char const *line); 7 | static int LoadTimeObject(char const *line); 8 | static void LoadObjectTypes(char const *filename); 9 | static int LoadVehicleObject(char const *line); 10 | }; -------------------------------------------------------------------------------- /include/CFire.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CFire { 4 | public: 5 | void Extinguish(); 6 | }; -------------------------------------------------------------------------------- /include/CFont.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma once 4 | 5 | #include "CSprite2d.h" 6 | 7 | class CFont { 8 | public: 9 | static CSprite2d *Sprite; 10 | }; -------------------------------------------------------------------------------- /include/CGame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CGame { 4 | public: 5 | 6 | }; 7 | 8 | extern int& gGameState; -------------------------------------------------------------------------------- /include/CHeli.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CAutomobile.h" 4 | 5 | enum eHeliNodes { 6 | HELI_NODE_NONE = 0, 7 | HELI_CHASSIS = 1, 8 | HELI_WHEEL_RF = 2, 9 | HELI_WHEEL_RM = 3, 10 | HELI_WHEEL_RB = 4, 11 | HELI_WHEEL_LF = 5, 12 | HELI_WHEEL_LM = 6, 13 | HELI_WHEEL_LB = 7, 14 | HELI_DOOR_RF = 8, 15 | HELI_DOOR_RR = 9, 16 | HELI_DOOR_LF = 10, 17 | HELI_DOOR_LR = 11, 18 | HELI_STATIC_ROTOR = 12, 19 | HELI_MOVING_ROTOR = 13, 20 | HELI_STATIC_ROTOR2 = 14, 21 | HELI_MOVING_ROTOR2 = 15, 22 | HELI_RUDDER = 16, 23 | HELI_ELEVATORS = 17, 24 | HELI_MISC_A = 18, 25 | HELI_MISC_B = 19, 26 | HELI_MISC_C = 20, 27 | HELI_MISC_D = 21, 28 | HELI_NUM_NODES 29 | }; 30 | 31 | struct tHeliLight { 32 | CVector m_vecOrigin; 33 | CVector m_vecTarget; 34 | float m_fTargetRadius; 35 | float m_fPower; 36 | int m_nCoronaIndex; 37 | bool field_24; 38 | bool m_bDrawShadow; 39 | char _pad[2]; 40 | CVector field_28[3]; 41 | }; 42 | 43 | class CHeli : public CAutomobile { 44 | public: 45 | char m_nHeliFlags; 46 | char _pad1[3]; 47 | float m_fLeftRightSkid; 48 | float m_fSteeringUpDown; 49 | float m_fSteeringLeftRight; 50 | float m_fAccelerationBreakStatus; 51 | int field_99C; 52 | int m_fRotorZ; 53 | int m_fSecondRotorZ; 54 | float m_fMaxAltitude; 55 | float field_9AC; 56 | float m_fMinAltitude; 57 | int field_9B4; 58 | char field_9B8; 59 | char m_nNumSwatOccupants; 60 | char m_anSwatIDs[4]; 61 | char _pad2[2]; 62 | int field_9C0[4]; 63 | int field_9D0; 64 | class FxSystem_c** m_pParticlesList; 65 | char field_9D8[24]; 66 | int field_9F0; 67 | CVector m_vecSearchLightTarget; 68 | float m_fSearchLightIntensity; 69 | int field_A04; 70 | int field_A08; 71 | class FxSystem_c** m_ppGunflashFx; 72 | char m_nFiringMultiplier; 73 | bool m_bSearchLightEnabled; 74 | char _pad3[2]; 75 | float field_A14; 76 | 77 | static bool& bPoliceHelisAllowed; // 1 78 | static unsigned int& TestForNewRandomHelisTimer; 79 | static CHeli** pHelis; // CHeli* pHelis[2]; 80 | static unsigned int& NumberOfSearchLights; 81 | static bool& bHeliControlsCheat; 82 | static tHeliLight* HeliSearchLights; 83 | 84 | CHeli(int nModelIndex, unsigned char nUsageType); 85 | }; -------------------------------------------------------------------------------- /include/CHud.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CHud { 4 | public: 5 | static long &Sprites; 6 | }; -------------------------------------------------------------------------------- /include/CHudColours.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CRGBA.h" 3 | 4 | class CHudColours { 5 | public: 6 | static CRGBA m_aHudColours[15]; 7 | }; -------------------------------------------------------------------------------- /include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE TRILOGY_SDK_INCLUDES *.h) 2 | target_sources(TrilogySDK 3 | PRIVATE 4 | ${TRILOGY_SDK_INCLUDES} 5 | ) -------------------------------------------------------------------------------- /include/CMatrix.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | 4 | #pragma pack(push, 8) 5 | class CMatrix { 6 | public: 7 | CVector right; 8 | unsigned int flags; 9 | CVector up; 10 | unsigned int pad1; 11 | CVector at; 12 | unsigned int pad2; 13 | CVector pos; 14 | unsigned int pad3; 15 | 16 | CMatrix* m_pAttachMatrix; 17 | bool m_bOwnsAttachedMatrix; 18 | 19 | void SetRotateZOnly(float fAngle); 20 | CVector& GetPosition() { return pos; }; 21 | }; 22 | #pragma pack(pop) -------------------------------------------------------------------------------- /include/CMatrixLink.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CMatrix.h" 4 | 5 | class CPlaceable; 6 | 7 | #pragma pack(push, 8) 8 | class CMatrixLink : public CMatrix { 9 | public: 10 | CPlaceable* m_pOwner; 11 | CMatrixLink* m_pPrev; 12 | CMatrixLink* m_pNext; 13 | }; 14 | #pragma pack(pop) -------------------------------------------------------------------------------- /include/CMessages.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CMessages { 4 | public: 5 | static void AddMessage(const wchar_t* szText, unsigned int nTime, unsigned short nFlags, bool bPreviousBrief); 6 | }; -------------------------------------------------------------------------------- /include/CModelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CAtomicModelInfo.h" 4 | #include "CBaseModelInfo.h" 5 | 6 | class CModelInfo { 7 | public: 8 | static CBaseModelInfo** ms_modelInfoPtrs; 9 | 10 | static CAtomicModelInfo* AddAtomicModel(int index); 11 | }; -------------------------------------------------------------------------------- /include/CMonsterTruck.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CAutomobile.h" 3 | 4 | class CMonsterTruck : public CAutomobile 5 | { 6 | public: 7 | CMonsterTruck(int nModelIndex, int nUsageType); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /include/CNodeAddress.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CNodeAddress 4 | { 5 | public: 6 | short m_nAreaId; 7 | short m_nNodeId; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /include/CObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CObjectInfo.h" 3 | #include "CEntity.h" 4 | #include "CPhysical.h" 5 | #include "eWeaponType.h" 6 | 7 | 8 | class CObject : public CPhysical { 9 | public: 10 | void* m_pControlCodeList; 11 | char m_nObjectType; 12 | char m_nBonusValue; 13 | __int16 m_nCostValue; 14 | int m_nObjectFlags; 15 | char m_nCurrentColDamageEffect; 16 | char field_1B1[4]; 17 | char m_nColBrightness; 18 | char field_1B6[10]; 19 | float m_fHealth; 20 | float m_fDoorAngle; 21 | float m_fScale; 22 | CObjectInfo* m_pObjectInfo; 23 | char field_1CC[8]; 24 | __int16 m_wScriptTriggerIndex; 25 | char field_1DC[18]; 26 | int m_pDummyObject; 27 | char field_1F0[4]; 28 | int m_dwTimeToRemoveParticles; 29 | char field_1FC[57]; 30 | 31 | void ObjectDamage(float damage, CVector* fxOrigin, CVector* fxDirection, CEntity* damager, eWeaponType weaponType); 32 | void Init(); 33 | static class CObject* Create(int modelIndex); 34 | 35 | }; -------------------------------------------------------------------------------- /include/CObjectInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | 4 | class CObjectInfo { 5 | public: 6 | float m_fMass; 7 | float m_fTurnMass; 8 | float m_fAirResistance; 9 | float m_fElasticity; 10 | float m_fBuoyancyConstant; 11 | float m_fUprootLimit; 12 | float m_fColDamageMultiplier; 13 | char m_bColDamageEffect; 14 | char m_bSpecialColResponseCase; 15 | char m_nCameraAvoidObject; 16 | char b_CausesExplosion; 17 | char m_bFxType; 18 | char __padding0[3]; 19 | CVector m_vFxOffset; 20 | struct FxSystemBP_c*** m_pFxSystem; 21 | float m_fSmashMultiplier; 22 | CVector m_vBreakVelocity; 23 | float m_fBreakVelocityRand; 24 | int m_dwGunBreakMode; 25 | int m_dwSparksOnImpact; 26 | }; -------------------------------------------------------------------------------- /include/CPed.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CPhysical.h" 3 | #include "CPlayerData.h" 4 | #include "CWeapon.h" 5 | #include "CPedStat.h" 6 | #include "CPedIntelligence.h" 7 | #include "CAnimBlendFrameData.h" 8 | #include "CPedIK.h" 9 | #include "CVector2D.h" 10 | 11 | class CVehicle; 12 | 13 | enum ePedState 14 | { 15 | PED_NONE = 0x0, 16 | PED_IDLE = 0x1, 17 | PED_LOOK_ENTITY = 0x2, 18 | PED_LOOK_HEADING = 0x3, 19 | PED_WANDER_RANGE = 0x4, 20 | PED_WANDER_PATH = 0x5, 21 | PED_SEEK_POSITION = 0x6, 22 | PED_SEEK_ENTITY = 0x7, 23 | PED_FLEE_POSITION = 0x8, 24 | PED_FLEE_ENTITY = 0x9, 25 | PED_PURSUE = 0xA, 26 | PED_FOLLOW_PATH = 0xB, 27 | PED_SNIPER_MODE = 0xC, 28 | PED_ROCKETLAUNCHER_MODE = 0xD, 29 | PED_DUMMY = 0xE, 30 | PED_PAUSE = 0xF, 31 | PED_ATTACK = 0x10, 32 | PED_FIGHT = 0x11, 33 | PED_FACE_PHONE = 0x12, 34 | PED_MAKE_PHONECALL = 0x13, 35 | PED_CHAT = 0x14, 36 | PED_MUG = 0x15, 37 | PED_AIMGUN = 0x16, 38 | PED_AI_CONTROL = 0x17, 39 | PED_SEEK_CAR = 0x18, 40 | PED_SEEK_BOAT_POSITION = 0x19, 41 | PED_FOLLOW_ROUTE = 0x1A, 42 | PED_CPR = 0x1B, 43 | PED_SOLICIT = 0x1C, 44 | PED_BUY_ICE_CREAM = 0x1D, 45 | PED_INVESTIGATE_EVENT = 0x1E, 46 | PED_EVADE_STEP = 0x1F, 47 | PED_ON_FIRE = 0x20, 48 | PED_SUNBATHE = 0x21, 49 | PED_FLASH = 0x22, 50 | PED_JOG = 0x23, 51 | PED_ANSWER_MOBILE = 0x24, 52 | PED_HANG_OUT = 0x25, 53 | PED_STATES_NO_AI = 0x26, 54 | PED_ABSEIL_FROM_HELI = 0x27, 55 | PED_SIT = 0x28, 56 | PED_JUMP = 0x29, 57 | PED_FALL = 0x2A, 58 | PED_GETUP = 0x2B, 59 | PED_STAGGER = 0x2C, 60 | PED_EVADE_DIVE = 0x2D, 61 | PED_STATES_CAN_SHOOT = 0x2E, 62 | PED_ENTER_TRAIN = 0x2F, 63 | PED_EXIT_TRAIN = 0x30, 64 | PED_ARREST_PLAYER = 0x31, 65 | PED_DRIVING = 0x32, 66 | PED_PASSENGER = 0x33, 67 | PED_TAXI_PASSENGER = 0x34, 68 | PED_OPEN_DOOR = 0x35, 69 | PED_DIE = 0x36, 70 | PED_DEAD = 0x37, 71 | PED_DIE_BY_STEALTH = 0x38, 72 | PED_CARJACK = 0x39, 73 | PED_DRAGGED_FROM_CAR = 0x3A, 74 | PED_ENTER_CAR = 0x3B, 75 | PED_STEAL_CAR = 0x3C, 76 | PED_EXIT_CAR = 0x3D, 77 | PED_HANDS_UP = 0x3E, 78 | PED_ARRESTED = 0x3F, 79 | PED_DEPLOY_STINGER = 0x40, 80 | }; 81 | 82 | class CPed : public CPhysical { 83 | public: 84 | char field_1A0[224]; 85 | char field_280[232]; 86 | char field_368[320]; 87 | char field_4A8[216]; 88 | CPedIntelligence* m_pIntelligence; 89 | CPlayerData* m_pPlayerData; 90 | unsigned char m_nCreatedBy; 91 | char field_590[3]; 92 | ePedState m_nPedState; 93 | char field_598[52]; 94 | int m_nPedFlags[4]; 95 | char field_5D0[4]; 96 | CAnimBlendFrameData* m_apPedBones[19]; 97 | int m_nAnimGroup; 98 | char field_67C[28]; 99 | struct RwObject* m_pWeaponObject; 100 | char field_6A0[24]; 101 | void* m_pGogglesObject; 102 | char field_6C0[8]; 103 | unsigned short m_nWeaponGunflashAlphaMP1; 104 | char field_6CA; 105 | unsigned short m_nWeaponGunflashAlphaMP2; 106 | CPedIK m_pedIK; 107 | char field_6F8[12]; 108 | float m_fHealth; 109 | float m_fMaxHealth; 110 | float m_fArmour; 111 | char field_708[20]; 112 | float m_fHeadingChangeRate; 113 | char field_9FF[56]; 114 | CVehicle* m_pVehicle; 115 | char field_768[16]; 116 | int m_nPedType; 117 | char field_780[4]; 118 | CPedStat* m_pStats; 119 | CWeapon m_aWeapon[13]; 120 | eWeaponType m_nSavedWeapon; 121 | char field_9FA[8]; 122 | char m_nActiveWeaponSlot; 123 | char field_99D[1]; 124 | unsigned char m_nWeaponAccuracy; 125 | char field_99F[37]; 126 | char m_nWeaponSkill; 127 | char field_9C5[31]; 128 | int m_nWeaponModelId; 129 | char field_9E8[17]; 130 | unsigned short m_nMoneyCount; 131 | char field_A0C[8]; 132 | char m_nLastWeaponDamage; 133 | char field_A05[59]; 134 | float m_fRemovalDistMultiplier; 135 | unsigned short m_wSpecialModelIndex; 136 | char field_A46[2]; 137 | int field_A48; 138 | char field_A4C; 139 | char field_A5D; 140 | char field_A5E; 141 | char field_A5F; 142 | 143 | void SetCharCreatedBy(char nCreatedBy); 144 | void SetModelIndex(int nModel); 145 | void RemoveWeaponModel(int nModelId, char nUnknow); 146 | void GiveWeapon(eWeaponType nWeapon, int nAmmo); 147 | void SetCurrentWeapon(eWeaponType nWeapon); 148 | void GrantAmmo(eWeaponType nWeapon, int nAmmo); 149 | void SetAmmo(eWeaponType nWeapon, int nAmmo); 150 | char GetWeaponSkill(eWeaponType nWeapon); 151 | void GetBonePosition(CVector* out, bool bDynamic, unsigned int nBoneId); 152 | void SetPedState(ePedState nState); 153 | bool IsPlayer(); 154 | bool IsAlive(); 155 | void DettachPedFromEntity(); 156 | void GiveDelayedWeapon(eWeaponType weaponType, unsigned int ammo, int a3); 157 | void RemoveWeaponAnims(int likeUnused, float blendDelta); 158 | }; -------------------------------------------------------------------------------- /include/CPedIK.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma pack(push, 8) 4 | struct LimbOrientation 5 | { 6 | public: 7 | float m_fYaw; 8 | float m_fPitch; 9 | }; 10 | 11 | class CPedIK { 12 | public: 13 | class CPed* ThisPed; 14 | LimbOrientation m_torsoOrien; 15 | float m_fSlopePitch; 16 | float m_fSlopePitchLimitMult; 17 | float m_fSlopeRoll; 18 | float m_fBodyRoll; 19 | int m_flags; 20 | }; 21 | #pragma pack(pop) 22 | -------------------------------------------------------------------------------- /include/CPedIntelligence.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CEntityScanner.h" 3 | 4 | class CPedIntelligence { 5 | public: 6 | char field_0[8]; 7 | char field_80[337]; 8 | int m_dwDecisionMakerType; 9 | int m_dwDecisionMakerTypeInGroup; 10 | float m_fHearingRange; 11 | float m_fSeeingRange; 12 | int m_dwDmNumPedsToScan; 13 | float m_fDmRadius; 14 | char field_17C[160]; 15 | CEntityScanner m_apEntities; 16 | char field_2B0[397]; 17 | }; -------------------------------------------------------------------------------- /include/CPedModelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CClumpModelInfo.h" 3 | 4 | #pragma pack(push, 4) 5 | class CPedModelInfo : public CClumpModelInfo 6 | { 7 | public: 8 | char field_50[32]; 9 | int m_nAnimType; 10 | int m_nPedType; 11 | int m_nStatType; 12 | __int16 m_nCarsCanDriveMask; 13 | __int16 m_nPedFlags; 14 | void* m_pHitColModel; 15 | char m_nRadio1; 16 | char m_nRadio2; 17 | char m_nRace; 18 | char field_8B; 19 | __int16 m_nPedAudioType; 20 | __int16 m_nVoice1; 21 | __int16 m_nVoice2; 22 | __int16 m_sVoiceID; 23 | }; 24 | #pragma pack(pop) -------------------------------------------------------------------------------- /include/CPedStat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CPedStat 4 | { 5 | public: 6 | unsigned int m_dwId; 7 | char m_acName[24]; 8 | float m_fFleeDistance; 9 | float m_fHeadingChangeRate; 10 | unsigned __int8 m_nFear; 11 | unsigned __int8 m_nTemper; 12 | unsigned __int8 m_nLawfullness; 13 | unsigned __int8 m_nSexiness; 14 | float m_fAttackStrength; 15 | float m_fDefendWeakness; 16 | __int16 m_wShootingRate; 17 | char m_nDefaultDecisionMaker; 18 | char _pad; 19 | }; 20 | -------------------------------------------------------------------------------- /include/CPhysical.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CEntity.h" 3 | #include "CQuaternion.h" 4 | #include "CColPoint.h" 5 | 6 | class CPhysical : public CEntity { 7 | public: 8 | float field_0; 9 | unsigned int m_nLastCollisionTime; 10 | int m_dwFlags; 11 | CVector m_vecMoveSpeed; 12 | CVector m_vecTurnSpeed; 13 | CVector m_vecFrictionMoveSpeed; 14 | CVector m_vecFrictionTurnSpeed; 15 | CVector m_vecForce; 16 | CVector m_vecTorque; 17 | float m_fMass; 18 | float m_fTurnMass; 19 | float m_fVelocityFrequency; 20 | float m_fAirResistance; 21 | float m_fElasticity; 22 | float m_fBuoyancyConstant; 23 | CVector m_vecCentreOfMass; 24 | void* m_pCollisionList; 25 | void* m_pMovingList; 26 | char m_nNumEntitiesCollided; 27 | unsigned char m_nContactSurface; 28 | char field_EA; 29 | CEntity* m_apCollidedEntities[6]; 30 | float m_fMovingSpeed; 31 | float m_fDamageIntensity; 32 | CEntity* m_pDamageEntity; 33 | CVector m_vecLastCollisionImpactVelocity; 34 | CVector m_vecLastCollisionPosn; 35 | unsigned short m_nPieceType; 36 | short field_FA; 37 | CPhysical* m_pAttachedTo; 38 | CVector m_vecAttachOffset; 39 | CVector m_vecAttachedEntityPosn; 40 | CQuaternion m_qAttachedEntityRotation; 41 | CEntity* m_pEntityIgnoredCollision; 42 | float m_fContactSurfaceBrightness; 43 | float m_dDynamicLighting; 44 | char field_190[8]; 45 | struct CRealTimeShadow* m_pShadowData; 46 | 47 | CPhysical(); 48 | void AddCollisionRecord(CEntity* collidedEntity); 49 | void AddToMovingList(); 50 | bool ApplyCollision(CEntity* entity, CColPoint& colPoint, float& arg2); 51 | void ApplyForce(CVector* dir, CVector* velocity, bool flag); 52 | void ApplyFriction(); 53 | void ApplySpeed(); 54 | void RemoveAndAdd(); 55 | void RemoveRefsToEntity(); 56 | }; 57 | -------------------------------------------------------------------------------- /include/CPlaceable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CSimpleTransform.h" 4 | #include "CMatrixLink.h" 5 | 6 | #pragma pack(push, 1) 7 | class CPlaceable { 8 | public: 9 | void* vtbl; 10 | CSimpleTransform m_SimpleCoors; 11 | CMatrixLink* m_pMatrix; 12 | 13 | CPlaceable(); 14 | void SetPosition(CVector const&); 15 | void SetPosition(float x, float y, float z); 16 | void SetOrientation(float x, float y, float z); 17 | CVector& GetPosition(); 18 | void SetHeading(float fAngle); 19 | float GetHeading(); 20 | void RemoveMatrix(); 21 | void AllocateStaticMatrix(); 22 | }; 23 | #pragma pack(pop) -------------------------------------------------------------------------------- /include/CPlane.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CAutomobile.h" 3 | 4 | class CPlane : public CAutomobile 5 | { 6 | public: 7 | CPlane(int nModexIndex, unsigned int nUsageType); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /include/CPlayerData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CPlayerData { 4 | public: 5 | char field_0[12]; 6 | struct CWanted* m_pWanted; 7 | char field_18[20]; 8 | char m_nChosenWeapon; 9 | char field_2D[24]; 10 | int m_dwPlayerFlags; 11 | int m_PlayerGroup; 12 | char field_50[16]; 13 | int m_MeleeWeaponAnimReferenced; 14 | int m_MeleeWeaponAnimReferencedExtra; 15 | char field_68[32]; 16 | }; -------------------------------------------------------------------------------- /include/CPlayerInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CPed.h" 3 | 4 | class CPlayerInfo { 5 | public: 6 | CPed* m_pPed; 7 | CPlayerData* m_pPlayerData; 8 | char field_28[200]; 9 | CVehicle* m_pRemoteVehicle; 10 | unsigned int m_pSpecCar; 11 | char field_E0[4]; 12 | int m_nMoneyCount; 13 | char field_100[20]; 14 | int m_nVehicleTimeCounter; 15 | char field_104[12]; 16 | char m_nPlayerState; 17 | char m_bAfterRemoteVehicleExplosion; 18 | char field_111[102]; 19 | unsigned short m_nNumHoursNotEating; 20 | char field_17A[9]; 21 | char m_nHealthSaved; 22 | char field_184[52]; 23 | unsigned char m_bParachuteModelLoaded; 24 | char field_1B9[3]; 25 | char m_nTimerForParachuteModel; 26 | }; -------------------------------------------------------------------------------- /include/CPlayerSkin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CPlayerSkin { 4 | public: 5 | static int &m_txdSlot; 6 | }; -------------------------------------------------------------------------------- /include/CPool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | union tPoolObjectFlags { 4 | struct { 5 | unsigned char nId : 7; 6 | bool bEmpty : 1; 7 | }; 8 | private: 9 | unsigned char nValue; 10 | 11 | public: 12 | unsigned char IntValue() { 13 | return nValue; 14 | } 15 | }; 16 | 17 | template 18 | class CPool { 19 | public: 20 | B* m_aStorage; 21 | tPoolObjectFlags* m_aFlags; 22 | int32_t m_nSize; 23 | int32_t m_nFreeIndex; 24 | bool m_bOwnsArrays; 25 | bool m_bDealWithNoMemory; 26 | 27 | public: 28 | CPool() { 29 | m_aStorage = nullptr; 30 | m_aFlags = nullptr; 31 | m_nSize = 0; 32 | m_bOwnsArrays = false; 33 | } 34 | 35 | CPool(int32_t nSize, const char* pPoolName) { 36 | m_aStorage = static_cast(operator new(sizeof(B) * nSize)); 37 | m_aFlags = static_cast(operator new(sizeof(tPoolObjectFlags) * nSize)); 38 | m_nSize = nSize; 39 | m_nFreeIndex = -1; 40 | m_bOwnsArrays = true; 41 | for (int32_t i = 0; i < nSize; ++i) { 42 | m_aFlags[i].bEmpty = true; 43 | m_aFlags[i].nId = 0; 44 | } 45 | } 46 | 47 | ~CPool() { 48 | Flush(); 49 | } 50 | 51 | void Init(int32_t nSize, void* pObjects, void* pInfos) { 52 | assert(this->m_aStorage == nullptr); 53 | m_aStorage = static_cast(pObjects); 54 | m_aFlags = static_cast(pInfos); 55 | m_nSize = nSize; 56 | m_nFreeIndex = -1; 57 | m_bOwnsArrays = false; 58 | for (int32_t i = 0; i < nSize; ++i) { 59 | m_aFlags[i].bEmpty = true; 60 | m_aFlags[i].nId = 0; 61 | } 62 | } 63 | 64 | void Flush() { 65 | if (m_bOwnsArrays) { 66 | operator delete(m_aStorage); 67 | operator delete(m_aFlags); 68 | } 69 | m_aStorage = nullptr; 70 | m_aFlags = nullptr; 71 | m_nSize = 0; 72 | m_nFreeIndex = 0; 73 | } 74 | 75 | void Clear() { 76 | for (int32_t i = 0; i < m_nSize; i++) 77 | m_aFlags[i].bEmpty = true; 78 | } 79 | 80 | bool IsFreeSlotAtIndex(int32_t idx) { 81 | return m_aFlags[idx].bEmpty; 82 | } 83 | 84 | int32_t GetIndex(A* pObject) { 85 | return std::int32_t(reinterpret_cast(pObject) - m_aStorage); 86 | } 87 | 88 | A* GetAt(int32_t nIndex) { 89 | return !IsFreeSlotAtIndex(nIndex) ? (A*)&m_aStorage[nIndex] : nullptr; 90 | } 91 | 92 | void SetFreeAt(int32_t idx, bool bFree) { 93 | m_aFlags[idx].bEmpty = bFree; 94 | } 95 | 96 | void SetIdAt(int32_t idx, uint8_t id) { 97 | m_aFlags[idx].nId = id; 98 | } 99 | 100 | uint8_t GetIdAt(int32_t idx) { 101 | return m_aFlags[idx].nId; 102 | } 103 | 104 | A* New() { 105 | bool bReachedTop = false; 106 | do { 107 | if (++m_nFreeIndex >= m_nSize) { 108 | if (bReachedTop) { 109 | m_nFreeIndex = -1; 110 | return nullptr; 111 | } 112 | bReachedTop = true; 113 | m_nFreeIndex = 0; 114 | } 115 | } while (!m_aFlags[m_nFreeIndex].bEmpty); 116 | m_aFlags[m_nFreeIndex].bEmpty = false; 117 | ++m_aFlags[m_nFreeIndex].nId; 118 | return &m_aStorage[m_nFreeIndex]; 119 | } 120 | 121 | void CreateAtRef(int32_t nRef) { 122 | nRef >>= 8; 123 | m_aFlags[nRef].bEmpty = false; 124 | ++m_aFlags[nRef].nId; 125 | m_nFreeIndex = 0; 126 | while (!m_aFlags[m_nFreeIndex].bEmpty) 127 | ++m_nFreeIndex; 128 | } 129 | 130 | A* New(int32_t nRef) { 131 | A* result = &m_aStorage[nRef >> 8]; 132 | CreateAtRef(nRef); 133 | return result; 134 | } 135 | 136 | void Delete(A* pObject) { 137 | int32_t nIndex = reinterpret_cast(pObject) - m_aStorage; 138 | m_aFlags[nIndex].bEmpty = true; 139 | if (nIndex < m_nFreeIndex) 140 | m_nFreeIndex = nIndex; 141 | } 142 | 143 | int32_t GetRef(A* pObject) { 144 | return (GetIndex(pObject) << 8) + m_aFlags[GetIndex(pObject)].IntValue(); 145 | } 146 | 147 | A* GetAtRef(int32_t ref) { 148 | int32_t nSlotIndex = ref >> 8; 149 | return nSlotIndex >= 0 && nSlotIndex < m_nSize && m_aFlags[nSlotIndex].IntValue() == (ref & 0xFF) ? reinterpret_cast(&m_aStorage[nSlotIndex]) : nullptr; 150 | } 151 | 152 | uint32_t GetNoOfUsedSpaces() { 153 | uint32_t counter = 0; 154 | for (int32_t i = 0; i < m_nSize; ++i) { 155 | if (!IsFreeSlotAtIndex(i)) 156 | ++counter; 157 | } 158 | return counter; 159 | } 160 | 161 | uint32_t GetNoOfFreeSpaces() { 162 | return m_nSize - GetNoOfUsedSpaces(); 163 | } 164 | 165 | uint32_t GetObjectSize() { 166 | return sizeof(B); 167 | } 168 | 169 | bool IsObjectValid(A* obj) { 170 | int32_t slot = GetIndex(obj); 171 | return slot >= 0 && slot < m_nSize && !IsFreeSlotAtIndex(slot); 172 | } 173 | }; -------------------------------------------------------------------------------- /include/CPools.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CPool.h" 3 | #include "CCutsceneObject.h" 4 | #include "CCopPed.h" 5 | #include "CHeli.h" 6 | #include "CPed.h" 7 | #include "CVehicle.h" 8 | #include "CObject.h" 9 | 10 | #ifdef GetObject 11 | #undef GetObject 12 | #endif 13 | 14 | typedef CPool CPedPool; 15 | typedef CPool CVehiclePool; 16 | typedef CPool CObjectPool; 17 | 18 | class CPools { 19 | public: 20 | static CPedPool*& ms_pPedPool; 21 | static CVehiclePool*& ms_pVehiclePool; 22 | static CObjectPool*& ms_pObjectPool; 23 | 24 | public: 25 | static CPed* GetPed(int32_t handle); 26 | static CVehicle* GetVehicle(int32_t handle); 27 | static CObject* GetObject(int32_t handle); 28 | static int32_t GetPedRef(CPed* ped); 29 | static int32_t GetVehicleRef(CVehicle* vehicle); 30 | static int32_t GetObjectRef(CObject* object); 31 | }; -------------------------------------------------------------------------------- /include/CPopulation.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CPopulation { 4 | public: 5 | static int &NumMiamiViceCops; 6 | }; -------------------------------------------------------------------------------- /include/CQuadBike.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CAutomobile.h" 3 | 4 | class CQuadBike : public CAutomobile 5 | { 6 | public: 7 | CQuadBike(int nModelIndex, char nUsageType); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /include/CQuaternion.h: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto San Andreas) header file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | Do not delete this comment block. Respect others' work! 6 | */ 7 | #pragma once 8 | 9 | #include "CVector.h" 10 | 11 | class CQuaternion { 12 | public: 13 | CVector imag; 14 | float real; 15 | 16 | // Quat to euler angles 17 | void Get(float* x, float* y, float* z); 18 | 19 | // Stores result of quat multiplication 20 | void Multiply(CQuaternion const& a, CQuaternion const& b); 21 | 22 | // Spherical linear interpolation 23 | void Slerp(CQuaternion const& from, CQuaternion const& to, float halftheta, float sintheta_inv, float t); 24 | 25 | // Quat from euler angles 26 | void Set(float x, float y, float z); 27 | 28 | // Spherical linear interpolation 29 | void Slerp(CQuaternion const& from, CQuaternion const& to, float t); 30 | 31 | // Conjugate of a quat 32 | void Conjugate(); 33 | 34 | // Squared length of a quat 35 | float GetLengthSquared(void); 36 | 37 | // Add right to the quat 38 | void operator+=(CQuaternion const& right); 39 | 40 | // Substract right from the quat 41 | void operator-=(CQuaternion const& right); 42 | 43 | // Assigns value from other quat 44 | void operator=(CQuaternion const& right); 45 | 46 | // Multiplies quat by a floating point value 47 | void operator*=(float multiplier); 48 | 49 | // Multiplies quat by a floating point value 50 | void Scale(float multiplier); 51 | 52 | // Copies value from other quat 53 | void Copy(CQuaternion const& from); 54 | 55 | // Gets a dot product for quats 56 | void Dot(CQuaternion const& a); 57 | 58 | // Normalises a quat 59 | void Normalise(); 60 | }; -------------------------------------------------------------------------------- /include/CQueuedMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma pack(push, 1) 4 | class CQueuedMode 5 | { 6 | public: 7 | short Mode; 8 | short __padding0; 9 | float Duration; 10 | short MinZoom; 11 | short MaxZoom; 12 | }; 13 | #pragma pack(pop) 14 | -------------------------------------------------------------------------------- /include/CRGBA.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CRGBA { 4 | public: 5 | unsigned char r; 6 | unsigned char g; 7 | unsigned char b; 8 | unsigned char a; 9 | 10 | CRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); 11 | void SetRGBAValue(unsigned char nColorId, unsigned char r, unsigned char g, unsigned char b, unsigned char a); 12 | }; -------------------------------------------------------------------------------- /include/CRadar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CVector.h" 4 | 5 | enum eBlipDisplay 6 | { 7 | BLIP_DISPLAY_NEITHER, // 0 8 | BLIP_DISPLAY_MARKER_ONLY, // 1 9 | BLIP_DISPLAY_BLIP_ONLY, // 2 10 | BLIP_DISPLAY_BOTH // 3 11 | }; 12 | 13 | 14 | enum eBlipType 15 | { 16 | BLIP_NONE, // 0 17 | BLIP_CAR, // 1 18 | BLIP_CHAR, // 2 19 | BLIP_OBJECT, // 3 20 | BLIP_COORD, // 4 - Checkpoint. 21 | BLIP_CONTACTPOINT, // 5 - Sphere. 22 | BLIP_SPOTLIGHT, // 6 23 | BLIP_PICKUP, // 7 24 | BLIP_AIRSTRIP // 8 25 | }; 26 | 27 | struct tRadarTrace 28 | { 29 | unsigned int m_nColour; 30 | unsigned int m_nEntityHandle; 31 | CVector m_vecPos; 32 | unsigned short m_nCounter; 33 | float m_fSphereRadius; 34 | unsigned short m_nBlipSize; 35 | struct CEntryExit* m_pEntryExit; 36 | unsigned short m_nRadarSprite; 37 | unsigned char m_bBright : 1; 38 | unsigned char m_bInUse : 1; 39 | unsigned char m_bShortRange : 1; 40 | unsigned char m_bFriendly : 1; 41 | unsigned char m_bBlipRemain : 1; 42 | unsigned char m_bBlipFade : 1; 43 | unsigned char m_nCoordBlipAppearance : 2; 44 | unsigned char m_nBlipDisplay : 2; 45 | unsigned char m_nBlipType : 4; 46 | }; 47 | 48 | 49 | class CRadar { 50 | public: 51 | static tRadarTrace* ms_RadarTrace; 52 | 53 | static int SetCoordBlip(eBlipType type, CVector* pPos, int nColor, eBlipDisplay display); 54 | static void SetBlipSprite(int nBlip, char nSpriteId); 55 | static void ChangeBlipDisplay(int blipIndex, eBlipDisplay blipDisplay); 56 | static void ChangeBlipScale(int blipIndex, int size); 57 | static void ClearBlip(int blipIndex); 58 | static void ClearBlipForEntity(eBlipType blipType, int entityHandle); 59 | static void Draw3dMarkers(); 60 | static void DrawBlips(bool a1); 61 | static void DrawCoordBlip(int blipArrId, unsigned char isSprite); 62 | static void DrawEntityBlip(int blipArrId, unsigned char arg1); 63 | static void DrawMap(); 64 | static void DrawRadarMap(); 65 | static int GetActualBlipArrayIndex(int blipIndex); 66 | static bool HasThisBlipBeenRevealed(int blipArrId); 67 | static void Initialise(); 68 | static void Load(); 69 | static int SetEntityBlip(eBlipType type, int entityHandle, int a3, eBlipDisplay display); 70 | static void SetupAirstripBlips(); 71 | }; -------------------------------------------------------------------------------- /include/CRect.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CRect { 4 | public: 5 | int left; 6 | int top; 7 | int right; 8 | int bottom; 9 | }; -------------------------------------------------------------------------------- /include/CReference.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CReference 4 | { 5 | public: 6 | class CReference* m_pNext; 7 | class CEntity** m_ppEntity; 8 | }; -------------------------------------------------------------------------------- /include/CRunningScript.h: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto San Andreas) header file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | Do not delete this comment block. Respect others' work! 6 | Не удалили 7 | */ 8 | #pragma once 9 | #include "memory.hpp" 10 | 11 | #ifndef CRUNNINGSCRIPT_H 12 | #define CRUNNINGSCRIPT_H 13 | 14 | enum eScriptParameterType { 15 | SCRIPTPARAM_END_OF_ARGUMENTS, 16 | SCRIPTPARAM_STATIC_INT_32BITS, 17 | SCRIPTPARAM_GLOBAL_NUMBER_VARIABLE, 18 | SCRIPTPARAM_LOCAL_NUMBER_VARIABLE, 19 | SCRIPTPARAM_STATIC_INT_8BITS, 20 | SCRIPTPARAM_STATIC_INT_16BITS, 21 | SCRIPTPARAM_STATIC_FLOAT, 22 | SCRIPTPARAM_GLOBAL_NUMBER_ARRAY, 23 | SCRIPTPARAM_LOCAL_NUMBER_ARRAY, 24 | SCRIPTPARAM_STATIC_SHORT_STRING, 25 | SCRIPTPARAM_GLOBAL_SHORT_STRING_VARIABLE, 26 | SCRIPTPARAM_LOCAL_SHORT_STRING_VARIABLE, 27 | SCRIPTPARAM_GLOBAL_SHORT_STRING_ARRAY, 28 | SCRIPTPARAM_LOCAL_SHORT_STRING_ARRAY, 29 | SCRIPTPARAM_STATIC_PASCAL_STRING, 30 | SCRIPTPARAM_STATIC_LONG_STRING, 31 | SCRIPTPARAM_GLOBAL_LONG_STRING_VARIABLE, 32 | SCRIPTPARAM_LOCAL_LONG_STRING_VARIABLE, 33 | SCRIPTPARAM_GLOBAL_LONG_STRING_ARRAY, 34 | SCRIPTPARAM_LOCAL_LONG_STRING_ARRAY, 35 | }; 36 | 37 | enum eButtonID { 38 | BUTTON_LEFT_STICK_X, 39 | BUTTON_LEFT_STICK_Y, 40 | BUTTON_RIGHT_STICK_X, 41 | BUTTON_RIGHT_STICK_Y, 42 | BUTTON_LEFT_SHOULDER1, 43 | BUTTON_LEFT_SHOULDER2, 44 | BUTTON_RIGHT_SHOULDER1, 45 | BUTTON_RIGHT_SHOULDER2, 46 | BUTTON_DPAD_UP, 47 | BUTTON_DPAD_DOWN, 48 | BUTTON_DPAD_LEFT, 49 | BUTTON_DPAD_RIGHT, 50 | BUTTON_START, 51 | BUTTON_SELECT, 52 | BUTTON_SQUARE, 53 | BUTTON_TRIANGLE, 54 | BUTTON_CROSS, 55 | BUTTON_CIRCLE, 56 | BUTTON_LEFTSHOCK, 57 | BUTTON_RIGHTSHOCK, 58 | }; 59 | 60 | union tScriptParam { 61 | uint32_t uParam; 62 | int32_t iParam; 63 | float fParam; 64 | void* pParam; 65 | uint8_t* szParam; 66 | }; 67 | 68 | class CRunningScript { 69 | public: 70 | CRunningScript* pNext; 71 | CRunningScript* m_pPrev; 72 | char m_szName[8]; 73 | uint8_t* m_pBaseIP; 74 | uint8_t* m_pCurrentIP; 75 | uint8_t* m_apStack[8]; 76 | uint16_t m_nSP; 77 | int32_t m_aLocalVars[42]; 78 | uint8_t m_bIsActive; 79 | uint8_t m_bCondResult; 80 | uint8_t m_bUseMissionCleanup; 81 | uint8_t m_bIsExternal; 82 | uint8_t m_bTextBlockOverride; 83 | int8_t m_nScriptBrainType; 84 | uint32_t m_nWakeTime; 85 | uint16_t m_nLogicalOp; 86 | uint8_t m_bNotFlag; 87 | uint8_t m_bWastedBustedCheck; 88 | uint8_t m_bWastedOrBusted; 89 | int32_t m_nEndOfScriptedCutscenePC; 90 | uint8_t m_bIsMission; 91 | char field_130[611]; 92 | unsigned __int16 field_390; 93 | 94 | void ProcessOneCommand(); 95 | void Init(); 96 | }; 97 | 98 | #endif // CRUNNINGSCRIPT_H -------------------------------------------------------------------------------- /include/CSimpleTransform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | 4 | class CSimpleTransform 5 | { 6 | public: 7 | CSimpleTransform(); 8 | CVector m_vPosn; 9 | float m_fAngle; 10 | }; -------------------------------------------------------------------------------- /include/CSprite2d.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CSprite2d { 4 | public: 5 | }; -------------------------------------------------------------------------------- /include/CStreaming.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | #include "CStreamingInfo.h" 4 | 5 | class CStreaming { 6 | public: 7 | static int *copModelByTown; // static int copModelByTown[4] 8 | static CStreamingInfo *ms_aInfoForModel; 9 | 10 | static void LoadAllRequestedModels(); 11 | static void RequestModel(int nModel, int nFlags); 12 | static void LoadScene(CVector const* vPos); 13 | static void RequestSpecialModel(int nModel, const char* szTxdName, int nFlags); 14 | static void SetModelIsDeletable(int nModel); 15 | static void SetMissionDoesntRequireModel(int nModel); 16 | static void RemoveInappropriatePedModels(); 17 | static void Update(); 18 | static void RemoveModel(int nModel); 19 | 20 | }; -------------------------------------------------------------------------------- /include/CStreamingInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum eStreamingFlags { 4 | GAME_REQUIRED = 0x2, 5 | MISSION_REQUIRED = 0x4, 6 | KEEP_IN_MEMORY = 0x8, 7 | PRIORITY_REQUEST = 0x10, 8 | SCM_COMMAND_FLAG = 0x0C 9 | }; 10 | 11 | enum eStreamingLoadState { 12 | LOADSTATE_NOT_LOADED = 0, 13 | LOADSTATE_LOADED = 1, 14 | LOADSTATE_Requested = 2, 15 | LOADSTATE_Channeled = 3, 16 | LOADSTATE_Finishing = 4 17 | }; 18 | 19 | class CStreamingInfo { 20 | public: 21 | char field_0; 22 | char field_1; 23 | char field_2; 24 | char field_3; 25 | char field_4; 26 | char field_5; 27 | char field_6; 28 | char field_7; 29 | __int16 m_nNextIndex; 30 | __int16 m_nPrevIndex; 31 | char m_nFlags; 32 | char m_nLoadState; 33 | char field_E; 34 | char field_F; 35 | }; -------------------------------------------------------------------------------- /include/CTheScripts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CEntity.h" 3 | 4 | class CTheScripts { 5 | public: 6 | static unsigned short& CommandsExecuted; 7 | 8 | static void ClearSpaceForMissionEntity(const CVector& m_pPos, CEntity* pEntity); 9 | }; -------------------------------------------------------------------------------- /include/CTheZones.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CTheZones { 4 | public: 5 | static int &m_CurrLevel; 6 | }; -------------------------------------------------------------------------------- /include/CTimer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CTimer { 4 | public: 5 | static unsigned int& m_snPreviousTimeInMilliseconds; 6 | static unsigned int& m_snTimeInMillisecondsNonClipped; 7 | static unsigned int& m_snTimeInMilliseconds; 8 | 9 | static void Update(); 10 | static unsigned int GetCurrentTimeInCycles(); 11 | }; -------------------------------------------------------------------------------- /include/CTrailer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CAutomobile.h" 3 | 4 | class CTrailer : public CAutomobile 5 | { 6 | public: 7 | CTrailer(int nModelIndex, unsigned char nUsageType); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /include/CTxdStore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CTxdStore { 4 | public: 5 | char RemoveTxdSlot(int index); 6 | }; -------------------------------------------------------------------------------- /include/CVector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CVector { 4 | public: 5 | float x; 6 | float y; 7 | float z; 8 | 9 | CVector(); 10 | CVector(float x, float y, float z); 11 | }; -------------------------------------------------------------------------------- /include/CVector2D.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CVector2D { 4 | public: 5 | float x; 6 | float y; 7 | }; -------------------------------------------------------------------------------- /include/CVehicle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CPhysical.h" 4 | #include "CPed.h" 5 | #include "CAutopilot.h" 6 | 7 | enum eDoorLock : unsigned int { 8 | DOORLOCK_NOT_USED, 9 | DOORLOCK_UNLOCKED, 10 | DOORLOCK_LOCKED, 11 | DOORLOCK_LOCKOUT_PLAYER_ONLY, 12 | DOORLOCK_LOCKED_PLAYER_INSIDE, 13 | DOORLOCK_COP_CAR, 14 | DOORLOCK_FORCE_SHUT_DOORS, 15 | DOORLOCK_SKIP_SHUT_DOORS 16 | }; 17 | 18 | class CVehicle : public CPhysical { 19 | public: 20 | char field_0[824]; 21 | struct tHandlingData* m_pHandlingData; 22 | char field_4E0[8]; 23 | unsigned int m_nHandlingFlags; 24 | CAutopilot m_tAutopilot; 25 | unsigned __int8 m_nFlags[8]; 26 | unsigned int m_nCreationTime; 27 | char m_nPrimaryColor; 28 | char m_nSecondaryColor; 29 | char m_nTertiaryColor; 30 | char m_nQuaternaryColor; 31 | char m_anExtras[2]; 32 | char field_5AA[38]; 33 | CPed* m_pDriver; 34 | CPed* m_apPassengers[8]; 35 | unsigned __int8 m_nNumPassengers; 36 | char field_619[3]; 37 | unsigned __int8 m_nMaxPassengers; 38 | char field_61D[1]; 39 | unsigned __int8 m_nNitroBoosts; 40 | char field_61F[17]; 41 | float m_fSteerAngle; 42 | float m_f2ndSteerAngle; 43 | float m_fGasPedal; 44 | float m_fBreakPedal; 45 | char field_63C[96]; 46 | unsigned __int8 m_nCreatedBy; 47 | char field_6A1[6]; 48 | unsigned __int8 m_nAmmoInClip; 49 | char field_6A8[4]; 50 | float m_fDirtLevel; 51 | char field_6B0[8]; 52 | float m_fHealth; 53 | char field_6BC[36]; 54 | int m_dwTimeTillWeNeedThisCar; 55 | unsigned int m_dwGunFiringTime; 56 | char field_6E4[36]; 57 | eDoorLock m_eDoorLock; 58 | char field_710[8]; 59 | char m_nLastWeaponDamageType; 60 | char field_71D[52]; 61 | char field_5B8[63]; 62 | int m_anCollisionLighting; 63 | char field_790[32]; 64 | int m_nVehicleClass; 65 | unsigned int m_dwVehicleSubClass; 66 | 67 | CVehicle(); 68 | void SetModelIndex(int nModel); 69 | }; -------------------------------------------------------------------------------- /include/CVehicleModelInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CClumpModelInfo.h" 3 | 4 | enum eVehicleType { 5 | VEHICLE_AUTOMOBILE, 6 | VEHICLE_MTRUCK, 7 | VEHICLE_QUAD, 8 | VEHICLE_HELI, 9 | VEHICLE_PLANE, 10 | VEHICLE_BOAT, 11 | VEHICLE_TRAIN, 12 | VEHICLE_FHELI, 13 | VEHICLE_FPLANE, 14 | VEHICLE_BIKE, 15 | VEHICLE_BMX, 16 | VEHICLE_TRAILER 17 | }; 18 | 19 | enum VehicleUpgradePosn { 20 | UPGRADE_BONNET, 21 | UPGRADE_BONNET_LEFT, 22 | UPGRADE_BONNET_RIGHT, 23 | UPGRADE_BONNET_DAM, 24 | UPGRADE_BONNET_LEFT_DAM, 25 | UPGRADE_BONNET_RIGHT_DAM, 26 | UPGRADE_SPOILER, 27 | UPGRADE_SPOILER_DAM, 28 | UPGRADE_WING_LEFT, 29 | UPGRADE_WING_RIGHT, 30 | UPGRADE_FRONTBULLBAR, 31 | UPGRADE_BACKBULLBAR, 32 | UPGRADE_LIGHTS, 33 | UPGRADE_LIGHTS_DAM, 34 | UPGRADE_ROOF, 35 | UPGRADE_NITRO, 36 | }; 37 | 38 | class CVehicleModelInfo : public CClumpModelInfo 39 | { 40 | public: 41 | unsigned __int16 m_nMdlFlags; 42 | char field_2C[40]; 43 | char m_szGameName[8]; 44 | char field_82[2]; 45 | eVehicleType m_nVehicleType; 46 | float m_fWheelSizeFront; 47 | float m_fWheelSizeRear; 48 | char field_90[2]; 49 | unsigned __int16 m_nHandlingId; 50 | char field_94; 51 | unsigned __int8 m_nVehicleClass; 52 | unsigned __int8 m_nFlags; 53 | unsigned __int8 m_nWheelUpgradeClass; 54 | char field_98[2]; 55 | __int16 m_wFrq; 56 | int m_nComprules; 57 | float m_fBikeSteerAngle; 58 | char field_A4[50]; 59 | }; 60 | 61 | -------------------------------------------------------------------------------- /include/CWeapon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "eWeaponType.h" 3 | #include "CVector.h" 4 | #include "CVector2D.h" 5 | 6 | class CPed; 7 | class CEntity; 8 | 9 | class CWeapon 10 | { 11 | public: 12 | int m_nType; 13 | int m_nState; 14 | int m_nAmmoInClip; 15 | int m_nTotalAmmo; 16 | int m_nShotTimer; 17 | char field_14; 18 | char m_bNoModel; 19 | char field_16; 20 | char field_17; 21 | char field_18[16]; 22 | 23 | void Update(CPed* pPed); 24 | bool TakePhotograph(CEntity *entity, CVector *point); 25 | bool Fire(CEntity *firingEntity, CVector *origin, CVector *muzzlePosn, CEntity *targetEntity, CVector *target, CVector *originForDriveBy); 26 | void AddGunshell(CEntity *entity, CVector *position, CVector2D *direction, float size); 27 | }; -------------------------------------------------------------------------------- /include/CWeaponInfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | #include "eWeaponType.h" 4 | 5 | class CWeaponInfo 6 | { 7 | public: 8 | int m_eFireType; 9 | float targetRange; 10 | float m_fWeaponRange; 11 | int dwModelId1; 12 | int dwModelId2; 13 | int nSlot; 14 | int m_nFlags; 15 | int AssocGroupId; 16 | short ammoClip; 17 | short damage; 18 | CVector fireOffset; 19 | int skillLevel; 20 | int reqStatLevelToGetThisWeaponSkilLevel; 21 | float m_fAccuracy; 22 | float moveSpeed; 23 | float animLoopStart; 24 | float animLoopEnd; 25 | int animLoopFire; 26 | int animLoop2Start; 27 | int animLoop2End; 28 | int animLoop2Fire; 29 | float breakoutTime; 30 | float speed; 31 | int radius; 32 | float lifespan; 33 | float spread; 34 | char AssocGroupId2; 35 | char field_6D; 36 | char baseCombo; 37 | char m_nNumCombos; 38 | 39 | static CWeaponInfo* GetWeaponInfo(eWeaponType nWeapon, char nSkill); 40 | }; 41 | 42 | -------------------------------------------------------------------------------- /include/CWeather.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CWeather { 4 | public: 5 | static float &Sandstorm; 6 | static float &UnderWaterness; 7 | static short &ForcedWeatherType; 8 | static short &NewWeatherType; 9 | static short &OldWeatherType; 10 | 11 | static void ForceWeatherNow(short weatherType); 12 | }; -------------------------------------------------------------------------------- /include/CWorld.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CPlayerInfo.h" 3 | 4 | class CWorld { 5 | public: 6 | static char& PlayerInFocus; 7 | static CPlayerInfo* Players; 8 | 9 | static void Process(); 10 | static void Add(CEntity* pEntity); 11 | static bool GetIsLineOfSightClear(const CVector *origin, const CVector *target, bool buildings, bool vehicles, bool peds, bool objects, bool dummies, bool doSeeThroughCheck, bool doIgnoreCameraCheck); 12 | static bool ProcessLineOfSight(const CVector *origin, const CVector *target, CColPoint *outColPoint, CEntity **outEntity, bool buildings, bool vehicles, bool peds, bool objects, bool dummies, bool doSeeThroughCheck, bool doCameraIgnoreCheck, bool doShootThroughCheck); 13 | }; -------------------------------------------------------------------------------- /include/FxPrtMult_c.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class FxPrtMult_c { 4 | public: 5 | 6 | }; -------------------------------------------------------------------------------- /include/FxSystemBP_c.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class FxSystemBP_c { 4 | public: 5 | 6 | }; -------------------------------------------------------------------------------- /include/FxSystem_c.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CVector.h" 3 | #include "FxPrtMult_c.h" 4 | #include "FxSystemBP_c.h" 5 | 6 | class FxSystem_c { 7 | public: 8 | void AddParticle(CVector *position, CVector *velocity, float unk, FxPrtMult_c *particleData, float a1, float brightness, float a2, int a3); 9 | FxSystemBP_c* Kill(); 10 | void Stop(); 11 | FxSystemBP_c* PlayAndKill(); 12 | }; -------------------------------------------------------------------------------- /include/ScriptCommands.h: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto) SHARED header file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | Do not delete this comment block. Respect others' work! 6 | */ 7 | #pragma once 8 | 9 | #include 10 | #include 11 | 12 | #include "ScriptCommandNames.h" 13 | #include "CRunningScript.h" 14 | 15 | class CPed; 16 | class CVehicle; 17 | class CObject; 18 | 19 | class scripting { 20 | 21 | public: 22 | enum ScriptCommandEndParameter { 23 | END_PARAMETER 24 | }; 25 | 26 | private: 27 | 28 | enum ScriptResultVarType { 29 | SCRIPT_RESULT_VAR_NUMBER, 30 | SCRIPT_RESULT_VAR_STRING, 31 | SCRIPT_RESULT_VAR_PED, 32 | SCRIPT_RESULT_VAR_VEHICLE, 33 | SCRIPT_RESULT_VAR_OBJECT 34 | }; 35 | 36 | class ScriptCode { 37 | unsigned char* data; 38 | unsigned int capacity; 39 | unsigned int size; 40 | 41 | struct VarToSet { 42 | unsigned int varIndex; 43 | void* pVar; 44 | ScriptResultVarType varType; 45 | 46 | VarToSet(unsigned int _varIndex, void* _pVar, ScriptResultVarType _varType); 47 | }; 48 | 49 | std::vector varsToSet; 50 | unsigned short varIndexCounter; 51 | 52 | public: 53 | ScriptCode(short commandId = -1); 54 | ~ScriptCode(); 55 | void AddParameterDescription(unsigned char paramType); 56 | void AddBytes(unsigned char* bytes, unsigned int count); 57 | unsigned char* GetData(); 58 | 59 | void SaveResultVariables(CRunningScript* script); 60 | void operator<<(char n); 61 | void operator<<(unsigned char n); 62 | void operator<<(short n); 63 | void operator<<(unsigned short n); 64 | void operator<<(int n); 65 | void operator<<(unsigned int n); 66 | void operator<<(float n); 67 | void operator<<(double n); 68 | void operator<<(ScriptCommandEndParameter); 69 | void operator<<(char* str); 70 | void operator<<(const char * str); 71 | void operator<<(float* p); 72 | void operator<<(int* p); 73 | void operator<<(unsigned int* p); 74 | void operator<<(CPed* n); 75 | void operator<<(CVehicle* n); 76 | void operator<<(CObject* n); 77 | void operator<<(CPed** p); 78 | void operator<<(CVehicle** p); 79 | void operator<<(CObject** p); 80 | 81 | template 82 | void Pack(T value) { 83 | operator<<(value); 84 | } 85 | 86 | template 87 | void Pack(First firstValue, Rest... rest) { 88 | Pack(firstValue); 89 | Pack(rest...); 90 | } 91 | 92 | void Pack() {} 93 | }; 94 | 95 | public: 96 | 97 | template 98 | static bool CallCommandById(unsigned int commandId, ArgTypes... arguments) { 99 | // create our 'script' object 100 | static CRunningScript script{}; 101 | memset(&script, 0, sizeof(CRunningScript)); 102 | script.Init(); 103 | strcpy(script.m_szName, "t-ldr"); 104 | script.m_bIsMission = false; 105 | script.m_bUseMissionCleanup = false; 106 | script.m_bNotFlag = (commandId >> 15) & 1; 107 | // our script code 108 | ScriptCode code(commandId); 109 | // for all arguments: add them to script code 110 | code.Pack(arguments...); 111 | script.m_pBaseIP = script.m_pCurrentIP = code.GetData(); 112 | script.ProcessOneCommand(); 113 | code.SaveResultVariables(&script); 114 | return script.m_bCondResult ? true : false; 115 | } 116 | 117 | 118 | }; 119 | 120 | template 121 | bool Command(ArgTypes... arguments) { 122 | return scripting::CallCommandById(static_cast(CommandId) - 0x10000, arguments...); 123 | } 124 | 125 | template 126 | bool Command(ArgTypes... arguments) { 127 | return scripting::CallCommandById(CommandId, arguments...); 128 | } -------------------------------------------------------------------------------- /include/eCamMode.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum eCamMode : unsigned short 4 | { 5 | MODE_NONE = 0x0, 6 | MODE_TOPDOWN = 0x1, 7 | MODE_GTACLASSIC = 0x2, 8 | MODE_BEHINDCAR = 0x3, 9 | MODE_FOLLOWPED = 0x4, 10 | MODE_AIMING = 0x5, 11 | MODE_DEBUG = 0x6, 12 | MODE_SNIPER = 0x7, 13 | MODE_ROCKETLAUNCHER = 0x8, 14 | MODE_MODELVIEW = 0x9, 15 | MODE_BILL = 0xA, 16 | MODE_SYPHON = 0xB, 17 | MODE_CIRCLE = 0xC, 18 | MODE_CHEESYZOOM = 0xD, 19 | MODE_WHEELCAM = 0xE, 20 | MODE_FIXED = 0xF, 21 | MODE_1STPERSON = 0x10, 22 | MODE_FLYBY = 0x11, 23 | MODE_CAM_ON_A_STRING = 0x12, 24 | MODE_REACTION = 0x13, 25 | MODE_FOLLOW_PED_WITH_BIND = 0x14, 26 | MODE_CHRIS = 0x15, 27 | MODE_BEHINDBOAT = 0x16, 28 | MODE_PLAYER_FALLEN_WATER = 0x17, 29 | MODE_CAM_ON_TRAIN_ROOF = 0x18, 30 | MODE_CAM_RUNNING_SIDE_TRAIN = 0x19, 31 | MODE_BLOOD_ON_THE_TRACKS = 0x1A, 32 | MODE_IM_THE_PASSENGER_WOOWOO = 0x1B, 33 | MODE_SYPHON_CRIM_IN_FRONT = 0x1C, 34 | MODE_PED_DEAD_BABY = 0x1D, 35 | MODE_PILLOWS_PAPS = 0x1E, 36 | MODE_LOOK_AT_CARS = 0x1F, 37 | MODE_ARRESTCAM_ONE = 0x20, 38 | MODE_ARRESTCAM_TWO = 0x21, 39 | MODE_M16_1STPERSON = 0x22, 40 | MODE_SPECIAL_FIXED_FOR_SYPHON = 0x23, 41 | MODE_FIGHT_CAM = 0x24, 42 | MODE_TOP_DOWN_PED = 0x25, 43 | MODE_LIGHTHOUSE = 0x26, 44 | MODE_SNIPER_RUNABOUT = 0x27, 45 | MODE_ROCKETLAUNCHER_RUNABOUT = 0x28, 46 | MODE_1STPERSON_RUNABOUT = 0x29, 47 | MODE_M16_1STPERSON_RUNABOUT = 0x2A, 48 | MODE_FIGHT_CAM_RUNABOUT = 0x2B, 49 | MODE_EDITOR = 0x2C, 50 | MODE_HELICANNON_1STPERSON = 0x2D, 51 | MODE_CAMERA = 0x2E, 52 | MODE_ATTACHCAM = 0x2F, 53 | MODE_TWOPLAYER = 0x30, 54 | MODE_TWOPLAYER_IN_CAR_AND_SHOOTING = 0x31, 55 | MODE_TWOPLAYER_SEPARATE_CARS = 0x32, 56 | MODE_ROCKETLAUNCHER_HS = 0x33, 57 | MODE_ROCKETLAUNCHER_RUNABOUT_HS = 0x34, 58 | MODE_AIMWEAPON = 0x35, 59 | MODE_TWOPLAYER_SEPARATE_CARS_TOPDOWN = 0x36, 60 | MODE_AIMWEAPON_FROMCAR = 0x37, 61 | MODE_DW_HELI_CHASE = 0x38, 62 | MODE_DW_CAM_MAN = 0x39, 63 | MODE_DW_BIRDY = 0x3A, 64 | MODE_DW_PLANE_SPOTTER = 0x3B, 65 | MODE_DW_DOG_FIGHT = 0x3C, 66 | MODE_DW_FISH = 0x3D, 67 | MODE_DW_PLANECAM1 = 0x3E, 68 | MODE_DW_PLANECAM2 = 0x3F, 69 | MODE_DW_PLANECAM3 = 0x40, 70 | MODE_AIMWEAPON_ATTACHED = 0x41, 71 | }; 72 | -------------------------------------------------------------------------------- /include/eCopType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum eCopType : unsigned __int32 4 | { 5 | COP_TYPE_CITYCOP = 0x0, 6 | COP_TYPE_LAPDM1 = 0x1, 7 | COP_TYPE_SWAT1 = 0x2, 8 | COP_TYPE_SWAT2 = 0x3, 9 | COP_TYPE_FBI = 0x4, 10 | COP_TYPE_ARMY = 0x5, 11 | COP_TYPE_CSHER = 0x7, 12 | }; 13 | -------------------------------------------------------------------------------- /include/eWeaponType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum eWeaponType : __int32 4 | { 5 | WEAPON_UNARMED = 0x0, 6 | WEAPON_BRASSKNUCKLE = 0x1, 7 | WEAPON_GOLFCLUB = 0x2, 8 | WEAPON_NIGHTSTICK = 0x3, 9 | WEAPON_KNIFE = 0x4, 10 | WEAPON_BASEBALLBAT = 0x5, 11 | WEAPON_SHOVEL = 0x6, 12 | WEAPON_POOLCUE = 0x7, 13 | WEAPON_KATANA = 0x8, 14 | WEAPON_CHAINSAW = 0x9, 15 | WEAPON_DILDO1 = 0xA, 16 | WEAPON_DILDO2 = 0xB, 17 | WEAPON_VIBE1 = 0xC, 18 | WEAPON_VIBE2 = 0xD, 19 | WEAPON_FLOWERS = 0xE, 20 | WEAPON_CANE = 0xF, 21 | WEAPON_GRENADE = 0x10, 22 | WEAPON_TEARGAS = 0x11, 23 | WEAPON_MOLOTOV = 0x12, 24 | WEAPON_ROCKET = 0x13, 25 | WEAPON_ROCKET_HS = 0x14, 26 | WEAPON_FREEFALL_BOMB = 0x15, 27 | WEAPON_PISTOL = 0x16, 28 | WEAPON_PISTOL_SILENCED = 0x17, 29 | WEAPON_DESERT_EAGLE = 0x18, 30 | WEAPON_SHOTGUN = 0x19, 31 | WEAPON_SAWNOFF = 0x1A, 32 | WEAPON_SPAS12 = 0x1B, 33 | WEAPON_MICRO_UZI = 0x1C, 34 | WEAPON_MP5 = 0x1D, 35 | WEAPON_AK47 = 0x1E, 36 | WEAPON_M4 = 0x1F, 37 | WEAPON_TEC9 = 0x20, 38 | WEAPON_COUNTRYRIFLE = 0x21, 39 | WEAPON_SNIPERRIFLE = 0x22, 40 | WEAPON_RLAUNCHER = 0x23, 41 | WEAPON_RLAUNCHER_HS = 0x24, 42 | WEAPON_FTHROWER = 0x25, 43 | WEAPON_MINIGUN = 0x26, 44 | WEAPON_SATCHEL_CHARGE = 0x27, 45 | WEAPON_DETONATOR = 0x28, 46 | WEAPON_SPRAYCAN = 0x29, 47 | WEAPON_EXTINGUISHER = 0x2A, 48 | WEAPON_CAMERA = 0x2B, 49 | WEAPON_NIGHTVISION = 0x2C, 50 | WEAPON_INFRARED = 0x2D, 51 | WEAPON_PARACHUTE = 0x2E, 52 | WEAPON_UNUSED = 0x2F, 53 | WEAPON_ARMOUR = 0x30, 54 | WEAPON_FLARE = 0x3A, 55 | }; 56 | -------------------------------------------------------------------------------- /include/memory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "CRect.h" 9 | 10 | namespace memory 11 | { 12 | static std::uintptr_t GetBase(void) 13 | { 14 | return reinterpret_cast(GetModuleHandleA(NULL)); 15 | } 16 | 17 | static std::uintptr_t GetAddr(std::uintptr_t addr) 18 | { 19 | return GetBase() + addr; 20 | } 21 | 22 | template 23 | static RetnType GtaCall(std::uintptr_t addr, Args... args) 24 | { 25 | return reinterpret_cast(GetAddr(addr))(args...); 26 | } 27 | 28 | template 29 | static Type Read(std::uintptr_t addr) { 30 | DWORD newProtect; 31 | VirtualProtect((void*)(addr), sizeof(Type), PAGE_EXECUTE_READWRITE, &newProtect); 32 | Type value = *reinterpret_cast((addr)); 33 | VirtualProtect((void*)(addr), sizeof(Type), newProtect, &newProtect); 34 | return value; 35 | } 36 | 37 | template 38 | static void Write(std::uintptr_t addr, Type value) { 39 | DWORD newProtect; 40 | VirtualProtect((void*)(addr), sizeof(Type), PAGE_EXECUTE_READWRITE, &newProtect); 41 | *reinterpret_cast((addr)) = value; 42 | VirtualProtect((void*)(addr), sizeof(Type), newProtect, &newProtect); 43 | } 44 | 45 | static void WriteBytes(std::uintptr_t addr, std::vector bytes) 46 | { 47 | DWORD newProtect; 48 | VirtualProtect((void*)(addr), bytes.size(), PAGE_EXECUTE_READWRITE, &newProtect); 49 | memcpy(reinterpret_cast(addr), bytes.data(), bytes.size()); 50 | VirtualProtect((void*)(addr), bytes.size(), newProtect, &newProtect); 51 | } 52 | 53 | static std::uintptr_t GetAddressFromOffsets(const std::uintptr_t& addr, const std::vector& offsets) 54 | { 55 | std::uintptr_t retn_addr{ addr }; 56 | for (unsigned __int8 i = 0; i < offsets.size(); i++) 57 | retn_addr = *(std::uintptr_t*)retn_addr + offsets[i]; 58 | return retn_addr; 59 | } 60 | 61 | static void memory_fill(std::uintptr_t addr, const int value, const int size) { 62 | DWORD newProtect; 63 | VirtualProtect((void*)addr, size, PAGE_EXECUTE_READWRITE, &newProtect); 64 | memset((void*)addr, value, size); 65 | VirtualProtect((void*)addr, size, newProtect, &newProtect); 66 | } 67 | 68 | static HWND GetGameHWND() { 69 | std::vector offsets{ 0xC8, 0, 0x28 }; 70 | std::uintptr_t addr = GetAddressFromOffsets(memory::GetAddr(0x54F13E8), offsets);; 71 | return *reinterpret_cast(addr); 72 | } 73 | 74 | static std::uintptr_t GetGD3D11RHI() 75 | { 76 | return memory::GetAddr(0x055B4CB8); 77 | } 78 | 79 | static ID3D11Device* GetD3DDevice() 80 | { 81 | return *(ID3D11Device**)memory::GetAddressFromOffsets(GetGD3D11RHI(), { 0x170 }); 82 | } 83 | 84 | static ID3D11DeviceContext* GetD3DeviceContext() 85 | { 86 | return *(ID3D11DeviceContext**)memory::GetAddressFromOffsets(GetGD3D11RHI(), { 0x158 }); 87 | } 88 | 89 | static IDXGISwapChain* GetDXGISwapChain() 90 | { 91 | return *(IDXGISwapChain**)memory::GetAddr(0x051BC748); 92 | } 93 | 94 | static void* GetGameterface() 95 | { 96 | return *(void**)memory::GetAddr(0x556BB88); 97 | } 98 | 99 | static CRect GetWindowSize() 100 | { 101 | CRect rRect; 102 | rRect.left = 0; 103 | rRect.top = 0; 104 | rRect.right = memory::Read(GetAddr(0x5156988)); 105 | rRect.bottom = memory::Read(GetAddr(0x515698C)); 106 | 107 | return rRect; 108 | } 109 | } -------------------------------------------------------------------------------- /src/CAEAmbienceTrackManager.cpp: -------------------------------------------------------------------------------- 1 | #include "CAEAmbienceTrackManager.h" 2 | #include "memory.hpp" 3 | 4 | void CAEAmbienceTrackManager::UpdateAmbienceTrackAndVolume(long a1, long a2, long a3) 5 | { 6 | memory::GtaCall(0xE79080, this, a1, a2, a3); 7 | } -------------------------------------------------------------------------------- /src/CAEAudioEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "CAEAudioEntity.h" 2 | #include "memory.hpp" 3 | 4 | long &CAEAudioEntity::m_nAudioEventVolumes = *reinterpret_cast(memory::GetAddr(0x55702C8)); -------------------------------------------------------------------------------- /src/CAEAudioHardware.cpp: -------------------------------------------------------------------------------- 1 | #include "CAEAudioHardware.h" 2 | #include "memory.hpp" 3 | 4 | long CAEAudioHardware::LoadSound(long a2, unsigned short a3, short a4) 5 | { 6 | return memory::GtaCall(0xE7C4B0, this, a2, a3, a4); 7 | } -------------------------------------------------------------------------------- /src/CAEAudioUtility.cpp: -------------------------------------------------------------------------------- 1 | #include "CAEAudioUtility.h" 2 | #include "memory.hpp" 3 | 4 | bool CAEAudioUtility::ResolveProbability(float a1) 5 | { 6 | return memory::GtaCall(0xE8A760, a1); 7 | } 8 | 9 | int CAEAudioUtility::GetRandomNumberInRange(int l, int h) 10 | { 11 | return memory::GtaCall(0xE7E420, l, h); 12 | } 13 | 14 | CVehicle* CAEAudioUtility::FindVehicleOfPlayer() 15 | { 16 | return memory::GtaCall(0xE7E620); 17 | } -------------------------------------------------------------------------------- /src/CAEPedSpeechAudioEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "CAEPedSpeechAudioEntity.h" 2 | #include "memory.hpp" 3 | 4 | char &CAEPedSpeechAudioEntity::s_bAPlayerSpeaking = *reinterpret_cast(memory::GetAddr(0x4FEE142)); 5 | 6 | signed long CAEPedSpeechAudioEntity::CanWePlayGlobalSpeechContext(unsigned short a2) 7 | { 8 | return memory::GtaCall(0xE8BC90, this, a2); 9 | } 10 | 11 | signed short CAEPedSpeechAudioEntity::GetSoundAndBankIDs(unsigned short phraseId, short *a3) 12 | { 13 | return memory::GtaCall(0xE8B080, this, phraseId, a3); 14 | } 15 | 16 | long CAEPedSpeechAudioEntity::LoadAndPlaySpeech(int a2) 17 | { 18 | return memory::GtaCall(0xE8B780, this, a2); 19 | } 20 | 21 | long CAEPedSpeechAudioEntity::GetVoice(const char *name, short type) 22 | { 23 | return memory::GtaCall(0xE8A030, name, type); 24 | } 25 | 26 | void CAEPedSpeechAudioEntity::StopCurrentSpeech() 27 | { 28 | memory::GtaCall(0xE8A760, this); 29 | } -------------------------------------------------------------------------------- /src/CAESound.cpp: -------------------------------------------------------------------------------- 1 | #include "CAESound.h" 2 | #include "memory.hpp" 3 | 4 | void CAESound::StopSoundAndForget() 5 | { 6 | memory::GtaCall(0xE95710, this); 7 | } -------------------------------------------------------------------------------- /src/CAnimBlendAssociation.cpp: -------------------------------------------------------------------------------- 1 | #include "CAnimBlendAssociation.h" 2 | #include "memory.hpp" 3 | 4 | // CAnimBlendAssociation* CAnimBlendAssociation::CAnimBlendAssociation() 5 | // { 6 | // return memory::GtaCall(0xE670A0, this); 7 | // } 8 | 9 | // CAnimBlendAssociation* CAnimBlendAssociation::CAnimBlendAssociation(CAnimBlendHierarchy *a2) 10 | // { 11 | // return memory::GtaCall(0xE67100, this, a2); 12 | // } 13 | 14 | unsigned long CAnimBlendAssociation::Init(int a1) 15 | { 16 | return memory::GtaCall(0xE67380, this, a1); 17 | } 18 | 19 | char CAnimBlendAssociation::Start(float progress) 20 | { 21 | return memory::GtaCall(0xE67500, this, progress); 22 | } 23 | 24 | CAnimBlendAssociation* CAnimBlendAssociation::CopyAnimation(int ID) 25 | { 26 | return memory::GtaCall(0xE6C880, this, ID); 27 | } -------------------------------------------------------------------------------- /src/CAnimBlendFrameData.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CAnimBlendFrameData.cpp -------------------------------------------------------------------------------- /src/CAnimBlendHierarchy.cpp: -------------------------------------------------------------------------------- 1 | #include "CAnimBlendHierarchy.h" 2 | #include "memory.hpp" 3 | 4 | void CAnimBlendHierarchy::RemoveUncompressedData() 5 | { 6 | memory::GtaCall(0xE680B0, this); 7 | } -------------------------------------------------------------------------------- /src/CAnimBlendNode.cpp: -------------------------------------------------------------------------------- 1 | #include "CAnimBlendNode.h" 2 | #include "memory.hpp" 3 | 4 | void CAnimBlendNode::CalcDeltas() 5 | { 6 | memory::GtaCall(0xE68480, this); 7 | } 8 | 9 | char CAnimBlendNode::FindKeyFrame(float a2) 10 | { 11 | return memory::GtaCall(0xE68680, this, a2); 12 | } 13 | 14 | char CAnimBlendNode::SetupKeyFrameCompressed() 15 | { 16 | return memory::GtaCall(0xE68B70, this); 17 | } -------------------------------------------------------------------------------- /src/CAnimManager.cpp: -------------------------------------------------------------------------------- 1 | #include "CAnimManager.h" 2 | #include "memory.hpp" 3 | 4 | long &CAnimManager::ms_aAnimAssocGroups = *reinterpret_cast(memory::GetAddr(0x5570250)); 5 | 6 | void CAnimManager::UncompressAnimation(CAnimBlendHierarchy *a1) 7 | { 8 | memory::GtaCall(0xE6C470, this, a1); 9 | } 10 | 11 | CAnimBlendAssociation * CAnimManager::AddAnimation(unsigned int animGroup, unsigned int animation) 12 | { 13 | return memory::GtaCall(0xE6C8F0, this, animGroup, animation); 14 | } 15 | 16 | CAnimBlendAssociation * CAnimManager::AddAnimation(long a1, CAnimManager *a2) 17 | { 18 | return memory::GtaCall(0xE6C9C0, a1, a2); 19 | } 20 | 21 | CAnimBlendAssociation * CAnimManager::BlendAnimation(long a1, CAnimBlendHierarchy *a2, unsigned int flags, float blendDelta) 22 | { 23 | return memory::GtaCall(0xE6D7E0, a1, a2, flags, blendDelta); 24 | } 25 | 26 | long CAnimManager::LoadAnimFiles() 27 | { 28 | return memory::GtaCall(0xE6DA40); 29 | } 30 | 31 | long CAnimManager::LoadAnimFile(long stream, char a2, char *string) 32 | { 33 | return memory::GtaCall(0xE6DF40, stream, a2, string); 34 | } 35 | 36 | long CAnimManager::CreateAnimAssocGroups() 37 | { 38 | return memory::GtaCall(0xE6DD90); 39 | } -------------------------------------------------------------------------------- /src/CAtomicModelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CAtomicModelInfo.h" -------------------------------------------------------------------------------- /src/CAutomobile.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto San Andreas) source file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | https://github.com/TrilogyDevelop/TrilogySDK 6 | Do not delete this comment block. Respect others' work! 7 | */ 8 | 9 | #include "CAutomobile.h" 10 | #include "memory.hpp" 11 | 12 | CAutomobile::CAutomobile() 13 | { 14 | } 15 | 16 | CAutomobile::CAutomobile(int nModelIndex, unsigned char usageType, char bSetupSuspensionLines) 17 | { 18 | memory::GtaCall(0x11EAD60, this, nModelIndex, usageType, bSetupSuspensionLines); 19 | } 20 | 21 | void CAutomobile::UpdateWheelMatrix(int nodeIndex, int flags) 22 | { 23 | return memory::GtaCall(0x11F8640, this, nodeIndex, flags); 24 | } 25 | 26 | void CAutomobile::PlaceOnRoadProperly() 27 | { 28 | memory::GtaCall(0x1202D50, this); 29 | } 30 | 31 | -------------------------------------------------------------------------------- /src/CAutopilot.cpp: -------------------------------------------------------------------------------- 1 | #include "CAutopilot.h" 2 | -------------------------------------------------------------------------------- /src/CBaseModelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CBaseModelInfo.h" 2 | -------------------------------------------------------------------------------- /src/CBike.cpp: -------------------------------------------------------------------------------- 1 | #include "CBike.h" 2 | #include "memory.hpp" 3 | 4 | CBike::CBike(int nModelIndex, unsigned char nUsageType) 5 | { 6 | memory::GtaCall(0x1206D40, this, nModelIndex, nUsageType); 7 | } 8 | 9 | void CBike::PlaceOnRoadProperly() 10 | { 11 | memory::GtaCall(0x1211A80, this); 12 | } 13 | -------------------------------------------------------------------------------- /src/CBmx.cpp: -------------------------------------------------------------------------------- 1 | #include "CBmx.h" 2 | #include "memory.hpp" 3 | 4 | CBmx::CBmx(int nModelIndex, unsigned char nUsageType) 5 | { 6 | memory::GtaCall(0x1215920, this, nModelIndex, nUsageType); 7 | } 8 | -------------------------------------------------------------------------------- /src/CBoat.cpp: -------------------------------------------------------------------------------- 1 | #include "CBoat.h" 2 | #include "memory.hpp" 3 | 4 | CBoat::CBoat(int nModelIndex, unsigned char nUsageType) 5 | { 6 | memory::GtaCall(0x1218780, this, nModelIndex, nUsageType); 7 | } 8 | -------------------------------------------------------------------------------- /src/CCam.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CCam.cpp -------------------------------------------------------------------------------- /src/CCamera.cpp: -------------------------------------------------------------------------------- 1 | #include "CCamera.h" 2 | #include "memory.hpp" 3 | 4 | CCamera& TheCamera = *reinterpret_cast(memory::GetAddr(0x4EA95E0)); 5 | 6 | void CCamera::TakeControl(CEntity* target, short ModeToGoTo, short TypeOfSwitch, int WhoIsInControlOfTheCamera) { 7 | memory::GtaCall(0xF97AB0, this, target, ModeToGoTo, TypeOfSwitch, WhoIsInControlOfTheCamera); 8 | } 9 | 10 | void CCamera::Restore() { 11 | memory::GtaCall(0xF95F00, this); 12 | } 13 | 14 | void CCamera::Process() { 15 | memory::GtaCall(0xF92A00, this); 16 | } 17 | 18 | void CCamera::Init() { 19 | memory::GtaCall(0xF80EE0, this); 20 | } 21 | 22 | void CCamera::Fade(float fadeDuration, short FadeInOutFlag) { 23 | memory::GtaCall(0xF904E0, this, fadeDuration, FadeInOutFlag); 24 | } 25 | 26 | void CCamera::CamControl() { 27 | memory::GtaCall(0xF8C7B0, this); 28 | } -------------------------------------------------------------------------------- /src/CClock.cpp: -------------------------------------------------------------------------------- 1 | #include "CClock.h" 2 | #include "memory.hpp" 3 | 4 | bool &CClock::bClockHasBeenStored = *reinterpret_cast(memory::GetAddr(0x5002672)); 5 | unsigned short &CClock::ms_Stored_nGameClockSeconds = *reinterpret_cast(memory::GetAddr(0x505F34C)); 6 | unsigned char &CClock::ms_Stored_nGameClockMinutes = *reinterpret_cast(memory::GetAddr(0x5002676)); 7 | unsigned char &CClock::ms_Stored_nGameClockHours = *reinterpret_cast(memory::GetAddr(0x5002673)); 8 | unsigned char &CClock::ms_Stored_nGameClockDays = *reinterpret_cast(memory::GetAddr(0x500267A)); 9 | unsigned char &CClock::ms_Stored_nGameClockMonths = *reinterpret_cast(memory::GetAddr(0x5002677)); 10 | unsigned char &CClock::CurrentDay = *reinterpret_cast(memory::GetAddr(0x500267B)); 11 | unsigned short &CClock::ms_nGameClockSeconds = *reinterpret_cast(memory::GetAddr(0x505F348)); 12 | unsigned char &CClock::ms_nGameClockMinutes = *reinterpret_cast(memory::GetAddr(0x5002487)); 13 | unsigned char &CClock::ms_nGameClockHours = *reinterpret_cast(memory::GetAddr(0x50029F5)); 14 | unsigned char &CClock::ms_nGameClockDays = *reinterpret_cast(memory::GetAddr(0x50029F6)); 15 | unsigned char &CClock::ms_nGameClockMonth = *reinterpret_cast(memory::GetAddr(0x50029F7)); 16 | unsigned int &CClock::ms_nLastClockTick = *reinterpret_cast(memory::GetAddr(0x50633D0)); 17 | unsigned int &CClock::ms_nMillisecondsPerGameMinute = *reinterpret_cast(memory::GetAddr(0x50633D4)); -------------------------------------------------------------------------------- /src/CClumpModelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CClumpModelInfo.h" 2 | -------------------------------------------------------------------------------- /src/CColPoint.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CColPoint.cpp -------------------------------------------------------------------------------- /src/CCopPed.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CCopPed.cpp -------------------------------------------------------------------------------- /src/CCutsceneObject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CCutsceneObject.cpp -------------------------------------------------------------------------------- /src/CEntity.cpp: -------------------------------------------------------------------------------- 1 | #include "CEntity.h" 2 | #include "memory.hpp" 3 | 4 | CEntity::CEntity() 5 | { 6 | } 7 | 8 | bool CEntity::GetIsOnScreen() { 9 | return memory::GtaCall(0xFA8730, this); 10 | } 11 | 12 | void CEntity::SetModelIndex_vtbl(unsigned int nModelIndex) 13 | { 14 | ((void(*)(CEntity*, unsigned int))(*(void***)this)[6])(this, nModelIndex); 15 | } 16 | 17 | void CEntity::SetModelIndexNoCreate(unsigned int nModelIndex) 18 | { 19 | ((void(*)(CEntity*, unsigned int))(*(void***)this)[7])(this, nModelIndex); 20 | } 21 | 22 | 23 | void CEntity::DeleteRwObject() 24 | { 25 | ((void(*)(CEntity*))(*(void***)this)[8])(this); 26 | } -------------------------------------------------------------------------------- /src/CEntityScanner.cpp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/CFileLoader.cpp: -------------------------------------------------------------------------------- 1 | #include "CFileLoader.h" 2 | 3 | #include "memory.hpp" 4 | 5 | void CFileLoader::LoadAnimatedClumpObject(char const *line) { 6 | memory::GtaCall(0xFAB0A0, line); 7 | } 8 | 9 | int CFileLoader::LoadPedObject(char const *line) { 10 | return memory::GtaCall(0xFAB7F0, line); 11 | } 12 | 13 | int CFileLoader::LoadTimeObject(char const *line) { 14 | return memory::GtaCall(0xFAA960, line); 15 | } 16 | 17 | void CFileLoader::LoadObjectTypes(char const *filename) { 18 | memory::GtaCall(0xFAA0E0, filename); 19 | } 20 | 21 | int CFileLoader::LoadVehicleObject(char const *line) { 22 | return memory::GtaCall(0xFAAAE0, line); 23 | } -------------------------------------------------------------------------------- /src/CFire.cpp: -------------------------------------------------------------------------------- 1 | #include "CFire.h" 2 | #include "memory.hpp" 3 | 4 | void CFire::Extinguish() 5 | { 6 | memory::GtaCall(0xFBA520, this); 7 | } -------------------------------------------------------------------------------- /src/CFont.cpp: -------------------------------------------------------------------------------- 1 | #include "CFont.h" 2 | 3 | #include "memory.hpp" 4 | 5 | CSprite2d* CFont::Sprite = 6 | reinterpret_cast(memory::GetAddr(0x5570250)); 7 | -------------------------------------------------------------------------------- /src/CGame.cpp: -------------------------------------------------------------------------------- 1 | #include "CGame.h" 2 | #include "memory.hpp" 3 | 4 | int& gGameState = *reinterpret_cast(memory::GetAddr(0x5143188)); -------------------------------------------------------------------------------- /src/CHeli.cpp: -------------------------------------------------------------------------------- 1 | #include "CHeli.h" 2 | #include "memory.hpp" 3 | 4 | CHeli::CHeli(int nModelIndex, unsigned char nUsageType) 5 | { 6 | memory::GtaCall(0x12205D0, this, nModelIndex, nUsageType); 7 | } 8 | -------------------------------------------------------------------------------- /src/CHud.cpp: -------------------------------------------------------------------------------- 1 | #include "CHud.h" 2 | #include "memory.hpp" 3 | 4 | long &CHud::Sprites = *reinterpret_cast(memory::GetAddr(0x528F040)); -------------------------------------------------------------------------------- /src/CHudColours.cpp: -------------------------------------------------------------------------------- 1 | #include "CHudColours.h" 2 | #include "memory.hpp" 3 | 4 | CHudColours& HudColour = *reinterpret_cast(memory::GetAddr(0x4EAAA70)); -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE TRILOGY_SDK_SOURCES *.cpp) 2 | target_sources(TrilogySDK 3 | PRIVATE 4 | ${TRILOGY_SDK_SOURCES} 5 | ) -------------------------------------------------------------------------------- /src/CMatrix.cpp: -------------------------------------------------------------------------------- 1 | #include "CMatrix.h" 2 | #include 3 | 4 | void CMatrix::SetRotateZOnly(float fAngle) { 5 | this->right.z = 0.0; 6 | this->up.z = 0.0; 7 | this->at.x = 0.0; 8 | this->at.y = 0.0; 9 | this->at.z = 1.0; 10 | this->right.x = cosf(fAngle); 11 | this->right.y = sinf(fAngle); 12 | this->up.x = -sinf(fAngle); 13 | this->up.y = cosf(fAngle); 14 | } -------------------------------------------------------------------------------- /src/CMatrixLink.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CMatrixLink.cpp -------------------------------------------------------------------------------- /src/CMessages.cpp: -------------------------------------------------------------------------------- 1 | #include "CMessages.h" 2 | #include "memory.hpp" 3 | 4 | void CMessages::AddMessage(const wchar_t* szText, unsigned int nTime, unsigned short nFlags, bool bPreviousBrief) { 5 | memory::GtaCall(0x11E9240, nullptr, szText, nTime, nFlags, bPreviousBrief); 6 | } -------------------------------------------------------------------------------- /src/CModelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelInfo.h" 2 | #include "memory.hpp" 3 | 4 | CBaseModelInfo** CModelInfo::ms_modelInfoPtrs = (CBaseModelInfo**)memory::GetAddr(0x507E930); 5 | 6 | CAtomicModelInfo* CModelInfo::AddAtomicModel(int index) { 7 | return memory::GtaCall(0x52B1FE0, index); 8 | } -------------------------------------------------------------------------------- /src/CMonsterTruck.cpp: -------------------------------------------------------------------------------- 1 | #include "CMonsterTruck.h" 2 | #include "memory.hpp" 3 | 4 | CMonsterTruck::CMonsterTruck(int nModelIndex, int nUsageType) 5 | { 6 | memory::GtaCall(0x1225630, this, nModelIndex, nUsageType); 7 | } 8 | -------------------------------------------------------------------------------- /src/CNodeAddress.cpp: -------------------------------------------------------------------------------- 1 | #include "CNodeAddress.h" 2 | -------------------------------------------------------------------------------- /src/CObject.cpp: -------------------------------------------------------------------------------- 1 | #include "CObject.h" 2 | #include "memory.hpp" 3 | 4 | void CObject::ObjectDamage(float damage, CVector* fxOrigin, CVector* fxDirection, CEntity* damager, eWeaponType weaponType) { 5 | memory::GtaCall(0x108F550, this, damage, fxOrigin, fxDirection, damager, weaponType); 6 | } 7 | 8 | void CObject::Init() { 9 | memory::GtaCall(0x108C820, this); 10 | } 11 | 12 | CObject* CObject::Create(int modelIndex) { 13 | return memory::GtaCall(0x108C820, modelIndex); 14 | } -------------------------------------------------------------------------------- /src/CPed.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto San Andreas) source file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | https://github.com/TrilogyDevelop/TrilogySDK 6 | Do not delete this comment block. Respect others' work! 7 | */ 8 | 9 | #include "CPed.h" 10 | #include "memory.hpp" 11 | 12 | void CPed::SetModelIndex(int nModel) { 13 | return memory::GtaCall(0x10950C0, this, nModel); 14 | } 15 | 16 | void CPed::GiveWeapon(eWeaponType nWeapon, int nAmmo) { 17 | return memory::GtaCall(0x109CC30, this, nWeapon, nAmmo); 18 | } 19 | 20 | void CPed::SetCharCreatedBy(char nCreatedBy) { 21 | memory::GtaCall(0x1095060, this, nCreatedBy); 22 | } 23 | 24 | void CPed::SetCurrentWeapon(eWeaponType nWeapon) { 25 | memory::GtaCall(0x109CF00, this, nWeapon); 26 | } 27 | 28 | void CPed::SetAmmo(eWeaponType nWeapon, int nAmmo) { 29 | memory::GtaCall(0x109D020, this, nWeapon, nAmmo); 30 | } 31 | 32 | void CPed::GrantAmmo(eWeaponType nWeapon, int nAmmo) { 33 | memory::GtaCall(0x109CFC0, this, nWeapon, nAmmo); 34 | } 35 | 36 | void CPed::RemoveWeaponModel(int nWeapon, char nUnknow) { 37 | memory::GtaCall(0x109C740, this, nWeapon, nUnknow); 38 | } 39 | 40 | char CPed::GetWeaponSkill(eWeaponType nWeapon) { 41 | return memory::GtaCall(0x10A0750, this, nWeapon); 42 | } 43 | 44 | void CPed::GetBonePosition(CVector* out, bool bDynamic, unsigned int nBoneId) { 45 | memory::GtaCall(0x10A01B0, this, out, bDynamic, nBoneId); 46 | } 47 | 48 | void CPed::SetPedState(ePedState nState) { 49 | memory::GtaCall(0x10A0750, this, nState); 50 | } 51 | 52 | bool CPed::IsPlayer() { 53 | return this->m_nPedType < 2; 54 | } 55 | 56 | bool CPed::IsAlive() { 57 | return this->m_nPedState != PED_DIE && this->m_nPedState != PED_DEAD; 58 | } 59 | 60 | void CPed::DettachPedFromEntity() { 61 | memory::GtaCall(0x109FB70, this); 62 | } 63 | 64 | void CPed::GiveDelayedWeapon(eWeaponType weaponType, unsigned int ammo, int a3) { 65 | memory::GtaCall(0x109FB70, this, ammo, a3); 66 | } 67 | 68 | void CPed::RemoveWeaponAnims(int likeUnused, float blendDelta) { 69 | memory::GtaCall(0x10A78C0, this, likeUnused, blendDelta); 70 | } -------------------------------------------------------------------------------- /src/CPedIK.cpp: -------------------------------------------------------------------------------- 1 | #include "CPedIK.h" -------------------------------------------------------------------------------- /src/CPedIntelligence.cpp: -------------------------------------------------------------------------------- 1 | #include "CPedIntelligence.h" -------------------------------------------------------------------------------- /src/CPedModelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CPedModelInfo.h" 2 | -------------------------------------------------------------------------------- /src/CPedStat.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CPedStat.cpp -------------------------------------------------------------------------------- /src/CPhysical.cpp: -------------------------------------------------------------------------------- 1 | #include "CPhysical.h" 2 | #include "memory.hpp" 3 | 4 | CPhysical::CPhysical() 5 | { 6 | 7 | } 8 | 9 | void CPhysical::AddCollisionRecord(CEntity* collidedEntity) { 10 | memory::GtaCall(0xFD4D00, this, collidedEntity); 11 | } 12 | 13 | void CPhysical::AddToMovingList() { 14 | memory::GtaCall(0xFD1A00, this); 15 | } 16 | 17 | bool CPhysical::ApplyCollision(CEntity* entity, CColPoint& colPoint, float& arg2) { 18 | return memory::GtaCall(0xFD5250, this, entity, colPoint, arg2); 19 | } 20 | 21 | void CPhysical::ApplyForce(CVector* dir, CVector* velocity, bool flag) { 22 | memory::GtaCall(0xFD1E60, this, dir, velocity, flag); 23 | } 24 | 25 | void CPhysical::ApplyFriction() { 26 | memory::GtaCall(0xFD2D10, this); 27 | } 28 | 29 | void CPhysical::ApplySpeed() { 30 | memory::GtaCall(0xFD2530, this); 31 | } 32 | 33 | void CPhysical::RemoveAndAdd() { 34 | memory::GtaCall(0xFD15B0, this); 35 | } 36 | 37 | void CPhysical::RemoveRefsToEntity() { 38 | memory::GtaCall(0xFDEA60, this); 39 | } -------------------------------------------------------------------------------- /src/CPlaceable.cpp: -------------------------------------------------------------------------------- 1 | #include "memory.hpp" 2 | #include "CPlaceable.h" 3 | #include 4 | 5 | CPlaceable::CPlaceable() 6 | { 7 | 8 | } 9 | 10 | void CPlaceable::SetPosition(CVector const& vPos) { 11 | if (this->m_pMatrix) { 12 | this->m_pMatrix->pos.x = vPos.x; 13 | this->m_pMatrix->pos.y = vPos.y; 14 | this->m_pMatrix->pos.z = vPos.z; 15 | this->m_pMatrix = 0; 16 | } 17 | else { 18 | this->m_SimpleCoors.m_vPosn.x = vPos.x; 19 | this->m_SimpleCoors.m_vPosn.y = vPos.y; 20 | this->m_SimpleCoors.m_vPosn.z = vPos.z; 21 | } 22 | } 23 | 24 | void CPlaceable::SetPosition(float x, float y, float z) { 25 | if (this->m_pMatrix) 26 | { 27 | this->m_pMatrix->pos.x = x; 28 | this->m_pMatrix->pos.y = y; 29 | this->m_pMatrix->pos.z = z; 30 | } 31 | else 32 | { 33 | this->m_SimpleCoors.m_vPosn.x = x; 34 | this->m_SimpleCoors.m_vPosn.y = y; 35 | this->m_SimpleCoors.m_vPosn.z = z; 36 | } 37 | } 38 | 39 | void CPlaceable::SetOrientation(float x, float y, float z) 40 | { 41 | memory::GtaCall(0xEE8C30, this, x, y, z); 42 | } 43 | 44 | CVector& CPlaceable::GetPosition() { 45 | if (this->m_pMatrix) 46 | return this->m_pMatrix->GetPosition(); 47 | else 48 | return this->m_SimpleCoors.m_vPosn; 49 | } 50 | 51 | void CPlaceable::SetHeading(float fAngle) { 52 | memory::GtaCall(0xEE8CA0, this, fAngle); 53 | } 54 | 55 | float CPlaceable::GetHeading() { 56 | if (this->m_pMatrix) 57 | return atan2f(this->m_pMatrix->up.x, this->m_pMatrix->up.y); 58 | else 59 | return this->m_SimpleCoors.m_fAngle; 60 | } 61 | 62 | void CPlaceable::RemoveMatrix() { 63 | memory::GtaCall(0xFE0A60, this); 64 | } 65 | 66 | void CPlaceable::AllocateStaticMatrix() { 67 | memory::GtaCall(0x54F4C0, this); 68 | } -------------------------------------------------------------------------------- /src/CPlane.cpp: -------------------------------------------------------------------------------- 1 | #include "CPlane.h" 2 | #include "memory.hpp" 3 | 4 | CPlane::CPlane(int nModexIndex, unsigned int nUsageType) 5 | { 6 | memory::GtaCall(0x12268C0, this, nModexIndex, nUsageType); 7 | } 8 | -------------------------------------------------------------------------------- /src/CPlayerData.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CPlayerData.cpp -------------------------------------------------------------------------------- /src/CPlayerInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CPlayerInfo.cpp -------------------------------------------------------------------------------- /src/CPlayerSkin.cpp: -------------------------------------------------------------------------------- 1 | #include "CPlayerSkin.h" 2 | #include "memory.hpp" 3 | 4 | int &CPlayerSkin::m_txdSlot = *reinterpret_cast(memory::GetAddr(0x50ADABC)); -------------------------------------------------------------------------------- /src/CPool.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CPool.cpp -------------------------------------------------------------------------------- /src/CPools.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto San Andreas Unreal) source file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | Do not delete this comment block. Respect others' work! 6 | */ 7 | #include "memory.hpp" 8 | #include "CPools.h" 9 | 10 | CPedPool*& CPools::ms_pPedPool = *(CPedPool**)(memory::GetAddr(0x55706E0)); 11 | CVehiclePool*& CPools::ms_pVehiclePool = *(CVehiclePool**)(memory::GetAddr(0x55706D8)); 12 | CObjectPool*& CPools::ms_pObjectPool = *(CObjectPool**)(memory::GetAddr(0x55706B8)); 13 | 14 | CPed* CPools::GetPed(int32_t handle) { 15 | return ms_pPedPool->GetAtRef(handle); 16 | } 17 | 18 | CVehicle* CPools::GetVehicle(int32_t handle) { 19 | return ms_pVehiclePool->GetAtRef(handle); 20 | } 21 | 22 | CObject* CPools::GetObject(int32_t handle) { 23 | return ms_pObjectPool->GetAtRef(handle); 24 | } 25 | 26 | int32_t CPools::GetPedRef(CPed* pPed) { 27 | return ms_pPedPool->GetRef(pPed); 28 | } 29 | 30 | int32_t CPools::GetVehicleRef(CVehicle* vehicle) { 31 | return ms_pVehiclePool->GetRef(vehicle); 32 | } 33 | 34 | int32_t CPools::GetObjectRef(CObject* object) { 35 | return ms_pObjectPool->GetRef(object); 36 | } 37 | 38 | // x 0x5156988 39 | // y 0x515698C -------------------------------------------------------------------------------- /src/CPopulation.cpp: -------------------------------------------------------------------------------- 1 | #include "CPopulation.h" 2 | #include "memory.hpp" 3 | 4 | int &CPopulation::NumMiamiViceCops = *reinterpret_cast(memory::GetAddr(0x5570EF8)); -------------------------------------------------------------------------------- /src/CQuadBike.cpp: -------------------------------------------------------------------------------- 1 | #include "CQuadBike.h" 2 | #include "memory.hpp" 3 | 4 | CQuadBike::CQuadBike(int nModelIndex, char nUsageType) 5 | { 6 | memory::GtaCall(0x122C8B0, this, nModelIndex, nUsageType); 7 | } 8 | -------------------------------------------------------------------------------- /src/CQuaternion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto San Andreas) source file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | Do not delete this comment block. Respect others' work! 6 | */ 7 | #include "CQuaternion.h" 8 | 9 | 10 | // Quat to euler angles 11 | void CQuaternion::Get(float* x, float* y, float* z) 12 | { 13 | ((void(__thiscall*)(CQuaternion*, float*, float*, float*))0x59C160)(this, x, y, z); 14 | } 15 | 16 | 17 | // Stores result of quat multiplication 18 | void CQuaternion::Multiply(CQuaternion const& a, CQuaternion const& b) 19 | { 20 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&, CQuaternion const&))0x59C270)(this, a, b); 21 | } 22 | 23 | // Spherical linear interpolation 24 | void CQuaternion::Slerp(CQuaternion const& from, CQuaternion const& to, float halftheta, float sintheta_inv, float t) 25 | { 26 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&, CQuaternion const&, float, float, float))0x59C300)(this, from, to, halftheta, sintheta_inv, t); 27 | } 28 | 29 | 30 | // Quat from euler angles 31 | void CQuaternion::Set(float x, float y, float z) 32 | { 33 | ((void(__thiscall*)(CQuaternion*, float, float, float))0x59C530)(this, x, y, z); 34 | } 35 | 36 | 37 | // Spherical linear interpolation 38 | void CQuaternion::Slerp(CQuaternion const& from, CQuaternion const& to, float t) 39 | { 40 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&, CQuaternion const&, float))0x59C630)(this, from, to, t); 41 | } 42 | 43 | // Conjugate of a quat 44 | void CQuaternion::Conjugate() 45 | { 46 | ((void(__thiscall*)(CQuaternion*))0x4D37D0)(this); 47 | } 48 | 49 | // Squared length of a quat 50 | float CQuaternion::GetLengthSquared(void) 51 | { 52 | return ((float(__thiscall*)(CQuaternion*))0x4D12C0)(this); 53 | } 54 | 55 | // Add right to the quat 56 | void CQuaternion::operator+=(CQuaternion const& right) 57 | { 58 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&))0x4D12F0)(this, right); 59 | } 60 | 61 | // Substract right from the quat 62 | void CQuaternion::operator-=(CQuaternion const& right) 63 | { 64 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&))0x4D1320)(this, right); 65 | } 66 | 67 | // Assigns value from other quat 68 | void CQuaternion::operator=(CQuaternion const& right) 69 | { 70 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&))0x4D00C0)(this, right); 71 | } 72 | 73 | // Multiplies quat by a floating point value 74 | void CQuaternion::operator*=(float multiplier) 75 | { 76 | ((void(__thiscall*)(CQuaternion*, float))0x4CF9B0)(this, multiplier); 77 | } 78 | 79 | // Multiplies quat by a floating point value 80 | void CQuaternion::Scale(float multiplier) 81 | { 82 | ((void(__thiscall*)(CQuaternion*, float))0x4CF9B0)(this, multiplier); 83 | } 84 | 85 | // Copies value from other quat 86 | void CQuaternion::Copy(CQuaternion const& from) 87 | { 88 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&))0x4CF9E0)(this, from); 89 | } 90 | 91 | // Gets a dot product for quats 92 | void CQuaternion::Dot(CQuaternion const& a) 93 | { 94 | ((void(__thiscall*)(CQuaternion*, CQuaternion const&))0x4CFA00)(this, a); 95 | } 96 | 97 | // Normalises a quat 98 | void CQuaternion::Normalise() 99 | { 100 | ((void(__thiscall*)(CQuaternion*))0x4D1610)(this); 101 | } -------------------------------------------------------------------------------- /src/CRGBA.cpp: -------------------------------------------------------------------------------- 1 | #include "CRGBA.h" 2 | 3 | CRGBA::CRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) { 4 | this->r = r; 5 | this->g = g; 6 | this->b = b; 7 | this->a = a; 8 | } 9 | 10 | void CRGBA::SetRGBAValue(unsigned char nColorId, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { 11 | CRGBA* nColor = &this[nColorId]; 12 | nColor->r = r; 13 | nColor->g = g; 14 | nColor->b = b; 15 | nColor->a = a; 16 | } -------------------------------------------------------------------------------- /src/CRadar.cpp: -------------------------------------------------------------------------------- 1 | #include "CRadar.h" 2 | #include "memory.hpp" 3 | 4 | tRadarTrace* CRadar::ms_RadarTrace = (tRadarTrace*)memory::GetAddr(0x528F070); 5 | 6 | int CRadar::SetCoordBlip(eBlipType type, CVector* pPos, int nColor, eBlipDisplay display) { 7 | return memory::GtaCall(0x103E230, type, pPos, nColor, display); 8 | } 9 | 10 | void CRadar::SetBlipSprite(int nBlip, char nSpriteId) { 11 | return memory::GtaCall(0x103ECD0, nBlip, nSpriteId); 12 | } 13 | 14 | void CRadar::ChangeBlipDisplay(int blipIndex, eBlipDisplay blipDisplay) { 15 | memory::GtaCall(0x103E970, blipIndex, blipDisplay); 16 | } 17 | 18 | void CRadar::ChangeBlipScale(int blipIndex, int size) { 19 | memory::GtaCall(0x103E930, blipIndex, size); 20 | } 21 | 22 | void CRadar::ClearBlip(int blipIndex) { 23 | memory::GtaCall(0x103E780, blipIndex); 24 | } 25 | 26 | void CRadar::ClearBlipForEntity(eBlipType blipType, int entityHandle) { 27 | memory::GtaCall(0x103E6F0, blipType, entityHandle); 28 | } 29 | 30 | void CRadar::Draw3dMarkers() { 31 | memory::GtaCall(0x103DA20); 32 | } 33 | 34 | void CRadar::DrawBlips(bool a1) { 35 | memory::GtaCall(0x103C0F0, a1); 36 | } 37 | 38 | void CRadar::DrawCoordBlip(int blipArrId, unsigned char isSprite) { 39 | memory::GtaCall(0x103C7B0, blipArrId, isSprite); 40 | } 41 | 42 | void CRadar::DrawEntityBlip(int blipArrId, unsigned char arg1) { 43 | memory::GtaCall(0x103CD00, blipArrId, arg1); 44 | } 45 | 46 | void CRadar::DrawMap() { 47 | memory::GtaCall(0x103B9F0); 48 | } 49 | 50 | void CRadar::DrawRadarMap() { 51 | memory::GtaCall(0x103F630); 52 | } 53 | 54 | int CRadar::GetActualBlipArrayIndex(int blipIndex) { 55 | return memory::GtaCall(0x103B9C0, blipIndex); 56 | } 57 | 58 | bool CRadar::HasThisBlipBeenRevealed(int blipArrId) { 59 | return memory::GtaCall(0x103E830, blipArrId); 60 | } 61 | 62 | void CRadar::Initialise() { 63 | memory::GtaCall(0x103B750); 64 | } 65 | 66 | void CRadar::Load() { 67 | memory::GtaCall(0x1131640); 68 | } 69 | 70 | int CRadar::SetEntityBlip(eBlipType nType, int entityHandle, int a3, eBlipDisplay nDisplay) { 71 | return memory::GtaCall(0x103E5F0, nType, entityHandle, a3, nDisplay); 72 | } 73 | 74 | void CRadar::SetupAirstripBlips() { 75 | memory::GtaCall(0x103E9B0); 76 | } -------------------------------------------------------------------------------- /src/CRect.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CRect.cpp -------------------------------------------------------------------------------- /src/CReference.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CReference.cpp -------------------------------------------------------------------------------- /src/CRunningScript.cpp: -------------------------------------------------------------------------------- 1 | #include "CRunningScript.h" 2 | 3 | void CRunningScript::ProcessOneCommand() { 4 | std::uint16_t& CommandsExecuted = *reinterpret_cast(memory::GetAddr(0x5002674)); 5 | CommandsExecuted++; 6 | 7 | auto Read2BytesFromScript = [](uint8_t*& ip) -> std::int16_t { 8 | int16_t retval = *reinterpret_cast(ip); 9 | ip += 2; 10 | return retval; 11 | }; 12 | 13 | union { 14 | int16_t op; 15 | struct { 16 | uint16_t command : 15; 17 | uint16_t notFlag : 1; 18 | }; 19 | } op = { Read2BytesFromScript(this->m_pCurrentIP) }; 20 | 21 | if (op.command < 0xa8c) { 22 | using CommandHandlerFn_t = std::int8_t(__thiscall CRunningScript::*)(int32_t); 23 | using CommandHandlerTable_t = std::array; 24 | CommandHandlerTable_t& s_OriginalCommandHandlerTable = *(CommandHandlerTable_t*)(memory::GetAddr(0x418A140)); 25 | std::invoke(s_OriginalCommandHandlerTable[(size_t)op.command / 100], this, (int32_t)op.command); 26 | } 27 | else { 28 | memory::GtaCall(0xF4A250, this, op.command); 29 | } 30 | } 31 | 32 | void CRunningScript::Init() { 33 | reinterpret_cast(memory::GetAddr(0xF2A980))(this); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/CSimpleTransform.cpp: -------------------------------------------------------------------------------- 1 | #include "CSimpleTransform.h" 2 | 3 | CSimpleTransform::CSimpleTransform() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/CStreaming.cpp: -------------------------------------------------------------------------------- 1 | #include "CStreaming.h" 2 | #include "memory.hpp" 3 | 4 | int *CStreaming::copModelByTown = reinterpret_cast(memory::GetAddr(0x419D6D0)); 5 | CStreamingInfo *CStreaming::ms_aInfoForModel = reinterpret_cast(memory::GetAddr(0x50D52B0)); 6 | 7 | void CStreaming::LoadAllRequestedModels() { 8 | memory::GtaCall(0x10FEB70); 9 | } 10 | 11 | void CStreaming::RequestModel(int nModel, int nFlags) { 12 | memory::GtaCall(0x10FC980, nModel, nFlags); 13 | } 14 | 15 | void CStreaming::LoadScene(CVector const* vPos) { 16 | memory::GtaCall(0x10FEC30, vPos); 17 | } 18 | 19 | void CStreaming::RequestSpecialModel(int nModel, const char* szTxdName, int nFlags) { 20 | memory::GtaCall(0x1100C10, nModel, szTxdName, nFlags); 21 | } 22 | 23 | void CStreaming::SetModelIsDeletable(int nModel) { 24 | memory::GtaCall(0x1100B10, nModel); 25 | } 26 | 27 | void CStreaming::SetMissionDoesntRequireModel(int nModel) { 28 | memory::GtaCall(0x1100B90, nModel); 29 | } 30 | 31 | void CStreaming::RemoveInappropriatePedModels() { 32 | memory::GtaCall(0x1102430); 33 | } 34 | 35 | void CStreaming::Update() { 36 | memory::GtaCall(0x10FB600); 37 | } 38 | 39 | void CStreaming::RemoveModel(int nModel) { 40 | memory::GtaCall(0x10FD3D0, nModel); 41 | } 42 | -------------------------------------------------------------------------------- /src/CStreamingInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CStreamingInfo.h" -------------------------------------------------------------------------------- /src/CTheScripts.cpp: -------------------------------------------------------------------------------- 1 | #include "CTheScripts.h" 2 | #include "memory.hpp" 3 | 4 | unsigned short& CTheScripts::CommandsExecuted = *reinterpret_cast(memory::GetAddr(0x5002674)); 5 | 6 | void CTheScripts::ClearSpaceForMissionEntity(const CVector& m_pPos, CEntity* pEntity) 7 | { 8 | memory::GtaCall(0xF5CB30, m_pPos, pEntity); 9 | } 10 | -------------------------------------------------------------------------------- /src/CTheZones.cpp: -------------------------------------------------------------------------------- 1 | #include "CTheZones.h" 2 | #include "memory.hpp" 3 | 4 | int &CTheZones::m_CurrLevel = *reinterpret_cast(memory::GetAddr(0x50716D8)); -------------------------------------------------------------------------------- /src/CTimer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto San Andreas) source file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | https://github.com/TrilogyDevelop/TrilogySDK 6 | Do not delete this comment block. Respect others' work! 7 | */ 8 | 9 | #include "CTimer.h" 10 | #include "memory.hpp" 11 | 12 | unsigned int& CTimer::m_snTimeInMilliseconds = *(unsigned int*)(memory::GetAddr(0x507064C)); 13 | unsigned int& CTimer::m_snPreviousTimeInMilliseconds = *(unsigned int*)(memory::GetAddr(0x5070648)); 14 | unsigned int& CTimer::m_snTimeInMillisecondsNonClipped = *(unsigned int*)(memory::GetAddr(0x507119C)); 15 | 16 | void CTimer::Update() { 17 | memory::GtaCall(0xFF9FC0); 18 | } 19 | 20 | unsigned int CTimer::GetCurrentTimeInCycles() { 21 | return memory::GtaCall(0xFF9E90); 22 | } -------------------------------------------------------------------------------- /src/CTrailer.cpp: -------------------------------------------------------------------------------- 1 | #include "CTrailer.h" 2 | #include "memory.hpp" 3 | 4 | CTrailer::CTrailer(int nModelIndex, unsigned char nUsageType) 5 | { 6 | memory::GtaCall(0x122DD70, this, nModelIndex, nUsageType); 7 | } 8 | -------------------------------------------------------------------------------- /src/CTxdStore.cpp: -------------------------------------------------------------------------------- 1 | #include "CTxdStore.h" 2 | #include "memory.hpp" 3 | 4 | char CTxdStore::RemoveTxdSlot(int index) 5 | { 6 | return memory::GtaCall(0x1109570, index); 7 | } -------------------------------------------------------------------------------- /src/CVector.cpp: -------------------------------------------------------------------------------- 1 | #include "CVector.h" 2 | 3 | CVector::CVector() 4 | { 5 | x = 0.f; 6 | y = 0.f; 7 | z = 0.f; 8 | } 9 | 10 | CVector::CVector(float x, float y, float z) { 11 | this->x = x; 12 | this->y = y; 13 | this->z = z; 14 | } -------------------------------------------------------------------------------- /src/CVector2D.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilogyDevelopment/TrilogySDK/eb604b3d88593ee808f7cf15b48ed638fb13e87b/src/CVector2D.cpp -------------------------------------------------------------------------------- /src/CVehicle.cpp: -------------------------------------------------------------------------------- 1 | #include "CVehicle.h" 2 | #include "memory.hpp" 3 | 4 | CVehicle::CVehicle() 5 | { 6 | } 7 | 8 | void CVehicle::SetModelIndex(int nModel) { 9 | memory::GtaCall(0x1237560, this, nModel); 10 | } -------------------------------------------------------------------------------- /src/CVehicleModelInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CVehicleModelInfo.h" 2 | -------------------------------------------------------------------------------- /src/CWeapon.cpp: -------------------------------------------------------------------------------- 1 | #include "CWeapon.h" 2 | #include "memory.hpp" 3 | 4 | void CWeapon::Update(CPed* pPed) { 5 | memory::GtaCall(0x1267350, this, pPed); 6 | } 7 | 8 | bool CWeapon::TakePhotograph(CEntity* entity, CVector* point) { 9 | return memory::GtaCall(0x1263E60, this, entity, point); 10 | } 11 | 12 | bool CWeapon::Fire(CEntity* firingEntity, CVector* origin, CVector* muzzlePosn, CEntity* targetEntity, CVector* target, CVector* originForDriveBy) { 13 | return memory::GtaCall(0x125E110, this, firingEntity, origin, muzzlePosn, targetEntity, target, originForDriveBy); 14 | } 15 | 16 | void CWeapon::AddGunshell(CEntity *entity, CVector *position, CVector2D *direction, float size) { 17 | memory::GtaCall(0x1260C70, this, entity, direction, size); 18 | } -------------------------------------------------------------------------------- /src/CWeaponInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CWeaponInfo.h" 2 | #include "memory.hpp" 3 | 4 | CWeaponInfo* CWeaponInfo::GetWeaponInfo(eWeaponType nWeapon, char nSkill) 5 | { 6 | return memory::GtaCall(0x126A890, nWeapon, nSkill); 7 | } -------------------------------------------------------------------------------- /src/CWeather.cpp: -------------------------------------------------------------------------------- 1 | #include "CWeather.h" 2 | #include "memory.hpp" 3 | 4 | float &CWeather::Sandstorm = *(float *)(memory::GetAddr(0x50B3004)); 5 | float &CWeather::UnderWaterness = *(float *)(memory::GetAddr(0x5571038)); 6 | short &CWeather::ForcedWeatherType = *(short *)(memory::GetAddr(0x51425F0)); 7 | short &CWeather::NewWeatherType = *(short *)(memory::GetAddr(0x50D5294)); 8 | short &CWeather::OldWeatherType = *(short *)(memory::GetAddr(0x50D5298)); 9 | 10 | void CWeather::ForceWeatherNow(short weatherType) { 11 | memory::GtaCall(0x1106920, weatherType); 12 | } -------------------------------------------------------------------------------- /src/CWorld.cpp: -------------------------------------------------------------------------------- 1 | #include "CWorld.h" 2 | #include "memory.hpp" 3 | 4 | char& CWorld::PlayerInFocus = *(char*)(memory::GetAddr(0x505F34E)); 5 | CPlayerInfo* CWorld::Players = (CPlayerInfo*)memory::GetAddr(0x524EFF0); 6 | 7 | void CWorld::Process() { 8 | memory::GtaCall(0x1003870); 9 | } 10 | 11 | void CWorld::Add(CEntity* pEntity) { 12 | memory::GtaCall(0xFFE870, pEntity); 13 | } 14 | 15 | bool CWorld::GetIsLineOfSightClear(const CVector *origin, const CVector *target, bool buildings, bool vehicles, bool peds, bool objects, bool dummies, bool doSeeThroughCheck, bool doIgnoreCameraCheck) { 16 | return memory::GtaCall(0xFFE8E0, origin, target, buildings, vehicles, peds, objects, dummies, doSeeThroughCheck, doIgnoreCameraCheck); 17 | } 18 | 19 | bool CWorld::ProcessLineOfSight(const CVector *origin, const CVector *target, CColPoint *outColPoint, CEntity **outEntity, bool buildings, bool vehicles, bool peds, bool objects, bool dummies, bool doSeeThroughCheck, bool doCameraIgnoreCheck, bool doShootThroughCheck) { 20 | return memory::GtaCall(0xFFFB80, origin, target, outColPoint, outEntity, buildings, vehicles, peds, objects, dummies, doSeeThroughCheck, doCameraIgnoreCheck, doShootThroughCheck); 21 | } -------------------------------------------------------------------------------- /src/FxSystem_c.cpp: -------------------------------------------------------------------------------- 1 | #include "FxSystem_c.h" 2 | #include "memory.hpp" 3 | 4 | void FxSystem_c::AddParticle(CVector *position, CVector *velocity, float unk, FxPrtMult_c *particleData, float a1, float brightness, float a2, int a3) 5 | { 6 | memory::GtaCall(0xA82360, this, position, velocity, unk, particleData, a1, brightness, a2, a3); 7 | } 8 | 9 | FxSystemBP_c* FxSystem_c::Kill() 10 | { 11 | return memory::GtaCall(0x1AFC550, this); 12 | } 13 | 14 | void FxSystem_c::Stop() 15 | { 16 | memory::GtaCall(0x32E1370, this); 17 | } 18 | 19 | FxSystemBP_c* FxSystem_c::PlayAndKill() 20 | { 21 | return memory::GtaCall(0xA82060, this); 22 | } -------------------------------------------------------------------------------- /src/ScriptCommands.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Plugin-SDK (Grand Theft Auto) SHARED source file 3 | Authors: GTA Community. See more here 4 | https://github.com/DK22Pac/plugin-sdk 5 | Do not delete this comment block. Respect others' work! 6 | */ 7 | 8 | #if defined(GTA3) || defined(GTAVC) || defined(GTASA) || defined(GTASA_UNREAL) 9 | #include "ScriptCommands.h" 10 | #include "CPools.h" 11 | 12 | 13 | #ifdef GTASA 14 | #define SCRIPT_COMMANDS_LVAR_MAX_INDEX 31 15 | #else 16 | #define SCRIPT_COMMANDS_LVAR_MAX_INDEX 15 17 | #endif 18 | 19 | scripting::ScriptCode::VarToSet::VarToSet(unsigned int _varIndex, void* _pVar, ScriptResultVarType _varType) { 20 | varIndex = _varIndex; 21 | pVar = _pVar; 22 | varType = _varType; 23 | } 24 | 25 | scripting::ScriptCode::ScriptCode(short commandId) { 26 | capacity = 32; 27 | data = new unsigned char[32]; 28 | size = 0; 29 | varIndexCounter = 0; 30 | if (commandId != -1) { 31 | AddBytes(reinterpret_cast(&commandId), 2); 32 | } 33 | } 34 | 35 | scripting::ScriptCode::~ScriptCode() { 36 | delete[] data; 37 | } 38 | 39 | void scripting::ScriptCode::AddParameterDescription(unsigned char paramType) { 40 | AddBytes(¶mType, 1); 41 | } 42 | 43 | void scripting::ScriptCode::AddBytes(unsigned char* bytes, unsigned int count) { 44 | unsigned int newSize = size + count; 45 | if (newSize > capacity) { 46 | while (newSize > capacity) 47 | capacity += 32; 48 | unsigned char* newData = new unsigned char[capacity]; 49 | memcpy(newData, data, size); 50 | delete[] data; 51 | data = newData; 52 | } 53 | memcpy(&data[size], bytes, count); 54 | size = newSize; 55 | } 56 | 57 | unsigned char* scripting::ScriptCode::GetData() { return data; }; 58 | 59 | #ifndef RAGE 60 | void scripting::ScriptCode::SaveResultVariables(CRunningScript* script) { 61 | #define LocalVar (*(tScriptParam*)&script->m_aLocalVars[varToSet.varIndex]) 62 | for (auto& varToSet : varsToSet) { 63 | if (varToSet.varType == SCRIPT_RESULT_VAR_NUMBER) { 64 | *reinterpret_cast(varToSet.pVar) = LocalVar.uParam; 65 | } 66 | else if (varToSet.varType == SCRIPT_RESULT_VAR_STRING) { 67 | char* pStr = reinterpret_cast(varToSet.pVar); 68 | strncpy(pStr, reinterpret_cast(&LocalVar.iParam), 15); 69 | pStr[15] = '\0'; 70 | } 71 | else if (varToSet.varType == SCRIPT_RESULT_VAR_PED) { 72 | CPed* result = nullptr; 73 | if (LocalVar.iParam != -1) 74 | result = CPools::GetPed(LocalVar.iParam); 75 | *reinterpret_cast(varToSet.pVar) = result; 76 | } 77 | else if (varToSet.varType == SCRIPT_RESULT_VAR_VEHICLE) { 78 | CVehicle* result = nullptr; 79 | if (LocalVar.iParam != -1) 80 | result = CPools::GetVehicle(LocalVar.iParam); 81 | *reinterpret_cast(varToSet.pVar) = result; 82 | } 83 | else if (varToSet.varType == SCRIPT_RESULT_VAR_OBJECT) { 84 | CObject* result = nullptr; 85 | if (LocalVar.iParam != -1) 86 | result = CPools::GetObject(LocalVar.iParam); 87 | *reinterpret_cast(varToSet.pVar) = result; 88 | } 89 | } 90 | } 91 | #endif 92 | 93 | void scripting::ScriptCode::operator<<(char n) { AddParameterDescription(SCRIPTPARAM_STATIC_INT_8BITS); AddBytes(reinterpret_cast(&n), 1); } 94 | void scripting::ScriptCode::operator<<(unsigned char n) { AddParameterDescription(SCRIPTPARAM_STATIC_INT_8BITS); AddBytes(reinterpret_cast(&n), 1); } 95 | void scripting::ScriptCode::operator<<(short n) { AddParameterDescription(SCRIPTPARAM_STATIC_INT_16BITS); AddBytes(reinterpret_cast(&n), 2); } 96 | void scripting::ScriptCode::operator<<(unsigned short n) { AddParameterDescription(SCRIPTPARAM_STATIC_INT_16BITS); AddBytes(reinterpret_cast(&n), 2); } 97 | void scripting::ScriptCode::operator<<(int n) { AddParameterDescription(SCRIPTPARAM_STATIC_INT_32BITS); AddBytes(reinterpret_cast(&n), 4); } 98 | void scripting::ScriptCode::operator<<(unsigned int n) { AddParameterDescription(SCRIPTPARAM_STATIC_INT_32BITS); AddBytes(reinterpret_cast(&n), 4); } 99 | #ifdef GTA3 100 | void scripting::ScriptCode::operator<<(float n) { 101 | AddParameterDescription(SCRIPTPARAM_STATIC_FLOAT); 102 | short s = static_cast(n * 16); 103 | AddBytes(reinterpret_cast(&s), 2); 104 | } 105 | 106 | void scripting::ScriptCode::operator<<(double n) { 107 | AddParameterDescription(SCRIPTPARAM_STATIC_FLOAT); 108 | short s = static_cast(static_cast(n) * 16); 109 | AddBytes(reinterpret_cast(&s), 2); 110 | } 111 | #else 112 | void scripting::ScriptCode::operator<<(float n) { AddParameterDescription(SCRIPTPARAM_STATIC_FLOAT); AddBytes(reinterpret_cast(&n), 4); } 113 | void scripting::ScriptCode::operator<<(double n) { AddParameterDescription(SCRIPTPARAM_STATIC_FLOAT); float f = static_cast(n); AddBytes(reinterpret_cast(&f), 4); } 114 | #endif 115 | void scripting::ScriptCode::operator<<(ScriptCommandEndParameter) { AddParameterDescription(SCRIPTPARAM_END_OF_ARGUMENTS); } 116 | 117 | #ifdef GTASA 118 | void scripting::ScriptCode::operator<<(char* str) { 119 | AddParameterDescription(SCRIPTPARAM_STATIC_PASCAL_STRING); 120 | unsigned int length = strlen(str); 121 | AddParameterDescription(length); 122 | AddBytes(reinterpret_cast(str), length); 123 | } 124 | 125 | void scripting::ScriptCode::operator<<(const char* str) { 126 | AddParameterDescription(SCRIPTPARAM_STATIC_PASCAL_STRING); 127 | unsigned int length = strlen(str); 128 | AddParameterDescription(length); 129 | AddBytes(reinterpret_cast(const_cast(str)), length); 130 | } 131 | 132 | void scripting::ScriptCode::operator<<(char(*p)[16]) { 133 | AddParameterDescription(SCRIPTPARAM_LOCAL_LONG_STRING_VARIABLE); 134 | if (varIndexCounter >= 28) 135 | Error("ScriptCode::operator<<(char **p): reached local var limit"); 136 | varsToSet.emplace_back(varIndexCounter, reinterpret_cast(*p), SCRIPT_RESULT_VAR_STRING); 137 | AddBytes(reinterpret_cast(&varIndexCounter), 2); 138 | varIndexCounter += 4; 139 | } 140 | #else 141 | void scripting::ScriptCode::operator<<(char* str) { 142 | static char tmpString[8]; 143 | strncpy(tmpString, str, 7); 144 | tmpString[7] = '\0'; 145 | AddBytes(reinterpret_cast(tmpString), 8); 146 | } 147 | 148 | void scripting::ScriptCode::operator<<(const char* str) { 149 | static char tmpString[8]; 150 | strncpy(tmpString, str, 7); 151 | tmpString[7] = '\0'; 152 | AddBytes(reinterpret_cast(const_cast(tmpString)), 8); 153 | } 154 | #endif 155 | 156 | void scripting::ScriptCode::operator<<(float* p) { 157 | AddParameterDescription(SCRIPTPARAM_LOCAL_NUMBER_VARIABLE); 158 | if (varIndexCounter >= SCRIPT_COMMANDS_LVAR_MAX_INDEX) 159 | printf("ScriptCode::operator<<(float *p): reached local var limit"); 160 | varsToSet.emplace_back(varIndexCounter, reinterpret_cast(p), SCRIPT_RESULT_VAR_NUMBER); 161 | AddBytes(reinterpret_cast(&varIndexCounter), 2); 162 | ++varIndexCounter; 163 | } 164 | 165 | void scripting::ScriptCode::operator<<(int* p) { 166 | AddParameterDescription(SCRIPTPARAM_LOCAL_NUMBER_VARIABLE); 167 | if (varIndexCounter >= SCRIPT_COMMANDS_LVAR_MAX_INDEX) 168 | printf("ScriptCode::operator<<(int *p): reached local var limit"); 169 | varsToSet.emplace_back(varIndexCounter, reinterpret_cast(p), SCRIPT_RESULT_VAR_NUMBER); 170 | AddBytes(reinterpret_cast(&varIndexCounter), 2); 171 | ++varIndexCounter; 172 | } 173 | 174 | void scripting::ScriptCode::operator<<(unsigned int* p) { 175 | AddParameterDescription(SCRIPTPARAM_LOCAL_NUMBER_VARIABLE); 176 | if (varIndexCounter >= SCRIPT_COMMANDS_LVAR_MAX_INDEX) 177 | printf("ScriptCode::operator<<(unsigned int *p): reached local var limit"); 178 | varsToSet.emplace_back(varIndexCounter, reinterpret_cast(p), SCRIPT_RESULT_VAR_NUMBER); 179 | AddBytes(reinterpret_cast(&varIndexCounter), 2); 180 | ++varIndexCounter; 181 | } 182 | 183 | void scripting::ScriptCode::operator<<(CPed* n) { 184 | if (!n) 185 | operator<<(-1); 186 | else 187 | operator<<(CPools::GetPedRef(n)); 188 | } 189 | 190 | void scripting::ScriptCode::operator<<(CVehicle* n) { 191 | if (!n) 192 | operator<<(-1); 193 | else 194 | operator<<(CPools::GetVehicleRef(n)); 195 | } 196 | 197 | void scripting::ScriptCode::operator<<(CObject* n) { 198 | if (!n) 199 | operator<<(-1); 200 | else 201 | operator<<(CPools::GetObjectRef(n)); 202 | } 203 | 204 | void scripting::ScriptCode::operator<<(CPed** p) { 205 | AddParameterDescription(SCRIPTPARAM_LOCAL_NUMBER_VARIABLE); 206 | if (varIndexCounter >= SCRIPT_COMMANDS_LVAR_MAX_INDEX) 207 | printf("ScriptCode::operator<<(CPed **p): reached local var limit"); 208 | varsToSet.emplace_back(varIndexCounter, reinterpret_cast(p), SCRIPT_RESULT_VAR_PED); 209 | AddBytes(reinterpret_cast(&varIndexCounter), 2); 210 | ++varIndexCounter; 211 | } 212 | 213 | void scripting::ScriptCode::operator<<(CVehicle** p) { 214 | AddParameterDescription(SCRIPTPARAM_LOCAL_NUMBER_VARIABLE); 215 | if (varIndexCounter >= SCRIPT_COMMANDS_LVAR_MAX_INDEX) 216 | printf("ScriptCode::operator<<(CVehicle **p): reached local var limit"); 217 | varsToSet.emplace_back(varIndexCounter, reinterpret_cast(p), SCRIPT_RESULT_VAR_VEHICLE); 218 | AddBytes(reinterpret_cast(&varIndexCounter), 2); 219 | ++varIndexCounter; 220 | } 221 | 222 | void scripting::ScriptCode::operator<<(CObject** p) { 223 | AddParameterDescription(SCRIPTPARAM_LOCAL_NUMBER_VARIABLE); 224 | if (varIndexCounter >= SCRIPT_COMMANDS_LVAR_MAX_INDEX) 225 | printf("ScriptCode::operator<<(CObject **p): reached local var limit"); 226 | varsToSet.emplace_back(varIndexCounter, reinterpret_cast(p), SCRIPT_RESULT_VAR_OBJECT); 227 | AddBytes(reinterpret_cast(&varIndexCounter), 2); 228 | ++varIndexCounter; 229 | } 230 | 231 | #endif --------------------------------------------------------------------------------