Coding

 Reply to this postStart new topic

[Q]Vehicle Components

LINK/2012
post Sep 7 2011, 12:14 AM
Post #1


I will kill you

Posts: 126
Joined: 13-May 11



Hi bunny.gif

How to add 10x nitro, 5x nitro, 2x nitro to a vehicle? I only see a "add single nitro"
And get the equipped nitro?

Stereo... how to add and check if stereo is equipped?

In topic:
http://gtagmodding.com/forums/index.php?showtopic=382

I see the Comps A and B, so, these in Others are A or B Comps?
Go to the top of the page
 
+Quote Post
Deji
post Sep 7 2011, 01:17 AM
Post #2


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Car upgrades are completely different from car components. Of course, due to the way the opcodes were named in the sascm.ini, it's kinda hard to tell the difference at first.

Here's a script that gets which type of nitrous is installed and whether the bass upgrade is installed:
SANNY
{$CLEO}
0000:

while true
    wait 0
    0256:   player 0 defined
    jf continue
    if
        00DF:   actor $PLAYER_ACTOR driving
    then
        03C0: 0@ = actor $PLAYER_ACTOR car
        096D: get_car 0@ component_on_slot 10 model_to 1@   // 10 == UPGRADE_STEREO
        if 1@ == #STEREO  // you could also just check if it is not -1 - this way is more specific
        then 2@v = "Yes"
        else 2@v = "No"
        end
        096D: get_car 0@ component_on_slot 8 model_to 1@    // 8 == UPGRADE_NITRO
        if
            1@ == #NTO_B_S
        then
            3@v = "2x"
        else
            if
                1@ == #NTO_B_L
            then
                3@v = "5x"
            else
                if
                    1@ == #NTO_B_TW
                then
                    3@v = "10x"
                else
                    3@v = "None"
                end
            end
        end
        0AD1: show_formatted_text_highpriority "Bass Upgrade Installed: %s~n~Nitro: %s" time 1 2@v 3@v
    end
end


Result...


--------------------
Go to the top of the page
 
+Quote Post
LINK/2012
post Sep 7 2011, 03:22 AM
Post #3


I will kill you

Posts: 126
Joined: 13-May 11



Great Deji, Very Thanks.

QUOTE
Car upgrades are completely different from car components

Maybe, I was without ideas to topic name.

QUOTE
096D: get_car 0@ component_on_slot 10 model_to 1@

Where I found these slots?

QUOTE
In topic:
http://gtagmodding.com/forums/index.php?showtopic=382

I see the Comps A and B, so, these in Others are A or B Comps?
Go to the top of the page
 
+Quote Post
Deji
post Sep 7 2011, 03:54 PM
Post #4


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



As I said, upgrades are different from components... And
SANNY
096D: get_car 0@ component_on_slot 10 model_to 1@


Would more appropriately be
SANNY
096D: get_car 0@ upgrade 10 model_to 1@


My constants for Vigilante Justice...
CODE
UPGRADE_HOOD                    = 0
UPGRADE_VENT                    = 1
UPGRADE_SPOIL                   = 2
UPGRADE_SIDESKIRT               = 3
UPGRADE_BULLFRNT                = 4
UPGRADE_BULLREAR                = 5
UPGRADE_LIGHTS                  = 6
UPGRADE_ROOF                    = 7
UPGRADE_NITRO                   = 8
UPGRADE_HYDRAULICS              = 9
UPGRADE_STEREO                  = 10
UPGRADE_WHEELS                  = 12
UPGRADE_EXHAUST                 = 13
UPGRADE_BUMPFRNT                = 14
UPGRADE_BUMPREAR                = 15
UPGRADE_MISC                    = 16


--------------------
Go to the top of the page
 
+Quote Post
LINK/2012
post Sep 7 2011, 05:17 PM
Post #5


I will kill you

Posts: 126
Joined: 13-May 11



Thanks Again, Solved my doubt. wub.gif
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: