aStiffSausage Posted May 21, 2011 Share Posted May 21, 2011 (edited) So, it's me again, this time with a bit buggy speedlimit... It's supposed to add 1 star wanted level at speed over 100km/h, 2 stars at 160km/h, and 3 stars when going over 200km/h. I've been trying to set it give wanted level when there's police nearby, but when I used the part from Real Cops-mod by ToonSkull, I'm sometimes getting wanted level even if I'm not speeding, and sometimes when there's normal ped around. Someone check this code? // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'LIMIT' 0004: $DRIVEBYMODE = 0 01F5: $PLAYER_ACTOR = get_player_actor $PLAYER_CHAR :LIMIT_260001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @LIMIT_26 00D6: if and00DF: actor $PLAYER_ACTOR driving 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 856C: not actor $PLAYER_ACTOR driving_police_car 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 004D: jump_if_false @LIMIT_26 03C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speed 00D6: if 0021: [email protected] > 29.765 004D: jump_if_false @LIMIT_26 0002: jump @LIMIT_141 :LIMIT_14100D6: if and00DF: actor $PLAYER_ACTOR driving 856C: not actor $PLAYER_ACTOR driving_police_car 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 810F: not player $PLAYER_CHAR wanted_level > 1 004D: jump_if_false @LIMIT_141 0001: wait 0 ms 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 10.0 handle_as [email protected]: get_actor [email protected] pedtype_to [email protected] else_jump @LIMIT_14100D6: if and0021: [email protected] > 29.765056D: actor [email protected] defined 0039: [email protected] == 6 else_jump @LIMIT_141 jump @LIMIT_151:LIMIT_151wait 0 ms010E: set_player $PLAYER_CHAR minimum_wanted_level_to 1 0002: jump @LIMIT_241 :LIMIT_2410001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @LIMIT_241 00D6: if and00DF: actor $PLAYER_ACTOR driving 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 856C: not actor $PLAYER_ACTOR driving_police_car 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 004D: jump_if_false @LIMIT_24103C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speed 00D6: if 0021: [email protected] > 47.6245 004D: jump_if_false @LIMIT_26 0002: jump @LIMIT_248 :LIMIT_24800D6: if and00DF: actor $PLAYER_ACTOR driving 856C: not actor $PLAYER_ACTOR driving_police_car 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 810F: not player $PLAYER_CHAR wanted_level > 2004D: jump_if_false @LIMIT_248 0001: wait 0 ms 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 10.0 handle_as [email protected]: get_actor [email protected] pedtype_to [email protected] 00D6: if and0021: [email protected] > 29.765056D: actor [email protected] defined0039: [email protected] == 6 else_jump @LIMIT_248jump @LIMIT_251:LIMIT_251010E: set_player $PLAYER_CHAR minimum_wanted_level_to 2 0002: jump @LIMIT_326:LIMIT_3260001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @LIMIT_326 00D6: if and00DF: actor $PLAYER_ACTOR driving 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 856C: not actor $PLAYER_ACTOR driving_police_car 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 004D: jump_if_false @LIMIT_326 03C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speed 00D6: if 0021: [email protected] > 59.53004D: jump_if_false @LIMIT_26 0002: jump @LIMIT_3141 :LIMIT_314100D6: if and00DF: actor $PLAYER_ACTOR driving 856C: not actor $PLAYER_ACTOR driving_police_car 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 810F: not player $PLAYER_CHAR wanted_level > 3 004D: jump_if_false @LIMIT_3141 0001: wait 0 ms 0001: wait 0 ms 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 10.0 handle_as [email protected]: get_actor [email protected] pedtype_to [email protected] 00D6: if and0021: [email protected] > 29.765056D: actor [email protected] defined0039: [email protected] == 6 else_jump @LIMIT_3141jump @LIMIT_3151:LIMIT_3151010E: set_player $PLAYER_CHAR minimum_wanted_level_to 3 0002: jump @LIMIT_26 EDIT: New script, now crashes at over 100km/h Edited May 21, 2011 by oksa8 Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 21, 2011 Author Share Posted May 21, 2011 So, so far no one has helped me... But I've been trying to get one other script to work, it's supposed to be like this: When you press PageUp, it will show a text-box with some text in it, and set max-speed of current vehicle to 20km/h, and every press of PageUp increases max-speed and pressing PageDown decreases max-speed by 20km/h, and if max-speed is 0km/h, then it's set to huge value. (Maybe around 400km/h). I got it somehow to work now, it doesn't freeze the game anymore, but it neither works... Someone check it? {$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'TOPSPD'01F5: $PLAYER_ACTOR = get_player_actor $PLAYER_CHAR wait 10000 ms :TOPSPD_10wait 0 msif0256: player $PLAYER_CHAR definedelse_jump @TOPSPD_10if and00DF: actor $PLAYER_ACTOR driving84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_trainelse_jump @TOPSPD_10jump @TOPSPD_20:TOPSPD_20if0AB0: key_pressed 0x33 //PageUpelse_jump @TOPSPD_10jump @TOPSPD_30:TOPSPD_3003C0: [email protected] = actor $PLAYER_ACTOR car00AD: set_car [email protected] max_speed_to [email protected]@ = 5.593 if0AB0: key_pressed 0x33 //[email protected] += 5.593end:TOPSPD_40if0AB0: key_pressed 0x34 //[email protected] -= 5.593end:[email protected] == 0 then00AD: set_car [email protected] max_speed_to 100.0 end Link to comment Share on other sites More sharing options...
ZAZ Posted May 22, 2011 Share Posted May 22, 2011 The player controle have higher priority to the player_car then opcode 00AD: It's possible to force it, if the car gets a drive_to command cruising can be done in this way 03C0: [email protected] = actor $PLAYER_ACTOR car02E3: [email protected] = car [email protected] speed:cruise_5wait 004BA: set_car [email protected] speed_instantly [email protected] @cruise_5 your script of first post is a bit confused, i don't know where i should beginn i recomand to work step by step, make first a simple script to find a cop and give him a marker get_actor_in_sphere must not find your desired ped, what happens if a normal ped stands close to CJ but the cop some meters behind? this code will find again the same ped CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 22, 2011 Author Share Posted May 22, 2011 Oh wow... Can't even create that marker on cop without crashing... // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'MARKER' wait 0 ms:MARKER_1wait 1000 msif 0256: player $PLAYER_CHAR defined else_jump @MARKER_1jump @MARKER_2:MARKER_2wait 1000 msif00F2: actor [email protected] near_actor $PLAYER_ACTOR radius 20.0 20.0 5.0056D: actor [email protected] definedelse_jump @MARKER_1jump @MARKER_3:MARKER_3wait 1000 msif or 02F2: actor [email protected] model == #LAPD1 02F2: actor [email protected] model == #SFPD1 02F2: actor [email protected] model == #LVPD102F2: actor [email protected] model == #LAPDM102F2: actor [email protected] model == #CSHERelse_jump @MARKER_1jump @MARKER_4:MARKER_4wait 1000 ms0187: [email protected] = create_marker_above_actor [email protected] @MARKER_1 I'll be trying cruising-code soon. Link to comment Share on other sites More sharing options...
Node Posted May 22, 2011 Share Posted May 22, 2011 Oh wow... Can't even create that marker on cop without crashing... // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'MARKER' wait 0 ms:MARKER_1wait 1000 msif 0256: player $PLAYER_CHAR defined else_jump @MARKER_1jump @MARKER_2:MARKER_2wait 1000 msif00F2: actor [email protected] near_actor $PLAYER_ACTOR radius 20.0 20.0 5.0056D: actor [email protected] definedelse_jump @MARKER_1jump @MARKER_3:MARKER_3wait 1000 msif or 02F2: actor [email protected] model == #LAPD1 02F2: actor [email protected] model == #SFPD1 02F2: actor [email protected] model == #LVPD102F2: actor [email protected] model == #LAPDM102F2: actor [email protected] model == #CSHERelse_jump @MARKER_1jump @MARKER_4:MARKER_4wait 1000 ms0187: [email protected] = create_marker_above_actor [email protected] @MARKER_1 I'll be trying cruising-code soon. Erm as far as i can see you havent checked for a ped? Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 22, 2011 Author Share Posted May 22, 2011 Oh wow... Can't even create that marker on cop without crashing... ... I'll be trying cruising-code soon. Erm as far as i can see you havent checked for a ped? K, how I do it? Link to comment Share on other sites More sharing options...
ZAZ Posted May 22, 2011 Share Posted May 22, 2011 Oh wow... Can't even create that marker on cop without crashing... ... I'll be trying cruising-code soon. Erm as far as i can see you havent checked for a ped? K, how I do it? the script of your first post contains the codes 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.008E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 10.0 handle_as [email protected]: if056D: actor [email protected] definedelse_jump @LIMIT_141 read more CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 27, 2011 Author Share Posted May 27, 2011 I thought I understood how the "kill-ped-nearby-and-show-pedtype-number"-script works, but nope. Crashes if speeding near cop. {$CLEO .cs}:RandomActor_for_to_step_methodthread 'RAFSTEP':RAFSTEP_10001: wait 0 ms00D6: if0256: player $PLAYER_CHAR defined004D: jump_if_false @RAFSTEP_100A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]: call_scm_func @RAFSTEP_func 4 [email protected] [email protected] [email protected] 5.0 [email protected]: if8039: not [email protected] == -1004D: jump_if_false @RAFSTEP_100D6: if8118: not actor [email protected] dead004D: jump_if_false @RAFSTEP_1089F: get_actor [email protected] pedtype_to [email protected]: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrianif0039: [email protected] == 6thenjump @LIMIT_26end0002: jump @RAFSTEP_1:RAFSTEP_func0006: [email protected] = 00006: [email protected] = 0:RAFSTEP_countLoop00D6: if056D: actor [email protected] defined004D: jump_if_false @RAFSTEP_1100D6: if and803B: not $PLAYER_ACTOR == [email protected] // (int)00FE: actor [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius [email protected] [email protected] [email protected]: jump_if_false @RAFSTEP_110006: [email protected] = 10002: jump @RAFSTEP_12:RAFSTEP_11000A: [email protected] += 100D6: if0019: [email protected] > 30000004D: jump_if_false @RAFSTEP_countLoop:RAFSTEP_1200D6: if0039: [email protected] == 0004D: jump_if_false @RAFSTEP_Result0006: [email protected] = -1:RAFSTEP_Result0AB2: ret 1 [email protected]:LIMIT_260001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @LIMIT_26 00D6: if and00DF: actor $PLAYER_ACTOR driving 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 856C: not actor $PLAYER_ACTOR driving_police_car 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 004D: jump_if_false @LIMIT_26 03C0: [email protected] = actor $PLAYER_ACTOR car 02E3: [email protected] = car [email protected] speed 00D6: if 0021: [email protected] > 29.765 004D: jump_if_false @LIMIT_26 0002: jump @LIMIT_141 :LIMIT_14100D6: if and00DF: actor $PLAYER_ACTOR driving 856C: not actor $PLAYER_ACTOR driving_police_car 84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli 84AB: not actor $PLAYER_ACTOR driving_plane 84C8: not actor $PLAYER_ACTOR driving_flying_vehicle 89AE: not actor $PLAYER_ACTOR driving_train 856C: not actor $PLAYER_ACTOR driving_police_car 810F: not player $PLAYER_CHAR wanted_level > 1 004D: jump_if_false @LIMIT_141 0001: wait 0 ms 00D6: if and0039: [email protected] == 60021: [email protected] > 29.765 else_jump @LIMIT_26 jump @LIMIT_151:LIMIT_151010E: set_player $PLAYER_ACTOR minimum_wanted_level_to 6jump @RAFSTEP_1 Link to comment Share on other sites More sharing options...
ZAZ Posted May 27, 2011 Share Posted May 27, 2011 I thought I understood how the "kill-ped-nearby-and-show-pedtype-number"-script works, but nope. Crashes if speeding near cop. you made a loop without wait :LIMIT_14100D6: if and00DF: actor $PLAYER_ACTOR driving856C: not actor $PLAYER_ACTOR driving_police_car84A7: not actor $PLAYER_ACTOR driving_boat84A9: not actor $PLAYER_ACTOR driving_heli84AB: not actor $PLAYER_ACTOR driving_plane84C8: not actor $PLAYER_ACTOR driving_flying_vehicle89AE: not actor $PLAYER_ACTOR driving_train856C: not actor $PLAYER_ACTOR driving_police_car810F: not player $PLAYER_CHAR wanted_level > 1004D: jump_if_false @LIMIT_141 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 27, 2011 Author Share Posted May 27, 2011 Added loop and tried some other possible stuff, changing jumps to other ones, a bit everything... Request thread, here I come. 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