Quantcast

Jump to content

» «
Photo

Check if another script

23 replies to this topic
HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#1

Posted 20 March 2012 - 05:50 PM

Is it possible to check if a car is defined in another script?
I have a script that's gets the handle of all police vehicles and has it to turn it's lights off and on if it's siren is on.

CODE
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP

:Noname_2
wait 0
if
  Player.Defined(0)
else_jump @Noname_2
09E8: [email protected] = actor $PLAYER_ACTOR active_interior
if
 [email protected] == 0
else_jump @Noname_2
if
0AE1: [email protected] = random_actor_near_point 0.0 0.0 0.0 in_radius 3000.0 find_next 0 pass_deads 1 //IF and SET
else_jump @Noname_94
jump @Noname_141

:Noname_94
if
8AE1:   not [email protected] = random_actor_near_point 0.0 0.0 0.0 in_radius 3000.0 find_next 1 pass_deads 1 //IF and SET
else_jump @Noname_141
jump @Noname_2

:Noname_141
if and
  Actor.Driving([email protected])
847A:   not actor [email protected] driving_bike
else_jump @Noname_2
03C0: [email protected] = actor [email protected] car
if or
0975:   car [email protected] emergency_vehicle
  Actor.DrivingPoliceVehicle([email protected])
else_jump @Noname_645
if
0ABD:   vehicle [email protected] siren_on
else_jump @Noname_645
0A92: create_custom_thread "AI_ELM.s" [email protected] [email protected]     // Tried doing this but the script keeps getting the handle of the same car that is sent and of new cars
wait 250
jump @Noname_2
//067F: set_car [email protected] lights 2
//0209: [email protected] = random_int_in_ranges 1 5
//gosub @Noname_488
//[email protected] = Car.StructAdressByHandle([email protected])
//[email protected] += 1440
//0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 0  
//0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 1  


/////////////        This is AI_ELM.s              the external script
:Noname_303
if
  Car.Defined([email protected])
else_jump @Noname_645
if
0ABD:   vehicle [email protected] siren_on
else_jump @Noname_645
gosub @Noname_398
wait [email protected]
if
  Car.Defined([email protected])
else_jump @Noname_645
if
0ABD:   vehicle [email protected] siren_on
else_jump @Noname_645
gosub @Noname_443
wait [email protected]
jump @Noname_303

:Noname_398
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 1 0  
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 1  
jump @Noname_643

:Noname_443
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 0  
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 1 1  
jump @Noname_643

:Noname_488
if
 [email protected] == 1
else_jump @Noname_520
[email protected] = 10
jump @Noname_643

:Noname_520
if
 [email protected] == 2
else_jump @Noname_552
[email protected] = 50
jump @Noname_643

:Noname_552
if
 [email protected] == 3
else_jump @Noname_584
[email protected] = 100
jump @Noname_643

:Noname_584
if
 [email protected] == 4
else_jump @Noname_617
[email protected] = 250
jump @Noname_643

:Noname_617
if
 [email protected] == 5
else_jump @Noname_643
[email protected] = 400

:Noname_643
return

:Noname_645
Actor.RemoveReferences([email protected])
Car.RemoveReferences([email protected])
0A93:

Bad.boy!
  • Bad.boy!

    ex SA modder

  • Feroci
  • Joined: 20 Jun 2010
  • Netherlands

#2

Posted 20 March 2012 - 06:36 PM

You'll have to use globals if you want to do something like that, or you'll need the specific location of the car.

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#3

Posted 20 March 2012 - 07:10 PM

QUOTE (HeresOtis @ Tuesday, Mar 20 2012, 17:50)
Is it possible to check if a car is defined in another script?

To realize Global Variables for Cleo scripts exist following Cleo opcode connected with a special expression:
Opcode 0AB3: and 0AB4:
The expression var together with a number, <var><space><number> is builing the Special Global Cleo Variable
CODE
0AB3: var 0 = 10

or
CODE
0006: [email protected] =  10  // integer values
0AB3: var 0 = [email protected]

and
CODE
0AB4: [email protected]= var 0

to get then stored value into your script needs to submit into a local:
CODE
0AB4: [email protected] = var 44
if
0039:   [email protected] ==  1  // integer values
004D: jump_if_false @nextlabel

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#4

Posted 20 March 2012 - 07:34 PM

@ZAZ, how would I store an actor & car handle to var? If [email protected] = actor, then would it just be 0AB3: var 0 = [email protected]?

And would it be [email protected] == 0 to check if the actor is not defined anymore?

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#5

Posted 20 March 2012 - 07:35 PM Edited by Link2012, 20 March 2012 - 07:48 PM.

I think that is better to loop through the vehicles pool and see if it's a police car or what you need...

Look at this DK22Pac topic, It should help you.:
http://www.gtaforums...howtopic=503390


And using the DK22Pac "forallcars", check if the vehicle is referenced by a script using: (I don't know where and why you need to check it, so this is what I managed to do in the circumstances)
CODE
:IsCarUsedByScript{Handle}
// Example of use:
// if
// 0AB1: call_scm_func @IsCarUsedByScript 1 VehicleHandle [email protected]
0A97: [email protected] = car [email protected] struct
[email protected] += 0x4A4
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
if
[email protected] == 2
0AB2: ret 0

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#6

Posted 20 March 2012 - 07:45 PM

@Link2012
Is the code example you provided correct? Can you use 0AB1 in a condition? What if [email protected] isn't equals to 2?

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#7

Posted 20 March 2012 - 08:06 PM

QUOTE (HeresOtis @ Tuesday, Mar 20 2012, 16:45)
@Link2012
Is the code example you provided correct? Can you use 0AB1 in a condition? What if [email protected] isn't equals to 2?

Yes, When you do the jump_if_false instruction it will check the last condition result (in the case [email protected] == 2)

if [email protected] isn't equal to 2 the vehicle isn't referenced.

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#8

Posted 20 March 2012 - 09:11 PM

Yeah it's a neat trick, you just can't group conditions as the "if" in the SCM Func resets the last condition result, etc.

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#9

Posted 20 March 2012 - 09:25 PM

Instead of
CODE
:IsCarUsedByScript{Handle}
// Example of use:
// if
// 0AB1: call_scm_func @IsCarUsedByScript 1 VehicleHandle [email protected]
0A97: [email protected] = car [email protected] struct
[email protected] += 0x4A4
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
if
[email protected] == 2
0AB2: ret 0


Shouldn't it be
CODE
:1
wait 0
if
  0AB1: call_scm_func @IsCarUsedByScript 1 VehicleHandle [email protected]
jf @notreferenced
jump @referenced

:IsCarUsedByScript{Handle}
0A97: [email protected] = car [email protected] struct
[email protected] += 0x4A4
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
if
[email protected] == 2
0AB2: ret 0

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#10

Posted 21 March 2012 - 12:06 AM

Is this correct? I want it where if the car isn't referenced, then send to to external script.

CODE
{$CLEO}
0000:


while true
 wait 0
 if
   Player.Defined(0)
 then
 09E8: [email protected] = actor $PLAYER_ACTOR active_interior
   if
     [email protected] == 0
   then
     if
       0AE1: [email protected] = random_actor_near_point 0.0 0.0 0.0 in_radius 3000.0 find_next 0 pass_deads 1 //IF and SET
     then
       if and
         Actor.Driving([email protected])
         847A:   not actor [email protected] driving_bike
       then
       03C0: [email protected] = actor [email protected] car
         if and
           0975:   car [email protected] emergency_vehicle
           0ABD:   vehicle [email protected] siren_on
         then
           if
             0AB1: call_scm_func @IsCarUsedByScript 1 VehicleHandle [email protected]
           then
             break
           end
         0A92: create_custom_thread "AI_ELM.s" [email protected] [email protected]  
         end
       end
     repeat  
     until 8AE1: not [email protected] = random_actor_near_point 0.0 0.0 0.0 in_radius 3000.0 find_next 0 pass_deads 1 //IF and SET
     end
   end
 end
end


:IsCarUsedByScript{Handle}
0A97: [email protected] = car [email protected] struct
[email protected] += 0x4A4
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
if
[email protected] == 2
0AB2: ret 0

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#11

Posted 21 March 2012 - 03:45 AM

Your identation is a little bad, I think that you're using SPACE, use TAB.


I think that the start of the repeat is the wrong place, this should be ok:
CODE
{$CLEO}
0000:
while true
   wait 0
   if
       Player.Defined(0)
   then
       09E8: [email protected] = actor $PLAYER_ACTOR active_interior
       if
       [email protected] == 0
       then
           while 0AE1: [email protected] = random_actor_near_point 0.0 0.0 0.0 in_radius 3000.0 find_next 1 {find next should be 1 to find next ped} pass_deads 1 //IF and SET
               if and
               Actor.Driving([email protected])
               847A:   not actor [email protected] driving_bike
               then
                   03C0: [email protected] = actor [email protected] car
                   if and
                   0975:   car [email protected] emergency_vehicle
                   0ABD:   vehicle [email protected] siren_on
                   then
                       if
                       0AB1: call_scm_func @IsCarUsedByScript 1 VehicleHandle [email protected]
                       then
                           continue // <<< Changed too, we will just forget about THIS vehicle, continue the loop.
                       end
                       0A92: create_custom_thread "AI_ELM.s" [email protected] [email protected]  
                   end
               end
           end
       end
   end
end

:IsCarUsedByScript{Handle}
0A97: [email protected] = car [email protected] struct
[email protected] += 0x4A4
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
if
[email protected] == 2
0AB2: ret 0


Finally, I think that you should use "forallcars" and not start a custom thread for all cars.



HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#12

Posted 21 March 2012 - 04:00 AM

Well, this is the custom thread:
CODE
{$CLEO .s}

//-------------MAIN---------------
0000: NOP
wait 0
if and
  Actor.Defined([email protected])
  Car.Defined([email protected])
else_jump @Noname_486
if and
  Actor.InCar([email protected], [email protected])
  Actor.Driving([email protected])
else_jump @Noname_486
if
0ABD:   vehicle [email protected] siren_on
else_jump @Noname_486
067F: set_car [email protected] lights 2
0209: [email protected] = random_int_in_ranges 1 5
gosub @Noname_329
[email protected] = Car.StructAdressByHandle([email protected])
[email protected] += 1440
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 0  
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 1  

:Noname_144
if
  Car.Defined([email protected])
else_jump @Noname_486
if
0ABD:   vehicle [email protected] siren_on
else_jump @Noname_486
gosub @Noname_239
wait [email protected]
if
  Car.Defined([email protected])
else_jump @Noname_486
if
0ABD:   vehicle [email protected] siren_on
else_jump @Noname_486
gosub @Noname_284
wait [email protected]
jump @Noname_144

:Noname_239
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 1 0  
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 1  
jump @Noname_484

:Noname_284
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 0  
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 1 1  
jump @Noname_484

:Noname_329
if
 [email protected] == 1
else_jump @Noname_361
[email protected] = 10
jump @Noname_484

:Noname_361
if
 [email protected] == 2
else_jump @Noname_393
[email protected] = 50
jump @Noname_484

:Noname_393
if
 [email protected] == 3
else_jump @Noname_425
[email protected] = 100
jump @Noname_484

:Noname_425
if
 [email protected] == 4
else_jump @Noname_458
[email protected] = 250
jump @Noname_484

:Noname_458
if
 [email protected] == 5
else_jump @Noname_484
[email protected] = 400

:Noname_484
return

:Noname_486
Actor.RemoveReferences([email protected])
Car.RemoveReferences([email protected])
0A93: end_custom_thread

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#13

Posted 21 March 2012 - 04:12 AM Edited by Link2012, 21 March 2012 - 04:15 AM.

This start_custom_thread will f*ck your memory until you die.

Everytime that you call it, it will allocate a new block for the script.
The end_custom_thread doesn't free the memory for me (for everyone?).

The memory will cry, cry, cry, sad sad.gif

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#14

Posted 21 March 2012 - 04:18 AM

Do you think its possible to make it into one script?

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#15

Posted 21 March 2012 - 04:26 AM

Yeah, place the custom script in a gosub.

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#16

Posted 21 March 2012 - 04:40 PM

CLEOs aren't that big, so start_custom_thread isn't a bad idea. But the best idea is to create new thread inside of one CLEO file by using some tricks.

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#17

Posted 21 March 2012 - 04:50 PM

QUOTE (SilentPL @ Wednesday, Mar 21 2012, 16:40)
CLEOs aren't that big, so start_custom_thread isn't a bad idea. But the best idea is to create new thread inside of one CLEO file by using some tricks.

Can this thread be ran multiple times? Like say [email protected] and [email protected] are actors. Can I do
CODE
0AB1: call_scm_func @CreateThread 2 @MyNewThread [email protected]
and
CODE
0AB1: call_scm_func @CreateThread 2 @MyNewThread [email protected]

Or can the thread only be ran once until it is ended?

CODE
{$CLEO}
0000:

while true
   wait 0
   if
       0ADC:   test_cheat "NEWTHREAD"
   then
       0AB1: call_scm_func @CreateThread 3 @MyNewThread 1 6
   end
end

:MyNewThread
0ACE: show_formatted_text_box "I'm a brand new thread!~n~%d %d" [email protected] [email protected]   // I'm a brand new thread!~n~1 6
wait 4000
0ACA: show_text_box "Okay, cya.."
end_thread  // You must use this opcode to end threads created with this function.

:CreateThread
0A9F: [email protected] = current_thread_pointer
000A: [email protected] += 0x10
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
0062: [email protected] -= [email protected]
0AA7: call_function 0x464C20 num_params 1 pop 1 [email protected] [email protected]
000A: [email protected] += 0x3C
for [email protected] = 0 to 30
   0A8C: write_memory [email protected] size 4 value [email protected]([email protected],30i) virtual_protect 0
   000A: [email protected] += 4
end
0AB2: ret 0

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#18

Posted 21 March 2012 - 05:57 PM

Sure, but use the fixed version from Deji + my fix, which comes few posts below on GTAG.

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#19

Posted 21 March 2012 - 08:44 PM

For 0AB1, I need to pass over 4 parameters - [email protected], [email protected], [email protected], [email protected], so would it be

CODE
0AB1: call_scm_func @CreateThread 7 @MyNewThread 1 6 [email protected] [email protected] [email protected] [email protected]


Then what would be the parameters I would use for [email protected], [email protected], [email protected], [email protected] in :MyNewThread?

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#20

Posted 21 March 2012 - 08:54 PM Edited by Link2012, 21 March 2012 - 08:57 PM.

QUOTE
Then what would be the parameters I would use for [email protected], [email protected], [email protected], [email protected] in :MyNewThread?

I didn't understand your question very well, I think that the answer is:

MyNewThread Locals:
[email protected] = 1
[email protected] = 6
[email protected] = [email protected]
[email protected] = [email protected]
[email protected] = [email protected]

EDIT:
I think that you don't want to pass 1 and 6, remove it.

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#21

Posted 21 March 2012 - 08:56 PM

QUOTE
0AB1: call_scm_func @CreateThread 7 @MyNewThread 1 6 [email protected] [email protected] [email protected] [email protected]


1 and 6 were examples of how to pass the parameters in the coding snippet, so you can remove them:
CODE
0AB1: call_scm_func @CreateThread 5 @MyNewThread [email protected] [email protected] [email protected] [email protected]


And yeah, they can be accessed by the new thread as Link said, but this time without those extra 2 parameters...
[email protected] = [email protected]
[email protected] = [email protected]
[email protected] = [email protected]
[email protected] = [email protected]

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#22

Posted 21 March 2012 - 08:59 PM

QUOTE (Link2012 @ Wednesday, Mar 21 2012, 20:54)
I didn't understand your question very well, I think that the answer is:

MyNewThread Locals:
[email protected] = 1
[email protected] = 6
[email protected] = [email protected]
[email protected] = [email protected]
[email protected] = [email protected]

I think you answered it correctly. Basically is sending parameters in 0AB1: call_scm_func @CreateThread 5 @MyNewThread the same as sending parameters using 0A92: create_custom_thread "ShowTextBox.s"

And is every parameter after @MyNewThread the start of the locals in the new thread?


EDIT: I submitted this after Deji. He explained the extra question in this post.

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#23

Posted 21 March 2012 - 09:13 PM

Can someone correct the main part of the script:
CODE
{$CLEO}
0000:

while true
   wait 0
   if
       Player.Defined($PLAYER_CHAR)
   then
       09E8: [email protected] = actor $PLAYER_ACTOR active_interior
       if
           [email protected] == 0
       then
           if
               0AE2: [email protected] = random_vehicle_near_point 0.0 0.0 0.0 in_radius 3000.0 find_next 0 pass_wrecked 1 //IF and SET
           then
               repeat
               if and
                   0975:   car [email protected] emergency_vehicle
                   0ABD:   vehicle [email protected] siren_on
               then
                   if
                       0AB1: call_scm_func @IsCarUsedByScript 1 VehicleHandle [email protected]
                   then
                       continue
                   end
                       [email protected] = 0
                       067F: set_car [email protected] lights 2
                       0209: [email protected] = random_int_in_ranges 1 5
                       gosub @Noname_1
                       [email protected] = Car.StructAdressByHandle([email protected])
                       [email protected] += 1440
                       0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 0  
                       0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 1
                       0AB1: call_scm_func @CreateThread 5 @MyNewThread VehicleHandle [email protected] VehicleStruct [email protected] TimeWait [email protected] Check [email protected]
                   
               end
           until 8AE2: not [email protected] = random_vehicle_near_point 0.0 0.0 0.0 in_radius 3000.0 find_next 1 pass_wrecked 1 //IF and SET  
       end        
   end            
end                
       


:IsCarUsedByScript{Handle}
0A97: [email protected] = car [email protected] struct
[email protected] += 0x4A4
0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
if
[email protected] == 2
0AB2: ret 0

:Noname_1
if
[email protected] == 1
else_jump @Noname_2
[email protected] = 10
jump @Noname_7

:Noname_2
if
[email protected] == 2
else_jump @Noname_3
[email protected] = 50
jump @Noname_7

:Noname_3
if
[email protected] == 3
else_jump @Noname_4
[email protected] = 100
jump @Noname_7

:Noname_4
if
[email protected] == 4
else_jump @Noname_5
[email protected] = 250
jump @Noname_7

:Noname_5
if
[email protected] == 5
else_jump @Noname_7
[email protected] = 400
jump @Noname_7

:Noname_7
return

:CreateThread
0A9F: [email protected] = current_thread_pointer
000A: [email protected] += 0x10
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
0062: [email protected] -= [email protected]
0AA7: call_function 0x464C20 num_params 1 pop 1 [email protected] [email protected]
005A: [email protected] += [email protected]
000A: [email protected] += 0x10
0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0
000A: [email protected] += 0x2C
for [email protected] = 0 to 30
   0A8C: write_memory [email protected] size 4 value [email protected]([email protected],30i) virtual_protect 0
   000A: [email protected] += 4
end
0AB2: ret 0

//----------------------------------------------------------------//

:MyNewThread
wait [email protected]
if
 Car.Defined([email protected])
else_jump @MyNewThread_4
if
  not Car.Wrecked([email protected])
jf @MyNewThread_3
if
0ABD:   vehicle [email protected] siren_on
else_jump @MyNewThread_3
gosub @MyNewThread_1
jump @MyNewThread

:MyNewThread_1
if
 [email protected] == 0
jf @MyNewThread_2
[email protected] = 1
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 1 0  
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 1  
return

:MyNewThread_2
[email protected] = 0
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 0 0  
0AA6: call_method 7086336 [email protected] num_params 2 pop 0 1 1  
return

:MyNewThread_3
Car.RemoveReferences([email protected])

:MyNewThread_4
end_thread

HeresOtis
  • HeresOtis

    SA C++ Whiz

  • Feroci
  • Joined: 29 Apr 2011
  • United-States

#24

Posted 22 March 2012 - 05:46 PM

Anyone?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users