Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

Cars used or created by script.


thalilmythos
 Share

Recommended Posts

How would i go about making a script that stores random cars but doesn't include mission cars or cars being used by scripts?

 

I am doing a mod that locks parked cars with the engine off and without drivers or passangers and i want to find a way for it to recognize mission cars and cars that have been used by the player

 

So this is what i got.

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013{$CLEO .cs}//-------------MAIN---------------thread 'LOCK' :LOCK_11wait 500 if    Player.Defined($PLAYER_CHAR)else_jump @LOCK_11 if 856E:   not car [email protected] defined else_jump @LOCK_55 gosub @LOCK_718 :LOCK_5504C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 0AE2: [email protected] = random_vehicle_near_point [email protected] [email protected] [email protected] in_radius 100.0 find_next 1 pass_wrecked 1 //IF and SET if 056E:   car [email protected] defined else_jump @LOCK_11 if 8202:   not actor $PLAYER_ACTOR near_car [email protected] radius 50.0 50.0 sphere 0 else_jump @LOCK_11 if 056E:   car [email protected] defined else_jump @LOCK_11 046C: [email protected] = car [email protected] driver if 856D:   not actor [email protected] defined else_jump @LOCK_11 if 056E:   car [email protected] defined else_jump @LOCK_11 if 8ABE:   not vehicle [email protected] engine_on else_jump @LOCK_11 if 056E:   car [email protected] defined else_jump @LOCK_11 wait 0 if and   not Car.Model([email protected]) == #PIZZABOY   not Car.Model([email protected]) == #PCJ600   not Car.Model([email protected]) == #FAGGIO   not Car.Model([email protected]) == #FREEWAY   not Car.Model([email protected]) == #SANCHEZ   not Car.Model([email protected]) == #QUADelse_jump @LOCK_11 if 056E:   car [email protected] defined else_jump @LOCK_11 wait 0 if and   not Car.Model([email protected]) == #TRACTOR   not Car.Model([email protected]) == #FORKLIFT   not Car.Model([email protected]) == #BFINJECT   not Car.Model([email protected]) == #BANSHEE   not Car.Model([email protected]) == #BMX   not Car.Model([email protected]) == #BAGGAGE   not Car.Model([email protected]) == #BIKE   not Car.Model([email protected]) == #MTBIKEelse_jump @LOCK_11 if 056E:   car [email protected] defined else_jump @LOCK_11 wait 0 if and   not Car.Model([email protected]) == #FCR900   not Car.Model([email protected]) == #NRG500   not Car.Model([email protected]) == #COPBIKE   not Car.Model([email protected]) == #FELTZER   not Car.Model([email protected]) == #BLADE   not Car.Model([email protected]) == #VORTEX   not Car.Model([email protected]) == #WINDSOR   not Car.Model([email protected]) == #SAVANNAelse_jump @LOCK_11 if 056E:   car [email protected] defined else_jump @LOCK_11 wait 0 if and   not Car.Model([email protected]) == #BANDITO   not Car.Model([email protected]) == #KART   not Car.Model([email protected]) == #MOWER   not Car.Model([email protected]) == #BROADWAY   not Car.Model([email protected]) == #BF400   not Car.Model([email protected]) == #WAYFARERelse_jump @LOCK_11 if 0B13: [email protected] = NOT 0 else_jump @LOCK_688 if 056E:   car [email protected] defined else_jump @LOCK_11 if    not Car.Model([email protected]) == [email protected]_jump @LOCK_11 if and81AD:   not car [email protected] sphere 0 near_point [email protected] [email protected] radius 10.0 10.0 81AD:   not car [email protected] sphere 0 near_point -1595.173 73.5244 radius 500.0 500.0 else_jump @LOCK_11 :LOCK_688if 056E:   car [email protected] defined else_jump @LOCK_11 Car.DoorStatus([email protected]) = 4jump @LOCK_11 :LOCK_718wait 0 if    Actor.Driving($PLAYER_ACTOR)else_jump @LOCK_809 if 856E:   not car [email protected] defined else_jump @LOCK_809 [email protected] = Actor.CurrentCar($PLAYER_ACTOR)if 056E:   car [email protected] defined else_jump @LOCK_809 Car.StorePos([email protected], [email protected], [email protected], [email protected])[email protected] = Car.Model([email protected])Car.DoorStatus([email protected]) = 0return :LOCK_809wait 0 return 

The purpose of the gosub is to store the player car and get the model and also unlock it if it exists as a way of insuring that the game doesn't find it and lock's it too if the player gets away 50 meters from it as the limit of the cars being locked at the start of the locking part in the script shows.

 

However, if you use a mod such as this:

 

http://gtaforums.com/topic/818366-lock-and-park-beta-the-battle-against-the-secret-towing-service/

 

Which i do, and the car stays there for a long time, and you go about your business stealing a lot of cars eventually the script will somehow "forget it" Ergo, the car gets locked when you come back to it after doing all your shenanigans.

 

which leads me to the question.

 

How could i make it so the game doesn't forget that this car has been used by the player, and apply it to every car used by him?

 

How could i make it so the game doesn't lock mission cars? without having to deactivate the script completely by using:

 

$ONMISSION == 0

 

PSDT: I use a mod to turn the engine off too so, the conditions for the car to be locked are met, which are: Engine off, not a driver inside the car.

Edited by thalilmythos
Link to comment
Share on other sites

I would use it better
memory
or an ini file
to save the value of the vehicle variable
gosub is the worst solution

only you have to remember that you must be in other sections


I would use it bettermemoryor an ini fileto save the value of the vehicle variablegosub is the worst solutiononly you have to remember that you must be in other sectionsf  2 @ == 1 // itemsjf @ CAR7_16905A9: s $ 7242 = 'ST1' // s $: CAR7_169f  2 @ == 2jf @ CAR7_18905A9: s $ 7242 = 'ST2' // s $: CAR7_1890AF1: write_int 1 @ to_ini_file "CLEO \ RACE_MAKER \ RACE.INI" section s $ 7242 key "set"-------------------------------------------------- ------------------------------------------here you put it in the ini file0494: get_joystick 0 direction_offset_to 13 @ 14 @ 20 @ 19 @if and  0 @ == 1  13 @> 0jf @ MENU_ACQ_44C19f   not 23 @> = 4jf @ MENU_ACQ_44C1223 @ + = 1077A: set_acquaintance 27 @ 23 @ 00AF1: write_int 23 @ to_ini_file "CLEO \ BACH.INI" section "MEMORY1" key "VAR": MENU_ACQ_44C12jump @ MENU_ACQ_442A2: MENU_ACQ_44C19/// no and here is the value extractorIF 0 @ == 1THEN    IF 8AF0: not 23 @ = get_int_from_ini_file "CLEO \ BACH.INI" section "MEMORY1" key "VAR"    THEN        23 @ = 0    END    0340: set_text_draw_RGBA 5 @ 6 @ 7 @ 255    033F: set_text_draw_letter_size 0.3 0.8    045A: draw_text_1number 134.0 80.0 GXT 'XTR' number 23 @END
Edited by Sanmodder
Link to comment
Share on other sites

So what you are doing here is writing every vehicle model stored on the 23 Var inside a ini file?

Link to comment
Share on other sites

So what you are doing here is writing every vehicle model stored on the 23 Var inside a ini file?

you need to add 5 variables to the ini file

 

cords x y z, vehicle

6 @

7 @

8 @

vehicle model

23 @

and the value of the vehicle variable

1 @

 

and then take these values from the ini file

 

explain in more detail what's in your script

Link to comment
Share on other sites

The first loop looks for any vehicle without driver and the engine off and locks the doors.

 

The gosub loop stores the player vehicle, it's model in [email protected] and it's coordinates on [email protected] [email protected] [email protected] to identify it.

 

This way, when the first loop is looking for random vehicles with the engine off and without a driver if it finds a car near the [email protected] [email protected] [email protected] coordinates and the [email protected] model (the player's car) it will not lock the doors.

So using mods that allow the player car to not dissapear such as this:

http://gtaforums.com/topic/818366-lock-and-park-beta-the-battle-against-the-secret-towing-service/ (I recommend you to look at this topic to understand what i'm talking about better.)

 

Becomes incompatible if you turn the vehicle's engine off too and leave it behind while using other cars because eventually the game kind of forgets the vehicle is still existing.

It can all be avoided if you just leave the engine on, but i don't want to half ass this, because i know some people like to use mods that allow them to do it.

 

So all i want to know is:

How to make the game recognize a car as being used by script without ever releasing.

 

OR

 

How to make the game store every car used by the player, and i do mean EVERY in the literal sense of the word.

 

ALSO

How to make the game recognize a car as being mission related to prevent cars in missions with the conditions i just described from being locked.

 

I'd apreciate if you tell me somehow how to do it instead of just sending a code man i want to learn, i don't want you to do it for me.

Edited by thalilmythos
Link to comment
Share on other sites


{$CLEO .cs}

 

0000: nop

 

:start

while true

repeat

wait 0

until if player.Defined(0)

if actor.Driving($player_actor)

then

[email protected] = actor.CurrentCar($player_actor)

Car.StorePos([email protected], [email protected], [email protected], [email protected])

[email protected] = Car.Model([email protected])

0aca: "press 6 to save car"

if 0ab0: 54

then

0AF1: write_int [email protected] to_ini_file "CLEO\CONFIG.INI" section "car_model" key "id"

0AF3: write_float [email protected] to_ini_file "CLEO\CONFIG.INI" section "cords" key "x"

0AF3: write_float [email protected] to_ini_file "CLEO\CONFIG.INI" section "cords" key "y"

0AF3: write_float [email protected] to_ini_file "CLEO\CONFIG.INI" section "cords" key "z"

goto @start

end

end

if 0ab0: 55

then

0aca: "press 7 to spawn car"

if or

8AF0: not [email protected] = get_int_from_ini_file "CLEO\CONFIG.INI" section "car_model" key "id"

8AF2: not [email protected] = get_float_from_ini_file "CLEO\CONFIG.INI" section "cords" key "x"

8AF2: not [email protected] = get_float_from_ini_file "CLEO\CONFIG.INI" section "cords" key "y"

8AF2: not [email protected] = get_float_from_ini_file "CLEO\CONFIG.INI" section "cords" key "z"

then

0aca: "~r~error not fund"

goto @start

end

model.Load([email protected])

038B: load_requested_models

if not model.Available([email protected])

then

goto @start

end

wait 50

[email protected] = car.Create([email protected], [email protected], [email protected], [email protected])

end

end

Link to comment
Share on other sites

I know how to spawn a car by script with keypress, that's not what i need, i have to kindly tell you, this is not helpfull.

Link to comment
Share on other sites

  • 2 weeks later...
Junior_Djjr

i want to find a way for it to recognize mission cars and cars that have been used by the player

{$cleo}0000:const//CreatedBy enumRANDOM_VEHICLE     = 1MISSION_VEHICLE    = 2PARKED_VEHICLE     = 3PERMANENT_VEHICLE  = 4//OffsetsmCreatedBy = 0x4A4endwhile true    wait 0    0AB5: store_actor $player_actor closest_vehicle_to [email protected] closest_ped_to [email protected]    if 056E:   car [email protected] defined    then        0A97: [email protected] = car [email protected] struct        [email protected] += mCreatedBy        0A8D: [email protected] = read_memory [email protected] size 1 vp false        if [email protected] == RANDOM_VEHICLE        then 0ACD: show_text_highpriority "Closest car is RANDOM_VEHICLE"    time 100        end          if [email protected] == MISSION_VEHICLE        then 0ACD: show_text_highpriority "Closest car is MISSION_VEHICLE"   time 100        end             if [email protected] == PARKED_VEHICLE        then 0ACD: show_text_highpriority "Closest car is PARKED_VEHICLE"    time 100        end             if [email protected] == PERMANENT_VEHICLE        then 0ACD: show_text_highpriority "Closest car is PERMANENT_VEHICLE" time 100        end    endend
Edited by Junior_Djjr
Link to comment
Share on other sites

thalilmythos

Why not just go about it the way you're actually meant to and edit the IPLs?

I don't know where the ipl's for the car generators are and i have looked around without finding it, maybe i am dumber than i think, could you point me in the right direction?

Link to comment
Share on other sites

There is no reason to think you're dumb, intelligence is not the same as knowledge, of course if you've never done it before then you won't know how to do it.

 

They're stored inside streaming IPLs which can be found inside the img archive. They will be broken into smaller parts of the main ipl for example lae2_stream0.ipl you will need somethong to open these with, I personally recommend IPL helper.

Some might be stored in the scm such as those that are in the way of missions, given as rewards or just some random unique oddities such as Sweets Greenwood. These are easy to identify as they all have global vars. Both of these spawn methods will have sections dedicated to both alarm and lock percentage.

  • Like 1

F8i4bRU.png

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
 Share

  • 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.