Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Yangster

[WIP|THREAD] Weapon Select

Recommended Posts

Yangster

Hold sprint and yes/no to cycle through the different weapons of each slot.

 

 

004F: create_thread ££WEAPONSELECT...:WEAPONSELECT0001: wait  50 ms00D6: if  00256:   player $PLAYER_CHAR defined    004D: jump_if_false ££WEAPONSELECT00D6: if  189Be:   NOT player_in_menu8449:   NOT actor $PLAYER_ACTOR in_a_car004D: jump_if_false ££WEAPONSELECT00D6: if  100E1:   key pressed  0  16 ;(sprint)00E1:   key pressed  0  11 ;(yes)    004D: jump_if_false ££WEAPONSELECT2     @10 = 10002: jump ££WEAPONSLOTGET      :WEAPONSELECT200D6: if  100E1:   key pressed  0  16 ;(sprint)00E1:   key pressed  0  10 ;(no)    004D: jump_if_false ££WEAPONSELECT     @10 = -1:WEAPONSLOTGET0470: @0 = actor $PLAYER_ACTOR current_weapon0085: @2 = @000D6: if  0       @0 > 1004D: jump_if_false ££WEAPONSLOT000D6: if  0       @0 > 9004D: jump_if_false ££WEAPONSLOT100D6: if  0       @0 > 15004D: jump_if_false ££WEAPONSLOT1100D6: if  1       @0 > 18       NOT @0 == 39004D: jump_if_false ££WEAPONSLOT800D6: if  0       @0 > 24004D: jump_if_false ££WEAPONSLOT200D6: if  0       @0 > 27004D: jump_if_false ££WEAPONSLOT300D6: if  2       NOT @0 == 28       NOT @0 == 29       NOT @0 == 32004D: jump_if_false ££WEAPONSLOT400D6: if  0       @0 > 31004D: jump_if_false ££WEAPONSLOT500D6: if  0       @0 > 34004D: jump_if_false ££WEAPONSLOT600D6: if  0       @0 > 39004D: jump_if_false ££WEAPONSLOT700D6: if  0       NOT @0 == 40004D: jump_if_false ££WEAPONSELECT00D6: if  0       @0 > 43004D: jump_if_false ££WEAPONSLOT9:WEAPONSLOT10005A: @0 += @1000D6: if  1       NOT @0 == 43       NOT @0 == 46004D: jump_if_false ££WEAPONSLOT10_4600D6: if  1       NOT @0 == 47       NOT @0 == 44004D: jump_if_false ££WEAPONSLOT10_44     @0 = 45     @1 = 3690002: jump ££WEAPONGIVE:WEAPONSLOT10_46     @0 = 46     @1 = 3710002: jump ££WEAPONGIVE:WEAPONSLOT10_44     @0 = 44     @1 = 3680002: jump ££WEAPONGIVE:WEAPONSLOT0     @0 = 1     @1 = 3310002: jump ££WEAPONGIVE:WEAPONSLOT1005A: @0 += @1000D6: if  1       NOT @0 == 1       NOT @0 == 9004D: jump_if_false ££WEAPONSLOT1_900D6: if  1       NOT @0 == 10       NOT @0 == 2004D: jump_if_false ££WEAPONSLOT1_20085: @1 = @0     @1 += 3310002: jump ££WEAPONGIVE:WEAPONSLOT1_9           @0 = 9     @1 = 3410002: jump ££WEAPONGIVE      :WEAPONSLOT1_2           @0 = 2     @1 = 3330002: jump ££WEAPONGIVE:WEAPONSLOT2005A: @0 += @1000D6: if  1       NOT @0 == 21       NOT @0 == 24004D: jump_if_false ££WEAPONSLOT2_2400D6: if  1       NOT @0 == 25       NOT @0 == 22004D: jump_if_false ££WEAPONSLOT2_22     @0 = 23     @1 = 3470002: jump ££WEAPONGIVE:WEAPONSLOT2_24     @0 = 24     @1 = 3480002: jump ££WEAPONGIVE:WEAPONSLOT2_22     @0 = 22     @1 = 3460002: jump ££WEAPONGIVE:WEAPONSLOT3005A: @0 += @1000D6: if  1       NOT @0 == 24       NOT @0 == 27004D: jump_if_false ££WEAPONSLOT3_2700D6: if  1       NOT @0 == 28       NOT @0 == 25004D: jump_if_false ££WEAPONSLOT3_25     @0 = 26     @1 = 3500002: jump ££WEAPONGIVE:WEAPONSLOT3_27     @0 = 27     @1 = 3510002: jump ££WEAPONGIVE:WEAPONSLOT3_25     @0 = 25     @1 = 3490002: jump ££WEAPONGIVE:WEAPONSLOT4005A: @0 += @1000D6: if  1       NOT @0 == 27       NOT @0 == 30004D: jump_if_false ££WEAPONSLOT4_3200D6: if  1       NOT @0 == 33       NOT @0 == 28004D: jump_if_false ££WEAPONSLOT4_28     @0 = 29     @1 = 3530002: jump ££WEAPONGIVE:WEAPONSLOT4_32     @0 = 32     @1 = 3720002: jump ££WEAPONGIVE:WEAPONSLOT4_28     @0 = 28     @1 = 3530002: jump ££WEAPONGIVE:WEAPONSLOT5005A: @0 += @1000D6: if  1       NOT @0 == 29       NOT @0 == 31004D: jump_if_false ££WEAPONSLOT5_31     @0 = 30     @1 = 3550002: jump ££WEAPONGIVE:WEAPONSLOT5_31     @0 = 31     @1 = 3560002: jump ££WEAPONGIVE:WEAPONSLOT6005A: @0 += @1000D6: if  1       NOT @0 == 32       NOT @0 == 34004D: jump_if_false ££WEAPONSLOT6_34     @0 = 33     @1 = 3570002: jump ££WEAPONGIVE:WEAPONSLOT6_34     @0 = 34     @1 = 3580002: jump ££WEAPONGIVE:WEAPONSLOT7005A: @0 += @1000D6: if  1       NOT @0 == 34       NOT @0 == 38004D: jump_if_false ££WEAPONSLOT7_3800D6: if  1       NOT @0 == 39       NOT @0 == 35004D: jump_if_false ££WEAPONSLOT7_350085: @1 = @0     @1 += 3240002: jump ££WEAPONGIVE:WEAPONSLOT7_38           @0 = 38     @1 = 3620002: jump ££WEAPONGIVE      :WEAPONSLOT7_35           @0 = 35     @1 = 3590002: jump ££WEAPONGIVE:WEAPONSLOT8005A: @0 += @1000D6: if  1       NOT @0 == 15       NOT @0 == 19004D: jump_if_false ££WEAPONSLOT8_3900D6: if  1       NOT @0 == 40       NOT @0 == 16004D: jump_if_false ££WEAPONSLOT8_1600D6: if  1       NOT @0 == 38       NOT @0 == 18004D: jump_if_false ££WEAPONSLOT8_180085: @1 = @0     @1 += 3260002: jump ££WEAPONGIVE:WEAPONSLOT8_39           @0 = 39     @1 = 3630002: jump ££WEAPONGIVE      :WEAPONSLOT8_16           @0 = 16     @1 = 3420002: jump ££WEAPONGIVE:WEAPONSLOT8_18           @0 = 18     @1 = 3440002: jump ££WEAPONGIVE:WEAPONSLOT9005A: @0 += @1000D6: if  1       NOT @0 == 40       NOT @0 == 43004D: jump_if_false ££WEAPONSLOT9_4300D6: if  1       NOT @0 == 44       NOT @0 == 41004D: jump_if_false ££WEAPONSLOT9_41     @0 = 42     @1 = 3660002: jump ££WEAPONGIVE:WEAPONSLOT9_43     @0 = 43     @1 = 3670002: jump ££WEAPONGIVE:WEAPONSLOT9_41     @0 = 41     @1 = 3650002: jump ££WEAPONGIVE:WEAPONSLOT11005A: @0 += @1000D6: if  1       NOT @0 == 9       NOT @0 == 15004D: jump_if_false ££WEAPONSLOT11_1500D6: if  1       NOT @0 == 16       NOT @0 == 10004D: jump_if_false ££WEAPONSLOT11_100085: @1 = @0     @1 += 3110002: jump ££WEAPONGIVE:WEAPONSLOT11_15           @0 = 15     @1 = 3260002: jump ££WEAPONGIVE      :WEAPONSLOT11_10           @0 = 10     @1 = 3210002: jump ££WEAPONGIVE:WEAPONGIVE0247: request_model @1038B: load_requested_models0001: wait  10 ms0555: remove_weapon  @2 from_actor $PLAYER_ACTOR01B2: give_actor $PLAYER_ACTOR weapon @0 ammo 50000001: wait  50 ms0002: jump ££WEAPONSELECT

 

 

Enjoy.

Share this post


Link to post
Share on other sites
jarjar

Interesting, you planning on officially releasing it?

Share this post


Link to post
Share on other sites
Yangster

No, not really, I didn't think anyone was interested from the lack of replies. I'm usually against releasing main.scm as it stops people using mods simultaneously. As with any code I post though, anyone who finds it interesting can compile and upload it if they wish. I won't be policing the forums so if the person that uploads it doesn't feel like giving me credit, then you don't have to.

 

I did notice a bug recently though.

 

Replace

 

 

:WEAPONSLOT4_28    @0 = 28    @1 = 3530002: jump ££WEAPONGIVE

 

 

with

 

 

:WEAPONSLOT4_28     @0 = 28     @1 = 3520002: jump ££WEAPONGIVE

 

 

or the wrong model is loaded. I didn't notice it before because I made CJ spawn with a micro uzi before.

Share this post


Link to post
Share on other sites
jarjar
No, not really, I didn't think anyone was interested from the lack of replies. I'm usually against releasing main.scm as it stops people using mods simultaneously. As with any code I post though, anyone who finds it interesting can compile and upload it if they wish. I won't be policing the forums so if the person that uploads it doesn't feel like giving me credit, then you don't have to.

Don't take the no replys the wrong way. It's been very queit around here lately, you could call it a "modding down time". Just one of the times where no-one has time to mod. Though some modders has quit due to the way Rockstar have been treating us. So don't take it the wrong way, people have noticed what you've done, and like me they proberly really like the mods you've made icon14.gif

 

Nice work man, your code layout is very nice icon14.gif

Share this post


Link to post
Share on other sites
andywongusa

When I put your threads before mission 0 and compile it, I encounter popping up window with"004D JUMP_IF_FALSE ’’ WEAPONSELECT Parameter 1 not set." and can't compile. Could U tell me what' wrong with it? confused.gif

Share this post


Link to post
Share on other sites
Y_Less

Which builder are you using?

 

Also, I often read but don't reply so a lot of other people may too. Compiling it doesn't restrict others adding mods, just means you have to decompile it again.

Share this post


Link to post
Share on other sites
andywongusa

WHY DID YOU PUT two pound signs in front of the label name instead of #? For example, usually I think #weaponselct is right while you use twp pound signs,when I replace the two pound signs with #,the builder can compile. Anyway,I use SA mission builder.

Share this post


Link to post
Share on other sites
andywongusa

The game crashed when I held sprint and Y,what's wrong cry.gif

Share this post


Link to post
Share on other sites
Y_Less
WHY DID YOU PUT two pound signs in front of the label name instead of #? For example, usually I think #weaponselct is right while you use twp pound signs,when I replace the two pound signs with #,the builder can compile. Anyway,I use SA mission builder.

# has never been right, on any builder. What sort of insane world are you living in?

Share this post


Link to post
Share on other sites
andywongusa

sorry, I mentioned££,which cannot be printed in the forum just now,so I type #,which is just to make piont.As you can see Yangster has change two pound signs to ££,which is always correct.OK, my bad!

Share this post


Link to post
Share on other sites
andywongusa

sorry, I mentioned££,which cannot be printed in the forum just now,so I type #,which is just to make piont.As you can see Yangster has change two pound signs to ££,which is always correct.OK, my bad!

Share this post


Link to post
Share on other sites
andywongusa

Anyway, I have a bad web browser which cannot distiguist ££ with #,sorry to bother you.

Share this post


Link to post
Share on other sites
Craig Kostelecky

 

:WEAPONGIVE0247: request_model @1038B: load_requested_models0001: wait  10 ms0555: remove_weapon  @2 from_actor $PLAYER_ACTOR01B2: give_actor $PLAYER_ACTOR weapon @0 ammo 50000001: wait  50 ms0002: jump ££WEAPONSELECT

 

Are you sure 10 ms is enough time to guarantee that the model will be loaded? I would think a simple loop would work more robustly. Like this:

 

:WEAPONGIVE0247: request_model @1038B: load_requested_models:WEAPONGIVE20001: wait  0 ms0248: model @1 available004D: jump_if_false ££WEAPONGIVE20555: remove_weapon  @2 from_actor $PLAYER_ACTOR01B2: give_actor $PLAYER_ACTOR weapon @0 ammo 50000001: wait  50 ms0002: jump ££WEAPONSELECT

 

 

Edit: fixed a typo. The second label name should have been WEAPONGIVE2.

Edited by Craig Kostelecky

Share this post


Link to post
Share on other sites
andywongusa

Craig Kostelecky£º004D: jump_if_false ££WEAPONGIVE2 is wrong, I think 004D: jump_if_false ££WEAPONGIVE is correct,or else label ££WEAPONGIVE2 not found. Could U guys think of way that CJ got every weaponslots once press sprint and Y/N?

Share this post


Link to post
Share on other sites
andywongusa

Craig Kostelecky£º004D: jump_if_false ££WEAPONGIVE2 is wrong, I think 004D: jump_if_false ££WEAPONGIVE is correct,or else label ££WEAPONGIVE2 not found. Could U guys think of way that CJ got every weaponslots once press sprint and Y/N?

Share this post


Link to post
Share on other sites
Yangster
:WEAPONGIVE0247: request_model @1038B: load_requested_models0001: wait  10 ms0555: remove_weapon  @2 from_actor $PLAYER_ACTOR01B2: give_actor $PLAYER_ACTOR weapon @0 ammo 50000001: wait  50 ms0002: jump ££WEAPONSELECT

 

Are you sure 10 ms is enough time to guarantee that the model will be loaded? I would think a simple loop would work more robustly. Like this:

 

:WEAPONGIVE0247: request_model @1038B: load_requested_models:WEAPONGIVE0001: wait  0 ms0248: model @1 available004D: jump_if_false ££WEAPONGIVE20555: remove_weapon  @2 from_actor $PLAYER_ACTOR01B2: give_actor $PLAYER_ACTOR weapon @0 ammo 50000001: wait  50 ms0002: jump ££WEAPONSELECT

 

I did end up doing something like that, though you can't name 2 loops the same thing.

 

Here's my final code:

 

 

:WEAPONSELECT0001: wait  40 ms00D6: if  00256:   player $PLAYER_CHAR defined    004D: jump_if_false ££WEAPONSELECT00D6: if  189Be:   NOT player_in_menu8449:   NOT actor $PLAYER_ACTOR in_a_car004D: jump_if_false ££WEAPONSELECT00D6: if  2100E1:   key pressed  0  18  (crouch)00E1:   key pressed  0  16  (sprint)004D: jump_if_false ££WEAPONSELECT 00D6: if  000E1:   key pressed  0  11  (yes)    004D: jump_if_false ££WEAPONSELECT2     @10 = 10002: jump ££WEAPONSLOTGET  :WEAPONSELECT200D6: if  000E1:   key pressed  0  10  (no)    004D: jump_if_false ££WEAPONSELECT     @10 = -1... [this section is all the same and hence not included here]:WEAPONSLOT11_10           @0 = 10     @1 = 3210002: jump ££WEAPONGIVE:WEAPONGIVE0001: wait  0 ms0247: request_model @1038B: load_requested_models00D6: if  00248:   model @1 available    004D: jump_if_false ££WEAPONGIVE0555: remove_weapon  @2 from_actor $PLAYER_ACTOR01B2: give_actor $PLAYER_ACTOR weapon @0 ammo 5000:WEAPONGIVEWAIT0001: wait  0 ms00D6: if  2100E1:   key pressed  0  10  (no)00E1:   key pressed  0  11  (yes)    004D: jump_if_false ££WEAPONSELECT:WEAPONGIVEWAIT20001: wait  100 ms0002: jump ££WEAPONSELECT

 

Share this post


Link to post
Share on other sites
Craig Kostelecky
Craig Kostelecky£º004D: jump_if_false ££WEAPONGIVE2 is wrong, I think 004D: jump_if_false ££WEAPONGIVE is correct,or else label ££WEAPONGIVE2 not found. Could U guys think of way that CJ got every weaponslots once press sprint and Y/N?

Oops blush.gif

 

A little typo on my end. If you compiled that code you'd get an error as you cannot have two different label names in two different places. So the second one should have been WEAPONGIVE2. I fixed my original post.

Share this post


Link to post
Share on other sites
asonofashadow

Hi x), please release a main.scm file so that I can use this mod with the script mod manager.

 

Also I have a suggestion. Why not build a menu system for picking your weapons?

 

rampage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.giframpage_ani.gif

Share this post


Link to post
Share on other sites
GamerShotgun
No, not really, I didn't think anyone was interested from the lack of replies. I'm usually against releasing main.scm as it stops people using mods simultaneously. As with any code I post though, anyone who finds it interesting can compile and upload it if they wish. I won't be policing the forums so if the person that uploads it doesn't feel like giving me credit, then you don't have to.

Don't take the no replys the wrong way. It's been very queit around here lately, you could call it a "modding down time". Just one of the times where no-one has time to mod. Though some modders has quit due to the way Rockstar have been treating us. So don't take it the wrong way, people have noticed what you've done, and like me they proberly really like the mods you've made icon14.gif

 

Nice work man, your code layout is very nice icon14.gif

Hey, why rockstar games are treating us? Without us, a lot of people wouldn't play GTA, because it gets boring after beating the main missions... We are the community who brings the fun back to the world of GTA confused.gif

Share this post


Link to post
Share on other sites
pull_my_trigga_en_call_me_nigga

can u explain how to place it in the main.scm file?

I think that we should replace it before the mission 0 and before that I think we should create the thread somewhere but I dunno where and how so plz explain it. colgate.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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