IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (2) 1 [2]   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 Check if another script

 
Deji  
Posted: Wednesday, Mar 21 2012, 20:56
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



QUOTE
0AB1: call_scm_func @CreateThread 7 @MyNewThread 1 6 0@ 3@ 5@ 6@


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 0@ 3@ 5@ 6@


And yeah, they can be accessed by the new thread as Link said, but this time without those extra 2 parameters...
0@ = 0@
1@ = 3@
2@ = 5@
3@ = 6@
Users WebsitePM
  Top
 

 
HeresOtis  
Posted: Wednesday, Mar 21 2012, 20:59
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

XXXXX



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

MyNewThread Locals:
0@ = 1
1@ = 6
2@ = 3@
3@ = 5@
4@ = 6@

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.
PM
  Top
 

 
HeresOtis  
Posted: Wednesday, Mar 21 2012, 21:13
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

XXXXX



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

while true
   wait 0
   if
       Player.Defined($PLAYER_CHAR)
   then
       09E8: 30@ = actor $PLAYER_ACTOR active_interior
       if
           30@ == 0
       then
           if
               0AE2: 0@ = 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 0@ emergency_vehicle
                   0ABD:   vehicle 0@ siren_on
               then
                   if
                       0AB1: call_scm_func @IsCarUsedByScript 1 VehicleHandle 0@
                   then
                       continue
                   end
                       6@ = 0
                       067F: set_car 0@ lights 2
                       0209: 4@ = random_int_in_ranges 1 5
                       gosub @Noname_1
                       3@ = Car.StructAdressByHandle(0@)
                       3@ += 1440
                       0AA6: call_method 7086336 3@ num_params 2 pop 0 0 0  
                       0AA6: call_method 7086336 3@ num_params 2 pop 0 0 1
                       0AB1: call_scm_func @CreateThread 5 @MyNewThread VehicleHandle 0@ VehicleStruct 3@ TimeWait 5@ Check 6@
                   
               end
           until 8AE2: not 0@ = 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: 3@ = car 0@ struct
3@ += 0x4A4
0A8D: 3@ = read_memory 3@ size 1 virtual_protect 0
if
3@ == 2
0AB2: ret 0

:Noname_1
if
4@ == 1
else_jump @Noname_2
5@ = 10
jump @Noname_7

:Noname_2
if
4@ == 2
else_jump @Noname_3
5@ = 50
jump @Noname_7

:Noname_3
if
4@ == 3
else_jump @Noname_4
5@ = 100
jump @Noname_7

:Noname_4
if
4@ == 4
else_jump @Noname_5
5@ = 250
jump @Noname_7

:Noname_5
if
4@ == 5
else_jump @Noname_7
5@ = 400
jump @Noname_7

:Noname_7
return

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

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

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

:MyNewThread_1
if
 3@ == 0
jf @MyNewThread_2
3@ = 1
0AA6: call_method 7086336 1@ num_params 2 pop 0 1 0  
0AA6: call_method 7086336 1@ num_params 2 pop 0 0 1  
return

:MyNewThread_2
3@ = 0
0AA6: call_method 7086336 1@ num_params 2 pop 0 0 0  
0AA6: call_method 7086336 1@ num_params 2 pop 0 1 1  
return

:MyNewThread_3
Car.RemoveReferences(0@)

:MyNewThread_4
end_thread
PM
  Top
 

 
HeresOtis  
Posted: Thursday, Mar 22 2012, 17:46
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

XXXXX



Anyone?
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (2) 1 [2] 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG