{$CLEO}
var
0@: Integer
1@: Integer
2@: Integer
3@: Integer
4@: Integer
5@: Integer
6@: Integer
7@: Float
8@: Float
9@: Float
10@: Float
11@: Float
12@: Float
13@: Float
14@: Float
15@: Float
16@: Float
17@: Float
18@: Float
19@: Integer
end
const
CAR_HANDLE = 0@
TRAILER_HANDLE = 1@
CAR_STRUCT = 2@
TRAILER_STRUCT = 3@
MODE = 4@
OLD_CAR_STRUCT = 5@
OLD_TRAILER_STRUCT = 6@
CAR_FRONT_LIGHT_X = 7@
CAR_FRONT_LIGHT_Y = 8@
CAR_FRONT_LIGHT_Z = 9@
CAR_BACK_LIGHT_X = 10@
CAR_BACK_LIGHT_Y = 11@
CAR_BACK_LIGHT_Z = 12@
TRAILER_FRONT_LIGHT_X = 13@
TRAILER_FRONT_LIGHT_Y = 14@
TRAILER_FRONT_LIGHT_Z = 15@
TRAILER_BACK_LIGHT_X = 16@
TRAILER_BACK_LIGHT_Y = 17@
TRAILER_BACK_LIGHT_Z = 18@
RwV3D = 19@
// Modes:
NULL = 0
LEFT = 1
RIGHT = 2
TOGETHER = 3
end
wait 0
while true
wait 0
if
not Player.Defined($PLAYER_CHAR)
then
continue
end
if and
actor.Driving($PLAYER_ACTOR)
84C8: not actor $PLAYER_ACTOR driving_flying_vehicle
then
03C0: CAR_HANDLE = actor $PLAYER_ACTOR car
0A97: CAR_STRUCT = car CAR_HANDLE struct
if
CAR_STRUCT <> OLD_CAR_STRUCT
then
0A8E: 31@ = CAR_STRUCT + 1424 // int
0A8D: 31@ = read_memory 31@ size 1 virtual_protect 0
if and
31@ <> 0
31@ <> 9
then
continue
end
0A8E: 30@ = CAR_STRUCT + 0x22 // int
0A8D: 30@ = read_memory 30@ size 2 virtual_protect 0 //model index
30@ *= 4
30@ += 0xA9B0C8
0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0 //CModel
30@ += 0x5C
0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0 //vehicle struct
//0@ += 0
0A8D: CAR_FRONT_LIGHT_X = read_memory 30@ size 4 virtual_protect 0 //x offset
30@ += 4
0A8D: CAR_FRONT_LIGHT_Y = read_memory 30@ size 4 virtual_protect 0 //y offset
30@ += 4
0A8D: CAR_FRONT_LIGHT_Z = read_memory 30@ size 4 virtual_protect 0 //z offset
30@ += 4
0A8D: CAR_BACK_LIGHT_X = read_memory 30@ size 4 virtual_protect 0 //x offset
30@ += 4
0A8D: CAR_BACK_LIGHT_Y = read_memory 30@ size 4 virtual_protect 0 //y offset
30@ += 4
0A8D: CAR_BACK_LIGHT_Z = read_memory 30@ size 4 virtual_protect 0 //z offset
if
CAR_FRONT_LIGHT_X == 0.0
then
CAR_FRONT_LIGHT_X = 0.15
end
if
CAR_BACK_LIGHT_X == 0.0
then
CAR_BACK_LIGHT_X = 0.15
end
OLD_CAR_STRUCT = CAR_STRUCT
MODE = NULL
end
0A8E: TRAILER_STRUCT = CAR_STRUCT + 0x4C8 // int
0A8D: TRAILER_STRUCT = read_memory TRAILER_STRUCT size 4 virtual_protect 0
if and
TRAILER_STRUCT > 0
TRAILER_STRUCT <> OLD_TRAILER_STRUCT
then
0A8E: 30@ = TRAILER_STRUCT + 0x22 // int
0A8D: 30@ = read_memory 30@ size 2 virtual_protect 0 //model index
30@ *= 4
30@ += 0xA9B0C8
0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0 //CModel
30@ += 0x5C
0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0 //vehicle struct
//0@ += 0
0A8D: TRAILER_FRONT_LIGHT_X = read_memory 30@ size 4 virtual_protect 0 //x offset
30@ += 4
0A8D: TRAILER_FRONT_LIGHT_Y = read_memory 30@ size 4 virtual_protect 0 //y offset
30@ += 4
0A8D: TRAILER_FRONT_LIGHT_Z = read_memory 30@ size 4 virtual_protect 0 //z offset
30@ += 4
0A8D: TRAILER_BACK_LIGHT_X = read_memory 30@ size 4 virtual_protect 0 //x offset
30@ += 4
0A8D: TRAILER_BACK_LIGHT_Y = read_memory 30@ size 4 virtual_protect 0 //y offset
30@ += 4
0A8D: TRAILER_BACK_LIGHT_Z = read_memory 30@ size 4 virtual_protect 0 //z offset
if
TRAILER_FRONT_LIGHT_X == 0.0
then
TRAILER_FRONT_LIGHT_X = 0.15
end
if
TRAILER_BACK_LIGHT_X == 0.0
then
TRAILER_BACK_LIGHT_X = 0.15
end
OLD_TRAILER_STRUCT = TRAILER_STRUCT
end
if
0AB0: key_pressed 90 // Z
then
if
MODE == 0
then
MODE = LEFT
repeat
wait 0
until 8AB0: not key_pressed 90 // Z
continue
end
if
MODE == LEFT
then
MODE = 0
repeat
wait 0
until 8AB0: not key_pressed 90 // Z
continue
end
end
if
0AB0: key_pressed 88 // X
then
if
MODE == 0
then
MODE = TOGETHER
repeat
wait 0
until 8AB0: not key_pressed 88 // X
continue
end
if
MODE == TOGETHER
then
MODE = 0
repeat
wait 0
until 8AB0: not key_pressed 88 // X
continue
end
end
if
0AB0: key_pressed 67 // C
then
if
MODE == 0
then
MODE = RIGHT
repeat
wait 0
until 8AB0: not key_pressed 67 // C
continue
end
if
MODE == RIGHT
then
MODE = 0
repeat
wait 0
until 8AB0: not key_pressed 67 // C
continue
end
end
if
32@ > 1000
then
32@ = 0
end
if
32@ < 500
then
if
MODE <> 0
then
if
TRAILER_STRUCT == 0
then
30@ = 0
else
30@ = 1
end
for 31@ = 0 to 30@
0AC6: 22@ = label @Attach_corona_to_car offset
22@ += 54
if
31@ == 0
then
0AC7: RwV3D = var 7@ offset
0A8E: 26@ = CAR_STRUCT + 0xA4 // int
0A8C: write_memory 22@ size 4 value CAR_STRUCT virtual_protect 0
else
0AC7: RwV3D = var 13@ offset
0A8E: 26@ = TRAILER_STRUCT + 0xA4 // int
0A8C: write_memory 22@ size 4 value TRAILER_STRUCT virtual_protect 0
end
for 29@ = 0 to 1
if
29@ == 1
then
RwV3D += 12
end
0A8E: 25@ = RwV3D + 4 // int
0A8D: 25@ = read_memory 25@ size 4 virtual_protect 0
if
25@ <> 0.0
then
if
MODE == TOGETHER
then
27@ = 1
else
27@ = 0
end
for 28@ = 0 to 27@
if and
28@ == 0
MODE <> RIGHT
then
0A8D: 22@ = read_memory RwV3D size 4 virtual_protect 0
22@ *= -1.0
0A8C: write_memory RwV3D size 4 value 22@ virtual_protect 0
end
0AC6: 22@ = label @Attach_corona_to_car offset
22@ += 41
0A8C: write_memory 22@ size 4 value RwV3D virtual_protect 0
for 21@ = 0 to 1
0AC6: 22@ = label @Attach_corona_to_car offset
22@ += 59
0A8C: write_memory 22@ size 4 value 26@ virtual_protect 0
0AC6: 22@ = label @Attach_corona_to_car offset
0AA5: call 22@ num_params 0 pop 0
26@ += 1
end
if and
28@ == 0
MODE <> RIGHT
then
0A8D: 22@ = read_memory RwV3D size 4 virtual_protect 0
22@ *= -1.0
0A8C: write_memory RwV3D size 4 value 22@ virtual_protect 0
end
end
end
end
end
end
end
end
end
:Attach_corona_to_car
hex
// передача параметров короны
6A 01 // push 1
6A 00 // push 0
68 00 00 70 41 // push 1.5e1
6A 00 // push 0
68 00 00 C0 3F // push 2.0e1
6A 00 // push 0
6A 00 // push 0
6A 00 // push 0
6A 00 // push 0
6A 00 // push 0
6A 00 // push FLARE
6A 00 // push ТИП КОРОНЫ
68 00 00 16 43 // push 1.5e2
68 C0 CC CC 3E // push РАДИУС
68 00 00 00 00 // push УКАЗАТЕЛЬ RwV3D
6A FF // push ЯРКОСТЬ
6A 00 // push СИНИЙ (RGB)
6A 80 // push ЗЕЛЁНЫЙ (RGB)
6A FF // push КРАСНЫЙ (RGB)
68 00 00 00 00 // push СТРУКТУРА МАШИНЫ
68 00 00 00 00 // push УНИКАЛЬНЫЙ НОМЕР
// создание короны
B8 80 C5 6F 00 // mov eax, CCoronas__addCorona
FF D0 // call eax
83 C4 54 // add esp, 0x54
C3 // retn
end