cerdopalo Posted July 6, 2020 Share Posted July 6, 2020 hi im want to create mod that when im press tab + 2 cj call someone and ryder come with his picador how to create this mod ??? im noob at modding help me Link to comment Share on other sites More sharing options...
jojo2971 Posted July 10, 2020 Share Posted July 10, 2020 (edited) On 06/07/2020 at 16:40, cerdopalo said: hi im want to create mod that when im press tab + 2 cj call someone and ryder come with his picador how to create this mod ??? im noob at modding help me Before starting to create a mod you can see these tutorials to have a better coding basis : http://ze-samphacks.blogspot.com/2015/03/cleo-tutorial-understanding-code.html https://gtaforums.com/topic/403790-mission-coding-for-dummies/  You will need a key pressed list : https://www.gta-modding.com/san_andreas/tutorials/virtual_key_codes.html  I can give you some opcodes which can help you for your mod. Spoiler This is an opcode for the key pressed to use in conditions : 0AB0: key_pressed 9 // TAB With these opcodes you can get the coordinates of the nearest car path (that you can use to create the car at this coordinates) : 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] With these opcodes the vehicle will drive to coordinates [email protected] [email protected] [email protected] : 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 Car.DriveTo([email protected], [email protected], [email protected], [email protected]) Here, if the car [email protected] is on the sphere with the radius of 10 and is stopped. Then the actor [email protected] exit the car [email protected] if 01B0: car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped else_jump @TEST_1 05CD: AS_actor [email protected] exit_car [email protected] The Player_Actor is added to the group Player_Group and the actor [email protected] is added to this group. 0630: put_actor $PLAYER_ACTOR in_group $PLAYER_GROUP as_leader 0631: put_actor [email protected] in_group $PLAYER_GROUP  I think I have given you the essentials for your project. To learn how to create mods, the best is to practice. Edited July 10, 2020 by jojo2971 Link to comment Share on other sites More sharing options...
cerdopalo Posted July 11, 2020 Author Share Posted July 11, 2020 (edited) thanks you im try 21 hours ago, jojo2971 said: Before starting to create a mod you can see these tutorials to have a better coding basis : http://ze-samphacks.blogspot.com/2015/03/cleo-tutorial-understanding-code.html https://gtaforums.com/topic/403790-mission-coding-for-dummies/  You will need a key pressed list : https://www.gta-modding.com/san_andreas/tutorials/virtual_key_codes.html  I can give you some opcodes which can help you for your mod.  Hide contents This is an opcode for the key pressed to use in conditions : 0AB0: key_pressed 9 // TAB With these opcodes you can get the coordinates of the nearest car path (that you can use to create the car at this coordinates) : 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] With these opcodes the vehicle will drive to coordinates [email protected] [email protected] [email protected] : 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 Car.DriveTo([email protected], [email protected], [email protected], [email protected]) Here, if the car [email protected] is on the sphere with the radius of 10 and is stopped. Then the actor [email protected] exit the car [email protected] if 01B0: car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped else_jump @TEST_1 05CD: AS_actor [email protected] exit_car [email protected] The Player_Actor is added to the group Player_Group and the actor [email protected] is added to this group. 0630: put_actor $PLAYER_ACTOR in_group $PLAYER_GROUP as_leader 0631: put_actor [email protected] in_group $PLAYER_GROUP  I think I have given you the essentials for your project. To learn how to create mods, the best is to practice. thx Edited July 11, 2020 by cerdopalo Link to comment Share on other sites More sharing options...
cerdopalo Posted July 12, 2020 Author Share Posted July 12, 2020  On 7/10/2020 at 5:38 PM, jojo2971 said: Before starting to create a mod you can see these tutorials to have a better coding basis : http://ze-samphacks.blogspot.com/2015/03/cleo-tutorial-understanding-code.html https://gtaforums.com/topic/403790-mission-coding-for-dummies/  You will need a key pressed list : https://www.gta-modding.com/san_andreas/tutorials/virtual_key_codes.html  I can give you some opcodes which can help you for your mod.  Hide contents This is an opcode for the key pressed to use in conditions : 0AB0: key_pressed 9 // TAB With these opcodes you can get the coordinates of the nearest car path (that you can use to create the car at this coordinates) : 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] With these opcodes the vehicle will drive to coordinates [email protected] [email protected] [email protected] : 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 Car.DriveTo([email protected], [email protected], [email protected], [email protected]) Here, if the car [email protected] is on the sphere with the radius of 10 and is stopped. Then the actor [email protected] exit the car [email protected] if 01B0: car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped else_jump @TEST_1 05CD: AS_actor [email protected] exit_car [email protected] The Player_Actor is added to the group Player_Group and the actor [email protected] is added to this group. 0630: put_actor $PLAYER_ACTOR in_group $PLAYER_GROUP as_leader 0631: put_actor [email protected] in_group $PLAYER_GROUP  I think I have given you the essentials for your project. To learn how to create mods, the best is to practice. im tryed but its hard for me but im edited a mod and he spawn and come with picador but idk how to make him come with fam1 Link to comment Share on other sites More sharing options...
jojo2971 Posted July 12, 2020 Share Posted July 12, 2020 12 hours ago, cerdopalo said: Â im tryed but its hard for me but im edited a mod and he spawn and come with picador but idk how to make him come with fam1 When you create an actor you can create him into a car in driver or passenger seat. Driver seat 129: [email protected] = create_actor_pedtype 8 model #FAM1 in_car [email protected] driverseat or Actor.CreateAsDriver([email protected], Gang2, #FAM1, [email protected]) Passenger seat 01C8: [email protected] = create_actor_pedtype 8 model #FAM1 in_car [email protected] passenger_seat 0 or Actor.CreateAsPassenger([email protected], Gang2, #FAM1, [email protected], 0) Â With this opcode you can also make sure that the vehicle does not stop at red lights or behind other vehicles : 00AE: set_car [email protected] traffic_behaviour_to 2 The link of the wiki to see informations of this opcode and the driving mode : https://gtamods.com/wiki/00AE Link to comment Share on other sites More sharing options...
cerdopalo Posted July 13, 2020 Author Share Posted July 13, 2020 (edited) 19 hours ago, jojo2971 said: When you create an actor you can create him into a car in driver or passenger seat. Driver seat 129: [email protected] = create_actor_pedtype 8 model #FAM1 in_car [email protected] driverseat or Actor.CreateAsDriver([email protected], Gang2, #FAM1, [email protected]) Passenger seat 01C8: [email protected] = create_actor_pedtype 8 model #FAM1 in_car [email protected] passenger_seat 0 or Actor.CreateAsPassenger([email protected], Gang2, #FAM1, [email protected], 0)  With this opcode you can also make sure that the vehicle does not stop at red lights or behind other vehicles : 00AE: set_car [email protected] traffic_behaviour_to 2 The link of the wiki to see informations of this opcode and the driving mode : https://gtamods.com/wiki/00AE this is script where do im add it iim need him to be passenger of picador and he is equiped tec9 and he leave car and join my gang like ryder or can u add it pls i tryed adding it but when the picador spawn game crash idk why {$CLEO .cs} //-------------MAIN--------------- 03A4: name_thread 'POLBACK' :POLBACK_11 0001: wait 0 ms 00D6: if 0256:  player $PLAYER_CHAR defined 004D: jump_if_false @POLBACK_11 00D6: if 0038:  $ONMISSION == 0 004D: jump_if_false @POLBACK_11 0001: wait 0 ms 00D6: if and 0AB0:  key_pressed 9 0AB0:  key_pressed 49 004D: jump_if_false @POLBACK_11 023C: load_special_actor 'RYDER' as 1 // models 290-299 0247: load_model #M4 0247: load_model #CELLPHONE 0247: load_model #PICADOR 0247: load_model #SPECIAL01 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 :POLBACK_183 0001: wait 0 ms 00D6: if and 0248:  model #M4 available 0248:  model #CELLPHONE available 0248:  model #PICADOR available 0248:  model #SPECIAL01 available 004D: jump_if_false @POLBACK_183 0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 0001: wait 2500 ms 03E5: show_text_box 'RYDER' 0001: wait 2500 ms 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 0001: wait 100 ms 00A5: [email protected] = create_car #PICADOR at [email protected] [email protected] [email protected] 0229: set_car [email protected] primary_color_to 55 secondary_color_to 0 03CC: enable_car [email protected] stuck_check_distance_to 2.0 time_to 2000 0186: [email protected] = create_marker_above_car [email protected] 00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 8 model #SPECIAL01 in_car [email protected] driverseat 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 00A7: car [email protected] drive_to [email protected] [email protected] [email protected] 0164: disable_marker [email protected] :POLBACK_365 0001: wait 0 ms 00D6: if 01B0:  car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped 004D: jump_if_false @POLBACK_365 05CD: AS_actor [email protected] exit_car [email protected] 0001: wait 500 ms 01B2: give_actor [email protected] weapon 31 ammo 9999 // Load the weapon model before using this 0001: wait 250 ms 07AF: $MAPLAYAGANG = player $PLAYER_CHAR group 0630: put_actor $PLAYER_ACTOR in_group $MAPLAYAGANG as_leader 0631: put_actor [email protected] in_group $MAPLAYAGANG 0001: wait 7000 ms :POLBACK_468 0001: wait 0 ms 00D6: if 06EE:  actor [email protected] in_group $MAPLAYAGANG 004D: jump_if_false @POLBACK_11 0002: jump @POLBACK_468  Edited July 13, 2020 by cerdopalo hi Link to comment Share on other sites More sharing options...
jojo2971 Posted July 14, 2020 Share Posted July 14, 2020 (edited) 12 hours ago, cerdopalo said: this is script where do im add it iim need him to be passenger of picador and he is equiped tec9 and he leave car and join my gang like ryder or can u add it pls i tryed adding it but when the picador spawn game crash idk why Spoiler {$CLEO .cs} //-------------MAIN--------------- 03A4: name_thread 'POLBACK' :POLBACK_11 0001: wait 0 ms 00D6: if 0256:  player $PLAYER_CHAR defined 004D: jump_if_false @POLBACK_11 00D6: if 0038:  $ONMISSION == 0 004D: jump_if_false @POLBACK_11 0001: wait 0 ms 00D6: if and 0AB0:  key_pressed 9 0AB0:  key_pressed 49 004D: jump_if_false @POLBACK_11 023C: load_special_actor 'RYDER' as 1 // models 290-299 0247: load_model #M4 0247: load_model #CELLPHONE 0247: load_model #PICADOR 0247: load_model #SPECIAL01 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 :POLBACK_183 0001: wait 0 ms 00D6: if and 0248:  model #M4 available 0248:  model #CELLPHONE available 0248:  model #PICADOR available 0248:  model #SPECIAL01 available 004D: jump_if_false @POLBACK_183 0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 0001: wait 2500 ms 03E5: show_text_box 'RYDER' 0001: wait 2500 ms 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 0001: wait 100 ms 00A5: [email protected] = create_car #PICADOR at [email protected] [email protected] [email protected] 0229: set_car [email protected] primary_color_to 55 secondary_color_to 0 03CC: enable_car [email protected] stuck_check_distance_to 2.0 time_to 2000 0186: [email protected] = create_marker_above_car [email protected] 00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 8 model #SPECIAL01 in_car [email protected] driverseat 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 00A7: car [email protected] drive_to [email protected] [email protected] [email protected] 0164: disable_marker [email protected] :POLBACK_365 0001: wait 0 ms 00D6: if 01B0:  car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped 004D: jump_if_false @POLBACK_365 05CD: AS_actor [email protected] exit_car [email protected] 0001: wait 500 ms 01B2: give_actor [email protected] weapon 31 ammo 9999 // Load the weapon model before using this 0001: wait 250 ms 07AF: $MAPLAYAGANG = player $PLAYER_CHAR group 0630: put_actor $PLAYER_ACTOR in_group $MAPLAYAGANG as_leader 0631: put_actor [email protected] in_group $MAPLAYAGANG 0001: wait 7000 ms :POLBACK_468 0001: wait 0 ms 00D6: if 06EE:  actor [email protected] in_group $MAPLAYAGANG 004D: jump_if_false @POLBACK_11 0002: jump @POLBACK_468  To add it in the picador in the passenger seat you need to load the model #FAM1. Then you can create this actor with another variable (by example [email protected]) because the other actor already using the variable [email protected] You also need to load the model of the tec9 if you want to use it (#TEC9). The Tec9 is the weapon 32. When you give the weapon to Ryder you give the weapon 31 (M4) so for the Fam1 actor you will give it the weapon 32 to give it the Tec9.  List of the weapons ID : Spoiler 00 UNARMED 01 BRASSKNUCKLE 02 GOLFCLUB 03 NIGHTSTICK 04 KNIFE 05 BASEBALLBAT 06 SHOVEL 07 POOLCUE 08 KATANA 09 CHAINSAW 10 DILDO1 11 DILDO2 12 VIBE1 13 VIBE2 14 FLOWERS 15 CANE 16 GRENADE 17 TEARGAS 18 MOLOTOV 19 ROCKET 20 ROCKET_HS 21 FREEFALL_BOMB 22 PISTOL 23 PISTOL_SILENCED 24 DESERT_EAGLE 25 SHOTGUN 26 SAWNOFF 27 SPAS12 28 MICRO_UZI 29 MP5 30 AK47 31 M4 32 TEC9 33 COUNTRYRIFLE 34 SNIPERRIFLE 35 RLAUNCHER 36 RLAUNCHER_HS 37 FTHROWER 38 MINIGUN 39 SATCHEL_CHARGE 40 DETONATOR 41 SPRAYCAN 42 EXTINGUISHER 43 CAMERA 44 NIGHTVISION 45 INFRARED 46 PARACHUTE 47-X ... Custom weapons    I modified the code to add the actor Fam1 in the picador with a Tec9 as well as some other small modifications : - I removed the loading of the model # SPECIAL01 because this model is already loaded with the line : 023C: load_special_actor 'RYDER' as 1 - I added the load of the models #FAM1 and #TEC9 and add the opcode ; 038B: load_requested_models to facilitate the load of models. - I moved the opcode 0164: disable_marker [email protected] so that the marker does not disappear when it is created and changed the color by green because the color by default is red and the red is used for enemies. - I turn the car into any random car when the actors exit the car by removing its reference. Prevents cars accumulate when the mod back to the beginning. - At the end of the code, the mod returns to the beginning when Ryder is no longer in the group. However, Ryder is not destroyed so he will stay in the game indefinitely until you leave the game. I also changed this and I added a condition that checks if he is dead. Now the mod checks if Ryder and Fam1 are in the group or are dead. When the actors are not defined the previously loaded models are released and the mod return to the beginning.  The new code : Spoiler {$CLEO .cs} //-------------MAIN--------------- 03A4: name_thread 'POLBACK' :POLBACK_11 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @POLBACK_11 00D6: if 0038: $ONMISSION == 0 004D: jump_if_false @POLBACK_11 00D6: if and 0AB0: key_pressed 9 0AB0: key_pressed 49 004D: jump_if_false @POLBACK_11 023C: load_special_actor 'RYDER' as 1 // models 290-299 0247: load_model #FAM1 0247: load_model #M4 0247: load_model #TEC9 0247: load_model #CELLPHONE 0247: load_model #PICADOR 038B: load_requested_models 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 :POLBACK_183 0001: wait 0 ms 00D6: if and 0248: model #FAM1 available 0248: model #M4 available 0248: model #TEC9 available 0248: model #CELLPHONE available 0248: model #PICADOR available 004D: jump_if_false @POLBACK_183 0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 0001: wait 2500 ms 03E5: show_text_box 'RYDER' 0001: wait 2500 ms 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 0001: wait 100 ms 00A5: [email protected] = create_car #PICADOR at [email protected] [email protected] [email protected] 0229: set_car [email protected] primary_color_to 55 secondary_color_to 0 03CC: enable_car [email protected] stuck_check_distance_to 2.0 time_to 2000 0186: [email protected] = create_marker_above_car [email protected] 0165: set_marker [email protected] color_to 1 00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 8 model #SPECIAL01 in_car [email protected] driverseat 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 01C8: [email protected] = create_actor_pedtype 8 model #FAM1 in_car [email protected] passenger_seat 0 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 00A7: car [email protected] drive_to [email protected] [email protected] [email protected] :POLBACK_365 0001: wait 0 ms 00D6: if 01B0: car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped 004D: jump_if_false @POLBACK_365 05CD: AS_actor [email protected] exit_car [email protected] 05CD: AS_actor [email protected] exit_car [email protected] 0164: disable_marker [email protected] 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 0001: wait 500 ms 01B2: give_actor [email protected] weapon 31 ammo 9999 // Load the weapon model before using this 01B2: give_actor [email protected] weapon 32 ammo 9999 // Load the weapon model before using this 0001: wait 250 ms 07AF: $MAPLAYAGANG = player $PLAYER_CHAR group 0630: put_actor $PLAYER_ACTOR in_group $MAPLAYAGANG as_leader 0631: put_actor [email protected] in_group $MAPLAYAGANG 0631: put_actor [email protected] in_group $MAPLAYAGANG 0001: wait 7000 ms :POLBACK_468 0001: wait 0 ms 00D6: if 056D: actor [email protected] defined 004D: jump_if_false @POLBACK_469 00D6: if or 86EE: not actor [email protected] in_group $PLAYER_GROUP 0118: actor [email protected] dead 004D: jump_if_false @POLBACK_469 0001: wait 2000 ms 034F: destroy_actor_with_fade [email protected] 0002: jump @POLBACK_469 :POLBACK_469 00D6: if 056D: actor [email protected] defined 004D: jump_if_false @POLBACK_470 00D6: if or 86EE: not actor [email protected] in_group $PLAYER_GROUP 0118: actor [email protected] dead 004D: jump_if_false @POLBACK_470 0001: wait 2000 ms 034F: destroy_actor_with_fade [email protected] 0002: jump @POLBACK_470 :POLBACK_470 00D6: if and 856D: not actor [email protected] defined 856D: not actor [email protected] defined 004D: jump_if_false @POLBACK_468 0296: unload_special_actor 1 0249: release_model #FAM1 0249: release_model #M4 0249: release_model #TEC9 0249: release_model #CELLPHONE 0249: release_model #PICADOR 0002: jump @POLBACK_11   There are certainly still many possible modifications to do. Such as checking if the car is not destroyed when it goes to its destination and disable its marker and its reference if it is the case. Edited July 14, 2020 by jojo2971 cerdopalo 1 Link to comment Share on other sites More sharing options...
cerdopalo Posted July 14, 2020 Author Share Posted July 14, 2020 5 hours ago, jojo2971 said: To add it in the picador in the passenger seat you need to load the model #FAM1. Then you can create this actor with another variable (by example [email protected]) because the other actor already using the variable [email protected] You also need to load the model of the tec9 if you want to use it (#TEC9). The Tec9 is the weapon 32. When you give the weapon to Ryder you give the weapon 31 (M4) so for the Fam1 actor you will give it the weapon 32 to give it the Tec9.  List of the weapons ID :  Reveal hidden contents 00 UNARMED 01 BRASSKNUCKLE 02 GOLFCLUB 03 NIGHTSTICK 04 KNIFE 05 BASEBALLBAT 06 SHOVEL 07 POOLCUE 08 KATANA 09 CHAINSAW 10 DILDO1 11 DILDO2 12 VIBE1 13 VIBE2 14 FLOWERS 15 CANE 16 GRENADE 17 TEARGAS 18 MOLOTOV 19 ROCKET 20 ROCKET_HS 21 FREEFALL_BOMB 22 PISTOL 23 PISTOL_SILENCED 24 DESERT_EAGLE 25 SHOTGUN 26 SAWNOFF 27 SPAS12 28 MICRO_UZI 29 MP5 30 AK47 31 M4 32 TEC9 33 COUNTRYRIFLE 34 SNIPERRIFLE 35 RLAUNCHER 36 RLAUNCHER_HS 37 FTHROWER 38 MINIGUN 39 SATCHEL_CHARGE 40 DETONATOR 41 SPRAYCAN 42 EXTINGUISHER 43 CAMERA 44 NIGHTVISION 45 INFRARED 46 PARACHUTE 47-X ... Custom weapons    I modified the code to add the actor Fam1 in the picador with a Tec9 as well as some other small modifications : - I removed the loading of the model # SPECIAL01 because this model is already loaded with the line : 023C: load_special_actor 'RYDER' as 1 - I added the load of the models #FAM1 and #TEC9 and add the opcode ; 038B: load_requested_models to facilitate the load of models. - I moved the opcode 0164: disable_marker [email protected] so that the marker does not disappear when it is created and changed the color by green because the color by default is red and the red is used for enemies. - I turn the car into any random car when the actors exit the car by removing its reference. Prevents cars accumulate when the mod back to the beginning. - At the end of the code, the mod returns to the beginning when Ryder is no longer in the group. However, Ryder is not destroyed so he will stay in the game indefinitely until you leave the game. I also changed this and I added a condition that checks if he is dead. Now the mod checks if Ryder and Fam1 are in the group or are dead. When the actors are not defined the previously loaded models are released and the mod return to the beginning.  The new code :  Hide contents {$CLEO .cs} //-------------MAIN--------------- 03A4: name_thread 'POLBACK' :POLBACK_11 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @POLBACK_11 00D6: if 0038: $ONMISSION == 0 004D: jump_if_false @POLBACK_11 00D6: if and 0AB0: key_pressed 9 0AB0: key_pressed 49 004D: jump_if_false @POLBACK_11 023C: load_special_actor 'RYDER' as 1 // models 290-299 0247: load_model #FAM1 0247: load_model #M4 0247: load_model #TEC9 0247: load_model #CELLPHONE 0247: load_model #PICADOR 038B: load_requested_models 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 :POLBACK_183 0001: wait 0 ms 00D6: if and 0248: model #FAM1 available 0248: model #M4 available 0248: model #TEC9 available 0248: model #CELLPHONE available 0248: model #PICADOR available 004D: jump_if_false @POLBACK_183 0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 0001: wait 2500 ms 03E5: show_text_box 'RYDER' 0001: wait 2500 ms 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 0001: wait 100 ms 00A5: [email protected] = create_car #PICADOR at [email protected] [email protected] [email protected] 0229: set_car [email protected] primary_color_to 55 secondary_color_to 0 03CC: enable_car [email protected] stuck_check_distance_to 2.0 time_to 2000 0186: [email protected] = create_marker_above_car [email protected] 0165: set_marker [email protected] color_to 1 00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 8 model #SPECIAL01 in_car [email protected] driverseat 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 01C8: [email protected] = create_actor_pedtype 8 model #FAM1 in_car [email protected] passenger_seat 0 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 00A7: car [email protected] drive_to [email protected] [email protected] [email protected] :POLBACK_365 0001: wait 0 ms 00D6: if 01B0: car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped 004D: jump_if_false @POLBACK_365 05CD: AS_actor [email protected] exit_car [email protected] 05CD: AS_actor [email protected] exit_car [email protected] 0164: disable_marker [email protected] 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 0001: wait 500 ms 01B2: give_actor [email protected] weapon 31 ammo 9999 // Load the weapon model before using this 01B2: give_actor [email protected] weapon 32 ammo 9999 // Load the weapon model before using this 0001: wait 250 ms 07AF: $MAPLAYAGANG = player $PLAYER_CHAR group 0630: put_actor $PLAYER_ACTOR in_group $MAPLAYAGANG as_leader 0631: put_actor [email protected] in_group $MAPLAYAGANG 0631: put_actor [email protected] in_group $MAPLAYAGANG 0001: wait 7000 ms :POLBACK_468 0001: wait 0 ms 00D6: if 056D: actor [email protected] defined 004D: jump_if_false @POLBACK_469 00D6: if or 86EE: not actor [email protected] in_group $PLAYER_GROUP 0118: actor [email protected] dead 004D: jump_if_false @POLBACK_469 0001: wait 2000 ms 034F: destroy_actor_with_fade [email protected] 0002: jump @POLBACK_469 :POLBACK_469 00D6: if 056D: actor [email protected] defined 004D: jump_if_false @POLBACK_470 00D6: if or 86EE: not actor [email protected] in_group $PLAYER_GROUP 0118: actor [email protected] dead 004D: jump_if_false @POLBACK_470 0001: wait 2000 ms 034F: destroy_actor_with_fade [email protected] 0002: jump @POLBACK_470 :POLBACK_470 00D6: if and 856D: not actor [email protected] defined 856D: not actor [email protected] defined 004D: jump_if_false @POLBACK_468 0296: unload_special_actor 1 0249: release_model #FAM1 0249: release_model #M4 0249: release_model #TEC9 0249: release_model #CELLPHONE 0249: release_model #PICADOR 0002: jump @POLBACK_11   There are certainly still many possible modifications to do. Such as checking if the car is not destroyed when it goes to its destination and disable its marker and its reference if it is the case. thank you im gonna try and later see if it work or not ty again Link to comment Share on other sites More sharing options...
cerdopalo Posted July 14, 2020 Author Share Posted July 14, 2020 (edited) 10 hours ago, jojo2971 said: To add it in the picador in the passenger seat you need to load the model #FAM1. Then you can create this actor with another variable (by example [email protected]) because the other actor already using the variable [email protected] You also need to load the model of the tec9 if you want to use it (#TEC9). The Tec9 is the weapon 32. When you give the weapon to Ryder you give the weapon 31 (M4) so for the Fam1 actor you will give it the weapon 32 to give it the Tec9.  List of the weapons ID :  Reveal hidden contents 00 UNARMED 01 BRASSKNUCKLE 02 GOLFCLUB 03 NIGHTSTICK 04 KNIFE 05 BASEBALLBAT 06 SHOVEL 07 POOLCUE 08 KATANA 09 CHAINSAW 10 DILDO1 11 DILDO2 12 VIBE1 13 VIBE2 14 FLOWERS 15 CANE 16 GRENADE 17 TEARGAS 18 MOLOTOV 19 ROCKET 20 ROCKET_HS 21 FREEFALL_BOMB 22 PISTOL 23 PISTOL_SILENCED 24 DESERT_EAGLE 25 SHOTGUN 26 SAWNOFF 27 SPAS12 28 MICRO_UZI 29 MP5 30 AK47 31 M4 32 TEC9 33 COUNTRYRIFLE 34 SNIPERRIFLE 35 RLAUNCHER 36 RLAUNCHER_HS 37 FTHROWER 38 MINIGUN 39 SATCHEL_CHARGE 40 DETONATOR 41 SPRAYCAN 42 EXTINGUISHER 43 CAMERA 44 NIGHTVISION 45 INFRARED 46 PARACHUTE 47-X ... Custom weapons    I modified the code to add the actor Fam1 in the picador with a Tec9 as well as some other small modifications : - I removed the loading of the model # SPECIAL01 because this model is already loaded with the line : 023C: load_special_actor 'RYDER' as 1 - I added the load of the models #FAM1 and #TEC9 and add the opcode ; 038B: load_requested_models to facilitate the load of models. - I moved the opcode 0164: disable_marker [email protected] so that the marker does not disappear when it is created and changed the color by green because the color by default is red and the red is used for enemies. - I turn the car into any random car when the actors exit the car by removing its reference. Prevents cars accumulate when the mod back to the beginning. - At the end of the code, the mod returns to the beginning when Ryder is no longer in the group. However, Ryder is not destroyed so he will stay in the game indefinitely until you leave the game. I also changed this and I added a condition that checks if he is dead. Now the mod checks if Ryder and Fam1 are in the group or are dead. When the actors are not defined the previously loaded models are released and the mod return to the beginning.  The new code :  Hide contents {$CLEO .cs} //-------------MAIN--------------- 03A4: name_thread 'POLBACK' :POLBACK_11 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @POLBACK_11 00D6: if 0038: $ONMISSION == 0 004D: jump_if_false @POLBACK_11 00D6: if and 0AB0: key_pressed 9 0AB0: key_pressed 49 004D: jump_if_false @POLBACK_11 023C: load_special_actor 'RYDER' as 1 // models 290-299 0247: load_model #FAM1 0247: load_model #M4 0247: load_model #TEC9 0247: load_model #CELLPHONE 0247: load_model #PICADOR 038B: load_requested_models 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 50.0 0.0 5.0 02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.0 0.0 :POLBACK_183 0001: wait 0 ms 00D6: if and 0248: model #FAM1 available 0248: model #M4 available 0248: model #TEC9 available 0248: model #CELLPHONE available 0248: model #PICADOR available 004D: jump_if_false @POLBACK_183 0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 0001: wait 2500 ms 03E5: show_text_box 'RYDER' 0001: wait 2500 ms 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 0001: wait 100 ms 00A5: [email protected] = create_car #PICADOR at [email protected] [email protected] [email protected] 0229: set_car [email protected] primary_color_to 55 secondary_color_to 0 03CC: enable_car [email protected] stuck_check_distance_to 2.0 time_to 2000 0186: [email protected] = create_marker_above_car [email protected] 0165: set_marker [email protected] color_to 1 00AE: set_car [email protected] traffic_behaviour_to 2 0129: [email protected] = create_actor_pedtype 8 model #SPECIAL01 in_car [email protected] driverseat 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 01C8: [email protected] = create_actor_pedtype 8 model #FAM1 in_car [email protected] passenger_seat 0 0223: set_actor [email protected] health_to 500 02E2: set_actor [email protected] weapon_accuracy_to 100 081A: set_actor [email protected] weapon_skill_to 2 00A7: car [email protected] drive_to [email protected] [email protected] [email protected] :POLBACK_365 0001: wait 0 ms 00D6: if 01B0: car [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius 10.0 10.0 10.0 stopped 004D: jump_if_false @POLBACK_365 05CD: AS_actor [email protected] exit_car [email protected] 05CD: AS_actor [email protected] exit_car [email protected] 0164: disable_marker [email protected] 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 0001: wait 500 ms 01B2: give_actor [email protected] weapon 31 ammo 9999 // Load the weapon model before using this 01B2: give_actor [email protected] weapon 32 ammo 9999 // Load the weapon model before using this 0001: wait 250 ms 07AF: $MAPLAYAGANG = player $PLAYER_CHAR group 0630: put_actor $PLAYER_ACTOR in_group $MAPLAYAGANG as_leader 0631: put_actor [email protected] in_group $MAPLAYAGANG 0631: put_actor [email protected] in_group $MAPLAYAGANG 0001: wait 7000 ms :POLBACK_468 0001: wait 0 ms 00D6: if 056D: actor [email protected] defined 004D: jump_if_false @POLBACK_469 00D6: if or 86EE: not actor [email protected] in_group $PLAYER_GROUP 0118: actor [email protected] dead 004D: jump_if_false @POLBACK_469 0001: wait 2000 ms 034F: destroy_actor_with_fade [email protected] 0002: jump @POLBACK_469 :POLBACK_469 00D6: if 056D: actor [email protected] defined 004D: jump_if_false @POLBACK_470 00D6: if or 86EE: not actor [email protected] in_group $PLAYER_GROUP 0118: actor [email protected] dead 004D: jump_if_false @POLBACK_470 0001: wait 2000 ms 034F: destroy_actor_with_fade [email protected] 0002: jump @POLBACK_470 :POLBACK_470 00D6: if and 856D: not actor [email protected] defined 856D: not actor [email protected] defined 004D: jump_if_false @POLBACK_468 0296: unload_special_actor 1 0249: release_model #FAM1 0249: release_model #M4 0249: release_model #TEC9 0249: release_model #CELLPHONE 0249: release_model #PICADOR 0002: jump @POLBACK_11   There are certainly still many possible modifications to do. Such as checking if the car is not destroyed when it goes to its destination and disable its marker and its reference if it is the case. thank you it works when im publish the mod im gonna credit you Edited July 14, 2020 by cerdopalo jojo2971 1 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