|
 |
|
|
|
|
|
Attention:
|
The Mod Showroom is only for posting previews/downloads of completed or near finished mods. All help topics should be posted in the Editing Discussion forums. Help topics and mod requests posted here will be locked or binned. Thank you.
|
|
GTAGarage.com : Free mod hosting, attach your files and screenshots to your topics
GTAModding.com : A wiki for everything related to GTA modding, including documentation and tutorials
|
[REL | CODE] Give n' Take Switching weapons with followers
 |
|
 |
| |
MrTi  |
Posted: Thursday, Jun 23 2005, 03:23
|
Crackhead

Group: Members
Joined: Jun 7, 2003


|
Here's a simple code to give anyone following you your current weapon and ammo, you in turn lose that weapon, but you can also take back the weapon, or whatever weapon and ammo that they are carrying. Taking a weapon may be cheap because some carry unlimited ammo for their weapon. To give a weapon, aim at whoever is following you with the weapon you want to give and press Y. To take a weapon, aim at the follower whose weapon you want and press N. To cycle through the follower's weapons aim at the follower and hold either weapon switch buttons (Q or E). This works with anybody that follows you and is considered in your "group". | CODE | 004F: create_thread ££giventake
:giventake 0001: wait 0 ms 00D6: if 0 0256: player $PLAYER_CHAR defined 004D: jump_if_false ££giventake 0004: $i = 0 0004: $homie($i,7i) = 0
:giventake2 0001: wait 0 ms 07AF: $gang = player $PLAYER_CHAR group 092B: $homie(0) = group $gang member 0 092B: $homie(1) = group $gang member 1 092B: $homie(2) = group $gang member 2 092B: $homie(3) = group $gang member 3 092B: $homie(4) = group $gang member 4 092B: $homie(5) = group $gang member 5 092B: $homie(6) = group $gang member 6
:give1 0001: wait 0 ms 00D6: if 1 00E1: key pressed 0 11 0457: player $PLAYER_CHAR aiming at actor $homie($i,7i) 004D: jump_if_false ££take1 00D6: if 0 00F2: actor $homie($i,7i) near actor $PLAYER_ACTOR radius 5.0 5.0 0 004D: jump_if_false ££take1 04ED: load animation "MISC"
:give2 00D6: if 0 84EE: NOT animation "MISC" loaded 004D: jump_if_false ££give3 0001: wait 0 ms 0002: jump ££give2
:give3 04C4: create_coordinate $x $y $z from_actor $PLAYER_ACTOR offset 0.0 1.0 0.0 02CE: $z = ground_z $x $y $z 00A1: put actor $homie($i,7i) at $x $y $z 0172: $angle = actor $PLAYER_ACTOR z_angle 000B: $angle += 180.0;; floating-point values 0173: set_actor $homie($i,7i) z_angle_to $angle 0605: unknown_action_sequence $PLAYER_ACTOR "PASS_RIFLE_PED" "MISC" 4.0 0 0 0 0 -1 0470: $gun = actor $PLAYER_ACTOR armed weapon unknown 041A: $ammo = actor $PLAYER_ACTOR weapon $gun ammo 0555: remove_weapon $gun from_actor $PLAYER_ACTOR 0605: unknown_action_sequence $homie($i,7i) "PASS_RIFLE_PLY" "MISC" 4.0 0 0 0 0 -1 01B2: give_actor $homie($i,7i) weapon $gun ammo $ammo;; Load the weapon model before using this
:take1 0001: wait 0 ms 00D6: if 1 00E1: key pressed 0 10 0457: player $PLAYER_CHAR aiming at actor $homie($i,7i) 004D: jump_if_false ££switchnext1 00D6: if 0 00F2: actor $homie($i,7i) near actor $PLAYER_ACTOR radius 5.0 5.0 0 004D: jump_if_false ££loop1 04ED: load animation "MISC"
:take2 00D6: if 0 84EE: NOT animation "MISC" loaded 004D: jump_if_false ££take3 0001: wait 0 ms 0002: jump ££take2
:take3 04C4: create_coordinate $x $y $z from_actor $PLAYER_ACTOR offset 0.0 1.0 0.0 02CE: $z = ground_z $x $y $z 00A1: put actor $homie($i,7i) at $x $y $z 0172: $angle = actor $PLAYER_ACTOR z_angle 000B: $angle += 180.0;; floating-point values 0173: set_actor $homie($i,7i) z_angle_to $angle 0605: unknown_action_sequence $homie($i,7i) "PASS_RIFLE_PED" "MISC" 4.0 0 0 0 0 -1 0470: $gun = actor $homie($i,7i) armed weapon unknown 041A: $ammo = actor $homie($i,7i) weapon $gun ammo 0555: remove_weapon $gun from_actor $homie($i,7i) 0605: unknown_action_sequence $PLAYER_ACTOR "PASS_RIFLE_PLY" "MISC" 4.0 0 0 0 0 -1 01B2: give_actor $PLAYER_ACTOR weapon $gun ammo $ammo;; Load the weapon model before using this
:switchnext1 0001: wait 0 ms 00D6: if 1 00E1: key pressed 0 7 0457: player $PLAYER_CHAR aiming at actor $homie($i,7i) 004D: jump_if_false ££switchback1
:switchnext2 0001: wait 0 ms 0008: $weapon += 1;; integer values 00D6: if 0 0028: $weapon >= 42;; integer values 004D: jump_if_false ££switchnext3 0004: $weapon = 0
:switchnext3 00D6: if 0 0491: actor $homie($i,7i) has_weapon $weapon 004D: jump_if_false ££switchnext2 01B9: set_actor $homie($i,7i) armed_weapon_to $weapon
:switchback1 0001: wait 0 ms 00D6: if 1 00E1: key pressed 0 5 0457: player $PLAYER_CHAR aiming at actor $homie($i,7i) 004D: jump_if_false ££loop1
:switchback2 0001: wait 0 ms 000E: $weapon -= 1;; integer values 00D6: if 0 8029: NOT $weapon >= 0;; integer values 004D: jump_if_false ££switchback3 0004: $weapon = 42
:switchback3 00D6: if 0 0491: actor $homie($i,7i) has_weapon $weapon 004D: jump_if_false ££switchback2 01B9: set_actor $homie($i,7i) armed_weapon_to $weapon
:loop1 0008: $i += 1;; integer values 00D6: if 0 0028: $i >= 7;; integer values 004D: jump_if_false ££giventake2 0004: $i = 0 0002: jump ££giventake2 | This post has been edited by MrTi on Thursday, Aug 18 2005, 02:48
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
MrTi  |
Posted: Thursday, Jun 23 2005, 17:48
|
Crackhead

Group: Members
Joined: Jun 7, 2003


|
I tested it again, and it works for me. To add the code, what I do is i put the 004F: create_thread ££giventake with the rest of the create_threads and i put my code at the very end of main, right above Mission 0. Also to Opius, I tried the array approach, but I just didn't get it to work. This post has been edited by MrTi on Thursday, Jun 23 2005, 21:00
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
MrTi  |
Posted: Wednesday, Jun 29 2005, 04:36
|
Crackhead

Group: Members
Joined: Jun 7, 2003


|
heres my new more optimized code using arrays. | CODE | :giventake 0001: wait 0 ms 00D6: if 0 0256: player $PLAYER_CHAR defined 004D: jump_if_false ££giventake 0004: $i = 0 0004: $homie($i,7i) = 0
:giventake2 0001: wait 0 ms 07AF: $gang = player $PLAYER_CHAR group 092B: $homie(0) = group $gang member 0 092B: $homie(1) = group $gang member 1 092B: $homie(2) = group $gang member 2 092B: $homie(3) = group $gang member 3 092B: $homie(4) = group $gang member 4 092B: $homie(5) = group $gang member 5 092B: $homie(6) = group $gang member 6
:give1 0001: wait 0 ms 00D6: if 1 00E1: key pressed 0 11 0457: player $PLAYER_CHAR aiming at actor $homie($i,7i) 004D: jump_if_false ££take1 00D6: if 0 00F2: actor $homie($i,7i) near actor $PLAYER_ACTOR radius 5.0 5.0 0 004D: jump_if_false ££take1 04ED: load animation "MISC"
:give2 00D6: if 0 84EE: NOT animation "MISC" loaded 004D: jump_if_false ££give3 0001: wait 0 ms 0002: jump ££give2
:give3 04C4: create_coordinate $x $y $z from_actor $PLAYER_ACTOR offset 0.0 1.0 0.0 02CE: $z = ground_z $x $y $z 00A1: put actor $homie($i,7i) at $x $y $z 0172: $angle = actor $PLAYER_ACTOR z_angle 000B: $angle += 180.0 ;; floating-point values 0173: set_actor $homie($i,7i) z_angle_to $angle 0605: unknown_action_sequence $PLAYER_ACTOR "PASS_RIFLE_PED" "MISC" 4.0 0 0 0 0 -1 0470: $gun = actor $PLAYER_ACTOR armed weapon unknown 041A: $ammo = actor $PLAYER_ACTOR weapon $gun ammo 0555: remove_weapon $gun from_actor $PLAYER_ACTOR 0605: unknown_action_sequence $homie($i,7i) "PASS_RIFLE_PLY" "MISC" 4.0 0 0 0 0 -1 01B2: give_actor $homie($i,7i) weapon $gun ammo $ammo;; Load the weapon model before using this
:take1 0001: wait 0 ms 00D6: if 1 00E1: key pressed 0 10 0457: player $PLAYER_CHAR aiming at actor $homie($i,7i) 004D: jump_if_false ££loop1 00D6: if 0 00F2: actor $homie($i,7i) near actor $PLAYER_ACTOR radius 5.0 5.0 0 004D: jump_if_false ££loop1 04ED: load animation "MISC"
:take2 00D6: if 0 84EE: NOT animation "MISC" loaded 004D: jump_if_false ££take3 0001: wait 0 ms 0002: jump ££take2
:take3 04C4: create_coordinate $x $y $z from_actor $PLAYER_ACTOR offset 0.0 1.0 0.0 02CE: $z = ground_z $x $y $z 00A1: put actor $homie($i,7i) at $x $y $z 0172: $angle = actor $PLAYER_ACTOR z_angle 000B: $angle += 180.0 ;; floating-point values 0173: set_actor $homie($i,7i) z_angle_to $angle 0605: unknown_action_sequence $homie($i,7i) "PASS_RIFLE_PED" "MISC" 4.0 0 0 0 0 -1 0470: $gun = actor $homie($i,7i) armed weapon unknown 041A: $ammo = actor $homie($i,7i) weapon $gun ammo 0555: remove_weapon $gun from_actor $homie($i,7i) 0605: unknown_action_sequence $PLAYER_ACTOR "PASS_RIFLE_PLY" "MISC" 4.0 0 0 0 0 -1 01B2: give_actor $PLAYER_ACTOR weapon $gun ammo $ammo;; Load the weapon model before using this
:loop1 0008: $i += 1;; integer values 00D6: if 0 0038: $i == 7 ;; integer values 004D: jump_if_false ££giventake2 0004: $i = 0 0002: jump ££giventake2 |
i added an animation where it shows u giving the weapon, and i also made it that u cant give them the weapon from far away, so u have to get close. why? because i want it to be realistic @officer purlaski i'm too lazy to find a place to host it, so give me your email and i'll just send it to u.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
.:Shady:.  |
Posted: Saturday, Jul 9 2005, 01:00
|
...

Group: Members
Joined: Feb 22, 2003

|
Thanks, greddy. I had no idea. Now to test this out on "Da Box."
EDIT: Okay, the mod works on the Xbox, but there's a small problem that isn't necessarily the mod's fault. I've noticed that once you've recruited a person and let go of the aim button, you can't aim at him anymore. But if you recruit a person and keep the aim button down, you can give or take a weapon one time. This is kinda disappointing when you wanna take something back, but maybe there's a way around this?
This post has been edited by .:Shady:. on Saturday, Jul 9 2005, 02:36
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
.:Shady:.  |
Posted: Tuesday, Jul 12 2005, 18:50
|
...

Group: Members
Joined: Feb 22, 2003

|
| QUOTE (.:Shady:. @ Jul 8 2005, 18:00) | Thanks, greddy. I had no idea. Now to test this out on "Da Box."
EDIT: Okay, the mod works on the Xbox, but there's a small problem that isn't necessarily the mod's fault. I've noticed that once you've recruited a person and let go of the aim button, you can't aim at him anymore. But if you recruit a person and keep the aim button down, you can give or take a weapon one time. This is kinda disappointing when you wanna take something back, but maybe there's a way around this? | Is anyone else having this problem or is it just me?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Dan!  |
Posted: Saturday, Jul 23 2005, 02:23
|
Stinky Cheese Robot

Group: Members
Joined: Jul 30, 2004

|
| QUOTE (.:Shady:. @ Jul 12 2005, 18:50) | | QUOTE (.:Shady:. @ Jul 8 2005, 18:00) | Thanks, greddy. I had no idea. Now to test this out on "Da Box."
EDIT: Okay, the mod works on the Xbox, but there's a small problem that isn't necessarily the mod's fault. I've noticed that once you've recruited a person and let go of the aim button, you can't aim at him anymore. But if you recruit a person and keep the aim button down, you can give or take a weapon one time. This is kinda disappointing when you wanna take something back, but maybe there's a way around this? |
Is anyone else having this problem or is it just me? | As far as I know you can't aim at people you've recruited. You can always "unrecruit" them and then recruit them and give n' take again, though.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(2) [1] 2
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|