Jump to content

I want to do a little edit to a CLEO mod called Police intelligence Improvement v2.0, using Sanny Builder 4, can someone help me?


spageti

Recommended Posts

So the thing is, in this mod the SWAT tanks chase you, but they're occupied by FBI agents with MP5s.
I just want to change the ped model, so that the SWAT tanks are occupied by SWAT members with MP5s.
How to do this?
What should I change in the .cs files, using Sanny Builder?
Screens from Sanny Builder in the reply

Edited by spageti
info in the text form was too messy
Link to comment
Share on other sites

Cops(SWAT) :


spacer.png
spacer.png
spacer.png

spacer.png

spacer.png

spacer.png
 

Cops(SWAT1) :

spacer.png

spacer.png

spacer.png

spacer.png

spacer.png

spacer.png

Edited by spageti
had to edit the content in relation to the post
Link to comment
Share on other sites

Post the script text instead screenshots 

Link to comment
Share on other sites

Yeah, sorry for the mess. Also, those two .cs files were not the ones I was looking for. Here it is, Cops(FBITRUCK) :
 

{$CLEO .cs}

nop
wait 0

:Noname_6
22@ = Player.StoreWantedLevel($player1)
wait 1000
20@ = Streaming.GetAreaVisible()
if and
  22@ == 5
  20@ == 0
goto_if_false @Noname_6
Streaming.RequestModel(#SWATVAN)
Streaming.RequestModel(#MP5LNG)
Streaming.RequestModel(#FBI)
Streaming.LoadAllModelsNow

:Noname_66
wait 300
if and
  Streaming.HasModelLoaded(#SWATVAN)
  Streaming.HasModelLoaded(#MP5LNG)
  Streaming.HasModelLoaded(#FBI)
goto_if_false @Noname_66
wait 0
5@ = Math.RandomIntInRange(50.0, 100.0)
6@ = Math.RandomIntInRange(50.0, 100.0)
1@, 2@, 3@ = Char.GetOffsetInWorldCoords($scplayer, 5@, 6@, 1.0)
7@, 8@, 9@ = Path.GetClosestCarNode(1@, 2@, 3@)
0@ = Car.Create(#SWATVAN, 7@, 8@, 9@)
10@ = Char.CreateInsideCar(0@, PedType.Cop, #FBI)
11@ = Char.CreateAsPassenger(0@, PedType.Cop, #FBI, 0)
Char.SetHealth(10@, 500)
Char.SetHealth(11@, 500)
Char.SetAccuracy(10@, 75)
Char.SetAccuracy(11@, 75)
Char.GiveWeapon(10@, WeaponType.Mp5, 99999)
Char.GiveWeapon(11@, WeaponType.Mp5, 99999)
Car.SetTraction(0@, 2.0)
Car.SetCruiseSpeed(0@, 50.0)
Car.SetMission(0@, CarMission.BlockPlayerFaraway)
Car.SetDrivingStyle(0@, DrivingMode.AvoidCars)
Streaming.MarkModelAsNoLongerNeeded(#SWATVAN)
Streaming.MarkModelAsNoLongerNeeded(#FBI)
Streaming.MarkModelAsNoLongerNeeded(#MP5LNG)
if
  Char.IsInAnyCar($scplayer)
goto_if_false @Noname_439
19@ = Char.StoreCarIsInNoSave($scplayer)
Char.AddAmmo(11@, WeaponType.Mp5, 200000)

:Noname_360
wait 0
if
  Char.LocateAnyMeansCar3D($scplayer, 0@, 300.0, 300.0, 150.0, False)
goto_if_false @Noname_857
if
  not Car.IsDead(0@)
goto_if_false @Noname_857
if
  not Char.IsDead(10@)
goto_if_false @Noname_609
goto @Noname_439

:Noname_439
wait 0
if and
  not Char.IsInAnyCar($scplayer)
  Char.LocateAnyMeansCar3D($scplayer, 0@, 15.0, 15.0, 150.0, False)
goto_if_false @Noname_360
Task.LeaveAnyCar(10@)
Task.LeaveAnyCar(11@)
Task.KillCharOnFoot(10@, $scplayer)
Task.KillCharOnFoot(11@, $scplayer)
goto @Noname_707

:Noname_517
wait 0
14@, 15@, 16@ = Car.GetCoordinates(0@)
if and
  not Char.IsInAnyCar($scplayer)
  Char.LocateAnyMeansCar3D($scplayer, 0@, 15.0, 15.0, 150.0, False)
goto_if_false @Noname_628
Task.LeaveAnyCar(10@)
Task.LeaveAnyCar(11@)
Task.KillCharOnFoot(10@, $scplayer)
Task.KillCharOnFoot(11@, $scplayer)
goto @Noname_707

:Noname_609
wait 0
Task.ShuffleToNextCarSeat(11@, 0@)
goto @Noname_628

:Noname_628
wait 0
if
  Char.LocateAnyMeansCar3D($scplayer, 0@, 300.0, 300.0, 150.0, False)
goto_if_false @Noname_857
if
  not Car.IsDead(0@)
goto_if_false @Noname_857
if
  not Char.IsDead(11@)
goto_if_false @Noname_857
goto @Noname_517

:Noname_707
wait 0
if
  not Char.IsDead($scplayer)
goto_if_false @Noname_815
if and
  Char.LocateAnyMeansChar2D(10@, $scplayer, 300.0, 300.0, False)
  Char.LocateAnyMeansChar2D(11@, $scplayer, 300.0, 300.0, False)
goto_if_false @Noname_815
if and
  Char.IsDead(10@)
  Char.IsDead(11@)
goto_if_false @Noname_707
if
  Char.HasBeenArrested($scplayer)
goto_if_false @Noname_707

:Noname_815
wait 0
Char.MarkAsNoLongerNeeded(10@)
Char.MarkAsNoLongerNeeded(11@)
Car.MarkAsNoLongerNeeded(0@)
10@ = Math.RandomIntInRange(10000, 20000)
wait 10@
goto @Noname_6

:Noname_857
wait 0
Char.MarkAsNoLongerNeeded(10@)
Char.MarkAsNoLongerNeeded(11@)
Car.MarkAsNoLongerNeeded(0@)
10@ = Math.RandomIntInRange(10000, 20000)
wait 10@
goto @Noname_6



-------------------------------------------------------------

All I want to do is change #FBI to #SWAT. But after I do this, I don't know how to save the file so that there's no 0011: Unknown opcode error.

Link to comment
Share on other sites

 

The script was written for Sannybuilder 4 / SBL mode (GTA SA v1.0-SBL)

 

When compiling, then it can't handle the model names and it says "script has no header"

Then you can insert the id numbers instead the names

look in data\default.ide, peds.ide, vehicles.ide

Streaming.RequestModel(601)//(#SWATVAN)
Streaming.RequestModel(353)//(#MP5LNG) 
Streaming.RequestModel(285)//(#SWAT)

 

or read Orions post below

 

 

 

 

 I recompiled the script with Sannybuilder 3 classic syntax

Spoiler

 

{$CLEO .cs}

0000: NOP
0001: wait 0 ms

:Noname_6
01C0: 22@ = player $PLAYER_CHAR wanted_level
0001: wait 1000 ms
077E: get_active_interior_to 20@
00D6: if and
0039: 22@ == 5
0039: 20@ == 0
004D: jump_if_false @Noname_6
0247: load_model #SWATVAN
0247: load_model #MP5LNG
0247: load_model #SWAT
038B: load_requested_models

:Noname_66
0001: wait 300 ms
00D6: if and
0248:   model #SWATVAN available
0248:   model #MP5LNG available
0248:   model #SWAT available
004D: jump_if_false @Noname_66
0001: wait 0 ms
0209: 5@ = random_int_in_ranges 50.0 100.0
0209: 6@ = random_int_in_ranges 50.0 100.0
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 5@ 6@ 1.0
02C1: store_to 7@ 8@ 9@ car_path_coords_closest_to 1@ 2@ 3@
00A5: 0@ = create_car #SWATVAN at 7@ 8@ 9@
0129: 10@ = create_actor_pedtype 6 model #SWAT in_car 0@ driverseat
01C8: 11@ = create_actor_pedtype 6 model #SWAT in_car 0@ passenger_seat 0
0223: set_actor 10@ health_to 500
0223: set_actor 11@ health_to 500
02E2: set_actor 10@ weapon_accuracy_to 75
02E2: set_actor 11@ weapon_accuracy_to 75
01B2: give_actor 10@ weapon 29 ammo 99999  // Load the weapon model before using this
01B2: give_actor 11@ weapon 29 ammo 99999  // Load the weapon model before using this
0423: set_car 0@ improved_handling_to 2.0 // (float)
00AD: set_car 0@ max_speed_to 50.0
00AF: set_car 0@ driver_behaviour_to 4
00AE: set_car 0@ traffic_behaviour_to 2
0249: release_model #SWATVAN
0249: release_model #SWAT
0249: release_model #MP5LNG
00D6: if 
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false @Noname_439
03C0: 19@ = actor $PLAYER_ACTOR car
0114: set_actor 11@ weapon 29 add_ammo 200000

:Noname_360
0001: wait 0 ms
00D6: if 
0205:   actor $PLAYER_ACTOR near_car 0@ radius 300.0 300.0 150.0 flag 0
004D: jump_if_false @Noname_857
00D6: if 
8119:   not car 0@ wrecked
004D: jump_if_false @Noname_857
00D6: if 
8118:   not actor 10@ dead
004D: jump_if_false @Noname_609
0002: jump @Noname_439

:Noname_439
0001: wait 0 ms
00D6: if and
80DF:   not actor $PLAYER_ACTOR driving
0205:   actor $PLAYER_ACTOR near_car 0@ radius 15.0 15.0 150.0 flag 0
004D: jump_if_false @Noname_360
0633: AS_actor 10@ exit_car
0633: AS_actor 11@ exit_car
05E2: AS_actor 10@ kill_actor $PLAYER_ACTOR
05E2: AS_actor 11@ kill_actor $PLAYER_ACTOR
0002: jump @Noname_707

:Noname_517
0001: wait 0 ms
00AA: store_car 0@ position_to 14@ 15@ 16@
00D6: if and
80DF:   not actor $PLAYER_ACTOR driving
0205:   actor $PLAYER_ACTOR near_car 0@ radius 15.0 15.0 150.0 flag 0
004D: jump_if_false @Noname_628
0633: AS_actor 10@ exit_car
0633: AS_actor 11@ exit_car
05E2: AS_actor 10@ kill_actor $PLAYER_ACTOR
05E2: AS_actor 11@ kill_actor $PLAYER_ACTOR
0002: jump @Noname_707

:Noname_609
0001: wait 0 ms
0676: AS_actor 11@ in_car 0@ move_from_passengerseat_to_driverseat
0002: jump @Noname_628

:Noname_628
0001: wait 0 ms
00D6: if 
0205:   actor $PLAYER_ACTOR near_car 0@ radius 300.0 300.0 150.0 flag 0
004D: jump_if_false @Noname_857
00D6: if 
8119:   not car 0@ wrecked
004D: jump_if_false @Noname_857
00D6: if 
8118:   not actor 11@ dead
004D: jump_if_false @Noname_857
0002: jump @Noname_517

:Noname_707
0001: wait 0 ms
00D6: if 
8118:   not actor $PLAYER_ACTOR dead
004D: jump_if_false @Noname_815
00D6: if and
00F2:   actor 10@ near_actor $PLAYER_ACTOR radius 300.0 300.0 0
00F2:   actor 11@ near_actor $PLAYER_ACTOR radius 300.0 300.0 0
004D: jump_if_false @Noname_815
00D6: if and
0118:   actor 10@ dead
0118:   actor 11@ dead
004D: jump_if_false @Noname_707
00D6: if 
0741:   actor $PLAYER_ACTOR busted
004D: jump_if_false @Noname_707

:Noname_815
0001: wait 0 ms
01C2: remove_references_to_actor 10@  // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 11@  // Like turning an actor into a random pedestrian
01C3: remove_references_to_car 0@
0209: 10@ = random_int_in_ranges 10000 20000
0001: wait 10@ ms
0002: jump @Noname_6

:Noname_857
0001: wait 0 ms
01C2: remove_references_to_actor 10@  // Like turning an actor into a random pedestrian
01C2: remove_references_to_actor 11@  // Like turning an actor into a random pedestrian
01C3: remove_references_to_car 0@
0209: 10@ = random_int_in_ranges 10000 20000
0001: wait 10@ ms
0002: jump @Noname_6

This script can you compile with Sannybulder 3

 

 

 

Edited by ZAZ
Link to comment
Share on other sites

"script has no header" - this error will pop up if the game directory is not set.
Each edit mode needs to be configured separately.

 

Link to comment
Share on other sites

2 hours ago, OrionSR said:

"script has no header" - this error will pop up if the game directory is not set.
Each edit mode needs to be configured separately.

 

omg, yes of course 🤪

Link to comment
Share on other sites

8 hours ago, ZAZ said:

omg, yes of course 🤪

Heads up: This issue has been coming up a lot more recently. SB3's installer used to help set the game directory. The installer was removed from SB4 due to warnings from various anti-virus utilities.

"Unknown model ID. Compiled file has no header, so the model name #ADRENALINE can not be used. Use number ID instead."

FYI: This error message doesn't seem appropriate anymore. If the game directory is set, SB4 has been compiling object IDs that used to require a model number when working with cleo scripts.

Edited by OrionSR
Link to comment
Share on other sites

Thanks to both of you for the replies. It works.
What I did is I just changed #FBI to #SWAT, using SN 4. Now the .cs files are 5KB instead of 1KB they were before.
Using your script @ZAZ, using SN 3, the .cs files were 23KB. Then I tried just changing words in SN 4, tested and it plays as intended.
I'm a total noob when it comes to all of this so instead of hitting 'compile' I was using 'save as' before 😁
Thank you, @ZAZ especially!

Edited by spageti
typo
Link to comment
Share on other sites

By default, Sanny will add the source code to the script, which can increase it's size significantly but doesn't affect how the script works in game.

Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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