Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "plugin.h"
- #include "extensions\ScriptCommands.h"
- using namespace plugin;
- static int _ZN9CMessages13AddBigMessageEPhjt_2 = 0x69F2B0;
- int chasingCop = 0;
- __declspec(naked) void goodCitizenFixer_asm() { // 0x66B477
- _asm {
- mov chasingCop, esi
- mov eax,[esi+0x47C]
- pushad
- add esi,0x46C
- mov eax,esi
- mov edx,esi
- mov edx,[edx]
- or edx,0x800000
- mov [eax],edx
- popad
- push 0x66B47D
- ret
- }
- }
- __declspec(naked) void removeFlag_asm() { // 0x5320CD
- _asm {
- pushad
- mov esi,[esp+0x54]
- add esi,0x46C
- mov eax,esi
- mov edx,esi
- mov edx,[edx]
- and edx,0xFF7FFFFF // -0x800000
- mov [eax],edx
- popad
- push _ZN9CMessages13AddBigMessageEPhjt_2
- ret
- }
- }
- class GoodCitizenBonusFix {
- public:
- GoodCitizenBonusFix() {
- injector::MakeJMP(0x66B477, goodCitizenFixer_asm);
- patch::RedirectCall(0x5320CD, removeFlag_asm);
- Events::gameProcessEvent += [] {
- Command<0x0ADF>("GOODBOY", "$50 GOOD CITIZEN BONUS!"); // COMMAND_ADD_TEXT_LABEL
- if (chasingCop) {
- CPed *chasingCopPed = reinterpret_cast<CPed *>(chasingCop);
- }
- for (int i = 0; i < CPools::ms_pPedPool->m_nSize; i++) {
- CPed *ped = CPools::ms_pPedPool->GetAt(i);
- if (ped) {
- if (ped->m_nPedFlags.bBeingChasedByPolice) {
- }
- // ped->m_nPedFlags.bBeingChasedByPolice = 1;
- }
- }
- };
- }
- } goodCitizenBonusFix;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement