Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

How do you display code correctly on this site??


Zambini
 Share

Recommended Posts

I remember the old layout when the code was arranged correctly but now it's all in a straight line.

Tried every browser and still the same.

Here's how it displays

https://ibb.co/DtXpMVM

Link to comment
Share on other sites

21 minutes ago, ZAZ said:

The old code block format is broken, because of forums software update

You must correct it by manual word wrap

This needs to know where a new line begins

 

Urgh. I was trying to follow along your cleo tutorial but it's literally impossible!

And how do you do it by word wrap?

Can you correct the last 2 comments by Silent and Wesser on this page:

 

https://gtaforums.com/topic/737166-how-to-attach-object-on-left-hand-while-handle-weapon/

 

And save it as txt then post it? 

Not being lazy but I'm completely unfamiliar with that and don't know what goes where. 

Link to comment
Share on other sites

56 minutes ago, Zambini said:

I remember the old layout when the code was arranged correctly but now it's all in a straight line.

Tried every browser and still the same.

Here's how it displays

https://ibb.co/DtXpMVM

entering the topic with http://web.archive.org/ may help you to correct the display.. Why don't you post the topic here so i may post the code to you 😉

11 minutes ago, Zambini said:

Urgh. I was trying to follow along your cleo tutorial but it's literally impossible!

And how do you do it by word wrap?

Can you correct the last 2 comments by Silent and Wesser on this page:

 

https://gtaforums.com/topic/737166-how-to-attach-object-on-left-hand-while-handle-weapon/

 

And save it as txt then post it? 

Not being lazy but I'm completely unfamiliar with that and don't know what goes where. 

// Usage: 0AB1: call_scm_func @ATEST_ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.0 0.0 0.0 on_bone 6
// This SCM function works as code below.
//  070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.0 0.0 0.0 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 0
// But it affects in only 1 frame.
// It means that you have to call this in every frame and you can use this to any objects.
:ATEST_ATTACH
0A9F: [email protected] = current_thread_pointer
000A: [email protected] += 0x44
0A96: [email protected] = actor [email protected] struct
0085: [email protected] = [email protected] // (int)
000A: [email protected] += 0x18
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
0AA7: call_function 0x734A40 num_params 1 pop 1 [email protected] [email protected] // _clumpGetFirstSkinAtomicHAnimHierarchy
0012: [email protected] *= 0x4
000A: [email protected] += 0x488
005A: [email protected] += [email protected] // (int)
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
000A: [email protected] += 0x14
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
0A8D: [email protected] = read_memory 0x7C51E0 size 4 virtual_protect 1
if
    0039: [email protected] == 0x424548B
then
    0AA7: call_function 0x7C51E0 num_params 2 pop 2 [email protected] [email protected] [email protected] // _RpHAnimIDGetIndex
    0AA7: call_function 0x7C5160 num_params 1 pop 1 [email protected] [email protected] // _RpHAnimHierarchyGetMatrixArray
    0012: [email protected] *= 0x40
    005A: [email protected] += [email protected] // (int)
    0AA5: call 0x7EDDD0 num_params 4 pop 4 [email protected] 1 [email protected] [email protected]
else
    0AA7: call_function 0x7C51A0 num_params 2 pop 2 [email protected] [email protected] [email protected] // _RpHAnimIDGetIndex
    0AA7: call_function 0x7C5120 num_params 1 pop 1 [email protected] [email protected] // _RpHAnimHierarchyGetMatrixArray
    0012: [email protected] *= 0x40
    005A: [email protected] += [email protected] // (int)
    0AA5: call 0x7EDD90 num_params 4 pop 4 [email protected] 1 [email protected] [email protected]
end
0177: set_object [email protected] Z_angle_to 0.0
0A98: [email protected] = object [email protected] struct
000A: [email protected] += 0x14
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
000A: [email protected] += -0x14
0AA6: call_method 0x411990 struct [email protected] num_params 0 pop 0 // sub_411990
0AA6: call_method 0x59AD20 struct [email protected] num_params 1 pop 0 [email protected] // _CMatrix__copyTo
0AA6: call_method 0x4241C0 struct [email protected] num_params 1 pop 0 [email protected] // sub_4241C0
000A: [email protected] += 0x18
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
if
    8039:   not  [email protected] == 0
then
    000A: [email protected] += 0x4
    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
    000A: [email protected] += 0x10
    0AA6: call_method 0x59AD70 struct [email protected] num_params 1 pop 0 [email protected] // _CMatrix__copyTo
end
000A: [email protected] += -0x18
0AA6: call_method 0x532B00 struct [email protected] num_params 0 pop 0 // _RwFrameUpdateObject
0AB2: ret 0

Silent..

{$CLEO}

const
    _CPedIntelligence__GetTaskHold  = 0x00600FF0
    _CWorld__PlayerInFocus          = 0x00B7CD74
    _CWorld__Players                = 0x00B7CD98
end
const
    _HOOK_PTR_005E784F_CPed__Render = [email protected]
    _CWorld__PlayersExtras          = [email protected]
end

0A9F: [email protected] = current_thread_pointer
[email protected] += 0x10 // CRunningScript.m_pBaseAddress
0A8D: [email protected] = read_memory [email protected] size 4 vp 0
0A8F: _HOOK_PTR_005E784F_CPed__Render = [email protected] - @_HOOK_PTR_005E784F_CPed__Render
0A8F: _CWorld__PlayersExtras = [email protected] - @_CWorld__PlayersExtras

0A8F: [email protected] = _HOOK_PTR_005E784F_CPed__Render - 0x005E7854
0A8C: write_memory 0x005E784F size 1 value 0xE9 vp 1
0A8C: write_memory 0x005E7850 size 4 value [email protected] vp 1

0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 1
0A8E: [email protected] = [email protected] + 4
0A8F: [email protected] = _CPedIntelligence__GetTaskHold - [email protected]
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8F: [email protected] = 0x005E7858 - _HOOK_PTR_005E784F_CPed__Render
0A8F: [email protected] = 0x005E787C - _HOOK_PTR_005E784F_CPed__Render
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 9
0A8F: [email protected] = [email protected] - 0x0D
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x1C
0A8F: [email protected] = [email protected] - 0x20
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x25
0A8C: write_memory [email protected] size 4 value _CWorld__PlayersExtras vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x2D
0A8F: [email protected] = [email protected] - 0x31
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x32
0A8F: [email protected] = [email protected] - 0x36
0A8C: write_memory [email protected] size 4 value [email protected] vp 0

[...]

0A90: [email protected] = 0 * 4 // PLAYERID * sizeof(CPlayerExtraInfo)
005A: [email protected] += _CWorld__PlayersExtras
0A8C: write_memory [email protected] size 1 value true vp 0 // false by default.

// Here player1's weapon is always drawn.

[...]

:_HOOK_PTR_005E784F_CPed__Render
hex
    E8 00000000   // 00000000 call    CPedIntelligence::GetTaskHold
    85C0          // 00000005 test    eax, eax
    0F84 00000000 // 00000007 jz      CPed::Render+1D8h
    8B8E 98050000 // 0000000D mov     ecx, [esi+CPed.m_iPedType]
    85C9          // 00000013 test    ecx, ecx
    74 09         // 00000015 jz      ped_is_player
    83F9 01       // 00000017 cmp     ecx, PEDTYPE_PLAYER2
    0F85 00000000 // 0000001A jne     CPed::Render+1FCh
                  // 00000020 ped_is_player:
    C1E1 02       // 00000020 shl     ecx, 2
    8A91 00000000 // 00000023 mov     dl, CWorld::PlayersExtras.m_bAlwaysDrawWeapon[ecx]
    84D2          // 00000029 test    dl, dl
    0F84 00000000 // 0000002B jz      CPed::Render+1FCh
    E9 00000000   // 00000031 jmp     CPed::Render+1D8h
end

{
    class CPlayerExtraInfo
    (
    public:
        bool m_bAlwaysDrawWeapon;
    );

    CPlayerExtraInfo CWorld::PlayersExtras[2];
}
:_CWorld__PlayersExtras
hex
    00 000000 00 000000
end

Wesser.. 

// This file was decompiled using SASCM.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
{$CLEO .cs}

//-------------MAIN---------------
thread 'TEST' 

:TEST_11
model.load(#GUN_BOXWEE)
model.load(#KNIFECUR)
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
else_jump @TEST_11 
if 
00E1:   player 0 pressed_key 6  
else_jump @TEST_11
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.1 0.0 0.0 
01B2: give_actor $PLAYER_ACTOR weapon 4 ammo 0 // Load the weapon model before using this
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 4 
[email protected] = object.Create(#GUN_BOXWEE,[email protected], [email protected], [email protected])
070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.0 0.0 0.0 on_bone 5 16 perform_animation "NULL" IFP_file "NULL" time -1 
wait 50 
jump @PTEST_11 
script is above if someone know how to fix please help me, thanks

GtaHellModded.. 

 

http://web.archive.org/web/20140924175623/http://gtaforums.com/topic/737166-how-to-attach-object-on-left-hand-while-handle-weapon/

 

I copied them but these needs to be controlled again like ZAZ mentioned before 😉

Edited by ArmanCan
Link to comment
Share on other sites

7 minutes ago, ArmanCan said:

entering the topic with http://web.archive.org/ may help you to correct the display.. Why don't you post the topic here so i may post the code to here 😉

// Usage: 0AB1: call_scm_func @ATEST_ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.0 0.0 0.0 on_bone 6
// This SCM function works as code below.
//  070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.0 0.0 0.0 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 0
// But it affects in only 1 frame.
// It means that you have to call this in every frame and you can use this to any objects.
:ATEST_ATTACH
0A9F: [email protected] = current_thread_pointer
000A: [email protected] += 0x44
0A96: [email protected] = actor [email protected] struct
0085: [email protected] = [email protected] // (int)
000A: [email protected] += 0x18
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
0AA7: call_function 0x734A40 num_params 1 pop 1 [email protected] [email protected] // _clumpGetFirstSkinAtomicHAnimHierarchy
0012: [email protected] *= 0x4
000A: [email protected] += 0x488
005A: [email protected] += [email protected] // (int)
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
000A: [email protected] += 0x14
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
0A8D: [email protected] = read_memory 0x7C51E0 size 4 virtual_protect 1
if
    0039: [email protected] == 0x424548B
then
    0AA7: call_function 0x7C51E0 num_params 2 pop 2 [email protected] [email protected] [email protected] // _RpHAnimIDGetIndex
    0AA7: call_function 0x7C5160 num_params 1 pop 1 [email protected] [email protected] // _RpHAnimHierarchyGetMatrixArray
    0012: [email protected] *= 0x40
    005A: [email protected] += [email protected] // (int)
    0AA5: call 0x7EDDD0 num_params 4 pop 4 [email protected] 1 [email protected] [email protected]
else
    0AA7: call_function 0x7C51A0 num_params 2 pop 2 [email protected] [email protected] [email protected] // _RpHAnimIDGetIndex
    0AA7: call_function 0x7C5120 num_params 1 pop 1 [email protected] [email protected] // _RpHAnimHierarchyGetMatrixArray
    0012: [email protected] *= 0x40
    005A: [email protected] += [email protected] // (int)
    0AA5: call 0x7EDD90 num_params 4 pop 4 [email protected] 1 [email protected] [email protected]
end
0177: set_object [email protected] Z_angle_to 0.0
0A98: [email protected] = object [email protected] struct
000A: [email protected] += 0x14
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
000A: [email protected] += -0x14
0AA6: call_method 0x411990 struct [email protected] num_params 0 pop 0 // sub_411990
0AA6: call_method 0x59AD20 struct [email protected] num_params 1 pop 0 [email protected] // _CMatrix__copyTo
0AA6: call_method 0x4241C0 struct [email protected] num_params 1 pop 0 [email protected] // sub_4241C0
000A: [email protected] += 0x18
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
if
    8039:   not  [email protected] == 0
then
    000A: [email protected] += 0x4
    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
    000A: [email protected] += 0x10
    0AA6: call_method 0x59AD70 struct [email protected] num_params 1 pop 0 [email protected] // _CMatrix__copyTo
end
000A: [email protected] += -0x18
0AA6: call_method 0x532B00 struct [email protected] num_params 0 pop 0 // _RwFrameUpdateObject
0AB2: ret 0

Silent..

{$CLEO}

const
    _CPedIntelligence__GetTaskHold  = 0x00600FF0
    _CWorld__PlayerInFocus          = 0x00B7CD74
    _CWorld__Players                = 0x00B7CD98
end
const
    _HOOK_PTR_005E784F_CPed__Render = [email protected]
    _CWorld__PlayersExtras          = [email protected]
end

0A9F: [email protected] = current_thread_pointer
[email protected] += 0x10 // CRunningScript.m_pBaseAddress
0A8D: [email protected] = read_memory [email protected] size 4 vp 0
0A8F: _HOOK_PTR_005E784F_CPed__Render = [email protected] - @_HOOK_PTR_005E784F_CPed__Render
0A8F: _CWorld__PlayersExtras = [email protected] - @_CWorld__PlayersExtras

0A8F: [email protected] = _HOOK_PTR_005E784F_CPed__Render - 0x005E7854
0A8C: write_memory 0x005E784F size 1 value 0xE9 vp 1
0A8C: write_memory 0x005E7850 size 4 value [email protected] vp 1

0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 1
0A8E: [email protected] = [email protected] + 4
0A8F: [email protected] = _CPedIntelligence__GetTaskHold - [email protected]
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8F: [email protected] = 0x005E7858 - _HOOK_PTR_005E784F_CPed__Render
0A8F: [email protected] = 0x005E787C - _HOOK_PTR_005E784F_CPed__Render
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 9
0A8F: [email protected] = [email protected] - 0x0D
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x1C
0A8F: [email protected] = [email protected] - 0x20
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x25
0A8C: write_memory [email protected] size 4 value _CWorld__PlayersExtras vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x2D
0A8F: [email protected] = [email protected] - 0x31
0A8C: write_memory [email protected] size 4 value [email protected] vp 0
0A8E: [email protected] = _HOOK_PTR_005E784F_CPed__Render + 0x32
0A8F: [email protected] = [email protected] - 0x36
0A8C: write_memory [email protected] size 4 value [email protected] vp 0

[...]

0A90: [email protected] = 0 * 4 // PLAYERID * sizeof(CPlayerExtraInfo)
005A: [email protected] += _CWorld__PlayersExtras
0A8C: write_memory [email protected] size 1 value true vp 0 // false by default.

// Here player1's weapon is always drawn.

[...]

:_HOOK_PTR_005E784F_CPed__Render
hex
    E8 00000000   // 00000000 call    CPedIntelligence::GetTaskHold
    85C0          // 00000005 test    eax, eax
    0F84 00000000 // 00000007 jz      CPed::Render+1D8h
    8B8E 98050000 // 0000000D mov     ecx, [esi+CPed.m_iPedType]
    85C9          // 00000013 test    ecx, ecx
    74 09         // 00000015 jz      ped_is_player
    83F9 01       // 00000017 cmp     ecx, PEDTYPE_PLAYER2
    0F85 00000000 // 0000001A jne     CPed::Render+1FCh
                  // 00000020 ped_is_player:
    C1E1 02       // 00000020 shl     ecx, 2
    8A91 00000000 // 00000023 mov     dl, CWorld::PlayersExtras.m_bAlwaysDrawWeapon[ecx]
    84D2          // 00000029 test    dl, dl
    0F84 00000000 // 0000002B jz      CPed::Render+1FCh
    E9 00000000   // 00000031 jmp     CPed::Render+1D8h
end

{
    class CPlayerExtraInfo
    (
    public:
        bool m_bAlwaysDrawWeapon;
    );

    CPlayerExtraInfo CWorld::PlayersExtras[2];
}
:_CWorld__PlayersExtras
hex
    00 000000 00 000000
end

Wesser.. 

Woah! Thanks a TON for this!!

Link to comment
Share on other sites

1 minute ago, Zambini said:

Woah! Thanks a TON for this!!

find someone to control them.. i've only copied them for you...

Link to comment
Share on other sites

6 minutes ago, ArmanCan said:

find someone to control them.. i've only copied them for you...

Well at least I have somewhere to start now

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.