Nesthor Posted May 6, 2020 Share Posted May 6, 2020 Hello, I have several mappings, especially for trucks, I would like to know if it is possible to save a location through a code, that is, that a variable is assigned to a place with its X Y Z coordinates, I would like to do a kind of missions, in which the player must take a load to other places that I will define in the code, but that is random so that he does not always have to go to the same place Link to comment Share on other sites More sharing options...
ZAZ Posted May 6, 2020 Share Posted May 6, 2020 (edited) Yes of course, it's very simple and a usual method to check for the content of a specific var which lead the code to code blocks depending to the content of the var Best example are the mission sniffers, if ever had a look into main.scm So go to the thread that starts mission 13, 14, 15, 16, 17, 18, 19, 20, 21 the global var $SWEET_TOTAL_PASSED_MISSIONS is set to 0 by default If mission Tagging up Turf is completed the var becomes to 1 by adding 1 $SWEET_TOTAL_PASSED_MISSIONS += 1 it becomes 2 by adding again 1 if mission Cleaning the Hood is completed and so on The mission sniffer checks for $SWEET_TOTAL_PASSED_MISSIONS and can so decide which mission should be started 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 0 Spoiler :SWEET 03A4: name_thread 'SWEET' :SWEET_11 0001: wait $DEFAULT_WAIT_TIME ms 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 9 004D: jump_if_false @SWEET_36 004E: end_thread :SWEET_36 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @SWEET_807 00D6: if 0038: $ONMISSION == 0 004D: jump_if_false @SWEET_807 00D6: if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere $X_SWEET_HOUSE $Y_SWEET_HOUSE $Z_SWEET_HOUSE radius 1.2 1.2 2.0 on_foot 004D: jump_if_false @SWEET_684 00D6: if 03EE: player $PLAYER_CHAR controllable 004D: jump_if_false @SWEET_684 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 0 004D: jump_if_false @SWEET_180 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET_1' time 1000 style 2 // Tagging up Turf 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 13 // Tagging Up Turf :SWEET_180 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 1 004D: jump_if_false @SWEET_232 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET1B' time 1000 style 2 // Cleaning the Hood 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 14 // Cleaning The Hood :SWEET_232 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 2 004D: jump_if_false @SWEET_284 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET_3' time 1000 style 2 // Drive-thru 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 15 // Drive-Thru :SWEET_284 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 3 004D: jump_if_false @SWEET_336 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET_2' time 1000 style 2 // Nines and AK's 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 16 // Nines And AK's :SWEET_336 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 4 004D: jump_if_false @SWEET_388 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET_4' time 1000 style 2 // Drive-By 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 17 // Drive-By :SWEET_388 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 5 004D: jump_if_false @SWEET_440 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET_5' time 1000 style 2 // Sweet's Girl 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 18 // Sweet's Girl :SWEET_440 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 6 004D: jump_if_false @SWEET_492 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET_6' time 1000 style 2 // Cesar Vialpando 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 19 // Cesar Vialpando :SWEET_492 00D6: if 0038: $SWEET_TOTAL_PASSED_MISSIONS == 8 004D: jump_if_false @SWEET_684 0956: get_respect_to $47 00D6: if 0018: $47 > 1 004D: jump_if_false @SWEET_632 00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes 00D6: if and 0028: $TIME_HOURS >= 9 001A: 17 > $TIME_HOURS 004D: jump_if_false @SWEET_609 00BE: text_clear_all 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'SWEET_7' time 1000 style 2 // Los Sepulcros 0050: gosub @SUB_CJ_GOTO_SWEET_HOUSE 0417: start_mission 20 // Los Sepulcros 0002: jump @SWEET_625 :SWEET_609 00BC: show_text_highpriority GXT 'MTIME3' time 1000 flag 1 // ~s~Komm zwischen 9:00 Uhr und 17:00 Uhr wieder :SWEET_625 0002: jump @SWEET_684 :SWEET_632 00BC: show_text_highpriority GXT 'MOREREP' time 1000 flag 1 // ~s~Du musst dir mehr Respekt erwerben. 00D6: if 0038: $HELP_RESPECT_SHOWN == 0 004D: jump_if_false @SWEET_684 03E5: show_text_box 'HELP101' // Du kannst dir Respekt erwerben, indem du bestimmte Missionen erf¬llst, indem du Mitglieder rivalisierender Gangs ausschaltest, indem du Gebiet eroberst und durch das Spr¬hen von Graffitis. 0004: $HELP_RESPECT_SHOWN = 1 :SWEET_684 00D6: if 00FF: actor $PLAYER_ACTOR sphere 0 in_sphere 1365.251 -1280.12 12.5469 radius 1.2 1.2 2.0 on_foot 004D: jump_if_false @SWEET_807 00D6: if 03EE: player $PLAYER_CHAR controllable 004D: jump_if_false @SWEET_807 00D6: if and 0038: $SWEET_TOTAL_PASSED_MISSIONS == 7 0038: $1346 == 1 004D: jump_if_false @SWEET_807 0004: $ONMISSION = 1 00BA: show_text_styled GXT 'CRASH_2' time 1000 style 2 // Doberman 0050: gosub @SUB_FADE_500MS 0417: start_mission 21 // Doberman :SWEET_807 0002: jump @SWEET_11 This can also be done by local vars The difference: global vars will be stored when making savegame, local vars not So if you wanna do it by cleo and it should be stored in savegame, then it needs additional method Edited May 6, 2020 by ZAZ 𝓦𝓸𝓵𝓯 1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
fikri7wgx Posted May 20, 2020 Share Posted May 20, 2020 (edited) i have some method for this, its matematic. :startnumber [email protected]=-500.0 [email protected]=-500.0 jump @loop :loop car. storepos([email protected], [email protected], [email protected], [email protected]) * [email protected][email protected](float) * [email protected][email protected](float) * [email protected][email protected] * [email protected][email protected] [email protected]*=-1.0 [email protected]=500.0 * [email protected][email protected] * [email protected][email protected] * [email protected][email protected] [email protected]*=-1.0 [email protected]=500.0 * [email protected][email protected] *get nearest car path coord from [email protected] [email protected] [email protected] to $x $y $z car. driveto([email protected], $x, $y, $z) * [email protected][email protected](float) * [email protected][email protected](float) jump @check :check if * actor player actor sphere [email protected] [email protected] [email protected] radius 50.0 50.0 in_car jf @check jump @loop //---------------------// * i mean use opcode, u can search it on sannybuilder. i forget it. that math formula u can mix it. but wit that, u will get random coord Every round. Edited May 20, 2020 by fikri7wgx wrong type 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