Nesthor 11 Posted September 12, 2019 Share Posted September 12, 2019 I am making a code in which I need to create about 20 peds, maybe more, next to a truck, I am using local variables but I have declared a range as the coordinates where they will appear with a certain offset with respect to the vehicle, how can I reuse the variables to be able to create more peds, since when compiling with more than 32 variables I get an error that says that only maximum 32 variables can be used. wait 500 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 6.0 0.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 4.5 0.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 2.6 0.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.2 1.9 0.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.1 1.0 0.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.2 0.1 0.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 -0.9 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] Use opcode 0407 because the creation of peds occurs regardless of where the truck is, so I don't use specific coordinates Link to post Share on other sites
Jack 517 Posted September 12, 2019 Share Posted September 12, 2019 For coorinates you can use just 3 variables: 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 4.5 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 2.6 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.2 1.9 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.1 1.0 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.2 0.1 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] ... The code reads the last stored coordinates and ignores the rest until you use the opcode 0407 to define coordinates again. You can not use [email protected] and [email protected] since they're reserved for timers (as it's written in cs tutorials). 1 Link to post Share on other sites
Nesthor 11 Posted September 12, 2019 Author Share Posted September 12, 2019 23 minutes ago, Jack said: For coorinates you can use just 3 variables: 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 4.5 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.0 2.6 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.2 1.9 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.1 1.0 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 2.2 0.1 0.0 0376: [email protected] = create_random_actor_at [email protected] [email protected] [email protected] ... The code reads the last stored coordinates and ignores the rest until you use the opcode 0407 to define coordinates again. You can not use [email protected] and [email protected] since they're reserved for timers (as it's written in cs tutorials). thanks, then I must first declare the variables and then create the actor, in each case it must be the same. I'll try thanks Link to post Share on other sites