Doesnt work.
Whats wrong?
_______________________
{$CLEO .cs}
//-------------MAIN---------------
thread "PORT"
wait 0
:MAIN
wait 10
if
0ADC: test_cheat "POR"
jf @CHECK_1
if 21@ == 0
then
0ACD: show_text_highpriority "G~ACTIVATED!" time 2000
21@ = 1
else
21@ = 0
0ACD: show_text_highpriority "~Y~DEACTIVATED!" time 2000
end
:CHECK_1
if and
21@ == 1
0AB0: key_pressed 80
jf @MAIN
Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@)
3@ = 10.0 // SEARCH RADIUS
gosub @AIC_GETACTOR // GET ACTOR WICH IS AT POS 0@ 1@ 2@ TO 9@
Actor.StorePos(9@,22@,23@,24@)
Actor.PutAt($PLAYER_ACTOR,22@,23@,24@)
wait 100
jump @MAIN
:AIC_GETACTOR
0395: clear_area 1 at 0@ 1@ 2@ radius 100000.0
0006: 16@ = 305868
0006: 5@ = @AIC_TESTACTORHANDLE
0006: 6@ = 1988
0002: jump @AIC_STARTSEARCH
:AIC_GETOBJECT
0006: 16@ = 305871
0006: 17@ = @AIC_TESTOBJECTHANDLE
0006: 20@ = 412
:AIC_GETVEHICLE
0006: 16@ = 305869
0006: 17@ = @AIC_TESTVEHICLEHANDLE
0006: 18@ = -1
0006: 20@ = 2584
0256: player $PLAYER_CHAR defined
004D: jump_if_false @AIC_STARTSEARCH
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @AIC_STARTSEARCH
03C0: 18@ = actor $PLAYER_ACTOR car
0002: jump @AIC_STARTSEARCH
:AIC_STARTSEARCH
008B: 16@ = &0(16@,1i) // CPool*
0AB1: call_scm_func @AIC_READMEMOFFSET 2 ( 16@ + 8 )^ = 7@ // CPool.Size
0A8D: 11@ = read_memory 16@ size 4 virtual_protect 0 // CPool.pUnits
0006: 9@ = -1
0006: 10@ = 0
:AIC_SEARCHLOOPMAIN
0AB1: call_scm_func @AIC_READMEMOFFSET 2 ( 11@ + 20 )^ = 4@ // xyz*
8039: not 4@ == 0
004D: jump_if_false @AIC_SEARCHLOOPNEXT
0AB1: call_scm_func @AIC_READMEMOFFSET 2 ( 4@ + 48 )^ = 12@ // x
0AB1: call_scm_func @AIC_READMEMOFFSET 2 ( 4@ + 52 )^ = 13@ // y
0AB1: call_scm_func @AIC_READMEMOFFSET 2 ( 4@ + 56 )^ = 14@ // z
050A: 15@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 12@ 13@ 14@
0025: 3@ > 15@ // (float)
004D: jump_if_false @AIC_SEARCHLOOPNEXT
0085: 9@ = 10@ // (int) // counter
0AB1: call_scm_func @AIC_READMEMOFFSET 2 ( 16@ + 4 )^ = 4@ // CPool.flags
005A: 4@ += 9@ // (int)
0A8D: 4@ = read_memory 4@ size 1 virtual_protect 0
0012: 9@ *= 256
005A: 9@ += 4@ // (int)
0002: jump 5@
:AIC_TESTACTORHANDLE
056D: is 9@ valid_actor_handle
004D: jump_if_false @AIC_NOHANDLE
00D6: if or
003C: $PLAYER_ACTOR == 9@ // (int)
0118: actor 9@ dead
004D: jump_if_false @AIC_NEWSEARCHRADIUS
0002: jump @AIC_NOHANDLE
:AIC_TESTOBJECTHANDLE
//0001: wait 0
83CA: not object 9@ exists
004D: jump_if_false @AIC_NEWSEARCHRADIUS
:AIC_TESTVEHICLEHANDLE
056E: is 9@ valid_vehicle_handle
004D: jump_if_false @AIC_NOHANDLE
00D6: if or
003B: 18@ == 9@ // (int)
0119: car 9@ wrecked
004D: jump_if_false @AIC_NEWSEARCHRADIUS
0002: jump @AIC_NOHANDLE
:AIC_NOHANDLE
0006: 9@ = -1
0002: jump @AIC_SEARCHLOOPNEXT
:AIC_NEWSEARCHRADIUS
if
056D: actor 9@ defined
jf @AIC_NOHANDLE
0085: 3@ = 15@
:AIC_SEARCHLOOPNEXT
005A: 11@ += 6@ // (int)
000A: 10@ += 1
002D: 10@ >= 7@ // (int)
004D: jump_if_false @AIC_SEARCHLOOPMAIN
0051: return
:AIC_READMEMOFFSET
0A8E: 0@ = 0@ + 1@ // int
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0AB2: ret 1 0@