Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "plugin.h"
- #include "CStreaming.h"
- static int _ZN14CRunningScript17CollectParametersEPjs = 0x464080;
- __declspec(naked) void CGangs_SetGangModels() {
- _asm {
- movsx eax,word ptr [esp+4] // gangID
- imul eax, 0x2A
- lea eax,[eax]
- mov cx,word ptr[esp+8]
- add eax,dword ptr [0xC0FA3C] // _gangsModels
- test cx, cx
- jl loc_sec_model
- mov [eax], cx
- loc_sec_model:
- mov cx, word ptr[esp+0x0C]
- test cx, cx
- jl loc_third_model
- mov [eax+2], cx
- loc_third_model:
- mov cx, word ptr[esp+0x10]
- test cx, cx
- jl loc_ret
- mov [eax+4], cx
- loc_ret:
- ret
- }
- }
- __declspec(naked) void command_0235_SET_GANG_PED_MODELS_() { // 0x47ECC2
- _asm {
- push 4
- mov ecx,esi
- call _ZN14CRunningScript17CollectParametersEPjs
- mov eax,ds:[0xA43C84] // param 4 gangModel 3
- mov ecx,ds:[0xA43C80] // param 3 gangModel 2
- mov edx,ds:[0xA43C7C] // param 2 gangModel 1
- push eax
- xor eax,eax
- mov eax,ds:[0xA43C78] // param 1 gangID
- push ecx
- push edx
- push eax
- call CGangs_SetGangModels
- add esp,0x10
- xor al,al
- mov ecx,[esp+0x7C]
- mov fs:[0],ecx
- pop edi
- pop esi
- pop ebx
- add esp,0x7C
- ret 4
- }
- }
- __declspec(naked) void command_0236_SET_GANG_CAR_MODEL_() { // not implemented
- _asm {
- push 2
- mov ecx,esi
- call _ZN14CRunningScript17CollectParametersEPjs
- xor al,al
- mov ecx,[esp+0x7C]
- mov fs:[0],ecx
- pop edi
- pop esi
- pop ebx
- add esp,0x7C
- ret 4
- }
- }
- using namespace plugin;
- class CommandTesting {
- public:
- CommandTesting() {
- plugin::patch::SetPointer(0x47F2C0, &command_0235_SET_GANG_PED_MODELS_);
- }
- } commandTesting;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement