Napisano dnia: 2013-01-09 18:20:49
Chciałbym poznać metody optymalizacji skryptu, gdyż ten pożera dużo zasobów.
Kod:
{$CLEO .cs}
thread 'CHEATS'
wait 10000
:CHEATS_1
wait 0
//wejśćiowe
0226: 0@ = actor $PLAYER_ACTOR health
if
0449: actor $PLAYER_ACTOR in_a_car
then
03C0: 1@ = actor $PLAYER_ACTOR car
0227: 2@ = car 1@ health
02E3: 3@ = car 1@ speed
end
if
0AB0: key_pressed 103
then
11@ = 1
else
11@ = 0
end
if
0AB0: key_pressed 105
then
018C: play_sound 1058 at 0.0 0.0 0.0
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 18@ closest_ped_to 19@
end
//leczenie postaci
if
0AB0: key_pressed 101
then
0@ += 1
0223: set_actor $PLAYER_ACTOR health_to 0@
end
//leczenie postaci automat
if and
11@ == 0
001B: 15 > 0@
then
0223: set_actor $PLAYER_ACTOR health_to 20
end
//odnawianie HP auta
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 99
then
2@ += 10
0224: set_car 1@ health_to 2@
end
//kamizelka
if and
0AB0: key_pressed 17
0AB0: key_pressed 101
then
035F: actor $PLAYER_ACTOR armour += 1
end
//naprawianie auta
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 99
2@ >= 1000
then
0A30: repair_car 1@
end
//naprawa auta automat
if and
11@ == 0
0449: actor $PLAYER_ACTOR in_a_car
300 > 2@
then
0224: set_car 1@ health_to 310
018C: play_sound 1052 at 0.0 0.0 0.0
end
//Teleport
if and
0AB0: key_pressed 17
0AB0: key_pressed 84
then
0AB6: store_target_marker_coords_to 4@ 5@ 6@
00A1: put_actor $PLAYER_ACTOR at 4@ 5@ 6@
018C: play_sound 1058 at 0.0 0.0 0.0
0003: shake_camera 100
end
//Turbo
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 18
then
3@ *= 1.3
04BA: set_car 1@ speed_to 3@
end
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 18
3@ < 10.0
then
Car.SetSpeedInstantly(1@, 10.0)
end
//przywracanie pozycji
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 17
0AB0: key_pressed 32
then
00AA: store_car 1@ position_to 7@ 8@ 9@
00AB: put_car 1@ at 7@ 8@ 9@
018C: play_sound 1058 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 32
0AB0: key_pressed 18
then
00A0: store_actor $PLAYER_ACTOR position_to 22@ 23@ 24@
00A1: put_actor $PLAYER_ACTOR at 22@ 23@ 24@
end
//infernus
if
0ADC: test_cheat "INFERNUS"
then
Model.Load(411)
20@ = 1
end
if and
20@ == 1
Model.Available(411)
80DF: not actor $PLAYER_ACTOR driving
then
12@ = Actor.Angle($PLAYER_ACTOR)
04C4: store_coords_to 13@ 14@ 15@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
16@ = Car.Create(411, 13@, 14@, 15@)
Car.Angle(16@) = 12@
072A: put_actor $PLAYER_ACTOR into_car 16@ driverseat
Model.Destroy(411)
20@ = 0
018C: play_sound 1058 at 0.0 0.0 0.0
end
//hijack
if and
18@ > 0
0AB0: key_pressed 17
0AB0: key_pressed 72
then
072A: put_actor $PLAYER_ACTOR into_car 18@ driverseat
018C: play_sound 1058 at 0.0 0.0 0.0
end
if and
18@ > 0
0AB0: key_pressed 17
0AB0: key_pressed 71
then
0430: put_actor $PLAYER_ACTOR into_car 18@ passenger_seat 0
018C: play_sound 1058 at 0.0 0.0 0.0
end
//autokill
if and
19@ > 0
0AB0: key_pressed 18
0AB0: key_pressed 75
then
04C4: store_coords_to 10@ 17@ 21@ from_actor 19@ with_offset 0.0 0.0 0.0
0668: AS_actor $PLAYER_ACTOR rotate_and_shoot_at 10@ 17@ 21@ 100 ms
018C: play_sound 1058 at 0.0 0.0 0.0
end
if and
19@ > 0
0AB0: key_pressed 18
0AB0: key_pressed 76
then
05E2: AS_actor $PLAYER_ACTOR kill_actor 19@
018C: play_sound 1058 at 0.0 0.0 0.0
end
//autofollow
if and
19@ > 0
80DF: not actor $PLAYER_ACTOR driving
0AB0: key_pressed 17
0AB0: key_pressed 85
then
0850: AS_actor $PLAYER_ACTOR follow_actor 19@
end
if and
19@ > 0
0AB0: key_pressed 17
0AB0: key_pressed 85
00DF: actor $PLAYER_ACTOR driving
then
07F8: car 1@ follow_car 18@ radius 3.0
end
//czity2
//jazda po wodzie
if
0AB0: key_pressed 49
then
0A8C: write_memory 9867602 size 4 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 49
then
0A8C: write_memory 9867602 size 4 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//latanie lodzi i aut
if
0AB0: key_pressed 50
then
0A8C: write_memory 0x969153 size 1 value 1 virtual_protect 0
0A8C: write_memory 0x969160 size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 50
then
0A8C: write_memory 0x969153 size 1 value 0 virtual_protect 0
0A8C: write_memory 0x969160 size 1 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//ciezkie auto
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 51
then
01EC: make_car 1@ very_heavy 1
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 51
0449: actor $PLAYER_ACTOR in_a_car
then
01EC: make_car 1@ very_heavy 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//bunnyhop
if
0AB0: key_pressed 52
then
0A8C: write_memory 0x969161 size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 52
then
0A8C: write_memory 0x969161 size 1 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//kangaroo
if
0AB0: key_pressed 53
then
0A8C: write_memory 0x96916C size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 53
then
0A8C: write_memory 0x96916C size 0 value 1 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//mocny hit
if
0AB0: key_pressed 54
then
0A8C: write_memory 0x969173 size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 54
then
0A8C: write_memory 0x969173 size 1 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
jump @CHEATS_1
thread 'CHEATS'
wait 10000
:CHEATS_1
wait 0
//wejśćiowe
0226: 0@ = actor $PLAYER_ACTOR health
if
0449: actor $PLAYER_ACTOR in_a_car
then
03C0: 1@ = actor $PLAYER_ACTOR car
0227: 2@ = car 1@ health
02E3: 3@ = car 1@ speed
end
if
0AB0: key_pressed 103
then
11@ = 1
else
11@ = 0
end
if
0AB0: key_pressed 105
then
018C: play_sound 1058 at 0.0 0.0 0.0
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 18@ closest_ped_to 19@
end
//leczenie postaci
if
0AB0: key_pressed 101
then
0@ += 1
0223: set_actor $PLAYER_ACTOR health_to 0@
end
//leczenie postaci automat
if and
11@ == 0
001B: 15 > 0@
then
0223: set_actor $PLAYER_ACTOR health_to 20
end
//odnawianie HP auta
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 99
then
2@ += 10
0224: set_car 1@ health_to 2@
end
//kamizelka
if and
0AB0: key_pressed 17
0AB0: key_pressed 101
then
035F: actor $PLAYER_ACTOR armour += 1
end
//naprawianie auta
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 99
2@ >= 1000
then
0A30: repair_car 1@
end
//naprawa auta automat
if and
11@ == 0
0449: actor $PLAYER_ACTOR in_a_car
300 > 2@
then
0224: set_car 1@ health_to 310
018C: play_sound 1052 at 0.0 0.0 0.0
end
//Teleport
if and
0AB0: key_pressed 17
0AB0: key_pressed 84
then
0AB6: store_target_marker_coords_to 4@ 5@ 6@
00A1: put_actor $PLAYER_ACTOR at 4@ 5@ 6@
018C: play_sound 1058 at 0.0 0.0 0.0
0003: shake_camera 100
end
//Turbo
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 18
then
3@ *= 1.3
04BA: set_car 1@ speed_to 3@
end
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 18
3@ < 10.0
then
Car.SetSpeedInstantly(1@, 10.0)
end
//przywracanie pozycji
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 17
0AB0: key_pressed 32
then
00AA: store_car 1@ position_to 7@ 8@ 9@
00AB: put_car 1@ at 7@ 8@ 9@
018C: play_sound 1058 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 32
0AB0: key_pressed 18
then
00A0: store_actor $PLAYER_ACTOR position_to 22@ 23@ 24@
00A1: put_actor $PLAYER_ACTOR at 22@ 23@ 24@
end
//infernus
if
0ADC: test_cheat "INFERNUS"
then
Model.Load(411)
20@ = 1
end
if and
20@ == 1
Model.Available(411)
80DF: not actor $PLAYER_ACTOR driving
then
12@ = Actor.Angle($PLAYER_ACTOR)
04C4: store_coords_to 13@ 14@ 15@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
16@ = Car.Create(411, 13@, 14@, 15@)
Car.Angle(16@) = 12@
072A: put_actor $PLAYER_ACTOR into_car 16@ driverseat
Model.Destroy(411)
20@ = 0
018C: play_sound 1058 at 0.0 0.0 0.0
end
//hijack
if and
18@ > 0
0AB0: key_pressed 17
0AB0: key_pressed 72
then
072A: put_actor $PLAYER_ACTOR into_car 18@ driverseat
018C: play_sound 1058 at 0.0 0.0 0.0
end
if and
18@ > 0
0AB0: key_pressed 17
0AB0: key_pressed 71
then
0430: put_actor $PLAYER_ACTOR into_car 18@ passenger_seat 0
018C: play_sound 1058 at 0.0 0.0 0.0
end
//autokill
if and
19@ > 0
0AB0: key_pressed 18
0AB0: key_pressed 75
then
04C4: store_coords_to 10@ 17@ 21@ from_actor 19@ with_offset 0.0 0.0 0.0
0668: AS_actor $PLAYER_ACTOR rotate_and_shoot_at 10@ 17@ 21@ 100 ms
018C: play_sound 1058 at 0.0 0.0 0.0
end
if and
19@ > 0
0AB0: key_pressed 18
0AB0: key_pressed 76
then
05E2: AS_actor $PLAYER_ACTOR kill_actor 19@
018C: play_sound 1058 at 0.0 0.0 0.0
end
//autofollow
if and
19@ > 0
80DF: not actor $PLAYER_ACTOR driving
0AB0: key_pressed 17
0AB0: key_pressed 85
then
0850: AS_actor $PLAYER_ACTOR follow_actor 19@
end
if and
19@ > 0
0AB0: key_pressed 17
0AB0: key_pressed 85
00DF: actor $PLAYER_ACTOR driving
then
07F8: car 1@ follow_car 18@ radius 3.0
end
//czity2
//jazda po wodzie
if
0AB0: key_pressed 49
then
0A8C: write_memory 9867602 size 4 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 49
then
0A8C: write_memory 9867602 size 4 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//latanie lodzi i aut
if
0AB0: key_pressed 50
then
0A8C: write_memory 0x969153 size 1 value 1 virtual_protect 0
0A8C: write_memory 0x969160 size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 50
then
0A8C: write_memory 0x969153 size 1 value 0 virtual_protect 0
0A8C: write_memory 0x969160 size 1 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//ciezkie auto
if and
0449: actor $PLAYER_ACTOR in_a_car
0AB0: key_pressed 51
then
01EC: make_car 1@ very_heavy 1
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 51
0449: actor $PLAYER_ACTOR in_a_car
then
01EC: make_car 1@ very_heavy 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//bunnyhop
if
0AB0: key_pressed 52
then
0A8C: write_memory 0x969161 size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 52
then
0A8C: write_memory 0x969161 size 1 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//kangaroo
if
0AB0: key_pressed 53
then
0A8C: write_memory 0x96916C size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 53
then
0A8C: write_memory 0x96916C size 0 value 1 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
//mocny hit
if
0AB0: key_pressed 54
then
0A8C: write_memory 0x969173 size 1 value 1 virtual_protect 0
018C: play_sound 1056 at 0.0 0.0 0.0
end
if and
0AB0: key_pressed 17
0AB0: key_pressed 54
then
0A8C: write_memory 0x969173 size 1 value 0 virtual_protect 0
018C: play_sound 1057 at 0.0 0.0 0.0
end
jump @CHEATS_1