Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- GTA SA Check Car Immunities
- }
- const
- ANY_CAR = 0@
- BULLETP = 1@
- FIREP = 2@
- EXPLOSIONP = 3@
- CRASHP = 4@
- end
- 0AB1: call_scm_func @getCarImmunities 1 car_handle: ANY_CAR store_to: BULLETP FIREP EXPLOSIONP CRASHP
- :getCarImmunities
- 0A97: 10@ = car 0@ struct
- 000A: 10@ += 66
- 0A8D: 11@ = read_memory 10@ size 1 virtual_protect 0
- if
- 11@ >= 128
- then
- 23@ = 1 // Explosionproof = True
- 11@ -= 128
- else
- 23@ = 0 // Explosionproof = False
- end
- if
- 11@ >= 16
- then
- 24@ = 1 // Crashproof = True
- 11@ -= 16
- else
- 24@ = 0 // Crashproof = False
- end
- if
- 11@ >= 8
- then
- 22@ = 1 // Fireproof = True
- 11@ -= 8
- else
- 22@ = 0 // Fireproof = False
- end
- if
- 11@ == 4
- then
- 21@ = 1 // Bulletproof = True
- else
- 21@ = 0 // Bulletproof = False
- end
- 0AB2: ret 4 21@ 22@ 23@ 24@
- {
- Display Car name by scm function.
- }
- 0AB1: call_scm_func @CarNameByID 1 #landstal 0@
- :CarNameByID
- 0@ *= 4
- 0@ += 0xA9B0C8
- 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
- 0@ += 0x32
- 0AA8: call_function_method 0x6A0050 struct 0xC1B340 num_params 1 pop 0 0@ 0@
- 0AB2: ret 1 0@
- {
- Change Color race checkpoint
- }
- 0AB1: call_scm_func @RacingCheckpointColour 4 set_racing_checkpoint 0@ colour_red_to 255 green 255 blue 255
- :RacingCheckpointColour
- {
- 0AB1: call_scm_func @RacingCheckpointColour 4 set_racing_checkpoint 0@ colour_red_to 255 green 255 blue 255
- Desc
- Sets racing checkpoint colour.
- Params
- 0@ - Checkpoint handle
- 1@ - Checkpoint red channel
- 2@ - Checkpoint green channel
- 3@ - Checkpoint blue channel
- Returned
- None.
- }
- for 4@ = 0xC7F15C to 0xC7F824 step 0x38
- 0A8D: 5@ = read_memory 4@ size 4 virtual_protect 0
- if
- 003B: 0@ == 5@
- then
- 000A: 4@ += 4
- 0A8C: write_memory 4@ size 1 value 1@ virtual_protect 0
- 000A: 4@ += 1
- 0A8C: write_memory 4@ size 1 value 2@ virtual_protect 0
- 000A: 4@ += 1
- 0A8C: write_memory 4@ size 1 value 3@ virtual_protect 0
- break
- end
- end
- 0AB2: ret 0
- {
- Get Player MAX breath
- }
- AB1: call_scm_func @getPlayerMaxBreath 0 store_to 1@
- :getPlayerMaxBreath
- {
- Parameters:
- Passed:
- none
- Result:
- 0@ - max lung capacity
- Example:
- 0AB1: call_scm_func @getPlayerMaxBreath 0 store_to 1@
- }
- 0653: 0@ = float_stat 225 // lung capacity stat
- 0653: 1@ = float_stat 22 // stamina stat
- 005B: 0@ += 1@
- 0@ *= 1.5
- 0@ += 1000.0
- if
- 0@ < 1150.0
- then
- 0@ = 1150.0
- end
- 0AB2: ret 1 0@
- {
- Subtract Money function
- }
- if 0AB1: call_scm_func @Money_subtract 1 money_to_subtract 4000
- then
- /// money have been subtracted
- end
- :Money_subtract
- {
- Type: IF and SET
- Parameters:
- Passed:
- 0@ - money to subtract
- Result:
- True or false. True when money have been subtracted
- Example:
- if 0AB1: call_scm_func @Money_subtract 1 money_to_subtract 4000
- }
- 010B: 1@ = player $PLAYER_CHAR money
- if
- 002D: 1@ >= 0@ // (int)
- then
- 0@ *= -1
- Player.Money($PLAYER_CHAR) += 0@
- 0485: return_true
- 0AB2: ret 0
- else
- 059A: return_false
- 0AB2: ret 0
- end
- {
- Player rotate where aiming, without weapon.
- }
- if
- 00E1: player 0 pressed_key 6 // aim weapon
- then
- 068E: get_camera_target_point_to 0@ 1@ 2@
- 068D: get_camera_position_to 2@ 3@ 4@
- var
- 0@: float
- 1@: float
- 2@: float
- 3@: float
- end
- dec(0@, 2@)
- dec(1@, 3@)
- 0604: get_Z_angle_for_point 0@ 1@ store_to 2@
- 0173: set_actor $PLAYER_ACTOR Z_angle_to 2@
- end
- {
- Save objects in Memory Pool // CLEO 4
- }
- for 0@ = 0 to 9
- 0093: 1@ = integer 0@ to_float
- 04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 1@ 0.0
- 0107: 2@ = create_object #KNIFECUR at 5@ 6@ 7@
- 0AC6: 30@ = label @pool offset
- 0085: 4@ = 0@ // (int)
- 0012: 4@ *= 4
- 005A: 30@ += 4@ // (int)
- 0A8C: write_memory 30@ size 4 value 2@ virtual_protect 0
- 04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1@
- 0107: 3@ = create_object #KATANA at 5@ 6@ 7@
- 0AC6: 30@ = label @pool offset
- 0085: 4@ = 0@ // (int)
- 0012: 4@ *= 4
- 005A: 30@ += 4@ // (int)
- 000A: 30@ += 40
- 0A8C: write_memory 30@ size 4 value 3@ virtual_protect 0
- end
- wait 2000
- for 0@ = 0 to 9
- 0AC6: 30@ = label @pool offset
- 0085: 4@ = 0@ // (int)
- 0012: 4@ *= 4
- 005A: 30@ += 4@ // (int)
- 0A8D: 2@ = read_memory 30@ size 4 virtual_protect 0
- if
- 03CA: object 2@ exists
- then
- 0108: destroy_object 2@
- end
- 0AC6: 30@ = label @pool offset
- 0085: 4@ = 0@ // (int)
- 0012: 4@ *= 4
- 005A: 30@ += 4@ // (int)
- 000A: 30@ += 40
- 0A8D: 3@ = read_memory 30@ size 4 virtual_protect 0
- if
- 03CA: object 3@ exists
- then
- 0108: destroy_object 3@
- end
- end
- :pool
- hex
- //2@ - knife pool - 40byte
- 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
- //3@ - katana pool - 40byte
- 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
- end
- {
- Get Angle Between Points function
- }
- 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
- 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 1@ 2@ and_XY 0.0 0.0 store_to 4@
- 0173: set_actor $PLAYER_ACTOR Z_angle_to 4@
- :getAngleBetweenPoints
- {
- Parameters:
- Passed:
- 0@ - 1st point X
- 1@ - 1st point Y
- 2@ - 2nd point X
- 3@ - 2nd point Y
- Result:
- 4@ - absolute angle
- Example:
- 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0 0.0 store_to 1@
- }
- 0063: 0@ -= 2@
- 0063: 1@ -= 3@
- 0604: get_Z_angle_for_point 0@ 1@ store_to 4@
- 0AB2: ret 1 4@
- {
- Get CAR Exhaust Pipe Offset
- }
- 03C0: 0@ = actor $PLAYER_ACTOR car
- 0AB1: call_scm_func @GetExhaustPipeOffset 1 car 0@ offset 1@ 2@ 3@
- :GetExhaustPipeOffset
- 0A97: 0@ = car 0@ struct
- 0@ += 0x22
- 0A8D: 0@ = read_memory 0@ size 2 virtual_protect 0 //model index
- 0@ *= 4
- 0@ += 0xA9B0C8
- 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 //CModel
- 0@ += 0x5C
- 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 //vehicle struct
- 0@ += 0x48
- 0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0 //x
- 0@ += 4
- 0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0 //y
- 0@ += 4
- 0A8D: 3@ = read_memory 0@ size 4 virtual_protect 0 //z
- 0AB2: ret 3 1@ 2@ 3@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement