Junior_Djjr Posted February 10, 2014 Share Posted February 10, 2014 (edited) I'm creating a mod to make new functions for weapons, cars, objects and actors... (yes, like imvehft)I'm starting, and the second function of i created is this: (you can download the mod here, and the weapon here)works for me and some others, but, some(much) peoples don't works in a modified game, only in unmodf game...i tested some scripts with my friend, and i discover of the problem is the "check" of the firing, in most games, don't returns true...i tried to check with:opcode 02E0: (actor firing)WeaponSlot - DWORD state // + 4 (0 idle, 1 firing, 2 reloading)0000046C pedFlags dd ? (checking the 16° bit)all of this works for me, but don't works for some others peoples! don't returns true, don't change the value etc...anyone know what is the mod of maked this bug and know other metod to check if the actor is firing?(i need this to works in any weapon, and no, don't say to me use key press ) Edited February 10, 2014 by Junior_Djjr XMDS 1 Link to comment Share on other sites More sharing options...
ZAZ Posted February 10, 2014 Share Posted February 10, 2014 (edited) works for me and some others, but, some(much) peoples don't works in a modified game, only in unmodf game... that happens often because some users have running anything else, bad scripted scripts or any plugin why should you fix your code if the problem is caused by another mod? are you Jesus? The reason for the problem must be fixed, not your code Example, I found a betatester for my mod two weeks a ago. He reported Sometimes I'm having trouble when I get to the heli zone, the pilot is out and walks away from heli. From here the script will be bugged. The heli will fly without pilot and later Good news with your TakeMoneyRun script. I removed the line: "039E: set_actor [email protected] locked 1 while_in_car i answered Unbelievable, it never happens for me that the pilot leaves the heli and set_actor [email protected] locked 1 avoids highjacking Are you shure that you don't have another cleoscript that have effect to peds? then he answered I never believed that IMFX (16sept2013 plugin.dll version) could be the issue. My bad... If you still want to solve it, then you must find out what cause the side effect But you can't be shure that another problem occur because of other mods Edited February 10, 2014 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Junior_Djjr Posted February 10, 2014 Author Share Posted February 10, 2014 omg........ and i don't discovered yet what mod make this but anyone know other way to check the firing of actor? :c (if i discover the mod of cause this bug i warning here ok) Link to comment Share on other sites More sharing options...
Wesser Posted February 10, 2014 Share Posted February 10, 2014 (edited) The script delay might cause the bug for some users, because the firing state changes almost instantly. Tomorrow I will show you how to inject useful assembly code at 0x007429F2 to try bypassing this inconvenience. Edited February 10, 2014 by Wesser 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Junior_Djjr Posted February 10, 2014 Author Share Posted February 10, 2014 The script delay might cause the bug for some users, because the firing state changes almost instantly. Tomorrow I will show you how to inject useful assembly code at 0x007429F2 to try bypassing this inconvenience. make sense! very good, this will fix some other mods too Link to comment Share on other sites More sharing options...
DK22Pac Posted February 10, 2014 Share Posted February 10, 2014 Maybe checking CWeapon +0x4 m_dwState // 1 = firingor 0x600F70 CTaskSimpleUseGun *__thiscall CPedIntelligence::GetTaskUseGun(CPedIntelligence *this)CTaskSimpleUseGun +0x10 m_nState // 0 - 4, maybe some of themAlso, why do you hate IVF so much? Link to comment Share on other sites More sharing options...
Junior_Djjr Posted February 10, 2014 Author Share Posted February 10, 2014 Maybe checking CWeapon +0x4 m_dwState // 1 = firingor 0x600F70 CTaskSimpleUseGun *__thiscall CPedIntelligence::GetTaskUseGun(CPedIntelligence *this)CTaskSimpleUseGun +0x10 m_nState // 0 - 4, maybe some of them the first isn't the same of weapon slot state? ...but i think of the second will work Also, why do you hate IVF so much?lol i'm not trying a competition with your mod, i will only create functions for weapons (and others like objects or actors) ...and others new functions for vehicles, like roof folding and electric windows from my old car (307cc BMS Edition) Link to comment Share on other sites More sharing options...
DK22Pac Posted February 10, 2014 Share Posted February 10, 2014 but i think of the second will workYou may try this 0A96: [email protected] = actor $PLAYER_ACTOR [email protected] += 0x47C0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AA8: call_function_method 0x600F70 struct [email protected] num_params 0 pop 0 [email protected] [email protected] <> 0then [email protected] += 0x10 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 0AD1: show_formatted_text_highpriority "%d" time 100 [email protected] Link to comment Share on other sites More sharing options...
Junior_Djjr Posted February 11, 2014 Author Share Posted February 11, 2014 (edited) yeah... i already tried with my ugly script {$CLEO}0000:while true wait 0 player.Defined($player_char) jf continue 0A96: [email protected] = actor $PLAYER_ACTOR struct [email protected] += 0x47C //CPedIntelligence 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 0AA8: call_function_method 0x600F70 struct [email protected] num_params 0 pop 0 [email protected] //CTaskSimpleUseGun [email protected] > 0 jf continue [email protected] += 0x10 0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 0AD1: show_formatted_text_highpriority "%i" time 200 [email protected] the problem is, don't returns the exact time of the fire, is only "is firing? isn't firing?" and i think of will be impossible to get the exactly time when this bug is hereis better to wait the Wesser fix this bug? this fix may be implanted in new version of cleo library too? edit: I could check the decrease of the am...ok no... Edited February 11, 2014 by Junior_Djjr Link to comment Share on other sites More sharing options...
DK22Pac Posted February 11, 2014 Share Posted February 11, 2014 Firing time must be here CWeapon +0x10 Link to comment Share on other sites More sharing options...
Junior_Djjr Posted February 11, 2014 Author Share Posted February 11, 2014 Firing time must be here CWeapon +0x10 i used CWeaponSlot+0x16 (i don't know if is the same) but works perfect! like... the value is const, and change in each bullet then is only to check the change of the value thanks one doubt, if i'm in twin weapons... i can control each weapon in each hand? or the objects of weapon is "mirrored"? as one could imagine... the slide cover of each weapon move in same time when fire Link to comment Share on other sites More sharing options...
Wesser Posted August 7, 2014 Share Posted August 7, 2014 (edited) Lately, I read you wish to review your Enhanced Functions script, I believe you do not mind using this code: {$CLEO}0000: NOPconst _CPed__GetWeaponSkill = 0x005E3B60 _CPedIntelligence__GetTaskUseGun = 0x00600F70 _CWeaponInfo__GetWeaponInfo = 0x00743C60endconst _HOOK_PTR_005E476B_CPool_CPed_CPed__Delete = [email protected] _HOOK_PTR_00630733_CTaskSimpleDead__ProcessPed = [email protected] _HOOK_PTR_007428E9_CWeapon__Fire = [email protected] _CPools__GettPoolPedID = [email protected] _CGunFireInfo__ms_aPedGunFireInfo = [email protected] _CGunFireInfo__AddPedGunFireInfo = [email protected] _CGunFireInfo__RemovePedGunFireInfo = [email protected] _CGunFireInfo__GetPedGunFireTime = [email protected]: [email protected] = current_thread_pointer0A8E: [email protected] = [email protected] + 0x10 // CRunningScript.m_iBaseAddress0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00A8F: _HOOK_PTR_005E476B_CPool_CPed_CPed__Delete = [email protected] - @_HOOK_PTR_005E476B_CPool_CPed_CPed__Delete0A8F: _HOOK_PTR_00630733_CTaskSimpleDead__ProcessPed = [email protected] - @_HOOK_PTR_00630733_CTaskSimpleDead__ProcessPed0A8F: _HOOK_PTR_007428E9_CWeapon__Fire = [email protected] - @_HOOK_PTR_007428E9_CWeapon__Fire0A8F: _CPools__GettPoolPedID = [email protected] - @_CPools__GettPoolPedID0A8F: _CGunFireInfo__ms_aPedGunFireInfo = [email protected] - @_CGunFireInfo__ms_aPedGunFireInfo0A8F: _CGunFireInfo__AddPedGunFireInfo = [email protected] - @_CGunFireInfo__AddPedGunFireInfo0A8F: _CGunFireInfo__RemovePedGunFireInfo = [email protected] - @_CGunFireInfo__RemovePedGunFireInfo0A8F: _CGunFireInfo__GetPedGunFireTime = [email protected] - @_CGunFireInfo__GetPedGunFireTime0A8F: [email protected] = _HOOK_PTR_005E476B_CPool_CPed_CPed__Delete - 0x005E47700A8C: write_memory 0x005E476B size 1 value 0xE9 virtual_protect 10A8C: write_memory 0x005E476C size 4 value [email protected] virtual_protect 10A8E: [email protected] = _HOOK_PTR_005E476B_CPool_CPed_CPed__Delete + 20A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CPools__GettPoolPedID - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _HOOK_PTR_005E476B_CPool_CPed_CPed__Delete + 0x140A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CGunFireInfo__RemovePedGunFireInfo - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _HOOK_PTR_005E476B_CPool_CPed_CPed__Delete + 0x200A8E: [email protected] = [email protected] + 40A8F: [email protected] = 0x005E4784 - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8F: [email protected] = _HOOK_PTR_00630733_CTaskSimpleDead__ProcessPed - 0x006307380A8C: write_memory 0x00630733 size 1 value 0xE9 virtual_protect 10A8C: write_memory 0x00630734 size 4 value [email protected] virtual_protect 10A8E: [email protected] = _HOOK_PTR_00630733_CTaskSimpleDead__ProcessPed + 20A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CPools__GettPoolPedID - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _HOOK_PTR_00630733_CTaskSimpleDead__ProcessPed + 80A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CGunFireInfo__RemovePedGunFireInfo - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _HOOK_PTR_00630733_CTaskSimpleDead__ProcessPed + 0x190A8E: [email protected] = [email protected] + 40A8F: [email protected] = 0x0063073C - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8F: [email protected] = _HOOK_PTR_007428E9_CWeapon__Fire - 0x007428EE0A8C: write_memory 0x007428E9 size 1 value 0xE9 virtual_protect 10A8C: write_memory 0x007428EA size 4 value [email protected] virtual_protect 10A8E: [email protected] = _HOOK_PTR_007428E9_CWeapon__Fire + 20A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CPools__GettPoolPedID - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _HOOK_PTR_007428E9_CWeapon__Fire + 0x130A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CGunFireInfo__AddPedGunFireInfo - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _HOOK_PTR_007428E9_CWeapon__Fire + 0x200A8E: [email protected] = [email protected] + 40A8F: [email protected] = 0x007428EE - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _CGunFireInfo__AddPedGunFireInfo + 0x100A8C: write_memory [email protected] size 4 value _CGunFireInfo__ms_aPedGunFireInfo virtual_protect 00A8E: [email protected] = _CGunFireInfo__AddPedGunFireInfo + 0x1F0A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CPedIntelligence__GetTaskUseGun - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _CGunFireInfo__RemovePedGunFireInfo + 0x0B0A8C: write_memory [email protected] size 4 value _CGunFireInfo__ms_aPedGunFireInfo virtual_protect 00A8E: [email protected] = _CGunFireInfo__GetPedGunFireTime + 0x0D0A8C: write_memory [email protected] size 4 value _CGunFireInfo__ms_aPedGunFireInfo virtual_protect 00A8E: [email protected] = _CGunFireInfo__GetPedGunFireTime + 0x2D0A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CPed__GetWeaponSkill - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8E: [email protected] = _CGunFireInfo__GetPedGunFireTime + 0x340A8E: [email protected] = [email protected] + 40A8F: [email protected] = _CWeaponInfo__GetWeaponInfo - [email protected]: write_memory [email protected] size 4 value [email protected] virtual_protect 0while true wait 0 0A96: [email protected] = actor $PLAYER_ACTOR struct 0AA7: call_function _CPools__GettPoolPedID num_params 1 pop 1 pPed [email protected] iPoolID [email protected] 0470: [email protected] = actor $PLAYER_ACTOR current_weapon 0AA7: call_function _CGunFireInfo__GetPedGunFireTime num_params 4 pop 4 bTwinPistol false eWeaponType [email protected] pPed [email protected] iPoolID [email protected] uiFireTime [email protected] [...] 0AA8: call_function_method _CPed__GetWeaponSkill struct [email protected] num_params 1 pop 0 eWeaponType [email protected] cWeaponSkill [email protected] 0AA7: call_function _CWeaponInfo__GetWeaponInfo num_params 2 pop 2 cWeaponSkill [email protected] eWeaponType [email protected] weaponInfo [email protected] 0A8E: [email protected] = [email protected] + 0x18 // CWeaponInfo.m_uiFlags 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 if 08B7: test [email protected] bit 11 // TWIN_PISTOL then 0AA7: call_function _CGunFireInfo__GetPedGunFireTime num_params 4 pop 4 bTwinPistol true eWeaponType [email protected] pPed [email protected] iPoolID [email protected] uiFireTime [email protected] [...] end //0AA7: call_function _CGunFireInfo__RemovePedGunFireInfo num_params 1 pop 1 iPoolID [email protected]:_HOOK_PTR_005E476B_CPool_CPed_CPed__Deletehex 51 // 00000000 push ecx E8 00000000 // 00000001 call CPools::GettPoolPedID 59 // 00000006 pop ecx 8BD0 // 00000007 mov edx, eax 83B9 30050000 37 // 00000009 cmp dword ptr [ecx+CPed.m_uiPedState], PEDSTATE_WASTED 74 07 // 00000010 je ped_is_wasted 50 // 00000012 push eax E8 00000000 // 00000013 call CGunFireInfo::RemovePedGunFireInfo 5A // 00000018 pop edx // 00000019 ped_is_wasted: 8B4E 04 // 00000019 mov ecx, [esi+CPool<CPed, CPed>.m_pFlags] 8D0411 // 0000001C lea eax, [ecx+edx] E9 00000000 // 0000001F jmp CPool<CPed, CPed>::Delete+24hend:_HOOK_PTR_00630733_CTaskSimpleDead__ProcessPedhex 56 // 00000000 push esi E8 00000000 // 00000001 call CPools::GettPoolPedID 50 // 00000006 push eax E8 00000000 // 00000007 call CGunFireInfo::RemovePedGunFireInfo 83C4 08 // 0000000C add esp, 8 C686 18070000 00 // 0000000F mov byte ptr [esi+CPed.m_cWeaponSlot], 0 8BCE // 00000016 mov ecx, esi E9 00000000 // 00000018 jmp CTaskSimpleDead::ProcessPed+13Chend:_HOOK_PTR_007428E9_CWeapon__Firehex 57 // 00000000 push edi E8 00000000 // 00000001 call CPools::GettPoolPedID 8B0D 84CBB700 // 00000006 mov ecx, CTimer.m_snTimeInMilliseconds 51 // 0000000C push ecx 8B16 // 0000000D mov edx, [esi+CWeapon.m_eWeaponType] 52 // 0000000F push edx 57 // 00000010 push edi 50 // 00000011 push eax E8 00000000 // 00000012 call CGunFireInfo::AddPedGunFireInfo 83C4 14 // 00000017 add esp, 14h 8B46 08 // 0000001A mov eax, [esi+CWeapon.m_iAmmoInClip] 85C0 // 0000001D test eax, eax E9 00000000 // 0000001F jmp CWeapon::Fire+05EEhend{ int CPools::GettPoolPedID(CPed *pPed) ( return ((int)pPed - (int)CPools::ms_pPedPool->m_pObjects) / sizeof(CCopPed); )}:_CPools__GettPoolPedIDhex 8B4C24 04 // 00000000 mov ecx, [esp+pPed] 8B15 9044B700 // 00000004 mov edx, CPools.ms_pPedPool 2B0A // 0000000A sub ecx, [edx+CPool<CPed, CPed>.m_pObjects] B8 A77CEE41 // 0000000C mov eax, 41EE7CA7h F7E9 // 00000011 imul ecx C1FA 09 // 00000013 sar edx, 9 8BC2 // 00000016 mov eax, edx C1E8 1F // 00000018 shr eax, 31 03C2 // 0000001B add eax, edx C3 // 0000001D ret// 90 // 0000001E nop// 90 // 0000001F nopend{ class CGunFireInfo ( public: struct PedInfo ( eWeaponType m_eWeaponType; unsigned int m_uiRGunFireTime; unsigned int m_uiLGunFireTime; ); static PedInfo ms_aPedGunFireInfo[140]; static void AddPedGunFireInfo(int iPoolID, CPed *pPed, eWeaponType eWeaponType, unsigned int uiFireTime); static void RemovePedGunFireInfo(int iPoolID); static unsigned int GetPedGunFireTime(int iPoolID, CPed *pPed, eWeaponType eWeaponType, bool bTwinPistol); );}:_CGunFireInfo__ms_aPedGunFireInfohex 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000end{ void CGunFireInfo::AddPedGunFireInfo(int iPoolID, CPed *pPed, eWeaponType eWeaponType, unsigned int uiFireTime) ( CTaskSimpleUseGun *pTaskSimpleUseGun = pPed->m_pPedIntelligence->GetTaskUseGun(); if(!pTaskSimpleUseGun || pTaskSimpleUseGun->m_ucGunFlashFlag & GUNFLASH_RHAND) ( ms_aPedGunFireInfo[iPoolID].m_uiRGunFireTime = uiFireTime; if(ms_aPedGunFireInfo[iPoolID].m_eWeaponType != eWeaponType) ms_aPedGunFireInfo[iPoolID].m_uiLGunFireTime = 0; ) else if(pTaskSimpleUseGun->m_ucGunFlashFlag & GUNFLASH_LHAND) ( if(ms_aPedGunFireInfo[iPoolID].m_eWeaponType != eWeaponType) ms_aPedGunFireInfo[iPoolID].m_uiRGunFireTime = 0; ms_aPedGunFireInfo[iPoolID].m_uiLGunFireTime = iFireTime; ) else ( ms_aPedGunFireInfo[iPoolID].m_uiRGunFireTime = 0; ms_aPedGunFireInfo[iPoolID].m_uiLGunFireTime = 0; ) ms_aPedGunFireInfo[iPoolID].m_eWeaponType = eWeaponType; )}:_CGunFireInfo__AddPedGunFireInfohex 53 // 00000000 push ebx 33DB // 00000001 xor ebx, ebx 56 // 00000003 push esi 8B7424 0C // 00000004 mov esi, [esp+8+iPoolID] 8D3476 // 00000008 lea esi, [esi+esi*2] C1E6 02 // 0000000B shl esi, 2 81C6 00000000 // 0000000E add esi, offset CGunFireInfo.ms_aPedGunFireInfo 8B4424 10 // 00000014 mov eax, [esp+8+pPed] 8B88 7C040000 // 00000018 mov ecx, [eax+CPed.m_pPedIntelligence] E8 00000000 // 0000001E call CPedIntelligence::GetTaskSimpleUseGun 8B4C24 18 // 00000023 mov ecx, [esp+8+uiFireTime] 8B5424 14 // 00000027 mov edx, [esp+8+eWeaponType] 85C0 // 0000002B test eax, eax 74 07 // 0000002D jz right_gun_fire_time 8A40 0D // 0000002F mov al, byte ptr [eax+CPedIntelligence.m_ucGunFlashFlag] A8 01 // 00000032 test al, GUNFLASH_RHAND 74 0C // 00000034 jz left_gun_fire_time // 00000036 right_gun_fire_time: 894E 04 // 00000036 mov [esi+CGunFireInfo.PedInfo.m_uiRGunFireTime], ecx 3916 // 00000039 cmp [esi+CGunFireInfo.PedInfo.m_eWeaponType], edx 74 03 // 0000003B je left_gun_fire_no_reset 895E 08 // 0000003D mov [esi+CGunFireInfo.PedInfo.m_uiLGunFireTime], ebx // 00000040 left_gun_fire_no_reset: EB 16 // 00000040 jmp epilogue // 00000042 left_gun_fire_time: A8 02 // 00000042 test al, GUNFLASH_LHAND 74 0C // 00000044 jz gun_fire_time_reset 3916 // 00000046 cmp [esi+CGunFireInfo.PedInfo.m_eWeaponType], edx 74 03 // 00000048 je right_gun_fire_no_reset 895E 04 // 0000004A mov [esi+CGunFireInfo.PedInfo.m_uiRGunFireTime], ebx // 0000004D right_gun_fire_no_reset: 894E 08 // 0000004D mov [esi+CGunFireInfo.PedInfo.m_uiLGunFireTime], ecx EB 06 // 00000050 jmp epilogue // 00000052 gun_fire_time_reset: 895E 04 // 00000052 mov [esi+CGunFireInfo.PedInfo.m_uiRGunFireTime], ebx 895E 08 // 00000055 mov [esi+CGunFireInfo.PedInfo.m_uiLGunFireTime], ebx // 00000058 epilogue: 8916 // 00000058 mov [esi+CGunFireInfo.PedInfo.m_eWeaponType], edx 5E // 0000005A pop esi 5B // 0000005B pop ebx C3 // 0000005C ret// 90 // 0000005D nop// 90 // 0000005E nop// 90 // 0000005F nopend{ void CGunFireInfo::RemovePedGunFireInfo(int iPoolID) ( ms_aPedGunFireInfo[iPoolID].m_eWeaponType = WEAPONTYPE_UNARMED; ms_aPedGunFireInfo[iPoolID].m_uiRGunFireTime = 0; ms_aPedGunFireInfo[iPoolID].m_uiLGunFireTime = 0; )}:_CGunFireInfo__RemovePedGunFireInfohex 8B4424 04 // 00000000 mov eax, [esp+iPoolID] 8D0440 // 00000004 lea eax, [eax+eax*2] C1E0 02 // 00000007 shl eax, 2 05 00000000 // 0000000A add eax, offset CGunFireInfo.ms_aPedGunFireInfo 33C9 // 0000000F xor ecx, ecx 8908 // 00000011 mov [eax+CGunFireInfo.PedInfo.m_eWeaponType], ecx 8948 04 // 00000013 mov [eax+CGunFireInfo.PedInfo.m_uiRGunFireTime], ecx 8948 08 // 00000016 mov [eax+CGunFireInfo.PedInfo.m_uiLGunFireTime], ecx C3 // 00000019 ret// 90 // 0000001A nop// 90 // 0000001B nop// 90 // 0000001C nop// 90 // 0000001D nop// 90 // 0000001E nop// 90 // 0000001F nopend{ unsigned int CGunFireInfo::GetPedGunFireTime(int iPoolID, CPed *pPed, eWeaponType eWeaponType, bool bTwinPistol) ( CWeaponInfo *pWeaponInfo; if(ms_aPedGunFireInfo[iPoolID].m_eWeaponType == eWeaponType) ( if(!bTwinPistol) return ms_aPedGunFireInfo[iPoolID].m_uiRGunFireTime; pWeaponInfo = CWeaponInfo::GetWeaponInfo(eWeaponType, pPed->GetWeaponSkill(eWeaponType)); if(pWeaponInfo->m_uiFlags & TWIN_PISTOL) return ms_aPedGunFireInfo[iPoolID].m_uiLGunFireTime; ) return 0; )}:_CGunFireInfo__GetPedGunFireTimehex 53 // 00000000 push ebx 8B5C24 08 // 00000001 mov ebx, [esp+4+iPoolID] 8D1C5B // 00000005 lea ebx, [ebx+ebx*2] C1E3 02 // 00000008 shl ebx, 2 81C3 00000000 // 0000000B add ebx, offset CGunFireInfo.ms_aPedGunFireInfo 56 // 00000011 push esi 8B7424 14 // 00000012 mov esi, [esp+8+eWeaponType] 3933 // 00000016 cmp [ebx+CGunFireInfo.PedInfo.m_eWeaponType], esi 75 2F // 00000018 jne no_gun_fire_time 8B5424 18 // 0000001A mov edx, [esp+8+bTwinPistol] 85D2 // 0000001E test edx, edx 75 05 // 00000020 jnz left_gun_fire_time 8B43 04 // 00000022 mov eax, [ebx+CGunFireInfo.PedInfo.m_uiRGunFireTime] EB 24 // 00000025 jmp epilogue // 00000027 left_gun_fire_time: 56 // 00000027 push esi 8B4C24 14 // 00000028 mov ecx, [esp+0Ch+pPed] E8 00000000 // 0000002C call CPed::GetWeaponSkill 50 // 00000031 push eax 56 // 00000032 push esi E8 00000000 // 00000033 call CWeaponInfo::GetWeaponInfo 83C4 08 // 00000038 add esp, 8 F740 18 00080000 // 0000003B test dword ptr [eax+CWeaponInfo.m_uiFlags], TWIN_PISTOL 74 05 // 00000042 jz no_gun_fire_time 8B43 08 // 00000044 mov eax, [ebx+CGunFireInfo.PedInfo.m_uiLGunFireTime] EB 02 // 00000047 jmp epilogue // 00000049 no_gun_fire_time: 33C0 // 00000049 xor eax, eax // 0000004B epilogue: 5E // 0000004B pop esi 5B // 0000004C pop ebx C3 // 0000004D ret// 90 // 0000004E nop// 90 // 0000004F nopend one doubt, if i'm in twin weapons... i can control each weapon in each hand? or the objects of weapon is "mirrored"? as one could imagine... the slide cover of each weapon move in same time when fire Unfortunately, only a clump is cloned per weapon which is rendered twice, one for each hand. Edited August 7, 2014 by Wesser Junior_Djjr 1 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Junior_Djjr Posted September 9, 2014 Author Share Posted September 9, 2014 (edited) (only now i view this message, i'm returned in the mod yesterday in a new function) holy sh*t, this is very nice! so, what the vantage use this and not this?: 0A8D: [email protected] = read_memory [email protected] size 1 vp 0 //[email protected] = CWeaponSlot+0x16if [email protected] <> [email protected] [email protected] = [email protected] 0485: return_true //firedelse 059A: return_falseendreturn Edited September 9, 2014 by Junior_Djjr Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now