Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Diegoti

Store a value to car? Example: Gasoline value

Recommended Posts

Diegoti

How can store a value to a vehicle? something to use like car gasoline or car race position or something,

 

Could some of those opcodes help?

0AEB: $car = car_struct $vehicle_struct handle
0A97: $CarStruct = car $MyCar struct

 

Example of what im looking for

Add 3 value to [email protected] or Set custom value 6 to [email protected] (something) like this
And then use them as 

IF player-driving

THEN

         [email protected] = player current car

         Get custom value of [email protected] and store as [email protected]

         IF [email protected] == 0

         THEN

                  turn off [email protected] engine

         END

END

 

--------

PS: You can check this Gasoline cleo if you want, in this script car have stored their current gasoline amount.

Spoiler
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

:NONAME_2
wait 0 
if and
   Player.Defined($PLAYER_CHAR)
  $ONMISSION == 0 
else_jump @NONAME_2 
if and
   Actor.Driving($PLAYER_ACTOR)
84A7:   not actor $PLAYER_ACTOR driving_boat 
84A9:   not actor $PLAYER_ACTOR driving_heli 
   not Actor.DrivingPlane($PLAYER_ACTOR)
84C8:   not actor $PLAYER_ACTOR driving_flying_vehicle 
89AE:   not actor $PLAYER_ACTOR driving_train 
else_jump @NONAME_2 
if and
   not Actor.DrivingVehicleType($PLAYER_ACTOR, #BMX)
   not Actor.DrivingVehicleType($PLAYER_ACTOR, #BIKE)
   not Actor.DrivingVehicleType($PLAYER_ACTOR, #MTBIKE)
   not Actor.DrivingVehicleType($PLAYER_ACTOR, #COMBINE)
   not Actor.DrivingVehicleType($PLAYER_ACTOR, #TRACTOR)
else_jump @NONAME_2 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 1944.852 -1769.554 13.0125 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 2209.816 2481.934 10.8203 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 604.8804 1705.273 6.541 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at -2414.49 982.081 45.2969 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at -2244.623 -2561.828 31.9219 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at -1327.512 2678.107 50.0625 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at -95.1488 -1174.303 1.9281 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at -1679.982 408.9051 7.2365 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 652.03 -571.34 16.34 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at -1605.897 -2714.252 48.5335 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at -1471.48 1864.31 32.64 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 1596.5 2199.1 10.83 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 2145.9 2748.16 10.83 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 2642.11 1106.53 10.83 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 2117.42 920.42 10.83 
0570: [email protected] = create_asset_radar_marker_with_icon 55 at 1381.68 456.26 19.91 
[email protected] = Actor.CurrentCar($PLAYER_ACTOR)
046C: [email protected] = car [email protected] driver 
if 
003B:   [email protected] == $PLAYER_ACTOR // (int) 
else_jump @NONAME_2 
0390: load_txd_dictionary "GASOLINE" 
038F: load_texture "SCALEF" as 1 // Load dictionary with 0390 first 
038F: load_texture "SCALEE" as 2 // Load dictionary with 0390 first 
038F: load_texture "ARROW" as 3 // Load dictionary with 0390 first 
038F: load_texture "LOCK" as 4 // Load dictionary with 0390 first 
wait 250 
gosub @NONAME_2130 
if 
88B7:   not test [email protected] bit 1 
else_jump @NONAME_626 
0099: [email protected] = random_int_in_ranges_0_to_32767 
08BD: set [email protected] bit 1 
0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect 0 
jump @NONAME_656 

:NONAME_626
0A97: [email protected] = car [email protected] struct 
0A8E: [email protected] = [email protected] + 5 // int 
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 

:NONAME_656
wait 0 
if 
  $ONMISSION == 0 
else_jump @NONAME_1928 
if 
   Actor.InCar($PLAYER_ACTOR, [email protected])
else_jump @NONAME_1826 
gosub @NONAME_2159 
if 
  [email protected] > 0 
else_jump @NONAME_2035 
02E3: [email protected] = car [email protected] speed 
if 
  [email protected] == 0.0 
else_jump @NONAME_758 
jump @NONAME_1826 

:NONAME_758
if and
  20.0 > [email protected] 
  [email protected] > 1.0 
else_jump @NONAME_796 
[email protected] -= 1 

:NONAME_796
if and
  [email protected] > 20.0 
  35.0 > [email protected] 
else_jump @NONAME_834 
[email protected] -= 2 

:NONAME_834
if and
  [email protected] > 35.0 
  50.0 > [email protected] 
else_jump @NONAME_872 
[email protected] -= 3 

:NONAME_872
if 
  [email protected] > 50.0 
else_jump @NONAME_900 
[email protected] -= 4 

:NONAME_900
if and
8100:   not actor $PLAYER_ACTOR in_sphere 1944.852 -1769.554 13.0125 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere 2209.816 2481.934 10.8203 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere 604.8804 1705.273 6.541 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere -2414.49 982.081 45.2969 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere -2244.623 -2561.828 31.9219 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere -1327.512 2678.107 50.0625 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere -95.1488 -1174.303 1.9281 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere -1679.982 408.9051 7.2365 radius 1.5 1.5 1.0 sphere 0 in_car 
else_jump @NONAME_1521 
if and
8100:   not actor $PLAYER_ACTOR in_sphere 652.03 -571.34 16.34 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere -1605.897 -2714.252 48.5335 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere -1471.48 1864.31 32.64 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere 1596.5 2199.1 10.83 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere 2145.9 2748.16 10.83 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere 2642.11 1106.53 10.83 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere 2117.42 920.42 10.83 radius 1.5 1.5 1.0 sphere 0 in_car 
8100:   not actor $PLAYER_ACTOR in_sphere 1381.68 456.26 19.91 radius 1.5 1.5 1.0 sphere 0 in_car 
else_jump @NONAME_1521 
jump @NONAME_1826 

:NONAME_1521
if 
  $ONMISSION == 0 
else_jump @NONAME_1928 
if 
  29000 > [email protected] 
else_jump @NONAME_1826 
if 
   Player.Money($PLAYER_CHAR) > 0
else_jump @NONAME_2107 
[email protected] = Player.Money($PLAYER_CHAR)
wait 150 
03BF: set_player $PLAYER_CHAR ignored_by_everyone 1 
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 0 
[email protected] = 0 
Car.LockInCurrentPosition([email protected]) = True
Player.CanMove($PLAYER_CHAR) = False

:NONAME_1624
wait 0 
[email protected] = Player.Money($PLAYER_CHAR)
0085: [email protected] = [email protected] // (int) 
0062: [email protected] -= [email protected] // (int) 
if 
   not 1 > [email protected] 
else_jump @NONAME_2084 
if 
  29700 >= [email protected] 
else_jump @NONAME_1775 
if 
  $ONMISSION == 0 
else_jump @NONAME_1928 
if 
   Actor.InCar($PLAYER_ACTOR, [email protected])
else_jump @NONAME_1928 
gosub @NONAME_2159 
[email protected] += 300 
097A: play_audio_at 0.0 0.0 0.0 event 1133 
[email protected] += 1 
jump @NONAME_1624 

:NONAME_1775
[email protected] *= -1 
Player.Money($PLAYER_CHAR) += [email protected]
036A: put_actor $PLAYER_ACTOR in_car [email protected] 
Car.LockInCurrentPosition([email protected]) = False
Player.CanMove($PLAYER_CHAR) = True
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 1 
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0 

:NONAME_1826
if or
   Actor.Dead($PLAYER_ACTOR)
   Car.Wrecked([email protected])
else_jump @NONAME_1861 
08C3: clear [email protected] bit 1 
jump @NONAME_1936 

:NONAME_1861
0A97: [email protected] = car [email protected] struct 
0A8E: [email protected] = [email protected] + 5 // int 
0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0 
if 
  $ONMISSION == 0 
else_jump @NONAME_1928 
if 
   not Actor.InCar($PLAYER_ACTOR, [email protected])
else_jump @NONAME_656 

:NONAME_1928
wait 0 
03F0: enable_text_draw 0 

:NONAME_1936
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
Marker.Disable([email protected])
08C3: clear [email protected] bit 1 
wait 1250 
jump @NONAME_2 

:NONAME_2035
[email protected] = 0 
if 
047A:   actor $PLAYER_ACTOR driving_bike 
else_jump @NONAME_2070 
02D4: car [email protected] turn_off_engine 
jump @NONAME_900 

:NONAME_2070
081D: set_car [email protected] engine_broken 1 
jump @NONAME_900 

:NONAME_2084
00BC: show_text_highpriority GXT 'GA_3' time 3000 flag 1 
jump @NONAME_1775 

:NONAME_2107
00BC: show_text_highpriority GXT 'NOMONEY' time 3000 flag 1 
jump @NONAME_1826 

:NONAME_2130
0A97: [email protected] = car [email protected] struct 
[email protected] += 4 
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0 
return 

:NONAME_2159
if 
  [email protected] > 5000 
else_jump @NONAME_2225 
03F0: enable_text_draw 1 
038D: draw_texture 1 position 220.0 425.3 size 128.0 64.0 RGBA 255 255 255 255 
jump @NONAME_2284 

:NONAME_2225
if 
  5000 > [email protected] 
else_jump @NONAME_2284 
03F0: enable_text_draw 1 
038D: draw_texture 2 position 220.0 425.3 size 128.0 64.0 RGBA 255 255 255 255 

:NONAME_2284
[email protected] = 66.0 
[email protected] = 166.0 
[email protected] = 33000 
0062: [email protected] -= [email protected] // (int) 
0093: [email protected] = integer [email protected] to_float 
[email protected] /= 500.0 
0063: [email protected] -= [email protected] // (float) 
005B: [email protected] += [email protected] // (float) 
03F0: enable_text_draw 1 
038D: draw_texture 3 position [email protected] 434.3 size 24.0 24.0 RGBA 255 255 255 255 
09B3: get_car [email protected] door_status [email protected] 
if 
   not [email protected] == 1 
else_jump @NONAME_2460 
03F0: enable_text_draw 1 
038D: draw_texture 4 position 200.0 418.3 size 24.0 24.0 RGBA 255 255 255 255 

:NONAME_2460
return 

 

 

PLEASE HELP

Share this post


Link to post
Share on other sites
ZAZ
On 10/27/2018 at 3:53 AM, Diegoti said:

PS: You can check this Gasoline cleo if you want, in this script car have stored their current gasoline amount.

There isn't an amount of gasoline in GTASA, but it's the amount of nitro!

 

get custom value (amount of nitro)

0A97: 22@ = car 8@ struct
000A: 22@ += 5
0A8D: 10@ = read_memory 22@ size 4 virtual_protect 0

 

set custom value (amount of nitro)

0A97: 22@ = car 8@ struct
000A: 22@ += 5
0A8C: write_memory 22@ size 4 value 10@ virtual_protect 0

 

Share this post


Link to post
Share on other sites
Diegoti

Im not meaning especifically to Gasoline xd.

 

Anyways, how can i do something like this.

 

IF player driving

THEN

          [email protected] current car

          get "custom-value" of [email protected] and store [email protected]

          IF [email protected] > 0

          THEN

                    [email protected] += -1

                    IF [email protected] == 0

                    THEN

                              [email protected] disable engine

                    END

          END

END

 

 

But each vehicle has its own [email protected] value

Share this post


Link to post
Share on other sites
ZAZ
5 hours ago, Diegoti said:

But each vehicle has its own [email protected] value

Which each vehicle? 

In which way do you wanna define the car handle? 

Share this post


Link to post
Share on other sites
Diegoti
3 hours ago, ZAZ said:

Which each vehicle? 

In which way do you wanna define the car handle? 

Whatever, im currently using vehicles Tertiary and Quaternary colors as custom values.

 

JUST AN EXAMPLE 

IF player driving
THEN
	[email protected] current car
	get car [email protected] tertiary color to [email protected] and quaternary color to [email protected]
	IF not [email protected] > 200 //tertiary color by default is 0
	THEN
		gosub @ASD
	END
END

:ASD
[email protected] += 1
set car [email protected] tertiary color to [email protected] and quaternary color to 0

get car [email protected] tertiary color to [email protected] and quaternary color to [email protected]

IF [email protected] > 200
THEN          
	[email protected] disable engine
END
wait 1000
return

 

Share this post


Link to post
Share on other sites
ZAZ

then there's only this one car

A car that was used by player will be removed from game as soon as player enter another car and isn't visible on screen

unless it was spawn by script by opcode 00A5:

That's not logic but it's a fact

Edited by ZAZ

Share this post


Link to post
Share on other sites
Diegoti

Well, lets do this, how can u make a Gasoline mod?

 

Mod which gives a random value to every car drive at firsts time to set its fuel value, and if change your car the last one will keep its fuel amount as you leave it.

 

Or pls explain me how that mod i posted do that.

 

 

Share this post


Link to post
Share on other sites
ZAZ
2 hours ago, Diegoti said:

Well, lets do this, how can u make a Gasoline mod?

You request a Gasoline mod?

 

 

2 hours ago, Diegoti said:

Mod which gives a random value to every car drive at firsts time to set its fuel value, and if change your car the last one will keep its fuel amount as you leave it.

you can do it only for the current player car

 

just use a variable to hold a value

 

if player enters a new car, then restore or give a new value

 

decrease value if player press acceleration or revers key

 

increase value if player is in car at gasstation

 

if value is smaller than zero, then stop car

 

keep car handle in loop if player is on foot but near car (not far away)

 

{$CLEO .cs}
thread 'GASOIL'

const  
_FUEL_AMOUNT_ = 2@
end

while true
    wait 0
    if
        0256:   player $PLAYER_CHAR defined
    then
        if
            00DF:   actor $PLAYER_ACTOR driving
        then
            03C0: 1@ = actor $PLAYER_ACTOR car
            0209: _FUEL_AMOUNT_ = random_int_in_ranges 50 1000
            0186: 3@ = create_marker_above_car 1@
            07E0: set_marker 3@ type_to 0
            00BA: show_text_styled GXT 'fem_on' time 1000 style 4

            while 0256:   player $PLAYER_CHAR defined
                wait 0
                03F0: enable_text_draw 1 
                045A: draw_text_1number 50.0  300.0 GXT 'NUMBER' number _FUEL_AMOUNT_
                if and
                    00DF:   actor $PLAYER_ACTOR driving
                    8119:  not car 1@ wrecked
                then
                    if
                        00DB:   actor $PLAYER_ACTOR in_car 1@
                    then                                        
                        if
                            _FUEL_AMOUNT_ > 0
                        then
                            if or
                                00E1:   player 0 pressed_key 16
                                00E1:   player 0 pressed_key 14
                            then
                                _FUEL_AMOUNT_ -= 1                            
                            end
                        else
                            0ABF: set_vehicle 1@ engine_state_to 0
                            04BA: set_car 1@ speed_to 0.0
                        end
                        //--------------//    -----  player is in car at gasstation
                        if  or
                            // gas station at grovestreet at 2486.97 -1670.24
                            00F1:   actor $PLAYER_ACTOR sphere 1 near_point 2486.97 -1670.24 radius 10.0 10.0 stopped_in_car  
                            // gas station at Green Bottles Bar at 2301.16 -1639.29
                            00F1:   actor $PLAYER_ACTOR sphere 1 near_point 2301.16 -1639.29 radius 10.0 10.0 stopped_in_car                            
                        then
                            _FUEL_AMOUNT_ += 10
                        end
                       
                    else
                        break // terminate and restart script, because player is in a new car   
                    end                    
                else
                    // ---------  player is not in car or car is wrecked
                    if
                        8119:  not car 1@ wrecked
                    then
                        if
                            8205: not  actor $PLAYER_ACTOR near_car 1@ radius 50.0 50.0 50.0 flag 0
                        then
                            break // terminate and restart script, because the car is out of range
                        end                    
                    else
                        break // terminate and restart script, because the car is wrecked
                    end
                end                
            end
            
            00BA: show_text_styled GXT 'fem_off' time 1000 style 4
            0164: disable_marker 3@
            
        end
    end
end

 

Share this post


Link to post
Share on other sites
Diegoti

Well, the language barrier won me here, ill never be capable to explain this.

Share this post


Link to post
Share on other sites
Strs

go for mass all cars have different and some are same but you can dig out 

 

Example 

 

{$CLEO .cs}
02A7: $Gas = create_icon_marker_and_sphere 51 at 2473.570068 -1700.703247 13.521050

 

:gasolin2
0001: wait 0 ms 
00D6: if 
00DF: actor $PLAYER_ACTOR driving 
004D: jump_if_false @gasolin2
03C0: [email protected] = actor $PLAYER_ACTOR car 
0A12: get_car [email protected] tertiary_color_to [email protected] quaternary_color_to [email protected] //this value dont exist thats why i use here so no messing with other car
00D6: if or
8039: [email protected] == 220
8039: [email protected] == 220
004D: jump_if_false @stop 
0A97: [email protected] = car [email protected] struct 
000A: [email protected] += 140 
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 
0017: [email protected] /= 10.0 // here you devide mass to what ever value you like i make devide by 10x 

 

:reduce
0001: wait 0 ms 
00D6: if
0ABE: vehicle [email protected] engine_on
004D: jump_if_false @refuel
0AD1: show_formatted_text_highpriority "Fuel used %g" time 2000 [email protected]
000F: [email protected] -= 0.05 // here 0.05 slower reduce gas value and 1.0 speed reduce gas value  
0023: 0.0 > [email protected]
004D: jump_if_false @reduce
0A11: set_car [email protected] tertiary_color_to 220 quaternary_color_to 220

 

:stop
0001: wait 0 ms 
00D6: if
056E: car [email protected] defined
004D: jump_if_false @gasolin2
0A12: get_car [email protected] tertiary_color_to [email protected] quaternary_color_to [email protected] //this value dont exist thats why i use here so no messing with other car
00D6: if and
0039: [email protected] == 220
0039: [email protected] == 220
004D: jump_if_false @gasolin2
00D6: if
0ABE: vehicle [email protected] engine_on
004D: jump_if_false @refuel
02D4: car [email protected] turn_off_engine
0002: jump @stop 

 

// here to refuel gas value

 

:refuel
0001: wait 0 ms 
00D6: if
00EE: actor $PLAYER_ACTOR sphere 0 near_point 2473.570068 -1700.703247 radius 4.0 4.0 in_car // near ryder house where his car park go there
004D: jump_if_false @gasolin2
00D6: if
056E: car [email protected] defined
004D: jump_if_false @gasolin2
0A12: get_car [email protected] tertiary_color_to [email protected] quaternary_color_to [email protected] //this value dont exist thats why i use here so no messing with other car same as above
00D6: if and
0039: [email protected] == 220
0039: [email protected] == 220
004D: jump_if_false @gasolin2
0AD1: show_formatted_text_highpriority "ReFueling %g" time 2000 [email protected]
000B: [email protected] += 0.2 // here 0.2 slower value and 1.0 speed reduce value  
0021: [email protected] > 100.0 // use what value you want to start car 
004D: jump_if_false @refuel
0A11: set_car [email protected] tertiary_color_to 1 quaternary_color_to 1
0002: jump @gasolin2

 

other things you try it just a example 

 

if you want in memory struct i can do that but this will be simple as f********* :) 


 

 

Share this post


Link to post
Share on other sites
Diegoti

Hi n thanks, im currently using Tert n Quaternary colors in other mod, I also have a Gasoline mod that works 4 me so I'm not looking 4 a new one :(

 

I'm just looking 4 a way to set custom values (as u did) but without using tertiary n quaternary color (cuz I'm already using it on a different mod)

Pls help :)

Share this post


Link to post
Share on other sites
Strs

you mean you want to inject some info to your car that should be unique ID so you can use it 

 

Share this post


Link to post
Share on other sites
ZAZ

Yes, something like that.
Example:
The extern script 'BARSTAF' controls the barkeeper and search for a random ped to let him order a drink
For this the extern script 'BARGUY' will be assigned

script 'BARSTAF' controls barkeeper
script 'BARGUY'  controls  BARGUY > random ped to order a drink


The health value of the BARGUY random ped will be controlled to let them do the animation at same time


0223: set_actor 8@ health_to 99
0605: actor 0@ perform_animation "BARSERVE_GIVE" IFP "BAR" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time 3000


/////////////////////////////



0226: 10@ = actor 0@ health
00D6: if
0039:   10@ == 99
004D: jump_if_false @BARGUY_747
0605: actor 0@ perform_animation "BARCUSTOM_GET" IFP "BAR" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time 0

 

 

 

 

Opcode 091C: creates actor handle_as [email protected] and assignes external_script "BARGUY"

091C: get_actor_in_sphere 14@ 15@ 16@ radius 6@ model #NULL external_script_named "BARGUY" handle_as 8@

 

 

 

//-------------External script 38 (BAR_STAFF)---------------

:BARSTAF
03A4: name_thread 'BARSTAF'

:BARSTAF_974
00A0: store_actor 0@ position_to 14@ 15@ 16@ 
091C: get_actor_in_sphere 14@ 15@ 16@ radius 6@ model #NULL external_script_named "BARGUY" handle_as 8@ 
00D6: if 
0019:   8@ > -1 
004D: jump_if_false @BARSTAF_1130 
0226: 13@ = actor 8@ health 
00D6: if 
0039:   13@ == 99 
004D: jump_if_false @BARSTAF_1073 
0006: 8@ = -1 
0002: jump @BARSTAF_1130


///////////////////////////////////////


:BARSTAF_1985
062E: get_actor 0@ task 1593 status_store_to 13@ // ret 7 if not found 
00D6: if 
04A4:   13@ == 7 // == constant 
004D: jump_if_false @BARSTAF_2076
0223: set_actor 8@ health_to 99 
0605: actor 0@ perform_animation "BARSERVE_GIVE" IFP "BAR" framedelta 4.0 loop 1 lockX 0 lockY 0 lockF 0 time 3000 

 

 


actor handle [email protected] will be assigned   as actor handle [email protected]  of Thread  'BARGUY'

 

 

//-------------External script 48 (BARGUY)---------------

:BARGUY
03A4: name_thread 'BARGUY'


:BARGUY_674
0226: 10@ = actor 0@ health
00D6: if
0039:   10@ == 99
004D: jump_if_false @BARGUY_747
0605: actor 0@ perform_animation "BARCUSTOM_GET" IFP "BAR" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time 0

 

 

 

 

 

Edited by ZAZ

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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