Jump to content

[SA] ~ CLEO Script Tutorial ~


Recommended Posts

  • 2 months later...
thanks for the tut, Zaz cookie.gifcookie.gif I have a question, is it possible to make a script which changes my criminal rating by pressing a certain button? Like,, click key 0 to get "king of san andreas" criminal rating tounge.giftounge.gif

search with opcode search tool for integer_stat

look also in Sanny Builder Help: GTA SA Statistics ID

 

integer_stat 152 = Criminals killed on Vigilante Mission

  • 3 weeks later...
  • 1 month later...

 

Great tutorial.

 

Looking at other Cleo scripts I sometimes run across a code like  "00E1:  player 0 pressed_key 4" . Key 4 is not in the Virtual key codes in the help file.

opcode 00E1: is R*originally opcode for key_press and can be changed in options>controle config

they are definded as controle functions, find it in Sanny Builder Help: SCM Documentation: GTA SA:Keypress numbers

 

Virtual keycodes can only be used with cleo opcode 0AB0:

 

0AB0:    key_pressed 8

 

look for cleo opcodes in Sanny Builder Help: CLEO 3 Code Library: CLEO 3: opcodes

Thanks ZAZ, didn't realize the opcodes were different. Paying more attention to the to the rest of the code. Right now just trying the basics like switching key_pressed so they don't use the same keys as other Cleo scripts.

  • 1 month later...
kal-el5676
Ups, visitors. Thx friends.

 

uhm how to make savepoints? cause I dont think I seen one from the tut. but if there is can you tell me wich bit is it.sorry for being a noob. smile.gif  smile.gif

Right, I forgot it.

Here it is:

The classic savescript with savedisk_pickup needs to insert 3 coords points.

One for the savedisk_pickup

One for the spawnpoint beside the pickup

One for the radar marker(If the savedisk is in an interior the location of the radar marker can be very different to pickup)

 

The savepoint of the script below is in the Atrium of Los Santos/Commerce

 

{$CLEO .cs}:SAVE_103A4: name_thread 'SAVE'0A95: enable_thread_saving0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.2682 -1647.6366 42.4687018B: show_on_radar 1@ 2:SAVE_20001: wait 0 ms0213: 2@ = create_pickup 1277 type 3 at 1720.7397 -1645.6292 20.2267:SAVE_50001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @SAVE_500D6: if 00214: pickup 2@ picked_up004D: jump_if_false @SAVE_50050: gosub @SAVE_140002: jump @SAVE_2 :SAVE_1400D6: if  00038:   $ONMISSION ==  0  // integer values004D: jump_if_false @SAVE_170004: $ONMISSION =  1  // integer values01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)0001: wait  350 ms03D8: show_SAVE_screen:SAVE_1500D6: if  083D9:   NOT   save_done004D: jump_if_false @SAVE_160001: wait  0 ms0002: jump @SAVE_15:SAVE_1600A1: put_actor $PLAYER_ACTOR at 1724.3228 -1646.5193 20.22720173: set_actor $PLAYER_ACTOR z_angle_to 176.801B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)0004: $ONMISSION =  1  // integer values0001: wait  350 ms0004: $ONMISSION =  0  // integer values:SAVE_170051: return

 

 

So much $ONMISSION = 0 and $ONMISSION = 1

Yes its nesssary. Otherwise the colored gangwar teritories will not be shown if a save was done while gangwar is activ.

 

And again the same script but in the kind of "decompilation without opcodes ":

 

{$CLEO .cs}:SAVE_1thread 'SAVE' 0A95: enable_thread_saving 0570: 1@ = create_asset_radar_marker_with_icon 35 at 1722.268 -1647.637 42.4687 018B: set_marker 1@ radar_mode 2 :SAVE_42wait 0 2@ = Pickup.Create(1277, 3, 1720.74, -1645.629, 20.2267):SAVE_71wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @SAVE_71 if   Pickup.Picked_up(2@)else_jump @SAVE_71 gosub @SAVE_121 jump @SAVE_42 :SAVE_121if  $ONMISSION == 0 else_jump @SAVE_240 $ONMISSION = 1 Player.CanMove($PLAYER_CHAR) = Falsewait 350 03D8: show_save_screen :SAVE_160if 83D9:   not save_done else_jump @SAVE_184 wait 0 jump @SAVE_160 :SAVE_184Actor.PutAt($PLAYER_ACTOR, 1724.323, -1646.519, 20.2272)Actor.Angle($PLAYER_ACTOR) = 176.8Player.CanMove($PLAYER_CHAR) = True$ONMISSION = 1 wait 350 $ONMISSION = 0 :SAVE_240return 

 

This doesn't seem to work for me. i try to compile and it says not enough parameters, expected 5.

 

Yeah, i'm real nooby when it comes to coding. All i had to do was take the coma's out of the coordinates.  sigh.gif

 

Anyone know a good tutorial for armour and health pickups?

You made a failure by copy and paste

 

take the coma's out?

 

which commas do you mean?

  • 4 weeks later...

 

Hey nice but my need to enter to yhe enterior the point but i can't find the id for yellow arrow for interior can help me?

You mean the entrance_marker

 

0A40: 1@ = create_entrance_marker_at 2493.9 -1670.8 14.5 color 6to remove the entrance_marker:0A41: destroy_entrance_marker 1@

 

 

But the yellow markers which we have in San Andreas to enter the interiors are not done with scm scripting

because they are hardcoded in connection with ENEX - IPL -entries

For example you will find in data\maps\LA\LAw.ipl following enex to enter the barber shop

 

enex823.629, -1588.9, 12.5764, 0, 2, 2, 8, 822.629, -1590.4, 12.5784, -1297.58, 0, 4, "BARBER2", 0, 2, 0, 24

 

More informations at: [sA|DOC] IPL Definitions

To modify or add enex entries requires to start a new game otherwise you will get buggy interior accesses

Or use the GTASA SaveGame ENEX Updater tool

 

 

Nevertheless is it possible to make an interior teleport and create therefor an entrance_marker

like in script below

Go to Grovestreet to find the entrance_marker with teleport

 

{$CLEO .cs}:Entrance_marker_103A4: name_thread 'ENTRMK'0A95: enable_thread_saving 0A40: 1@ = create_entrance_marker_at 2493.9 -1670.8 14.5 color 60A40: 2@ = create_entrance_marker_at 2527.6 -1679.5 1016.5 color 6:Entrance_marker_30001: wait 0 ms if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @Entrance_marker_3if00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2493.9 -1670.8 13.4 radius  2.0  2.0  2.0 004D: jump_if_false @Entrance_marker_5016A: fade 0 time 1000 0001: wait 1000 ms 04E4: unknown_refresh_game_renderer_at  2535.8301 -1674.675303CB: set_camera  2535.8301 -1674.6753 1015.498600A1: put_actor $PLAYER_ACTOR at 2535.8301 -1674.6753 1015.4986 0860: link_actor $PLAYER_ACTOR to_interior 1 04BB: select_interior 10001: wait 500 ms 016A: fade 1 time 10000002: jump @Entrance_marker_3:Entrance_marker_5if00FF:   actor $PLAYER_ACTOR  0 (in-sphere)near_point_on_foot 2527.6 -1679.5 1015.5 radius  2.0  2.0  2.0 004D: jump_if_false @Entrance_marker_3016A: fade 0 time 1000 0001: wait 1000 ms 04E4: unknown_refresh_game_renderer_at  2494.5 -1679.203CB: set_camera  2494.5 -1679.2 13.400A1: put_actor $PLAYER_ACTOR at 2494.5 -1679.2 13.4 0860: link_actor $PLAYER_ACTOR to_interior 0 04BB: select_interior 00001: wait 500 ms 016A: fade 1 time 10000002: jump @Entrance_marker_3

 

Edited by ZAZ
  • 1 month later...

Zaz, is there any way to select what sign loads on the side of a vehicle? for example the rumpo spawns with random business signs on it or none at all. I changed one of the panels for a cleo I am trying to make and if possible load that graphic every time it spawns. Tried looking at opcode search under rumpo and sign but no luck.

 

Zaz, is there any way to select what sign loads on the side of a vehicle? for example the rumpo spawns with random business signs on it or none at all. I changed one of the panels for a cleo I am trying to make and if possible load that graphic every time it spawns. Tried looking at opcode search under rumpo and sign but no luck.

No, not in that kind.

There exist an opcode to choose a model varaition

 

0506: set_car_model #PICADOR next_variation 4 4 // first param is useless

 

you know, the truck trailers are coming in different variations

 

 

and in addition every car can have a paintjop if it is made from the modelauthor

 

06ED: set_car 1@ paintjob 0

 

Example:

make the texturing for the Infernus to allow additional textures as paintjop

the basic files would be:

infernus.dff

infernus.txd

the paintjop textures would be:

infernus1.txd = paintjob 0

infernus2.txd = paintjob 1

infernus3.txd = paintjob 2

infernus4.txd = paintjob 3

and so on

 

 

 

another way would be to attach a graffiti object

but it's not recomanded because it requires that the user have exactly that car model which must fit the positioning for the object

furthermore is the positioning an annoying work

script below spawns an BOXVILLE in SF north/west - Esplanade East - and attach the tag_azteca

 

{$CLEO .cs}//1531, tag_azteca, tags_LAazteca, 50, 1048580thread 'GRFV' :GRFV_11wait 0 if   Player.Defined($PLAYER_CHAR)jf @GRFV_11 if 00FF:   actor $PLAYER_ACTOR sphere 1 in_sphere -1558.284 1184.458 7.1875 radius 1.0 1.0 1.0 on_foot jf @GRFV_11 Model.Load(#BOXVILLE)Model.Load(1531):GRFV_89wait 0 if and  Model.Available(#BOXVILLE)  Model.Available(1531)jf @GRFV_89 0@ = Car.Create(#BOXVILLE, -1557.747, 1168.721, 7.1875)Car.Angle(0@) = 90.01@ = Object.Create(1531, -1557.747, 1168.721, 7.1875)Object.RemoveFromMissionCleanupList(1@)0681: attach_object 1@ to_car 0@ with_offset 1.3 0.0 0.8 rotation 180.0 180.0 0.0 Model.Destroy(#BOXVILLE)Model.Destroy(1531):GRFV_223wait 0 if   Player.Defined($PLAYER_CHAR)jf @GRFV_223 if 80FF:   not actor $PLAYER_ACTOR sphere 0 in_sphere -1558.284 1184.458 7.1875 radius 2.0 2.0 2.0 on_foot jf @GRFV_223 Car.RemoveReferences(0@)jump @GRFV_11

 

 

 

 

Edited by ZAZ

Thanks Zaz, you've been an enormous help with this CLEO Script Tutorial.

 

opcode 0506 looks interesting. The comment is kinda throwing me off though,

 

// first param is useless

Is that referring to the the first 4, and if so do I just leave it alone or if I wanted to change it would it be something like this:

 

0506: set_car_model #PICADOR next_variation 3 3 // first param is useless

 

 

opcode 06ED answered another question I had. Thanks.

 

The boxville script is a great idea, only problem is if you walk into the marker 2 or more times before driving off in it the tag floats in the air. mercie_blink.gif Is there a way to correct it?

 

In theory if I changed something like the bobo sign and put my texture on it, used its load # it should work right?

 

Unrelated question

Using your tutorials and other peoples Cleos as examples I was able to have Pulaski and Tenpeni randomly driving around SA in a copcarla and armed them with a colt and shotgun. The problem is they don't act like cops. I get a 1 star wanted level if I try to open the door but they get out and just stand there. Other cops in the area beat the crap out of me but they just watch.I tried using this code:

 

$COP2 = Actor.Create(COP, #SPECIAL02, 1@, 2@, 3@)

 

and this:

 

07DD: set_actor $COP2 temper_to 100 // see pedstats.dat

 

with no luck. But they definitely hate criminals though! lol.gif

 

 

 

opcode 0506 looks interesting. The comment is kinda throwing me off though,

 

// first param is useless

Is that referring to the the first 4, and if so do I just leave it alone or if I wanted to change it would it be something like this:

 

0506: set_car_model #PICADOR next_variation 3 3 // first param is useless

 

 

 

the comment say, it doesn't matter which value the first param have, just work with the last param

 

 

The boxville script is a great idea, only problem is if you walk into the marker 2 or more times before driving off in it the tag floats in the air. mercie_blink.gif Is there a way to correct it?

You're right, the object won't be removed in that script

we need now to keep the spawned BOXVILLE in focus till player drives another vehicle or is going away and gets bigger distance

try the script below

 

 

The problem is they don't act like cops.

don't use global variables in cleo scripts like $COP2, it can cause bugs and crashes

only $PLAYER_ACTOR, $PLAYER_CHAR and $ONMISSION are valid

try

 

06E4: AS_actor 2@ attempt_to_bust_actor $PLAYER_ACTOR

 

 

Graffitionvehicle

the boxville can be spawned in more ways:

-press Tab and G to spawn infront of player

-drive a boxville

-go into red marker

 

then the code run in a loop to check conditions to cleanup the car and object handle and start the script again from beginning

the conditions are:

-is player driving another vehicle

-is player going away and gets bigger distance than 50.0

-press Tab and G when player is on foot

-is $ONMISSION activ when player is on foot

-is car wrecked

-is player dead or arrested

 

 

 

{$CLEO .cs}:Graffitionvehicle//03A4: name_thread 'GRFV'//1531, tag_azteca, tags_LAazteca, 50, 1048580:Grafonveh_10001: wait  0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @Grafonveh_1if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot -1558.2838 1184.4581 7.1875 radius  1.0  1.0  1.0004D: jump_if_false @Grafonveh_211@ = -1557.747412@ = 1168.721313@ = 7.187514@ = 270.0jump @Grafonveh_4:Grafonveh_2if  and0AB0:   key_pressed 9// TAB0AB0:   key_pressed 71//  G keyjf @Grafonveh_304C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0 5.5  0.30172: 14@ = actor $PLAYER_ACTOR z_angle000B: 14@ +=  270.0  // floating-point valuesjump @Grafonveh_4:Grafonveh_3if00DD:   actor $PLAYER_ACTOR driving_car_with_model #boxvillejf @Grafonveh_103C0: 0@ = actor $PLAYER_ACTOR car11@ = -1557.747412@ = 1168.721313@ = 7.187514@ = 270.0:Grafonveh_40247: request_model #boxville0247: request_model 1531:Grafonveh_50001: wait  0 msif  and0248:   model #boxville available0248:   model 1531 available004D: jump_if_false @Grafonveh_5if80DD:   not actor $PLAYER_ACTOR driving_car_with_model #boxvillejf @Grafonveh_600A5: 0@ = create_car #boxville at 11@ 12@ 13@0175: set_car 0@ z_angle_to 90.0:Grafonveh_60107: 1@ = create_object 1531 at  11@ 12@ 180.0//08D2: object 1@ scale_model  0.501C7: remove_object_from_mission_cleanup_list 1@0681: attach_object 1@ to_car 0@ with_offset 1.3 0.0 0.8 rotation 180.0 180.0 0.00249: release_model #boxville0249: release_model 1531wait 1000:Grafonveh_80001: wait 30 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @Grafonveh_13if8119:  not car 0@ wrecked004D: jump_if_false @Grafonveh_13if00DF: actor $PLAYER_ACTOR driving004D: jump_if_false @Grafonveh_9if00DB:   actor $PLAYER_ACTOR in_car 0@004D: jump_if_false @Grafonveh_130002: jump @Grafonveh_10:Grafonveh_9if  and0038:   $ONMISSION ==  0  // integer values0202:   actor $PLAYER_ACTOR near_car 0@ radius  50.0  50.0 unknown  0004D: jump_if_false @Grafonveh_13if  and0AB0:   key_pressed 9// TAB0AB0:   key_pressed 71//  G keyjf @Grafonveh_80002: jump @Grafonveh_13:Grafonveh_100002: jump @Grafonveh_8:Grafonveh_1301C4: remove_references_to_object 1@01C3: remove_references_to_car 0@ // Like turning a car into any random car00BC: text_highpriority 'fem_off'  2000 ms  1wait 10000002: jump @Grafonveh_1

 

Edited by ZAZ
Millinescence

Nice tutorials, ZAZ. You're doing a great job ^^. I have a question though; I'm trying to make a mod where if the player gets into a pickup truck (bobcat, picador, saddler, etc.) with people that follow you (gang members and the like), that one of them will get into the bed of the truck in turret mode like Ryder from the 'Catalyst' mission. How would you go about doing that?

 

While searching through that mission in the .scm, I found this little bit of code:

 

:RYDER3_14356 ifnot Actor.Dead($ACTOR_RYDER)jf @RYDER3_144090465: remove_actor $ACTOR_RYDER from_turret_mode0464: put_actor $ACTOR_RYDER into_turret_on_car 108@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 15.0 with_weapon 28 

 

 

EDIT:

Using your tutorials and the code snippet I found as a guide, I now have a test script that creates a GSF and puts him in the bed of a Picador once the player is in the vehicle.

 

{$CLEO .cs}//-------------MAIN---------------thread 'TRUKTUR' :TRUKTUR_11wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @TRUKTUR_11 if   Actor.DrivingVehicleType($PLAYER_ACTOR, #PICADOR)else_jump @TRUKTUR_11 Model.Load(#FAM1)Model.Load(#AK47):TRUKTUR_59wait 0 if and  Model.Available(#FAM1)  Model.Available(#AK47)else_jump @TRUKTUR_5903C0: 1@ = actor $PLAYER_ACTOR car   009A: 2@ = create_actor_pedtype 8 model #FAM1 at 0.0 0.0 0.001B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using this Actor.WeaponAccuracy(2@) = 100Actor.Health(2@) = 10000464: put_actor 2@ into_turret_on_car 1@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 30.0 with_weapon 30 Model.Destroy(#FAM1):TRUKTUR_170wait 0 if   not Actor.Dead(2@)else_jump @TRUKTUR_216 if 00DD:   actor $PLAYER_ACTOR driving_car_with_model #PICADOR else_jump @TRUKTUR_216 jump @TRUKTUR_170 :TRUKTUR_216Actor.RemoveReferences(2@)jump @TRUKTUR_11

 

But what I really want to do is make it so that instead of a GSF that appears out of thin air, I want a GSF that you recruit off the street to be put into turret mode instead.

Can you please help? Thanks in advance. Take some cookies cookie.gifcookie.gifcookie.gif :3

Edited by Millinescence

 

I want a GSF that you recruit off the street to be put into turret mode instead.

 

the gangmembers won't do this job confused.gif

test the script below

recruit a homie and then enter a picador

 

{$CLEO .cs}//-------------MAIN---------------thread 'TRUKTUR':TRUKTUR_11wait 0if Player.Defined($PLAYER_CHAR)else_jump @TRUKTUR_11if Actor.DrivingVehicleType($PLAYER_ACTOR, #PICADOR)else_jump @TRUKTUR_1107AF: 5@ = player $PLAYER_CHAR group092B: 2@ = group 5@ member 0if056D:   actor 2@ defined 004D: jump_if_false @TRUKTUR_12if 8118:   not actor 2@ dead 004D: jump_if_false @TRUKTUR_12jump @TRUKTUR_13:TRUKTUR_12wait 1000jump @TRUKTUR_11:TRUKTUR_13Model.Load(#AK47):TRUKTUR_59wait 0if Model.Available(#AK47)else_jump @TRUKTUR_5903C0: 1@ = actor $PLAYER_ACTOR car0687: clear_actor 2@ task 0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1 060B: set_actor 2@ decision_maker_to 3201B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using thisActor.WeaponAccuracy(2@) = 100Actor.Health(2@) = 1000wait 10000792: disembark_instantly_actor 2@ 0464: put_actor 2@ into_turret_on_car 1@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 360.0 with_weapon 30077A: set_actor 2@ acquaintance 1 to_actors_pedtype 7 // see ped.dat 077A: set_actor 2@ acquaintance 4 to_actors_pedtype 7 // see ped.dat 077A: set_actor 2@ acquaintance 1 to_actors_pedtype 6 // see ped.dat 077A: set_actor 2@ acquaintance 4 to_actors_pedtype 6 // see ped.dat:TRUKTUR_170wait 0if Player.Defined($PLAYER_CHAR)else_jump @TRUKTUR_216if  and not Car.Wrecked(1@) not Actor.Dead(2@)else_jump @TRUKTUR_216if00DD:   actor $PLAYER_ACTOR driving_car_with_model #PICADORelse_jump @TRUKTUR_216jump @TRUKTUR_170:TRUKTUR_2160465: remove_actor 2@ from_turret_modeActor.RemoveReferences(2@)0632: release_group 5@jump @TRUKTUR_11

 

Millinescence

 

I want a GSF that you recruit off the street to be put into turret mode instead.

 

the gangmembers won't do this job confused.gif

 

That is so weird...once the first homie gets into turret mode, the second one becomes confused as to where to get into the truck when the passenger seat is wide open for them. And when I get out of the truck, they disband dontgetit.gif

 

I'm also using the Gunslinger Girl CLEO, so I called them up and tried to see if they would get in the truck with me. Triela (blond hair) got into turret mode and Henrietta (brown hair) was confused at first like the homie, but I get out and get back in and then Henrietta managed to get into the passenger seat with me.

EDIT: So then I approach some Ballas in the Picador with the two girls to see what they'll do. Henrietta gets out the truck and shoots them while Triella just watches. dozingoff.gif

 

I noticed that you also cleared the homie's task (whatever that means) and changed his decision marker. Do you think that might be why?

Edited by Millinescence

 

I want a GSF that you recruit off the street to be put into turret mode instead.

 

the gangmembers won't do this job confused.gif

 

 

I noticed that you also cleared the homie's task (whatever that means) and changed his decision marker. Do you think that might be why?

I tried a lot to get them working

try yourself, remove the codes before put_in_turret, make commentslashes infront, play around

 

//0687: clear_actor 2@ task//0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1//060B: set_actor 2@ decision_maker_to 32  <<<stops the ped-presettings01B2: give_actor 2@ weapon 30 ammo 99999 // Load the weapon model before using this//Actor.WeaponAccuracy(2@) = 100//Actor.Health(2@) = 1000//wait 1000//0792: disembark_instantly_actor 2@0464: put_actor 2@ into_turret_on_car 1@ at_car_offset 0.0 -1.3 0.8 position 2 shooting_angle_limit 360.0 with_weapon 30//077A: set_actor 2@ acquaintance 1 to_actors_pedtype 7 // see ped.dat//077A: set_actor 2@ acquaintance 4 to_actors_pedtype 7 // see ped.dat//077A: set_actor 2@ acquaintance 1 to_actors_pedtype 6 // see ped.dat//077A: set_actor 2@ acquaintance 4 to_actors_pedtype 6 // see ped.dat

 

Ok Zaz I need you expertise again.

 

First off sorry about the global variables, I was just messing around with another cleo script to see if it would work. I have made my script without them.

 

your code:

 

06E4: AS_actor 2@ attempt_to_bust_actor $PLAYER_ACTOR

 

works but as I suspected there already out of the car shooting at me before I get anywhere near them.

 

I tried doing this:

 

:GANG_TASK_UNIT_585 if or Player.WantedLevel($PLAYER_CHAR) = 1 Player.WantedLevel($PLAYER_CHAR) = 2 Player.WantedLevel($PLAYER_CHAR) = 3 Player.WantedLevel($PLAYER_CHAR) = 4 Player.WantedLevel($PLAYER_CHAR) = 5 else_jump @GANG_TASK_UNIT_585  06E4: AS_actor 7@ attempt_to_bust_actor $PLAYER_ACTOR  06E4: AS_actor 8@ attempt_to_bust_actor $PLAYER_ACTOR 

 

 

Game crashes

 

tried changing above to

 

Player.WantedLevel($PLAYER_CHAR) > 0

 

 

Game crashes

 

gave up on that for now and tried this

 

if  8202:   not actor $PLAYER_ACTOR near_car 5@ radius 100.0 100.0 flag 0  else_jump @GANG_TASK_UNIT_585  wait 5000  if  8202:   not actor $PLAYER_ACTOR near_car 5@ radius 100.0 100.0 flag 0  else_jump @GANG_TASK_UNIT_585  Actor.DestroyWithFade(7@) Actor.DestroyWithFade(8@) Actor.DestroyWithFade(9@) Car.Destroy(5@) jump @GANG_TASK_UNIT_19 

 

 

Game crashes

 

This is the part of my script that works

 

{$CLEO .cs} //-------------MAIN--------------- thread 'GANG_TASK_UNIT'  :GANG_TASK_UNIT_19 wait 0  if     Player.Defined($PLAYER_CHAR) else_jump @GANG_TASK_UNIT_19  if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 1555.0 -1520.0 100.0 radius 1275.0 800.0 1000.0  else_jump @GANG_TASK_UNIT_19  073E: get_car_in_sphere 1555.0 -1520.0 100.0 radius 400.0 model -1 handle_as 0@  if     not 0@ == -1  else_jump @GANG_TASK_UNIT_19  if  8202:   not actor $PLAYER_ACTOR near_car 0@ radius 100.0 100.0 flag 0  else_jump @GANG_TASK_UNIT_19  0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 0.0 0.0  4@ = Car.Angle(0@) 023C: load_special_actor 'TENPEN' as 1 // models 290-299  023C: load_special_actor 'PULASKI' as 2 // models 290-299  Model.Load(#COPCARLA) Model.Load(#DESERT_EAGLE) Model.Load(#SHOTGSPA) Model.Load(#BALLAS3) 06E9: load_car_component #WHEEL_GN3  038B: load_requested_models  wait 0  if and 023D:   special_actor 1 loaded  023D:   special_actor 2 loaded     Model.Available(#COPCARLA)    Model.Available(#DESERT_EAGLE)    Model.Available(#SHOTGSPA)    Model.Available(#BALLAS3) else_jump @GANG_TASK_UNIT_19  Car.Destroy(0@) 5@ = Car.Create(#COPCARLA, 1@, 2@, 3@) 06E7: 6@ = add_car_component #WHEEL_GN3 to_car 5@  0229: set_car 5@ primary_color_to 0 secondary_color_to 1  Car.SetMaxSpeed(5@, 20.0) Car.Angle(5@) = 4@ Car.Health(5@) = 1000 Car.SetToNormalDriver(5@) Car.SetDriverBehaviour(5@, FollowRoad) 7@ = Actor.Create(Cop, #SPECIAL01, 1@, 2@, 3@) 8@ = Actor.Create(Cop, #SPECIAL02, 1@, 2@, 3@) 9@ = Actor.Create(gang1, #BALLAS3, 1@, 2@, 3@) 01B2: give_actor 7@ weapon 27 ammo 9999 // Load the weapon model before using this  01B9: set_actor 7@ armed_weapon_to 27  01B2: give_actor 8@ weapon 24 ammo 9999 // Load the weapon model before using this  01B9: set_actor 8@ armed_weapon_to 24  081A: set_actor 7@ weapon_skill_to 1  Actor.WeaponAccuracy(7@) = 95 081A: set_actor 8@ weapon_skill_to 1  Actor.WeaponAccuracy(8@) = 95 087E: set_actor 7@ weapon_droppable 1  087E: set_actor 8@ weapon_droppable 1  07DD: set_actor 7@ temper_to 100 // see pedstats.dat  07DD: set_actor 8@ temper_to 100 // see pedstats.dat  0245: set_actor 7@ walk_style_to "SWAT"  0245: set_actor 8@ walk_style_to "SWAT"  0245: set_actor 9@ walk_style_to "GANG1"  072A: put_actor 8@ into_car 5@ driverseat  0430: put_actor 7@ into_car 5@ passenger_seat 0  0430: put_actor 9@ into_car 5@ passenger_seat 1  03FE: set_actor 7@ money 2491  0249: release_model #SPECIAL01 0249: release_model #SPECIAL01 0249: release_model #BALLAS3

 

 

that all works, anything I put after it crashes the game. I don't know if its in the code above or I just Know enough yet. Probably both smile.gif

 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.