Advertisement
HolywoodJack

CommTest

Aug 16th, 2022
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. #include "plugin.h"
  2. #include "CStreaming.h"
  3.  
  4. static int _ZN14CRunningScript17CollectParametersEPjs = 0x464080;
  5.  
  6. __declspec(naked) void CGangs_SetGangModels() {
  7. _asm {
  8. movsx eax,word ptr [esp+4] // gangID
  9. imul eax, 0x2A
  10. lea eax,[eax]
  11. mov cx,word ptr[esp+8]
  12. add eax,dword ptr [0xC0FA3C] // _gangsModels
  13. test cx, cx
  14. jl loc_sec_model
  15. mov [eax], cx
  16. loc_sec_model:
  17. mov cx, word ptr[esp+0x0C]
  18. test cx, cx
  19. jl loc_third_model
  20. mov [eax+2], cx
  21. loc_third_model:
  22. mov cx, word ptr[esp+0x10]
  23. test cx, cx
  24. jl loc_ret
  25. mov [eax+4], cx
  26. loc_ret:
  27. ret
  28. }
  29. }
  30. __declspec(naked) void command_0235_SET_GANG_PED_MODELS_() { // 0x47ECC2
  31. _asm {
  32. push 4
  33. mov ecx,esi
  34. call _ZN14CRunningScript17CollectParametersEPjs
  35. mov eax,ds:[0xA43C84] // param 4 gangModel 3
  36. mov ecx,ds:[0xA43C80] // param 3 gangModel 2
  37. mov edx,ds:[0xA43C7C] // param 2 gangModel 1
  38. push eax
  39. xor eax,eax
  40. mov eax,ds:[0xA43C78] // param 1 gangID
  41. push ecx
  42. push edx
  43. push eax
  44. call CGangs_SetGangModels
  45. add esp,0x10
  46. xor al,al
  47. mov ecx,[esp+0x7C]
  48. mov fs:[0],ecx
  49. pop edi
  50. pop esi
  51. pop ebx
  52. add esp,0x7C
  53. ret 4
  54. }
  55. }
  56.  
  57. __declspec(naked) void command_0236_SET_GANG_CAR_MODEL_() { // not implemented
  58. _asm {
  59. push 2
  60. mov ecx,esi
  61. call _ZN14CRunningScript17CollectParametersEPjs
  62. xor al,al
  63. mov ecx,[esp+0x7C]
  64. mov fs:[0],ecx
  65. pop edi
  66. pop esi
  67. pop ebx
  68. add esp,0x7C
  69. ret 4
  70. }
  71. }
  72.  
  73. using namespace plugin;
  74.  
  75. class CommandTesting {
  76. public:
  77. CommandTesting() {
  78. plugin::patch::SetPointer(0x47F2C0, &command_0235_SET_GANG_PED_MODELS_);
  79. }
  80. } commandTesting;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement