Rapier Posted August 31, 2009 Share Posted August 31, 2009 we can use the adress 0x00969110 as cheat key_press check This memory address is for version 1.0, but, for version 1.01 which will be? That's because my mods did not work anymore after I did the upgrade to version 1.01 and all are activated as a cheat. Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059458031 Share on other sites More sharing options...
Wesser Posted August 31, 2009 Share Posted August 31, 2009 It's 0x96B790 for 1.1. Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059458217 Share on other sites More sharing options...
markbaker Posted August 31, 2009 Share Posted August 31, 2009 wow, thanks ZAZ! this is a god-send Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059459176 Share on other sites More sharing options...
markbaker Posted August 31, 2009 Share Posted August 31, 2009 One more question: Is there a pathing tool out there like carrec, but for the Camera instead of for cars? It would be nice if i could record a path for my camera to move along during cutscenes, for a cinematic feel. Thanks Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059460048 Share on other sites More sharing options...
Rapier Posted September 1, 2009 Share Posted September 1, 2009 It's 0x96B790 for 1.1. Thanks Wesser! Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059460284 Share on other sites More sharing options...
ZAZ Posted September 1, 2009 Author Share Posted September 1, 2009 (edited) One more question: Is there a pathing tool out there like carrec, but for the Camera instead of for cars? It would be nice if i could record a path for my camera to move along during cutscenes, for a cinematic feel. Thanks No, there isn't way to make camera paths. For camera exist a lot of opcodes to realize your plan. One way could be to record a carrec with heli and use then any vehicle to attach the carrec path. Then put the camera on vehicle 00A5: 1@ = create_car #INFERNUS at 2487.5 -1660.5 13.350679: put_camera_on_car 1@ with_offset 0.0 -5.0 1.5 rotation 0.0 0.0 0.0 0.0 2//view trunk0679: put_camera_on_car 1@ with_offset 0.0 -5.0 1.5 <--xyz position relativ to carxyz point to view relativ to car-->> 0.0 0.0 0.0 rotation -->> 0.0 2 <--mode the equivalent for the actor is opcode 067C: The exemple above is from a cutsene which I made to move the camera nearer to the viewpoint 0007: 6@ = 0.5 // floating-point values0007: 7@ = 0.0 // floating-point values0007: 8@ = 0.0 // floating-point values:Loopwait 0067C: $PLAYER_ACTOR 8@ 6@ 0.7 7@ 13.5 0.5 0.0 2000B: 6@ += 0.03 // floating-point values000B: 7@ += 0.01 // floating-point values000B: 8@ += 0.01 // floating-point valuesjump @Loop If you put the cam to player the player-walk-movement will be buggy In connection with opcode 015F: you can set the camera view to follow an actor automaticly 015F: set_camera_position -2248.2187 -79.441 37.7686 rotation 0.0 0.0 0.0 0159: camera_on_ped 80@ 15 2 Edited September 1, 2009 by ZAZ Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059462055 Share on other sites More sharing options...
markbaker Posted September 3, 2009 Share Posted September 3, 2009 ZAZ: I've got a heli flying along a carrec path with a camera attached to the heli. What I want to do is: the heli-mounted camera automatically 'point at' a parked or moving car while the heli is flying along the path. Is this possible? Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059467043 Share on other sites More sharing options...
ZAZ Posted September 3, 2009 Author Share Posted September 3, 2009 (edited) I've got a heli flying along a carrec path with a camera attached to the heli. What I want to do is: the heli-mounted camera automatically 'point at' a parked or moving car while the heli is flying along the path. Is this possible? Camera on carrec path Only the combination of opcode 015F: and 0159: let the camera follow automaticly a moving target point But we have enough codes in SA to do everything. We can read the car positions as variable values and and insert this variables as parameter in the standart camera position opcode The placing of cars by using parked_car_generator dont allows the using of its variable name in vehicle associated opcodes because its not a car but a car_generator But we can simple use the same coords to insert it in the standart camera target opcode The script below spawns a NRG500 and follows the carrec path carrec899.rrr by keypress 8 The camera shows a fix XYZcoordpoint (I placed a Monster at SFAirport and drove around and inserted the coords of the parked_car #monster in the script) //-init_parked_car_generator #MONSTER color -1 -1 1 alarm 0 door_lock 0 0 10000 at -1355.7821 -71.4736 14.1462 angle 86.0 0160: set_camera_point_at -1355.7821 -71.4736 14.1462 mode 2 {$CLEO .cs}:CameraDrive_103A4: name_thread 'DRVCARC':CameraDrive_110001: wait 0 ms00D6: if0256: player $PLAYER_CHAR defined004D: jump_if_false @CameraDrive_11if0AB0: key_pressed 56//----------- key 8004D: jump_if_false @CameraDrive_110247: request_model #NRG500:CameraDrive_130001: wait 0 ms00D6: if 00248: model #NRG500 available004D: jump_if_false @CameraDrive_1300A5: 0@ = create_car #NRG500 at 0.0 0.0 100.00175: set_car 0@ z_angle_to 0.002AC: set_car 0@ immunities BP 1 FP 1 EP 1 CP 1 MP 10249: release_model #NRG5000006: 8@ = 89907C0: load_path 8@:CameraDrive_170001: wait 0 ms00D6: if07C1: path 8@ available004D: jump_if_false @CameraDrive_1700D6: if8119: not car 0@ wrecked004D: jump_if_false @CameraDrive_500001: wait 500 ms05EB: assign_car 0@ to_path 8@:CameraDrive_210001: wait 0 ms00D6: if0256: player $PLAYER_CHAR defined004D: jump_if_false @CameraDrive_5000D6: if or00E1: key_pressed 0 15//Enter/Exit0119: car 0@ wrecked004D: jump_if_false @CameraDrive_250002: jump @CameraDrive_50:CameraDrive_250407: create_coordinate 11@ 12@ 13@ from_car 0@ with_offset 0.0 0.0 1.0015F: set_camera_position 11@ 12@ 13@ rotation 0.0 0.0 0.0 //init_parked_car_generator #MONSTER at -1355.7821 -71.4736 14.1462 0160: set_camera_point_at -1355.7821 -71.4736 14.1462 mode 20002: jump @CameraDrive_21:CameraDrive_500001: wait 0 ms00D6: if0256: player $PLAYER_CHAR defined004D: jump_if_false @CameraDrive_500373: set_camera_directly_behind_player02EB: restore_camera_with_jumpcut05EC: release_car 0@ from_path0873: release_path 8@01C3: remove_references_to_car 0@ // Like turning a car into any random car0001: wait 1000 ms0002: jump @CameraDrive_11 To view a moving target from a moving vehicle is a bit more complicate because we need a script for the moving target and a script for the camera on carrec path. I merged the CarDrive script and the CameraDrive script Script below spawns the car Infernus in Grovestreet with two homies inthere, if player goes into red marker(sphere) additional it spawns a NRG500 and follows the carrec path carrec899.rrr The camera shows a moving XYZcoords of the driving Infernus {$CLEO .cs}:CarrecCamCarDrive_103A4: name_thread 'CRCMCDR':CarrecCamCarDrive_20001: wait 0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @CarrecCamCarDrive_2if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point 2491.5 -1667.5 13.35 radius 1.0 1.0 1.0004D: jump_if_false @CarrecCamCarDrive_20247: request_model #INFERNUS0247: request_model #fam10247: request_model #fam20247: request_model #NRG500:CarrecCamCarDrive_30001: wait 0 msif and0248: model #INFERNUS available0248: model #fam1 available0248: model #fam2 available0248: model #NRG500 available004D: jump_if_false @CarrecCamCarDrive_300A5: 1@ = create_car #INFERNUS at 2487.5 -1660.5 13.350175: set_car 1@ z_angle_to 90.00129: 2@ = create_actor 8 #fam1 in_car 1@ driverseat01C8: 3@ = create_actor 8 #fam2 in_car 1@ passenger_seat 00186: 4@ = create_marker_above_car 1@07E0: set_marker 4@ type_to 100A5: 0@ = create_car #NRG500 at 0.0 0.0 100.00175: set_car 0@ z_angle_to 0.002AC: set_car 0@ immunities BP 1 FP 1 EP 1 CP 1 MP 10006: 8@ = 89907C0: load_path 8@:CarrecCamCarDrive_50001: wait 0 ms00D6: if07C1: path 8@ available004D: jump_if_false @CarrecCamCarDrive_500D6: if8119: not car 0@ wrecked004D: jump_if_false @CarrecCamCarDrive_500001: wait 500 ms05EB: assign_car 0@ to_path 8@//////////////////// the drive-to commands --vv----0615: define_action_sequences 5@05D1: AS_actor -1 drive_car 1@ to 2353.1528 -1658.6493 13.384 speed 20.0 0 0 505D1: AS_actor -1 drive_car 1@ to 2431.7739 -1674.7444 13.6643 speed 20.0 0 0 505D1: AS_actor -1 drive_car 1@ to 2431.5864 -1628.0818 13.698 speed 20.0 2 0 50616: define_action_sequences_end 5@0618: assign_actor 2@ to_action_sequences 5@061B: remove_references_to_AS_pack 5@//////////////////// the drive-to commands --^^----:CarrecCamCarDrive_130001: wait 0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @CarrecCamCarDrive_13//////////////////// the the camera codes must run in a Loop --vv----0407: create_coordinate 11@ 12@ 13@ from_car 0@ with_offset 0.0 0.0 1.5015F: set_camera_position 11@ 12@ 13@ rotation 0.0 0.0 0.00407: create_coordinate 14@ 15@ 16@ from_car 1@ with_offset 0.0 0.0 1.00160: set_camera_point_at 14@ 15@ 16@ mode 2//////////////////// the the camera codes must run in a Loop --vv----if or00E1: key_pressed 0 15//Enter/Exit0119: car 0@ wrecked0119: car 1@ wrecked01F4: car 1@ flipped8202: not actor $PLAYER_ACTOR near_car 1@ radius 500.0 500.0 flag 0004D: jump_if_false @CarrecCamCarDrive_13:CarrecCamCarDrive_500001: wait 0 ms00D6: if0256: player $PLAYER_CHAR defined004D: jump_if_false @CarrecCamCarDrive_500373: set_camera_directly_behind_player02EB: restore_camera_with_jumpcut05EC: release_car 0@ from_path0873: release_path 8@01C3: remove_references_to_car 0@ // Like turning a car into any random car01C3: remove_references_to_car 1@ // Like turning a car into any random car01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian01C2: remove_references_to_actor 3@ // Like turning an actor into a random pedestrian0164: disable_marker 4@0249: release_model #INFERNUS0249: release_model #fam10249: release_model #fam20249: release_model #NRG5000001: wait 1000 ms0002: jump @CarrecCamCarDrive_2 Edited September 3, 2009 by ZAZ Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059468717 Share on other sites More sharing options...
Chuka Posted September 11, 2009 Share Posted September 11, 2009 ZAZ!! in Spanish! please!! Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059488264 Share on other sites More sharing options...
ZAZ Posted September 11, 2009 Author Share Posted September 11, 2009 ZAZ!! in Spanish! please!! try google translation, but don't use the translated scripts Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059488383 Share on other sites More sharing options...
Rapier Posted September 12, 2009 Share Posted September 12, 2009 (edited) Important information (I think...): Memory address to check if exist a target on the map (red mark) for SA 1.01: 0x00BA8DF7. Edited September 12, 2009 by Rapier Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059490733 Share on other sites More sharing options...
markbaker Posted September 12, 2009 Share Posted September 12, 2009 ZAZ Much thanks! I am making great progress on my project! I'm wondering if it is possible to assign a vehicle directly to a path contained in an rrr file - without having to close GTA:SA & open the R3D tool and add it to carrec.img? It would be a HUGE timesaver if I could record a path, and then immediately playback my recorded paths with a simple keypress to see how it looks Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059490828 Share on other sites More sharing options...
ZAZ Posted September 12, 2009 Author Share Posted September 12, 2009 (edited) I'm wondering if it is possible to assign a vehicle directly to a path contained in an rrr file - without having to close GTA:SA & open the R3D tool and add it to carrec.img? Not possible i think but what is R3D tool? IMG is loaded by startup Start game with menue button of sannybuilder is faster Edited September 12, 2009 by ZAZ Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059490853 Share on other sites More sharing options...
kmasdmk Posted September 12, 2009 Share Posted September 12, 2009 Hi all. I need help with my small anim. I have this anim in file dancing.ifp And i want use this anim in air. And idk how. Here is my cleo code. ... Player.Defined($PLAYER_CHAR)else_jump @RASK14_MOD_21 04ED: load_animation "DANCING" :RASK14_MOD_52wait 10 if and0AB0: key_pressed 49 8818: not actor $PLAYER_ACTOR in_air 84AD: not actor $PLAYER_ACTOR in_water 8449: not actor $PLAYER_ACTOR in_a_car 847A: not actor $PLAYER_ACTOR driving_bike 84A7: not actor $PLAYER_ACTOR driving_boat 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 84A9: not actor $PLAYER_ACTOR driving_heli else_jump @RASK14_MOD_150 0605: actor $PLAYER_ACTOR perform_animation_sequence "BD_CLAP" IFP_file "DANCING" 4.0 loop 1 1 1 0 time 700 // versionA wait 1500 ... What i need edit or add ? With this player use anim on earth. Thanks. (sorry when i write this post to bad topic.i am new on this forum.) Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059491093 Share on other sites More sharing options...
ZAZ Posted September 14, 2009 Author Share Posted September 14, 2009 (edited) (sorry when i write this post to bad topic.i am new on this forum.) No problem but the forum to post such question is here I need help with my small anim.I have this anim in file dancing.ifp And i want use this anim in air. And idk how. Here is my cleo code. What i need edit or add ? With this player use anim on earth. Thanks. What means in air? While falling or should the actor fly? Have you seen the Airswim script in chapter CLEO Script Tutorial/Additional Themes : Animations ? press Backspace to dance in air {$CLEO .cs}:Airdance03A4: name_thread 'AirDnce' :AirDance_010001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @AirDance_0100D6: if 00AB0: key_pressed 8004D: jump_if_false @AirDance_0104ED: load_animation "DANCING" :AirDance_030001: wait 0 msif04EE: animation "DANCING" loaded004D: jump_if_false @AirDance_03083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 0.0 0.0 20.00001: wait 1000 ms0812: unknown_action_sequence $PLAYER_ACTOR "BD_CLAP" from_file "DANCING" 1.0 1 1 1 1 -2:AirDance_050001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @AirDance_05083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 0.0 2.0 2.0if and8AB0: not key_pressed 80611: actor $PLAYER_ACTOR animation == "BD_CLAP" 004D: jump_if_false @AirDance_070002: jump @AirDance_05:AirDance_070792: disembark_instantly_actor $PLAYER_ACTOR04EF: release_animation "DANCING"0001: wait 1000 ms0002: jump @AirDance_01 Edited September 14, 2009 by ZAZ Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059494390 Share on other sites More sharing options...
bull.04 Posted September 18, 2009 Share Posted September 18, 2009 How do you make a timer? Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059505449 Share on other sites More sharing options...
ZAZ Posted September 19, 2009 Author Share Posted September 19, 2009 How do you make a timer? Look at CLEO Script Tutorial/Give access with math coding : Time check for milliseconds in real time Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059506030 Share on other sites More sharing options...
bull.04 Posted September 19, 2009 Share Posted September 19, 2009 I mean one that counts down on screen like in the mission where you steal weapons from Colonel Fuhrberger's house. Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059507950 Share on other sites More sharing options...
Glenstorm Posted September 20, 2009 Share Posted September 20, 2009 sorry if this was covered earlier in the tutorial... but pls help.. how to create a script which uses a parked car generator, which does not save the car if the game is saved? in other words, i want the car to be there, if the .cs script is in the CLEO folder, and not to be there when it is removed, regardless of the user saving his game in between... currently im trying with enable_thread_saving thing.... i removed the line and it still gets saved in the savegame... how to remove this stupid functionality? Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059508502 Share on other sites More sharing options...
ZAZ Posted September 20, 2009 Author Share Posted September 20, 2009 (edited) sorry if this was covered earlier in the tutorial... but pls help.. how to create a script which uses a parked car generator, which does not save the car if the game is saved? in other words, i want the car to be there, if the .cs script is in the CLEO folder, and not to be there when it is removed, regardless of the user saving his game in between... currently im trying with enable_thread_saving thing.... i removed the line and it still gets saved in the savegame... how to remove this stupid functionality? This function is a parked_car_generator and not a car. The savegame don't stores a placed car. It stores a parked_car_generator funktion You can set that the generator don't places cars with ciro as last parameter in opcode 014C: 014C: set_parked_car_generator $PARKED_BMX_GLEN_PARK cars_to_generate_to 0 but it's not possible to remove the generator funktion Also enable_thread_saving can not prevent that. The opcode 0A95: enable_thread_saving should prevent duplicates of parked_car_generators, pickups or placed objects by making savgames, load that save, save it again and so on. Edited September 20, 2009 by ZAZ Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059509064 Share on other sites More sharing options...
bull.04 Posted September 21, 2009 Share Posted September 21, 2009 can you make an example script that shows how to make a timer to show up on the screen? Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059511001 Share on other sites More sharing options...
ZAZ Posted September 22, 2009 Author Share Posted September 22, 2009 can you make an example script that shows how to make a timer to show up on the screen? The game supports opcodes to show automatic timers but it needs to insert global variables and because global can cause bugs and crashes in Cleo I will show first how to display timers in scripted variation. This needs to calculate the values of 33@ or 32@ to show minutes and seconds, for the text number display can be used text_draw opcodes, text_high_priority opcodes or text_style opcodes I made a little script which invite you to run with your player_actor around the SF-garage in Doherty Go into the red marker (not that to start the mission) then run to the next red marker and so on A yellow blip on radar shows you where to run The first script shows the simple value of 33@ text_draw opcodes are used to show the value {$CLEO .cs}:Timeout_1// --- 32@ and 33@ are allways running as script timer in ms and you can catch its valuethread 'Timeout' 018A: 1@ = create_checkpoint_at -2026.2032 139.4361 28.8:Timeout_3//------------------------------------------------------- first loopwait 0 if0256: player $PLAYER_CHAR defined jf @Timeout_303F0: enable_text_draw 1045A: text_draw_1number 500.0 200.0 'NUMBER' 33@if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2026.2032 139.4361 28.83 radius 2.5 2.5 5.5jf @Timeout_3Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2057.0911 139.3797 28.8333@ = 0// set the timer to 0:Timeout_5//------------------------------------------------------- second loopwait 0 if0256: player $PLAYER_CHAR defined jf @Timeout_repeat03F0: enable_text_draw 1045A: text_draw_1number 500.0 200.0 'NUMBER' 33@if33@ > 4000// check if timer is bigger than 4000msjf @Timeout_7jump @Timeout_repeat:Timeout_7if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2057.0911 139.3797 28.83 radius 2.5 2.5 5.5jf @Timeout_5Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2063.8882 184.6683 28.84333@ = 0// set the timer to 0:Timeout_9//------------------------------------------------------- third loopwait 0 if0256: player $PLAYER_CHAR defined jf @Timeout_repeat03F0: enable_text_draw 1045A: text_draw_1number 500.0 200.0 'NUMBER' 33@if33@ > 5000// check if timer is bigger than 4000msjf @Timeout_11jump @Timeout_repeat:Timeout_11if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2063.8882 184.6683 28.843 radius 2.5 2.5 5.5jf @Timeout_9Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2024.1184 180.6013 28.835933@ = 0// set the timer to 0:Timeout_13//------------------------------------------------------- fourth loopwait 0 if0256: player $PLAYER_CHAR defined jf @Timeout_repeat03F0: enable_text_draw 1045A: text_draw_1number 500.0 200.0 'NUMBER' 33@if33@ > 5000// check if timer is bigger than 5000msjf @Timeout_15jump @Timeout_repeat:Timeout_15if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2024.1184 180.6013 28.8359 radius 2.5 2.5 5.5jf @Timeout_1300BA: show_text_styled GXT 'M_PASSD' time 5000 style 1Marker.Disable(1@)03F0: enable_text_draw 00A93: end_custom_thread//- end by success:Timeout_repeat//-----------------------refresh00BA: show_text_styled GXT 'M_FAIL' time 5000 style 103F0: enable_text_draw 0Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2026.2032 139.4361 28.80002: jump @Timeout_3 The next script shows the calculated values of 33@ as seconds and 1/100 of a second text_draw opcodes are used to show the time Use the fxt below and insert it into your fxt file Showt01 SHOWTime: ~1~:~1~ Run again around the SF-garage in Doherty {$CLEO .cs}:Showtime_1thread 'Showtime' 018A: 1@ = create_checkpoint_at -2026.2032 139.4361 28.8:Showtime_3//------------------------------------------------------- first loopwait 0 if0256: player $PLAYER_CHAR defined jf @Showtime_3if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2026.2032 139.4361 28.83 radius 2.5 2.5 5.5jf @Showtime_3Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2057.0911 139.3797 28.8333@ = 026@ = 4000//----countdownt start value in ms:Showtime_5//------------------------------------------------------- second loopwait 0 if0256: player $PLAYER_CHAR defined jf @Showtime_repeatgosub @Showtime_text_draw//---------- gosub to the display settingif33@ > 4000//-- must be equal to the previous countdownt start valuejf @Showtime_7jump @Showtime_repeat:Showtime_7if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2057.0911 139.3797 28.83 radius 2.5 2.5 5.5jf @Showtime_5Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2063.8882 184.6683 28.84333@ = 026@ = 5000//----countdownt start value in ms:Showtime_9//------------------------------------------------------- third loopwait 0 if0256: player $PLAYER_CHAR defined jf @Showtime_repeatgosub @Showtime_text_draw//---------- gosub to the display settingif33@ > 5000//-- must be equal to the previous countdownt start valuejf @Showtime_11jump @Showtime_repeat:Showtime_11if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2063.8882 184.6683 28.843 radius 2.5 2.5 5.5jf @Showtime_9Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2024.1184 180.6013 28.835933@ = 026@ = 5000//----countdownt start value in ms:Showtime_13//------------------------------------------------------- fourth loopwait 0 if0256: player $PLAYER_CHAR defined jf @Showtime_repeatgosub @Showtime_text_draw//---------- gosub to the display settingif33@ > 5000//-- must be equal to the previous countdownt start valuejf @Showtime_15jump @Showtime_repeat:Showtime_15if00FE: actor $PLAYER_ACTOR 1 (in-sphere)near_point -2024.1184 180.6013 28.8359 radius 2.5 2.5 5.5jf @Showtime_1300BA: show_text_styled GXT 'M_PASSD' time 5000 style 1Marker.Disable(1@)03F0: enable_text_draw 00A93: end_custom_thread//- end by success:Showtime_repeat//-----------------------refresh00BA: show_text_styled GXT 'M_FAIL' time 5000 style 103F0: enable_text_draw 0Marker.Disable(1@)018A: 1@ = create_checkpoint_at -2026.2032 139.4361 28.80002: jump @Showtime_3:Showtime_text_draw//------------------------------- subscript0085: 31@ = 33@ // make a local equal to the timer 33@ 0085: 30@ = 33@ // make one more local equal to the timer 33@ 0085: 28@ = 26@ // make a local equal to the countdownt start value which show the seconds28@ /= 100031@ /= 10000062: 28@ -= 31@ 0085: 27@ = 26@ // make one more local equal to the countdownt start value which show parts of seconds 27@ /= 1030@ /= 100062: 27@ -= 30@03F0: enable_text_draw 1 0340: set_text_draw_RGBA 0 64 255 255 033F: set_text_draw_letter_size 0.5 3.0 0343: set_text_draw_linewidth 640.0 045B: draw_text_2numbers 450.0 200.0 GXT 'SHOWT01' numbers 28@ 27@return Instead text_draw opcodes can also be used text_high_priority opcodes replace 03F0: enable_text_draw 1 0340: set_text_draw_RGBA 0 64 255 255 033F: set_text_draw_letter_size 0.5 3.0 0343: set_text_draw_linewidth 640.0 045B: draw_text_2numbers 450.0 200.0 GXT 'SHOWT01' numbers 28@ 27@ with 02FD: show_text_2numbers_lowpriority GXT 'Showt01' numbers 28@ 27@ time 10 flag 1 or use text_style opcodes and replace it with 036D: show_text_2numbers_styled GXT 'Showt01' numbers 28@ 27@ time 5 style 6 As I said above can also be used an automatic timer but it needs to use global variables You need first to declare the value then start the timer. Use stop timer at the end to remove the reference of the timer and of the variable type 1 counts in descending order and type 0 counts in ascending order {$CLEO .cs}:Timer_1thread 'TIMER'0004: $time2 = 90000 // integer values014E: set_timer_to $time2 type 1:Timer_2wait 0if$time2 == 0jf @Timer_2014F: stop_timer $time200BA: show_text_styled GXT 'fem_off' time 1000 style 10A93: end_custom_thread For the timer exist also a version which show a text replace 014E: set_timer_to $time2 type 1 with 03C3: set_timer_to $time2 type 1 GXT 'Showt01' // global_variable // Time To make it complete I show also how to use the StatusText or StatusBar opcode But it needs also to use global variables At first the StatusText opcode which displays only a value as numbers It displays not the time but it displays automaticly the value of the global variable {$CLEO .cs}:Status_1thread 'STATUS'0004: $time2 = 1000 // integer values03C4: set_status_text $time2 type 0 GXT 'Showt01' // global_variable // Score ~1~:Status_2wait 0$time2 -= 1if$time2 == 0jf @Status_20151: remove_status_text $time200BA: show_text_styled GXT 'fem_off' time 1000 style 10A93: end_custom_thread type 0 shows the value as numbers type 1 shows the value as an bar also there exist other opcodes to displays more StatusTexts or StatusBars in more rows among each other for the statusBar you must consider that a full bar have allways the value 100 and to show the correct bar needs to calculate the value relativ to 100 in other words: the bar shows percents {$CLEO .cs}:Status2_1thread 'STATUS2'0004: $time1 = 100 // integer values0004: $time2 = 1000 // integer values04F7: status_text $time1 type 1 line 1 GXT 'Showt01' // global_variable // Score04F7: status_text $time2 type 0 line 2 GXT 'Showt01' // global_variable // Score:Status2_2wait 0$time2 -= 10084: $time1 = $time2$time1 /= 10if$time2 == 0jf @Status2_20151: remove_status_text $time10151: remove_status_text $time200BA: show_text_styled GXT 'fem_off' time 1000 style 10A93: end_custom_thread Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059515012 Share on other sites More sharing options...
larvaz Posted October 28, 2009 Share Posted October 28, 2009 (edited) Wusup! hello 2 Everyone... well im new here, at the forum, i think ive been coding from the last month XD.. i was reading ZAZ car drive tut.. i took the examle code, the one that uses 07E7: AS_assign_scmpath_to_actor im planing a race script around the city, NFS style jojo.. but ive troubles with my code... everythings fine when makin the cars, the "oponent" perfectly follows my desired path... then i decide to make a winnin condition, cheking if any of the cars reached the final race chekpoint, near the train station.. heres the whole code {$CLEO .cs}:scmpath_103A4: name_thread 'SCMP':scmpath_30001: wait 0 msif0256: player $PLAYER_CHAR definedjf @scmpath_3077E: 0@ = active_interiorif and0038: 0@ == 0 // integer values0AB0: key_pressed 8//----------------------------------------Backspace jf @scmpath_3016A: fade 0 () 250 ms0001: wait 250 ms01B4: set_player $PLAYER_CHAR frozen_state 0 (frozen)0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5 -408.1 14.10173: set_actor $PLAYER_ACTOR z_angle_to 90.80001: wait 500 ms0247: request_model #INFERNUS0247: request_model #MAFFA:scmpath_50001: wait 0 msif and0248: model #INFERNUS available 0248: model #MAFFA availablejf @scmpath_500C0: set_current_time_hours_to 1 minutes_to 0 // i prefer raciin at nite jojo00A5: 1@ = create_car #INFERNUS at 2639.6252 2097.3906 10.6558 //put car racestart0175: set_car 1@ z_angle_to 191.00224: set_car 1@ health_to 200000A5: 7@ = create_car #INFERNUS at 2634.3599 2097.4692 10.6499 //put opponent racestart0175: set_car 7@ z_angle_to 191.00224: set_car 7@ health_to 2000020A: set_car 7@ door_status_to 402AC: set_car 7@ immunities 1 1 1 1 101EC: make_car 7@ very_heavy 10129: 9@ = create_actor 24 #MAFFA in_car 7@ driverseat0223: set_actor 9@ health_to 300004E4: unknown_refresh_game_renderer_at 2639.6252 2097.390603CB: set_camera 2639.6252 2097.3906 10.6558029B: 23@ = init_object 1655 at -1576.02 -202.34 13.760177: set_object 23@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 23@0382: set_object 23@ collision_detection 1029B: 24@ = init_object 1655 at -1597.9 -506.5 21.70177: set_object 24@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 24@0382: set_object 24@ collision_detection 1029B: 25@ = init_object 1655 at -1375.9 -581.5 13.690177: set_object 25@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 25@0382: set_object 25@ collision_detection 1029B: 26@ = init_object 1655 at -1374.9 -585.5 13.690177: set_object 26@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 26@0382: set_object 26@ collision_detection 10177: set_object 23@ z_angle_to 135.00177: set_object 24@ z_angle_to 225.00177: set_object 25@ z_angle_to 280.00177: set_object 26@ z_angle_to 280.00186: 29@ = create_marker_above_car 7@07E0: set_marker 29@ type_to 10249: release_model #INFERNUS0249: release_model #MAFFACar.LockInCurrentPosition(7@) = TrueCar.LockInCurrentPosition(1@) = True04e0: car 7@ abandon_path_radius 20000AD: set_car 7@ max_speed_to 100.004BA: set_car 7@ speed_instantly 30.000AF: set_car 7@ driver_behaviour_to 100AE: unknown_set_car 7@ to_ignore_traffic_lights 20001: wait 250 ms036A: put_actor $PLAYER_ACTOR in_car 1@0001: wait 250 ms016A: fade 1 () 1000 ms0001: wait 1000 ms0373: set_camera_directly_behind_player02EB: restore_camera_with_jumpcut01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen)0006: 15@ = 0 // integer values0006: 16@ = 0 // integer values0006: 20@ = 20000 // floating-point values0006: 19@ = 0 // integer values 0007: 11@ = 2647.3511 // floating-point values0007: 12@ = 2069.1543 // floating-point values 2647.8835 2068.5312 9.70850007: 13@ = 10.1373 // floating-point values0006: $win = 00006: $lose = 0wait 3000 msCar.LockInCurrentPosition(1@) = FalseCar.LockInCurrentPosition(7@) = False00A7: car 7@ drive_to 11@ 12@ 13@00AD: set_car 7@ max_speed_to 100.004e0: car 7@ abandon_path_radius 25008C6: set_actor 9@ stay_on_bike 106D5: $check = create_racing_checkpoint_at 2866.5557 1279.0804 15.0 point_to 2866.5557 1279.0804 10.763 type 1 radius 15.0 //heres the checkpoint coords:scmpath_70001: wait 0 msif0256: player $PLAYER_CHAR definedjf @scmpath_70050: gosub @scmpath_sub_3if and8119: NOT car 1@ wrecked8119: NOT car 7@ wrecked8118: NOT actor 9@ deadjf @scmpath_7if00FE: actor $PLAYER_ACTOR 0 ()near_point 2639.6252 2097.3906 10.6558 radius 1000.5 1000.5 50.5jf @scmpath_12//// heres where i put the $PLAYER_ACTOR´s car winnin condition...////:checkwinwait 0if80EC: actor $PLAYER_ACTOR 0 near_point 2866.5557 1279.0804 10.763 radius 8.0 8.0 //check if youve reach tha finish linejf @scmpath_7:putwin //true? winnin gets 1 value0006: $win = 1jump @chekloop //and jumps to make the check, otherwise it continues with normal script// end of winnin conditionjump @scmpath_7:scmpath_120164: disable_marker 29@01C3: remove_references_to_car 1@ // Like turning a car into any random car01C3: remove_references_to_car 7@ // Like turning a car into any random car01C2: remove_references_to_actor 9@ // Like turning an actor into a random pedestrian0108: destroy_object 23@0108: destroy_object 24@0108: destroy_object 25@0108: destroy_object 26@jump @scmpath_3:scmpath_sub_3if8119: NOT car 7@ wreckedjf @scmpath_sub_109if00DB: actor 9@ in_car 7@jf @scmpath_sub_99if0039: 19@ == 1 // integer valuesjf @scmpath_sub_100006: 19@ = 0 // integer valuesjump @scmpath_sub_100:scmpath_sub_10if0039: 15@ == 0 // integer valuesjf @scmpath_sub_11if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 5.2 5.2 5.0jf @scmpath_sub_110006: 15@ = 1 // integer values05D6: clear_scmpath0007: 11@ = 2690.3149 // floating-point values0007: 12@ = 2003.0887 // floating-point values0007: 13@ = 6.6397 // floating-point values000A: 16@ += 0 // integer values 0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_11if0039: 15@ == 1 // integer valuesjf @scmpath_sub_12if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1200AD: set_car 7@ max_speed_to 10.00006: 15@ = 2 // integer values05D6: clear_scmpath0007: 11@ = 2705.8157 // floating-point values0007: 12@ = 1937.0188 // floating-point values 0007: 13@ = 6.6761 // floating-point values000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_12if0039: 15@ == 2 // integer valuesjf @scmpath_sub_13if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1300AD: set_car 7@ max_speed_to 25.00006: 15@ = 3 // integer values05D6: clear_scmpath0007: 11@ = 2726.5459 // floating-point values0007: 12@ = 1887.1978 // floating-point values 0007: 13@ = 6.6737 // floating-point values000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_13if0039: 15@ == 3 // integer valuesjf @scmpath_sub_14if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 8.2 8.2 5.0jf @scmpath_sub_1400AD: set_car 7@ max_speed_to 25.00006: 15@ = 4 // integer values05D6: clear_scmpath0007: 11@ = 2737.7283 // floating-point values0007: 12@ = 1763.1494 // floating-point values0007: 13@ = 6.8209 // floating-point values 000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_14if0039: 15@ == 4 // integer valuesjf @scmpath_sub_15if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 5.2 5.2 5.0jf @scmpath_sub_150006: 15@ = 5 // integer values05D6: clear_scmpath0007: 11@ = 2747.7874 // floating-point values0007: 12@ = 1691.6516 // floating-point values0007: 13@ = 8.8271 // floating-point values 000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_15if0039: 15@ == 5 // integer valuesjf @scmpath_sub_16if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1600AD: set_car 7@ max_speed_to 10.00006: 15@ = 6 // integer values05D6: clear_scmpath0007: 11@ = 2844.8591 // floating-point values0007: 12@ = 1537.704 // floating-point values0007: 13@ = 10.7916 // floating-point values000A: 16@ += 0 // integer values0007: 17@ = 40.0 // floating-point values 0007: 18@ = 10.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@00AE: unknown_set_car 7@ to_ignore_traffic_lights 2jump @scmpath_sub_100:scmpath_sub_16if0039: 15@ == 6 // integer valuesjf @scmpath_sub_17if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 8.2 8.2 5.0jf @scmpath_sub_1700AD: set_car 7@ max_speed_to 0.00006: 15@ = 7 // integer values05D6: clear_scmpath0007: 11@ = 2867.3679 // floating-point values0007: 12@ = 1490.7612 // floating-point values0007: 13@ = 10.7581 // floating-point values000A: 16@ += 0 // integer values 0007: 17@ = 100.0 // floating-point values 0007: 18@ = 0.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@00AE: unknown_set_car 7@ to_ignore_traffic_lights 2jump @scmpath_sub_100:scmpath_sub_17if0039: 15@ == 7 // integer valuesjf @scmpath_sub_18if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1800AD: set_car 7@ max_speed_to 5.001EB: set_car_density_to 0.00006: 15@ = 8 // integer values05D6: clear_scmpath0007: 11@ = 2862.9255 // floating-point values0007: 12@ = 1298.3546 // floating-point values0007: 13@ = 10.5398 // floating-point values last checkpoint!!!!!000A: 16@ += 0 // integer values 0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_18if0039: 15@ == 8 // integer valuesjf @scmpath_sub_109if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 25.2 25.2 5.0jf @scmpath_sub_109 // aand heres the oponnent´s car winnin conditionif01AF: car 7@ 0 ()near_point 2866.5557 1279.0804 10.763 radius 8.2 8.2 5.0 jf @scmpath_sub_109 // if 7@ reached tha finish line, $lose becomes 10006: $lose = 1:chekloopwait 0if0039: $win == 1 //checkin if $PLAYER_ACTOR´s car already reached finish linejump @winner //so make me the winner //if false checks if oponents reached finishif0039: $lose == 1jump @loserace //if true, youre a loser ha-hA:winner00AD: set_car 7@ max_speed_to 0.00006: 15@ = 1 // integer values //winnin text00BC: text_highpriority 'BJ_WIN' 5000 ms 1jump @scmpath_12:loserace00AD: set_car 7@ max_speed_to 0.00006: 15@ = 1 // integer values //loser text00BC: text_highpriority 'BJ_LOSE' 5000 ms 1// end of conditionjump @scmpath_12000A: 16@ += 1 // integer values05D6: clear_scmpath0007: 11@ = -1181.78 // floating-point values0007: 12@ = -331.30 // floating-point values0007: 13@ = 13.76 // floating-point values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@if0039: 16@ == 2 // integer valuesjf @scmpath_sub_10000BC: text_highpriority 'BJ_LOSE' 5000 ms 1jump @scmpath_sub_100:scmpath_sub_99if0039: 19@ == 0 // integer valuesjf @scmpath_sub_10900AD: set_car 7@ max_speed_to 0.005CB: actor_goto_and_enter_car 9@ 7@ 50000006: 19@ = 1 // integer valuesjump @scmpath_sub_109:scmpath_sub_10007E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 303F0: text_draw_toggle 00006: 33@ = 0 // integer valuesjump @scmpath_sub_109:scmpath_sub_102if01F3: car 7@ airbornejf @scmpath_sub_1030007: 18@ = 0.0 // floating-point values04BA: set_car 7@ speed_instantly 18@07E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 3jump @scmpath_sub_103:scmpath_sub_103if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 30.2 30.2 5.0jf @scmpath_sub_104jump @scmpath_sub_105:scmpath_sub_10402E3: 20@ = car 7@ speedif81F3: NOT car 7@ airbornejf @scmpath_sub_106if and0021: 20@ > 30.0 // floating-point values0019: 33@ > 700 // integer valuesjf @scmpath_sub_10504BA: set_car 7@ speed_instantly 50.0:scmpath_sub_105if0019: 33@ > 2000 // integer valuesjf @scmpath_sub_109:scmpath_sub_1060006: 33@ = 0 // integer values:scmpath_sub_1090051: return let me remember u, i used ZAZ example script the F@kin prob is that when i press backspace to start tha race, the cars are placed as normal but it seems the winnin condition is broken, and the text You win is showed since the beginning of the race... it nevers check if the car´s at finish line... i dunno whers my code error haha... heres my code without the winnin checks, runs perfectly... {$CLEO .cs}:scmpath_103A4: name_thread 'SCMP':scmpath_30001: wait 0 msif0256: player $PLAYER_CHAR definedjf @scmpath_3077E: 0@ = active_interiorif and0038: 0@ == 0 // integer values0AB0: key_pressed 8//----------------------------------------Backspace jf @scmpath_3016A: fade 0 () 250 ms0001: wait 250 ms01B4: set_player $PLAYER_CHAR frozen_state 0 (frozen)0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5 -408.1 14.10173: set_actor $PLAYER_ACTOR z_angle_to 90.80001: wait 500 ms0247: request_model #INFERNUS0247: request_model #MAFFA:scmpath_50001: wait 0 msif and0248: model #INFERNUS available 0248: model #MAFFA availablejf @scmpath_500C0: set_current_time_hours_to 1 minutes_to 0 // i prefer raciin at nite jojo00A5: 1@ = create_car #INFERNUS at 2639.6252 2097.3906 10.6558 //put car racestart0175: set_car 1@ z_angle_to 191.00224: set_car 1@ health_to 200000A5: 7@ = create_car #INFERNUS at 2634.3599 2097.4692 10.6499 //put opponent racestart0175: set_car 7@ z_angle_to 191.00224: set_car 7@ health_to 2000020A: set_car 7@ door_status_to 402AC: set_car 7@ immunities 1 1 1 1 101EC: make_car 7@ very_heavy 10129: 9@ = create_actor 24 #MAFFA in_car 7@ driverseat0223: set_actor 9@ health_to 300004E4: unknown_refresh_game_renderer_at 2639.6252 2097.390603CB: set_camera 2639.6252 2097.3906 10.6558029B: 23@ = init_object 1655 at -1576.02 -202.34 13.760177: set_object 23@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 23@0382: set_object 23@ collision_detection 1029B: 24@ = init_object 1655 at -1597.9 -506.5 21.70177: set_object 24@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 24@0382: set_object 24@ collision_detection 1029B: 25@ = init_object 1655 at -1375.9 -581.5 13.690177: set_object 25@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 25@0382: set_object 25@ collision_detection 1029B: 26@ = init_object 1655 at -1374.9 -585.5 13.690177: set_object 26@ z_angle_to 270.001C7: remove_object_from_mission_cleanup_list 26@0382: set_object 26@ collision_detection 10177: set_object 23@ z_angle_to 135.00177: set_object 24@ z_angle_to 225.00177: set_object 25@ z_angle_to 280.00177: set_object 26@ z_angle_to 280.00186: 29@ = create_marker_above_car 7@07E0: set_marker 29@ type_to 10249: release_model #INFERNUS0249: release_model #MAFFACar.LockInCurrentPosition(7@) = TrueCar.LockInCurrentPosition(1@) = True04e0: car 7@ abandon_path_radius 20000AD: set_car 7@ max_speed_to 100.004BA: set_car 7@ speed_instantly 30.000AF: set_car 7@ driver_behaviour_to 100AE: unknown_set_car 7@ to_ignore_traffic_lights 20001: wait 250 ms036A: put_actor $PLAYER_ACTOR in_car 1@0001: wait 250 ms016A: fade 1 () 1000 ms0001: wait 1000 ms0373: set_camera_directly_behind_player02EB: restore_camera_with_jumpcut01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen)0006: 15@ = 0 // integer values0006: 16@ = 0 // integer values0006: 20@ = 20000 // floating-point values0006: 19@ = 0 // integer values 0007: 11@ = 2647.3511 // floating-point values0007: 12@ = 2069.1543 // floating-point values 2647.8835 2068.5312 9.70850007: 13@ = 10.1373 // floating-point values0006: $win = 00006: $lose = 0wait 3000 msCar.LockInCurrentPosition(1@) = FalseCar.LockInCurrentPosition(7@) = False00A7: car 7@ drive_to 11@ 12@ 13@00AD: set_car 7@ max_speed_to 100.004e0: car 7@ abandon_path_radius 25008C6: set_actor 9@ stay_on_bike 106D5: $check = create_racing_checkpoint_at 2866.5557 1279.0804 15.0 point_to 2866.5557 1279.0804 10.763 type 1 radius 15.0 //heres the checkpoint coords:scmpath_70001: wait 0 msif0256: player $PLAYER_CHAR definedjf @scmpath_70050: gosub @scmpath_sub_3if and8119: NOT car 1@ wrecked8119: NOT car 7@ wrecked8118: NOT actor 9@ deadjf @scmpath_7if00FE: actor $PLAYER_ACTOR 0 ()near_point 2639.6252 2097.3906 10.6558 radius 1000.5 1000.5 50.5jf @scmpath_12jump @scmpath_7:scmpath_120164: disable_marker 29@01C3: remove_references_to_car 1@ // Like turning a car into any random car01C3: remove_references_to_car 7@ // Like turning a car into any random car01C2: remove_references_to_actor 9@ // Like turning an actor into a random pedestrian0108: destroy_object 23@0108: destroy_object 24@0108: destroy_object 25@0108: destroy_object 26@jump @scmpath_3:scmpath_sub_3if8119: NOT car 7@ wreckedjf @scmpath_sub_109if00DB: actor 9@ in_car 7@jf @scmpath_sub_99if0039: 19@ == 1 // integer valuesjf @scmpath_sub_100006: 19@ = 0 // integer valuesjump @scmpath_sub_100:scmpath_sub_10if0039: 15@ == 0 // integer valuesjf @scmpath_sub_11if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 5.2 5.2 5.0jf @scmpath_sub_110006: 15@ = 1 // integer values05D6: clear_scmpath0007: 11@ = 2690.3149 // floating-point values0007: 12@ = 2003.0887 // floating-point values0007: 13@ = 6.6397 // floating-point values000A: 16@ += 0 // integer values 0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_11if0039: 15@ == 1 // integer valuesjf @scmpath_sub_12if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1200AD: set_car 7@ max_speed_to 10.00006: 15@ = 2 // integer values05D6: clear_scmpath0007: 11@ = 2705.8157 // floating-point values0007: 12@ = 1937.0188 // floating-point values 0007: 13@ = 6.6761 // floating-point values000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_12if0039: 15@ == 2 // integer valuesjf @scmpath_sub_13if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1300AD: set_car 7@ max_speed_to 25.00006: 15@ = 3 // integer values05D6: clear_scmpath0007: 11@ = 2726.5459 // floating-point values0007: 12@ = 1887.1978 // floating-point values 0007: 13@ = 6.6737 // floating-point values000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_13if0039: 15@ == 3 // integer valuesjf @scmpath_sub_14if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 8.2 8.2 5.0jf @scmpath_sub_1400AD: set_car 7@ max_speed_to 25.00006: 15@ = 4 // integer values05D6: clear_scmpath0007: 11@ = 2737.7283 // floating-point values0007: 12@ = 1763.1494 // floating-point values0007: 13@ = 6.8209 // floating-point values 000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_14if0039: 15@ == 4 // integer valuesjf @scmpath_sub_15if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 5.2 5.2 5.0jf @scmpath_sub_150006: 15@ = 5 // integer values05D6: clear_scmpath0007: 11@ = 2747.7874 // floating-point values0007: 12@ = 1691.6516 // floating-point values0007: 13@ = 8.8271 // floating-point values 000A: 16@ += 0 // integer values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_15if0039: 15@ == 5 // integer valuesjf @scmpath_sub_16if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1600AD: set_car 7@ max_speed_to 10.00006: 15@ = 6 // integer values05D6: clear_scmpath0007: 11@ = 2844.8591 // floating-point values0007: 12@ = 1537.704 // floating-point values0007: 13@ = 10.7916 // floating-point values000A: 16@ += 0 // integer values0007: 17@ = 40.0 // floating-point values 0007: 18@ = 10.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@00AE: unknown_set_car 7@ to_ignore_traffic_lights 2jump @scmpath_sub_100:scmpath_sub_16if0039: 15@ == 6 // integer valuesjf @scmpath_sub_17if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 8.2 8.2 5.0jf @scmpath_sub_1700AD: set_car 7@ max_speed_to 0.00006: 15@ = 7 // integer values05D6: clear_scmpath0007: 11@ = 2867.3679 // floating-point values0007: 12@ = 1490.7612 // floating-point values0007: 13@ = 10.7581 // floating-point values000A: 16@ += 0 // integer values 0007: 17@ = 100.0 // floating-point values 0007: 18@ = 0.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@00AE: unknown_set_car 7@ to_ignore_traffic_lights 2jump @scmpath_sub_100:scmpath_sub_17if0039: 15@ == 7 // integer valuesjf @scmpath_sub_18if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 15.2 15.2 5.0jf @scmpath_sub_1800AD: set_car 7@ max_speed_to 5.001EB: set_car_density_to 0.00006: 15@ = 8 // integer values05D6: clear_scmpath0007: 11@ = 2862.9255 // floating-point values0007: 12@ = 1298.3546 // floating-point values0007: 13@ = 10.5398 // floating-point values last checkpoint!!!!!000A: 16@ += 0 // integer values 0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@jump @scmpath_sub_100:scmpath_sub_18if0039: 15@ == 8 // integer valuesjf @scmpath_sub_109if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 25.2 25.2 5.0jf @scmpath_sub_10900AD: set_car 7@ max_speed_to 0.00006: 15@ = 1 // integer values //loser text00BC: text_highpriority 'BJ_LOSE' 5000 ms 1// end of conditionjump @scmpath_12000A: 16@ += 1 // integer values05D6: clear_scmpath0007: 11@ = -1181.78 // floating-point values0007: 12@ = -331.30 // floating-point values0007: 13@ = 13.76 // floating-point values0007: 17@ = 100.0 // floating-point values0007: 18@ = 20.0 // floating-point values05D7: add_point_to_scmpath 11@ 12@ 13@if0039: 16@ == 2 // integer valuesjf @scmpath_sub_10000BC: text_highpriority 'BJ_LOSE' 5000 ms 1jump @scmpath_sub_100:scmpath_sub_99if0039: 19@ == 0 // integer valuesjf @scmpath_sub_10900AD: set_car 7@ max_speed_to 0.005CB: actor_goto_and_enter_car 9@ 7@ 50000006: 19@ = 1 // integer valuesjump @scmpath_sub_109:scmpath_sub_10007E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 303F0: text_draw_toggle 00006: 33@ = 0 // integer valuesjump @scmpath_sub_109:scmpath_sub_102if01F3: car 7@ airbornejf @scmpath_sub_1030007: 18@ = 0.0 // floating-point values04BA: set_car 7@ speed_instantly 18@07E7: AS_assign_scmpath_to_actor 9@ in_car 7@ speed 17@ flags 2 0 3jump @scmpath_sub_103:scmpath_sub_103if01AF: car 7@ 0 ()near_point 11@ 12@ 13@ radius 30.2 30.2 5.0jf @scmpath_sub_104jump @scmpath_sub_105:scmpath_sub_10402E3: 20@ = car 7@ speedif81F3: NOT car 7@ airbornejf @scmpath_sub_106if and0021: 20@ > 30.0 // floating-point values0019: 33@ > 700 // integer valuesjf @scmpath_sub_10504BA: set_car 7@ speed_instantly 50.0:scmpath_sub_105if0019: 33@ > 2000 // integer valuesjf @scmpath_sub_109:scmpath_sub_1060006: 33@ = 0 // integer values:scmpath_sub_1090051: return please help !! last question, i dont understand last script part, that airborne checks, i dunno whats an airborn jajaja.... i hope mi post is readeable... kus im from mexiko, i speak spanish.. asi que si igual hay algun hispano que me ayude, estaria genial jeje... chidoo pzz.. PD: heey ZAZ your tutorials are greaat.. helped me a lot.... peace out Edited October 28, 2009 by larvaz Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059591454 Share on other sites More sharing options...
ZAZ Posted October 29, 2009 Author Share Posted October 29, 2009 (edited) but ive troubles with my code... everythings fine when makin the cars, the "oponent" perfectly follows my desired path... then i decide to make a winnin condition, cheking if any of the cars reached the final race chekpoint, near the train station.. heres the whole code the F@kin prob is that when i press backspace to start tha race, the cars are placed as normal but it seems the winnin condition is broken, and the text You win is showed since the beginning of the race... it nevers check if the car´s at finish line... welcome larvaz the reason of your problem is that the location check is a not-version this means: if player_actor is not near_point 2639.6252 2097.3906 10.6558because of the opcodesif80EC: actor $PLAYER_ACTOR 0 near_point 2866.5557 1279.0804 10.763 radius 8.0 8.0 //check if youve reach tha finish linejf @scmpath_7 The most question codes can be changed into the opposite question by changing the ciro of the opcode into 8 and insert "not" into the code line exemble: 00E1: key_pressed 0 10 and 80E1: NOT key_pressed 0 11 the correct check: if00EC: actor $PLAYER_ACTOR 0 near_point 2866.5557 1279.0804 10.763 radius 8.0 8.0 //jf @scmpath_7 last question, i dont understand last script part, that airborne checks, i dunno whats an airborn jajaja.... airborn means, the vehicle is in air for example the vehicle jumps over a ramp and is for same seconds in air in this case it loose the information of the destination and needs to get it again Edited October 29, 2009 by ZAZ Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059595135 Share on other sites More sharing options...
Jur1zz Posted October 31, 2009 Share Posted October 31, 2009 Hi How can I attach vehicle sound for added "not replaced" cars, with CLEO not "VehicleAudioEditorUltimate" Example Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059601130 Share on other sites More sharing options...
ZAZ Posted October 31, 2009 Author Share Posted October 31, 2009 (edited) Hi How can I attach vehicle sound for added "not replaced" cars, with CLEO not "VehicleAudioEditorUltimate" Example there're no scriptcodes to play egine sounds and the cleo script function to play mp3 is unstable maybe a trick can help: place a car in background test the script below by driving a bicycle {$CLEO .cs}:CarsoundDummy03A4: name_thread 'CSDUMMY':CarsoundDummy_10001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @CarsoundDummy_1if00DF: actor $PLAYER_ACTOR driving004D: jump_if_false @CarsoundDummy_103C0: 0@ = actor $PLAYER_ACTOR car0247: request_model #INFERNUS:CarsoundDummy_30001: wait 0 msif0248: model #INFERNUS available004D: jump_if_false @CarsoundDummy_300A5: 1@ = create_car #INFERNUS at 0.5 0.5 713.350249: release_model #INFERNUS099A: set_car 1@ collision_detection 00338: set_car 1@ visibility 00683: attach_car 1@ to_car 0@ with_offset 0.0 0.0 4.5 rotation 0.0 0.0 0.0:CarsoundDummy_50001: wait 500 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @CarsoundDummy_15if and8119: NOT car 0@ wrecked8119: NOT car 1@ wrecked00DF: actor $PLAYER_ACTOR driving004D: jump_if_false @CarsoundDummy_15if0686: car 1@ attached004D: jump_if_false @CarsoundDummy_1504C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0 100.0 0.002E3: 5@ = car 0@ speed00A7: car 1@ drive_to 11@ 12@ 13@//---simple drive-to command00AD: set_car 1@ max_speed_to 5@//---speed declaration, important!!0002: jump @CarsoundDummy_5:CarsoundDummy_1501C3: remove_references_to_car 0@ // Like turning a car into any random car00A6: destroy_car 1@0002: jump @CarsoundDummy_1 Edited October 31, 2009 by ZAZ Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059601205 Share on other sites More sharing options...
Jur1zz Posted October 31, 2009 Share Posted October 31, 2009 Hi How can I attach vehicle sound for added "not replaced" cars, with CLEO not "VehicleAudioEditorUltimate" Example there're no scriptcodes to play egine sounds and the cleo script function to play mp3 is unstable maybe a trick can help: place a car with actor in background Look at this MOTO IGiNe v0.2 Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059601216 Share on other sites More sharing options...
ZAZ Posted November 1, 2009 Author Share Posted November 1, 2009 Hi How can I attach vehicle sound for added "not replaced" cars, with CLEO not "VehicleAudioEditorUltimate" Example there're no scriptcodes to play egine sounds and the cleo script function to play mp3 is unstable maybe a trick can help: place a car with actor in background Look at this MOTO IGiNe v0.2 Yes, I did, but I don't know what you want. Note: This is a script tutorial and not a request topic so please don't post again here If you want that I do the script then visit my Homepage, vistit every site and click on every avertising, then post in my cleo mod showroom topic to request the script. Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059602408 Share on other sites More sharing options...
markjaysongalang Posted November 1, 2009 Share Posted November 1, 2009 Yey! Thanks for this tutorial. I'm making my Fast and Slowmotion Mod! I'll post updates soon. Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059602520 Share on other sites More sharing options...
Jur1zz Posted November 1, 2009 Share Posted November 1, 2009 Hi How can I attach vehicle sound for added "not replaced" cars, with CLEO not "VehicleAudioEditorUltimate" Example there're no scriptcodes to play egine sounds and the cleo script function to play mp3 is unstable maybe a trick can help: place a car with actor in background Look at this MOTO IGiNe v0.2 Yes, I did, but I don't know what you want. Note: This is a script tutorial and not a request topic so please don't post again here If you want that I do the script then visit my Homepage, vistit every site and click on every avertising, then post in my cleo mod showroom topic to request the script. I just want know how they get sounds for bikes Link to comment https://gtaforums.com/topic/403594-sa-~-cleo-script-tutorial-~/page/2/#findComment-1059602577 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