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)


  Reply to this topicStart new topicStart Poll

 How to disable scripts?

 When playing a mission?
 
Dr. John13  
Posted: Monday, Apr 30 2012, 11:55
Quote Post


Forced™
Group Icon
Group: Members
Joined: Dec 31, 2011

XXXXX



I made another script and I am sure it will crash in missions so I was thinking how can I disable my script in missions so that the user doesn't gets any crashes?
PMMSNYahooXbox Live
  Top
 

 
Bad.boy!  
Posted: Monday, Apr 30 2012, 12:02
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



You have to edit your script. Check if $ONMISSION is one and disable your script until $ONMISSION is zero.
PM
  Top
 

 
Ashwin the new boy  
Posted: Monday, Apr 30 2012, 13:43
Quote Post


I am The Most Confused Person
Group Icon
Group: Members
Joined: Nov 14, 2010

ia.gif

XXXXX



as bad.boY said
make your script to be stuck in a loop while on you are in a mission
CODE

:0
wait 0
if
$ONMISSION == 0
jf @0
//// your script ////

this code can be changed according to the need of Script
Users WebsitePM
  Top
 

 
Dr. John13  
Posted: Monday, Apr 30 2012, 13:51
Quote Post


Forced™
Group Icon
Group: Members
Joined: Dec 31, 2011

XXXXX



Should I put it above ////--------MAIN-------//// line or below?
PMMSNYahooXbox Live
  Top
 

 
Frank.s  
Posted: Monday, Apr 30 2012, 13:56
Quote Post


IV Scripter, Modeler.
Group Icon
Group: Members
Joined: Apr 15, 2008

en.gif

Member Award




Read some basic scripting tutorials before trying to do things that you don't understand.
If you did, then you'd know the layout of a scm file and you'd know that from top to bottom it goes:

Definitions
-
Main
-
All standard threads
-
Mission threads
-
External scripts.

This post has been edited by Frank.s on Monday, Apr 30 2012, 13:58
PM
  Top
 

 
Dr. John13  
Posted: Monday, Apr 30 2012, 14:12
Quote Post


Forced™
Group Icon
Group: Members
Joined: Dec 31, 2011

XXXXX



No, guys. The script isn't disabling. I am worried about mission Snail Trail. confused.gif

Here's the layout:

CODE
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

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

:0
wait 0
if
$ONMISSION == 0
jf @0

thread 'TRAIN'
12@ = 0
33@ = 0

:TRAIN_25
wait 0
if
  Player.Defined($PLAYER_CHAR)
else_jump @TRAIN_25
if
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -1982.125 -594.5937 25.7206 radius 100.5 100.5 50.5
else_jump @TRAIN_129
if
 12@ == 0
else_jump @TRAIN_179
12@ = 1
06D7: enable_train_traffic 0
jump @TRAIN_237

:TRAIN_129
if
 12@ == 1
else_jump @TRAIN_25
12@ = 0
06D7: enable_train_traffic 0
07BE: remove_references_to_train 1@
07BE: remove_references_to_train 2@
wait 0
jump @TRAIN_25

:TRAIN_179
if and
 12@ == 1
 33@ > 5300
else_jump @TRAIN_25
06D7: enable_train_traffic 0
07BE: remove_references_to_train 1@
07BE: remove_references_to_train 2@
12@ = 0
wait 0
jump @TRAIN_25

:TRAIN_237
01EB: set_traffic_density_multiplier_to 10000.0
Model.Load(#FREIGHT)
Model.Load(#FREIFLAT)
Model.Load(#STREAK)
Model.Load(#STREAKC)
wait 0
if or
  not Model.Available(#FREIGHT)
  not Model.Available(#FREIFLAT)
  not Model.Available(#STREAK)
  not Model.Available(#STREAKC)
else_jump @TRAIN_306
jump @TRAIN_237

:TRAIN_306
06D8: 2@ = create_train_at -1981.207 -474.4401 25.7109 type 12 direction 0
06DC: set_train 2@ acc 60.0
06DD: set_train 2@ speed 70.0
wait 0
06D7: enable_train_traffic 0
06D8: 1@ = create_train_at -1979.603 -678.1725 27.759 type 12 direction 1
06DC: set_train 1@ acc 60.0
06DD: set_train 1@ speed 70.0
33@ = 0
Model.Destroy(#FREIGHT)
Model.Destroy(#FREIFLAT)
Model.Destroy(#STREAK)
Model.Destroy(#STREAKC)
jump @TRAIN_25

PMMSNYahooXbox Live
  Top
 

 
Bad.boy!  
Posted: Monday, Apr 30 2012, 15:49
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



Don't decompile your scripts if you have to source code.
Use this:
CODE
:TRAIN_25
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @TRAIN_25
if
00FE:   actor $PLAYER_ACTOR  0 (in-sphere)near_point -1982.1246 -594.5937 25.7206 radius  100.5  100.5  50.5
004D: jump_if_false @TRAIN_136
00D6: if
0039:   12@ == 0
004D: jump_if_false @TRAIN_222
if
$ONMISSION == 0
jf @TRAIN_25
0006: 12@ = 1
//00BC: show_text_highpriority GXT 'FEM_ON' time 3000 flag 1  // ON
06D7: enable_train_traffic 0
0002: jump @TRAIN_248
PM
  Top
 

 
Dr. John13  
Posted: Monday, Apr 30 2012, 16:06
Quote Post


Forced™
Group Icon
Group: Members
Joined: Dec 31, 2011

XXXXX



I tested it with the mission and I got a crash. So, I edited the script a bit and placed that opcode after Player_CHAR

CODE
{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'TRAIN'
12@ = 0
33@ = 0

:TRAIN_25
wait 0
if
 Player.Defined($PLAYER_CHAR)
else_jump @TRAIN_25
if
$ONMISSION == 0
jf @TRAIN_25
if
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -1982.125 -594.5937 25.7206 radius 100.5 100.5 50.5
else_jump @TRAIN_129
if
12@ == 0
else_jump @TRAIN_179
12@ = 1
06D7: enable_train_traffic 0
jump @TRAIN_237

:TRAIN_129
if
12@ == 1
else_jump @TRAIN_25
12@ = 0
06D7: enable_train_traffic 0
07BE: remove_references_to_train 1@
07BE: remove_references_to_train 2@
wait 0
jump @TRAIN_25

:TRAIN_179
if and
12@ == 1
33@ > 5300
else_jump @TRAIN_25
06D7: enable_train_traffic 0
07BE: remove_references_to_train 1@
07BE: remove_references_to_train 2@
12@ = 0
wait 0
jump @TRAIN_25

:TRAIN_237
Model.Load(#FREIGHT)
Model.Load(#FREIFLAT)
Model.Load(#STREAK)
Model.Load(#STREAKC)
wait 0
if or
 not Model.Available(#FREIGHT)
 not Model.Available(#FREIFLAT)
 not Model.Available(#STREAK)
 not Model.Available(#STREAKC)
else_jump @TRAIN_306
jump @TRAIN_237

:TRAIN_306
06D8: 2@ = create_train_at -1981.207 -474.4401 25.7109 type 12 direction 0
06DC: set_train 2@ acc 60.0
06DD: set_train 2@ speed 70.0
wait 0
06D7: enable_train_traffic 0
06D8: 1@ = create_train_at -1979.603 -678.1725 27.759 type 12 direction 1
06DC: set_train 1@ acc 60.0
06DD: set_train 1@ speed 70.0
33@ = 0
Model.Destroy(#FREIGHT)
Model.Destroy(#FREIFLAT)
Model.Destroy(#STREAK)
Model.Destroy(#STREAKC)
jump @TRAIN_25


And now it's working well. smile.gif Thanks to all.
PMMSNYahooXbox Live
  Top
 

 

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

0 Members:

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



 
IMG IMG