[SNIPPET] GET/SET Vehicle Handling Values

So you wanna edit a vehicle's handling value? Like make a car go faster?
With these two snippets you can do it!


0AB1: @GET_HANDLING 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 _TO: 0@
Code:
//0AB1: @GET_HANDLING 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 _TO: 0@
:GET_HANDLING
0@ *= 4
0@ += 0xA9B0C8
0A8D: 0@ 0@ 4 0
0@ += 0x4A
0A8D: 0@ 0@ 2 0
0@ *= 0xE0
0@ += 0xC2B9DC
005A: 0@ 1@
0A8D: 3@ 0@ 2@ 0
0AB2: 1 3@

0AB1: @SET_HANDLING 4 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 INTO: -1.0
Code:
//0AB1: @SET_HANDLING 4 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 INTO: -1.0
:SET_HANDLING
0@ *= 4
0@ += 0xA9B0C8
0A8D: 0@ 0@ 4 0
0@ += 0x4A
0A8D: 0@ 0@ 2 0
0@ *= 0xE0
0@ += 0xC2B9DC
005A: 0@ 1@
0A8C: 0@ 2@ 3@ 0
0AB2: 0

Here is a list of all the offsets:

Code:
//-------------------------------
//List of Handling Offsets:
{
0x0  = [dword] Index/Identifier
0x4  = fMass
0x8  = 1.0 / fMass
0xC  = fTurnMass
0x10 = fDragMult
0x14 = CentreOfMass.x
0x18 = CentreOfMass.y
0x1C = CentreOfMass.z
0x20 = [byte] nPercentSubmerged
0x24 = fMass * 8.0000001E-1 / nPercentSubmerged
0x28 = fTractionMultiplier
0x74 = [byte] TransmissionData.nDriveType
0x75 = [byte] TransmissionData.nEngineType
0x76 = [byte] TransmissionData.nNumberOfGears
0x7C = TransmissionData.fEngineAcceleration (Multiplied by 3.9999999E-4)
0x80 = TransmissionData.fEngineInertia
0x84 = TransmissionData.fMaxVelocity (Multiplied by 5.5555599E-3)
0x94 = fBrakeDeceleration (Multiplied by 3.9999999E-4)
0x98 = fBrakeBias
0x9C = [byte] bABS
0xA0 = fSteeringLock
0xA4 = fTractionLoss
0xA8 = fTractionBias
0xAC = fSuspensionForceLevel
0xB0 = fSuspensionDampingLevel
0xB4 = fSuspensionHighSpdComDamp
0xB8 = Suspension upper limit
0xBC = Suspension lower limit
0xC0 = Suspension bias between front and rear
0xC4 = Suspension anti-dive multiplier
0xC8 = fCollisionDamageMultiplier (multiplier not yet found)
0xCC = [hex] modelFlags
0xD0 = [hex] handlingFlags
0xD4 = fSeatOffsetDistance
0xD8 = [dword] nMonetaryValue
0xDC = [byte] Front lights
0xDD = [byte] Rear lights
0xDE = [byte] Vehicle anim group 
}

Example:
- Making the SULTAN take no damage when colliding with somehting:
Code:
{$CLEO .cs}
0000:
0AB1: @SET_HANDLING 4 FROM_VEHICLE_MODEL #SULTAN OFFSET 0xC8 SIZE 4 INTO: 0.0 //fCollisionDamageMultiplier
004E: END_THIS_THREAD
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Re: GET/SET Vehicle Handling Values

0x88 = fMaxSpeed * 60.0 = carMaxSpeed

carMaxSpeed * 3.6 = carMaxSpeedKMH
 

Adeel

Active member
Joined
Jul 24, 2014
Messages
80
Reaction score
0
Re: GET/SET Vehicle Handling Values

Can you make CLEO of this code please i am noob at this  :yesyes:
RESPECT A LOT  :yesyes:
 

Adeel

Active member
Joined
Jul 24, 2014
Messages
80
Reaction score
0
Re: GET/SET Vehicle Handling Values

I beg you  :angry:  :yesyes:
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,126
Solutions
1
Reaction score
158
Re: GET/SET Vehicle Handling Values

You could check this out, I'm not sure if this will work because I was playing with it some time ago (i was using 0.3z r1 and sampfuncs)
Code:
{$CLEO}
0000: NOP
//0x28 = fTractionMultiplier
//0xA0 = fSteeringLock
//0xA4 = fTractionLoss
//0x1C = CentreOfMass.z
:first
wait 0
if
0ADC:   test_cheat "uu"
then
0811: 1@ = actor $PLAYER_ACTOR used_car
0441: 2@ = car 1@ model
0AB1: @GET_carSpec 3 FROM_VEHICLE_MODEL 2@ OFFSET 0x1C SIZE 4 _TO: 0@
0AB1: @GET_carSpec 3 FROM_VEHICLE_MODEL 2@ OFFSET 0xA4 SIZE 4 _TO: 3@
0AF8: samp add_message_to_chat "%f" color -1 0@
end

if
0ADC:   test_cheat "ii"
then
//0013: 0@ *= 0.0
0@ -= 0.1
3@ += 0.1
0AB1: @SET_carSpec 4 FROM_VEHICLE_MODEL 2@ OFFSET 0x1C SIZE 4 INTO: 0@
0AB1: @SET_carSpec 4 FROM_VEHICLE_MODEL 2@ OFFSET 0xA4 SIZE 4 _TO: 3@
0AF8: samp add_message_to_chat "%f done" color -1 0@
end  
jump @first


//0AB1: @GET_carSpec 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 _TO: 0@
:GET_carSpec
0@ *= 4
0@ += 0xA9B0C8
0A8D: 0@ 0@ 4 0
0@ += 0x4A
0A8D: 0@ 0@ 2 0
0@ *= 0xE0
0@ += 0xC2B9DC
005A: 0@ 1@
0A8D: 3@ 0@ 2@ 0
0AB2: 1 3@


//0AB1: @SET_carSpec 4 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 INTO: -1.0
:SET_carSpec
0@ *= 4
0@ += 0xA9B0C8
0A8D: 0@ 0@ 4 0
0@ += 0x4A
0A8D: 0@ 0@ 2 0
0@ *= 0xE0
0@ += 0xC2B9DC
005A: 0@ 1@
0A8C: 0@ 2@ 3@ 0
0AB2: 0

//-------------------------------
//List of Handling Offsets:
{
0x0  = [dword] Index/Identifier
0x4  = fMass
0x8  = 1.0 / fMass
0xC  = fTurnMass
0x10 = fDragMult
0x14 = CentreOfMass.x
0x18 = CentreOfMass.y
0x1C = CentreOfMass.z
0x20 = [byte] nPercentSubmerged
0x24 = fMass * 8.0000001E-1 / nPercentSubmerged
0x28 = fTractionMultiplier
0x74 = [byte] TransmissionData.nDriveType
0x75 = [byte] TransmissionData.nEngineType
0x76 = [byte] TransmissionData.nNumberOfGears
0x7C = TransmissionData.fEngineAcceleration (Multiplied by 3.9999999E-4)
0x80 = TransmissionData.fEngineInertia
0x84 = TransmissionData.fMaxVelocity (Multiplied by 5.5555599E-3)
0x94 = fBrakeDeceleration (Multiplied by 3.9999999E-4)
0x98 = fBrakeBias
0x9C = [byte] bABS
0xA0 = fSteeringLock
0xA4 = fTractionLoss
0xA8 = fTractionBias
0xAC = fSuspensionForceLevel
0xB0 = fSuspensionDampingLevel
0xB4 = fSuspensionHighSpdComDamp
0xB8 = Suspension upper limit
0xBC = Suspension lower limit
0xC0 = Suspension bias between front and rear
0xC4 = Suspension anti-dive multiplier
0xC8 = fCollisionDamageMultiplier (multiplier not yet found)
0xCC = [hex] modelFlags
0xD0 = [hex] handlingFlags
0xD4 = fSeatOffsetDistance
0xD8 = [dword] nMonetaryValue
0xDC = [byte] Front lights
0xDD = [byte] Rear lights
0xDE = [byte] Vehicle anim group 
}
 

Adeel

Active member
Joined
Jul 24, 2014
Messages
80
Reaction score
0
Re: GET/SET Vehicle Handling Values

monday link said:
You could check this out, I'm not sure if this will work because I was playing with it some time ago (i was using 0.3z r1 and sampfuncs)
Code:
{$CLEO}
0000: NOP
//0x28 = fTractionMultiplier
//0xA0 = fSteeringLock
//0xA4 = fTractionLoss
//0x1C = CentreOfMass.z
:first
wait 0
if
0ADC:   test_cheat "uu"
then
0811: 1@ = actor $PLAYER_ACTOR used_car
0441: 2@ = car 1@ model
0AB1: @GET_carSpec 3 FROM_VEHICLE_MODEL 2@ OFFSET 0x1C SIZE 4 _TO: 0@
0AB1: @GET_carSpec 3 FROM_VEHICLE_MODEL 2@ OFFSET 0xA4 SIZE 4 _TO: 3@
0AF8: samp add_message_to_chat "%f" color -1 0@
end

if
0ADC:   test_cheat "ii"
then
//0013: 0@ *= 0.0
0@ -= 0.1
3@ += 0.1
0AB1: @SET_carSpec 4 FROM_VEHICLE_MODEL 2@ OFFSET 0x1C SIZE 4 INTO: 0@
0AB1: @SET_carSpec 4 FROM_VEHICLE_MODEL 2@ OFFSET 0xA4 SIZE 4 _TO: 3@
0AF8: samp add_message_to_chat "%f done" color -1 0@
end  
jump @first


//0AB1: @GET_carSpec 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 _TO: 0@
:GET_carSpec
0@ *= 4
0@ += 0xA9B0C8
0A8D: 0@ 0@ 4 0
0@ += 0x4A
0A8D: 0@ 0@ 2 0
0@ *= 0xE0
0@ += 0xC2B9DC
005A: 0@ 1@
0A8D: 3@ 0@ 2@ 0
0AB2: 1 3@


//0AB1: @SET_carSpec 4 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 INTO: -1.0
:SET_carSpec
0@ *= 4
0@ += 0xA9B0C8
0A8D: 0@ 0@ 4 0
0@ += 0x4A
0A8D: 0@ 0@ 2 0
0@ *= 0xE0
0@ += 0xC2B9DC
005A: 0@ 1@
0A8C: 0@ 2@ 3@ 0
0AB2: 0

//-------------------------------
//List of Handling Offsets:
{
0x0  = [dword] Index/Identifier
0x4  = fMass
0x8  = 1.0 / fMass
0xC  = fTurnMass
0x10 = fDragMult
0x14 = CentreOfMass.x
0x18 = CentreOfMass.y
0x1C = CentreOfMass.z
0x20 = [byte] nPercentSubmerged
0x24 = fMass * 8.0000001E-1 / nPercentSubmerged
0x28 = fTractionMultiplier
0x74 = [byte] TransmissionData.nDriveType
0x75 = [byte] TransmissionData.nEngineType
0x76 = [byte] TransmissionData.nNumberOfGears
0x7C = TransmissionData.fEngineAcceleration (Multiplied by 3.9999999E-4)
0x80 = TransmissionData.fEngineInertia
0x84 = TransmissionData.fMaxVelocity (Multiplied by 5.5555599E-3)
0x94 = fBrakeDeceleration (Multiplied by 3.9999999E-4)
0x98 = fBrakeBias
0x9C = [byte] bABS
0xA0 = fSteeringLock
0xA4 = fTractionLoss
0xA8 = fTractionBias
0xAC = fSuspensionForceLevel
0xB0 = fSuspensionDampingLevel
0xB4 = fSuspensionHighSpdComDamp
0xB8 = Suspension upper limit
0xBC = Suspension lower limit
0xC0 = Suspension bias between front and rear
0xC4 = Suspension anti-dive multiplier
0xC8 = fCollisionDamageMultiplier (multiplier not yet found)
0xCC = [hex] modelFlags
0xD0 = [hex] handlingFlags
0xD4 = fSeatOffsetDistance
0xD8 = [dword] nMonetaryValue
0xDC = [byte] Front lights
0xDD = [byte] Rear lights
0xDE = [byte] Vehicle anim group 
}
Thanks It's really work  :looky: :yesyes:
Respect Alot  :yesyes:
 

Adeel

Active member
Joined
Jul 24, 2014
Messages
80
Reaction score
0
Re: GET/SET Vehicle Handling Values

Which Error Is This ?
Maybe it doesn't work ?
 

Attachments

  • sa-mp-003.png
    sa-mp-003.png
    525.3 KB · Views: 157

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
Is the "GET" handling from the handling.cfg in our gta folder or the one in the samp.dll?
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
zin said:
Is the "GET" handling from the handling.cfg in our gta folder or the one in the samp.dll?

It GETs the currently loaded handling.cfg in memory, so the one from samp.saa.
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
Is there anyway I can edit the handling in samp.saa I know there is that custom saa2 mod but I want to just open it and edit the files is that possible?
 
Top