12jango Posted August 28, 2010 Share Posted August 28, 2010 Hey, guys as long as I know any of these opcodes could get actors at several points : 089E: get_actor_in_sphere [email protected] [email protected] [email protected] radius 5.0 handle_as [email protected] // versionB 08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 50.0 handle_as [email protected] 073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected] But they are not satisfying yet! 'Cause you know they couldn't get gang type, drug dealer, and any other actors (especially custom actors in missions!) But, I found out that this one : 0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected] Could get any actors! Absolutely can! This one's good! But, it only get the nearest actor, otherwise you can't! T_T And also if these opcodes used in a place without any single human, it will gone crash! So my questions are : 1. Do you know how to make get_actor work better (can be use to get any actors, in the coordinates that we type) 2. Please tell me how to solve the crash problem like I wrote above! Please show me the example script, I would be glad for that. Thanks very much! Link to comment Share on other sites More sharing options...
Adler Posted August 28, 2010 Share Posted August 28, 2010 GTAG - All Possible Actors. Add a radius check in the loop if you want to check if the actor is near the player. Link to comment Share on other sites More sharing options...
12jango Posted September 5, 2010 Author Share Posted September 5, 2010 Still ain't get it, fellas... Anyone have another suggestions? Link to comment Share on other sites More sharing options...
TheSiggi Posted September 5, 2010 Share Posted September 5, 2010 use 056D: to check whether the script cought any ped: :GETACTOR0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected]:CHECKwait 0if056d: [email protected] @GETACTOR... Link to comment Share on other sites More sharing options...
ZAZ Posted September 5, 2010 Share Posted September 5, 2010 (edited) GTAG - All Possible Actors. Add a radius check in the loop if you want to check if the actor is near the player. Dejis template isn't suitable to use it in praxis It needs to add a while true loop and an if player defined check {$CLEO .cs}:RandomActor_for_to_step_methodthread 'RAFSTEP'while truewait 0if0256: player $PLAYER_CHAR defined thenfor [email protected] = 0 to 35584 step 256 0085: [email protected] = [email protected] for [email protected] = 0 to 127 if and 056D: actor [email protected] defined // if we've got an actor 803C: not $PLAYER_ACTOR == [email protected] // make sure we've not got the player. then 0321: kill_actor [email protected] break end 000A: [email protected] += 1 endendendend the recompiled script with opcodes {$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'RAFSTEP' :RAFSTEP_110001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @RAFSTEP_142 0006: [email protected] = 0 :RAFSTEP_380085: [email protected] = [email protected] // (int) 0006: [email protected] = 0 :RAFSTEP_5300D6: if and056D: actor [email protected] defined 803C: not $PLAYER_ACTOR == [email protected] // (int) 004D: jump_if_false @RAFSTEP_89 0321: kill_actor [email protected] 0002: jump @RAFSTEP_117 :RAFSTEP_89000A: [email protected] += 1 000A: [email protected] += 1 0019: [email protected] > 127 004D: jump_if_false @RAFSTEP_53 :RAFSTEP_117000A: [email protected] += 256 0019: [email protected] > 35584 004D: jump_if_false @RAFSTEP_38 :RAFSTEP_1420002: jump @RAFSTEP_11 Edited September 5, 2010 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
12jango Posted September 8, 2010 Author Share Posted September 8, 2010 Question, ZAZ! It appears that it get an actor so randomly near the player, so I tried to store coordinates so that it only kill the enemy at the marked coordinates...But it crashed! Link to comment Share on other sites More sharing options...
Deji Posted September 8, 2010 Share Posted September 8, 2010 I'm not sure what you mean... You want to only get actors within a certain area? You can use any conditional statements and checks after the defined check, before killing the actor. for [email protected] = 0 to 35584 step 256 0085: [email protected] = [email protected] for [email protected] = 0 to 127 if and 056D: actor [email protected] defined // if we've got an actor 803C: not $PLAYER_ACTOR == [email protected] // make sure we've not got the player. then if 00EC: actor [email protected] 0 near_point 0.0 0.0 radius 10.0 10.0 // coordinates the actor must be near then 0321: kill_actor [email protected] break end end 000A: [email protected] += 1 endend 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