DIR Return Create A Forum - Home
---------------------------------------------------------
gtaforums
HTML https://gtamixmods.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Tutorials
*****************************************************
#Post#: 157--------------------------------------------------
[TUT|SA]How to create missions without DYOM.
DIR By: ArijitSen
Date: November 10, 2012, 8:59 pm
---------------------------------------------------------
So another tutorial from me .By this tutorial you will be able
to make your own
missions .So without wasting time let us go for it.. ;D
[SIZE=7]1. Mission Defined Table[/SIZE]
Missionscripts of main.scm must be listed in the Mission Defined
Table
[CODE]DEFINE MISSIONS 2// amount of defined missionscripts
DEFINE MISSION 0 AT @INITIAL_1
DEFINE MISSION 1 AT @TestMission_1[/CODE]
------------------------------------------------------------------------
[SIZE=7]2. on_mission_flag[/SIZE]
$ONMISSION is not only a variable to check if a mission script
is running or not.
Set $ONMISSION to 1 activates a special mission mode if some
important conditions are accomplished.
It needs to set $ONMISSION equal to on_mission_flag
[CODE]0180: set_on_mission_flag_to $ONMISSION// Note: your
missions have to use the variable defined here[/CODE]
This code is set by default in the main part of the original
main.scm
------------------------------------------------------------------------
[SIZE=7]3. Missionstart[/SIZE]
opcode 0417: to start a missionscript works also in cleoscripts
to start a mission of main.scm
[CODE]0417: start_mission 0
0417: start_mission 1[/CODE]
The parameter value gives the number in order of the Mission
Defined Table
It's also possible to insert the label of the missionscript
(without @)
[CODE]0417: start_mission INITIAL_1
0417: start_mission TestMission_1[/CODE]
You can place this code where you want unless in missionscripts
Normaly is used a little script to check if the player_actor is
near a specified location
We call it mission sniffer
But in addition does the originaly main.scm also contains
mission scripts just to setup stuff
So you can find these start_mission codes at beginning of the
main thread of originaly main.scm:
[CODE]0417: start_mission 0 // Initial 1
0417: start_mission 1 // Initial 2[/CODE]
depending to your decompilation mode can also be this:
[CODE]0417: start_mission INITIAL // Initial 1
0417: start_mission INITIL2 // Initial 2[/CODE]
------------------------------------------------------------------------
[SIZE=7]4. Very simple missionscript without
on_mission_mode[/SIZE]
The very shortest version of a missionscript is this:
[CODE]:INITIAL_1
03A4: name_thread 'INITIAL'
004E: end_thread[/CODE]
It can be used to setup stuff:
[CODE]:INITIAL_1
03A4: name_thread 'INITIAL'
014B: 1@ = init_parked_car_generator #PCJ600 0 17 1 alarm 0
door_lock 0 0 10000 at 2490.0 -1682.0 13.5 angle 90.0
014C: set_parked_car_generator 1@ cars_to_generate_to 101
032B: 2@ = create_weapon_pickup #AK47 15 ammo 3000 at 2490.0
-1662.0 13.5
032B: 3@ = create_weapon_pickup #JETPACK 15 ammo 0 at 2492.0
-1662.0 13.5
0213: 4@ = create_pickup #BODYARMOUR type 15 at 2494.0 -1662.0
13.5
0213: 5@ = create_pickup #GUN_PARA type 15 at 2496.0 -1662.0
13.5
0213: 6@ = create_pickup #BRIBE type 15 at 2498.0 -1662.0 13.5
004E: end_thread[/CODE]
Mission 0 and Mission 1 of originaly main.scm
[CODE]//-------------Mission 0---------------
// Originally: Initial 1
:INITIAL
03A4: name_thread 'INITIAL'
---
--
-
004E: end_thread
This mission is used in originally main.scm to setup a lot of
parked cars, objects and predefined values
//-------------Mission 1---------------
// Originally: Initial 2
:INITIL2
03A4: name_thread 'INITIL2'
0004: $3407 = 25
---
--
-
004E: end_thread
This mission is used in originally main.scm to setup a lot of
parked cars, objects and predefined values
[/CODE]
------------------------------------------------------------------------
[SIZE=7]5. Mission Sniffer (Missionstart script)[/SIZE]
A Mission Sniffer is mostly done in this way:
[CODE]:MissionStart1
03A4: name_thread "MST"
:MissionStart2
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
else_jump @MissionStart2
if
0038: $ONMISSION == 0 // integer values
else_jump @MissionStart2
if
00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot
2498.5 -1678.5 13.35 radius 2.0 2.0 1.0
else_jump @MissionStart2
0004: $ONMISSION = 1 // integer values
0417: start_mission 1 // originally: TestMission
jump @MissionStart2[/CODE]
The parameter 1 of the near_point opcode 00FE: actor
$PLAYER_ACTOR 1 (in-sphere)near_point
is displaying a red marker (sphere).
If the parameter is zero 00FE: actor $PLAYER_ACTOR 0
(in-sphere)near_point does not displaying a red marker.
To display a red marker in this way needs to set 0 ms as maximum
in the wait code of this Loop
A Mission Sniffer must check the on_mission_flag, if $ONMISSION
== 0, to avoid starting missionscripts at twice
------------------------------------------------------------------------
[SIZE=7]6. Mission Script Template with on_mission_mode (Action
Mission)[/SIZE]
[CODE]:TestMiss_1
03A4: name_thread "TESTM"
0050: gosub @TestMiss_main_1
if
0112: wasted_or_busted
else_jump @TestMiss_end_1
0050: gosub @TestMiss_fail_1
:TestMiss_end_1
0050: gosub @TestMiss_clep_1
004E: end_thread
:TestMiss_main_1
0317: increment_mission_attempts//here starts the missionscript
0004: $ONMISSION = 1
:TestMiss_11
0001: wait 0 ms
if
00E1: key_pressed 0 17//press fire button to pass the mission
else_jump @TestMiss_11
:TestMiss_pass_1
00BA: text_styled 'M_PASS' 5000 ms 1
0051: return
:TestMiss_fail_1
00BA: text_styled 'M_FAIL' 5000 ms 1
0051: return
:TestMiss_clep_1
0004: $ONMISSION = 0
00D8: mission_cleanup
0051: return[/CODE]
As first a gosub to let the mission script run in a subroutine
[CODE]gosub @TestMiss_main_1[/CODE]
[CODE]:TestMiss_main_1
0317: increment_mission_attempts//here starts the missionscript
0004: $ONMISSION = 1
:TestMiss_11// the code is looping in a subroutine
0001: wait 0 ms
if
00E1: key_pressed 0 17
else_jump @TestMiss_11[/CODE]
Then the mission is running in a subroutine and dont needs to
check if player is defined or dead or busted.
If player dies or get busted, [B][U]the exe cancels the
subroutine[/U][/B] as like as a return code of our script is
readed
------------------------------------------------------------------------
[SIZE=7]7.gosub[/SIZE]
The gosub command leads the reading process to an excluded
subscript.
Excluded means the codes of the subscript are not binded in the
code order of our thread.
[CODE]0050: gosub @MODLSUBROUTINE[/CODE]
A subscript must allways end with return
[CODE]0051: return[/CODE]
If the subscript ends with 0051: return, our thread then
continues with reading the codes after the 0050: gosub command
Example:
[CODE]:MODLSUB_1
03A4: name_thread 'MODLSUB'
:MODLSUB_2
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
else_jump @MODLSUB_2
if
00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot
2491.5 -1667.5 13.35 radius 1.0 1.0 1.0
else_jump @MODLSUB_2
0050: gosub @MODLSUBROUTINE
:Loop_1
0001: wait 0 ms
if
8118: NOT actor 1@ dead
else_jump @Cleanup_1
if
0104: actor $PLAYER_ACTOR near_actor 1@ radius 80.0 80.0
10.0 sphere 0
else_jump @Cleanup_1
0002: jump @Loop_1
:Cleanup_1
01C2: remove_references_to_actor 1@ // Like turning an actor
into a random pedestrian
0002: jump @MODLSUB_2
:MODLSUBROUTINE
0005: 1@ = 2473.25
0005: 2@ = -1657.79
0005: 3@ = 13.4
0005: 4@ = 2501.12
0005: 5@ = -1676.5
0005: 6@ = 13.4
0208: 7@ = random_float_in_ranges 1@ 4@
0208: 8@ = random_float_in_ranges 2@ 5@
0208: 9@ = random_float_in_ranges 3@ 6@
0247: request_model #TRIBOSS
0247: request_model #AK47
:Load_MODLSUB_Check
0001: wait 0 ms
if and
0248: model #TRIBOSS available
0248: model #AK47 available
else_jump @Load_MODLSUB_Check
009A: 1@ = create_actor 24 #TRIBOSS at 7@ 8@ 9@
0173: set_actor 1@ z_angle_to 180.0
01B2: give_actor 1@ weapon 30 ammo 99999 // Load the weapon
model before using this
02E2: set_actor 1@ weapon_accuracy_to 100
0223: set_actor 1@ health_to 1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model #TRIBOSS
0051: return[/CODE]
A subscript must allways end with return
and only subscripts may end with return
------------------------------------------------------------------------
[SIZE=7]8. The Head of the Mission Script Template[/SIZE]
[CODE]:TestMiss_1
03A4: name_thread "TESTM"
0050: gosub @TestMiss_main_1
if
0112: wasted_or_busted
else_jump @TestMiss_end_1
0050: gosub @TestMiss_fail_1
:TestMiss_end_1
0050: gosub @TestMiss_clep_1
004E: end_thread
[/CODE]
As first a gosub to let the mission script run in a subroutine
gosub @TestMiss_main_1
Then the mission is running in a subroutine and dont needs to
check if player is defined or dead or busted.
If player dies or get busted, [B][U]the exe cancels the
subroutine[/U][/B] as like as a return code of our script was
readed
Alternativly can the reading process run into return, for
example if the mission is successful completed, for example if
the actor 1@ is dead
(in the Mission Script Template does it need just to press the
fire button to let the reading process run into the return of
the mission_passed scriptpart)
So either the reading process reads a return or will be canceled
by the exe
Then the reading process continue the script after gosub
@TestMiss_main_1
This is then the wasted_or_busted check (opcode 0112: works only
in mission mode)
If player was wasted or busted it runs into the mission fail
subscript: gosub @TestMiss_fail_1
If player was not wasted or busted it skips the gosub to the
mission fail subscript
In both ways it runs at the end into the gosub to the mission
cleanup subscript: gosub @TestMiss_clep_1
At the very end it runs into end_thread to terminate the mission
thread
------------------------------------------------------------------------
[SIZE=7]9. Where to place the scripts[/SIZE]
I will explain and
[U][B][SIZE=7]subdivide the decompiled main.scm and script.img
in to 8 segments[/SIZE][/B][/U]
first 5 segment, OBJECT TABLE, MISSION TABLE, EXTERNAL_SCRIPT
table, UNKNOWN_EMPTY_SEGMENT, UNKNOWN_THREADS_MEMORY
[CODE]1.) OBJECT TABLE
DEFINE OBJECTS 3 // max. amount of defined
OBJECTS
DEFINE OBJECT (dummyobject) // Object 0 is always unused.
You can put anything here.
DEFINE OBJECT KEYCARD // Object 1
DEFINE OBJECT A51_JETDOOR // Object 2
Objectlist to can use objects by modelname e.g. A51_JETDOOR:
0107: $2670 = create_object #A51_JETDOOR at 268.664 1884.06
15.925
also possible to use the count number of Objectlist e.g.
A51_JETDOOR:
0107: $2670 = create_object -2 at 268.664 1884.06 15.925
----------------------------------------------------------------
2.) MISSION TABLE
DEFINE MISSIONS 3 // max. amount of defined
MISSIONS
DEFINE MISSION 0 AT @INITIAL // Initial 1
DEFINE MISSION 1 AT @INITIL2 // Initial 2
DEFINE MISSION 2 AT @INTRO // Intro; originally
Intromission
these first 3 missions of originally main.scm start immediately
at gamestart
----------------------------------------------------------------
3.) EXTERNAL_SCRIPT table
DEFINE EXTERNAL_SCRIPTS 1 // max. amount of
defined EXTERNAL_SCRIPTS
DEFINE SCRIPT PLAYER_PARACHUTE AT @PLCHUTE // 0
Player_parachute
------------------------------------------------------------------
4.) a unknown or unused segment (don't change anything)
DEFINE UNKNOWN_EMPTY_SEGMENT 0
------------------------------------------------------------------
5.) a unknown or unused segment (don't change anything)
DEFINE UNKNOWN_THREADS_MEMORY 0
------------------------------------------------------------------[/CODE]
6.) MAINPART
[CODE]6.) MAINPART
means: main thread
and other normal threads, executed by 004F: create_thread
main thread (main script) at gamestart
now the reading process runs into the main thread, the source
script to create the player-actor in the gameworld and to start
all other scripts
//-------------MAIN---------------
:MAIN_1
03A4: name_thread 'MAIN'
016A: fade 0 (in) 0 ms
04E4: unknown_refresh_game_renderer_at 2494.5 -1668.5
03CB: set_camera 2494.5 -1668.5 13.4
0053: $PLAYER_CHAR = create_player #NULL at 2494.5 -1668.5 13.4
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player
$PLAYER_CHAR
0180: set_on_mission_flag_to $ONMISSION // Note: your missions
have to use the variable defined here
004F: create_thread @HOTR
"create_thread" starts a thread (script) which is placed in the
MAINPART
a part of the threads of originally main.scm are initialized in
the main thread directly by create_thread
---
other threads which are placed in the MAINPART are initialized
indirectly
indirectly means to start a thread which starts also another
thread
for example the Intro mission of originally main.scm starts the
thread of the mobil phone for storyline
004F: create_thread @MOB_LA1
to start this thread which is also placed in the MAINPART:
:MOB_LA1
0111: set_wasted_busted_check 0
03A4: name_thread 'MOB_LA1'
---
---
"start_mission" starts a mission script in mission mode which is
placed in the MISSIONPART
The startcodes for the first 2 mission scripts of originally
main.scm are placed in the main thread
these missions are used in originally main.scm to setup a lot of
parked cars, objects and predefined values
0417: start_mission 0 // Initial 1
0001: wait 0 ms
0417: start_mission 1 // Initial 2
a mission script in mission mode means that you have to use some
special methods
very important is to have this line in the main thread
0180: set_on_mission_flag_to $ONMISSION
Other start_mission codes are placed in Mission Starter Threads,
"mission sniffer"
For Example the "Sweet mission sniffer" of originally main.scm
:SWEET
03A4: name_thread 'SWEET'
...
..
.
00D6: if
0038: $SWEET_TOTAL_PASSED_MISSIONS == 0
004D: jump_if_false @SWEET_180
0004: $ONMISSION = 1
00BA: show_text_styled GXT 'SWEET_1' time 1000 style 2 //
Lighthouse Mutants
0417: start_mission 13 // Tagging Up Turf
---
---
"run_external_script" starts an external_script which is placed
in the EXTERN SCRIPT PART
0913: run_external_script 66 (CARMOD1)
it needs first to load and check if the script is loaded
08A9: load_external_script 66 (CARMOD1)
00D6: if
08AB: external_script 66 (CARMOD1) loaded
004D: jump_if_false @MAIN_4329
0913: run_external_script 66 (CARMOD1)
Some startcodes for Extern Scripts of originally main.scm like
CARMOD1 are placed in the main thread
Other startcodes for Extern Scripts are placed in other threads
or mission scripts as well in extern scripts
---
---
Ok, summery: the MAINPART (6) contains the main thread and other
normal threads
The MAINPART ends where the MISSIONPART beginns
These are the last lines of MAINPART of originally main.scm
:MOB_GF_3609
00BE: text_clear_all
0051: return
End of MAINPART
Here can you place your modscript which is mostly just a normal
thread
Below of the last thread of MAINPART
Above of the first mission script
Note:
The amount of data of MAINPART is limited to 200 000 byte[/CODE]
7.) MISSIONPART
[CODE]7. MISSIONPART
Here are placed the mission scripts which must be defined in the
MISSION TABLE
The MISSIONPART beginns where the MAINPART ends, at:
//-------------Mission 0---------------
// Originally: Initial 1
:INITIAL
03A4: name_thread 'INITIAL'
This mission is used in originally main.scm to setup a lot of
parked cars, objects and predefined values
//-------------Mission 1---------------
// Originally: Initial 2
:INITIL2
03A4: name_thread 'INITIL2'
0004: $3407 = 25
This mission is used in originally main.scm to setup a lot of
parked cars, objects and predefined values
//-------------Mission 2---------------
// Originally: Intro
This is the the originally Intromission where CJ arrived at
Airport in originally main.scm
:INTRO
03A4: name_thread 'INTRO'
0050: gosub @INTRO_47
00D6: if
0112: wasted_or_busted // mission only
004D: jump_if_false @INTRO_38
0050: gosub @INTRO_9994
:INTRO_38
0050: gosub @INTRO_9996
004E: end_thread
:INTRO_47
0004: $ONMISSION = 1
---
---
End of MISSIONPART
Here can you place your MissionScript which must be defined in
the MISSION TABLE
Below of the last Missionscript
Above of the first EXTERNAL_SCRIPT[/CODE]
-----------------------------------------------------------------------------------------------------------
missionscripts must be placed in same order as they are defined
in the Mission Defined Table
-----------------------------------------------------------------------------------------------------------
8.) EXTERNAL_SCRIPT Part
[CODE]8.) EXTERNAL_SCRIPT
Externscripts will be compiled to seperately script files and
archived in script.img
The first Externscript of the originally script.img is the
player_parachute script
//-------------External script 0
(PLAYER_PARACHUTE)---------------
:PLCHUTE
03A4: name_thread 'PLCHUTE'
0247: load_model #GUN_PARA
:PLCHUTE_16
00D6: if
8248: not model #GUN_PARA available
004D: jump_if_false @PLCHUTE_43
0001: wait 0 ms
0002: jump @PLCHUTE_16
The first Externscript is normaly the aaa.scm when you open
script.img with img tool
aaa.scm is an empty dummy script because an empty script.img
can't exist
so if you don't have any Externscripts in your source script,
then set the amount of defined externscripts of the
EXTERNAL_SCRIPT table to -1 and none script.img will be created
if you set the amount of defined externscripts to 0, it creates
a script.img which contains the aaa.scm[/CODE]
-----------------------------------------------------------------------------------------------------------
externscripts must be placed in same order
as they are defined in the Externscript Defined Table
-----------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------
Below a total stripped main with 2 missions
mission 0 and mission 1
gamestart in Grovestreet where you find the stuff of mission 0
and also the marker to start mission 1
compile it and test it
[CODE]
DEFINE OBJECTS 1
DEFINE OBJECT (dummyobject) // This is an unused object. You can
put anything here.
DEFINE MISSIONS 2
DEFINE MISSION 0 AT @INITIAL_1 // originally: Initial 1
DEFINE MISSION 1 AT @TestMission_1 // originally: TestMission
DEFINE EXTERNAL_SCRIPTS -1
DEFINE UNKNOWN_EMPTY_SEGMENT 0
DEFINE UNKNOWN_THREADS_MEMORY 0
//-------------MAIN---------------
:MAIN_1
03A4: name_thread 'MAIN'
016A: fade 0 (in) 0 ms
042C: set_total_missions_to 0
030D: set_total_mission_points_to 0
01F0: set_max_wanted_level_to 6
0111: set_wasted_busted_check_to 0 (disabled)
00C0: set_current_time 23 0
04E4: unknown_refresh_game_renderer_at 2494.5 -1668.5
03CB: set_camera 2494.5 -1668.5 13.4
0053: $PLAYER_CHAR = create_player #NULL at 2494.5 -1668.5 13.4
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player
$PLAYER_CHAR
0173: set_actor $PLAYER_ACTOR z_angle_to 7.0
0373: set_camera_directly_behind_player
070D: $PLAYER_CHAR
0629: change_stat 181 (islands unlocked) to 4 // integer see
statdisp.dat
01B6: set_weather 1
04BB: select_interior 0 // select render area
01B4: set_player $PLAYER_CHAR frozen_state 1 (unfrozen)
01B7: release_weather
016C: restart_if_wasted_at 2494.5 -1668.5 13.4 angle 180.0
town_number 0
016D: restart_if_busted_at 2494.5 -1668.5 13.4 angle 180.0
town_number 0
016C: restart_if_wasted_at 2494.5 -1668.5 13.4 angle 180.0
town_number 1
016D: restart_if_busted_at 2494.5 -1668.5 13.4 angle 180.0
town_number 1
016C: restart_if_wasted_at 2494.5 -1668.5 13.4 angle 180.0
town_number 2
016D: restart_if_busted_at 2494.5 -1668.5 13.4 angle 180.0
town_number 2
0629: change_stat 181 (islands unlocked) to 4 // integer see
statdisp.dat
0998: add_respect 1000
062A: change_stat 165 (energy) to 800.0 // float
062A: change_stat 23 (muscle) to 800.0 // float
062A: change_stat 21 (fat) to 200.0 // float
0629: change_stat 225 (lung capasity) to 1000 // integer see
statdisp.dat
0629: change_stat 22 (stamina) to 1000 // integer see
statdisp.dat
0629: change_stat 156 (dance skill) to 1000 // integer see
statdisp.dat
062A: change_stat 81 (gambling skill) to 1000.0 // integer see
statdisp.dat
087B: set_player $PLAYER_CHAR clothes_texture "HAWAIIRED" model
"HAWAII" body_part 0
087B: set_player $PLAYER_CHAR clothes_texture "BASK2HEATBAND"
model "BASK1" body_part 3
087B: set_player $PLAYER_CHAR clothes_texture "GLASSES05DARK"
model "GLASSES03" body_part 15
087B: set_player $PLAYER_CHAR clothes_texture "LEATHERTR" model
"LEATHERTR" body_part 2
070D: rebuild_player $PLAYER_CHAR
0109: player $PLAYER_CHAR money += 350000
016A: fade 1 (out) 1000 ms
0001: wait 100 ms
03E6: remove_text_box
0180: set_on_mission_flag_to $ONMISSION // Note: your missions
have to use the variable defined here
0417: start_mission 0 // originally: Initial 1
004F: create_thread @MissionStart1
:MAIN_3
0001: wait 2500 ms
jump @MAIN_3
:MissionStart1
03A4: name_thread "MST"
:MissionStart2
0001: wait 0 ms
if
0256: player $PLAYER_CHAR defined
else_jump @MissionStart2
if
0038: $ONMISSION == 0 // integer values
else_jump @MissionStart2
if
00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot
2498.5 -1678.5 13.35 radius 2.0 2.0 1.0
else_jump @MissionStart2
0004: $ONMISSION = 1 // integer values
0417: start_mission 1 // originally: TestMission
jump @MissionStart2
//-------------Mission 0---------------
// Originally: Initial 1
:INITIAL_1
03A4: name_thread 'INITIAL'
014B: 1@ = init_parked_car_generator #PCJ600 0 17 1 alarm 0
door_lock 0 0 10000 at 2490.0 -1682.0 13.5 angle 90.0
014C: set_parked_car_generator 1@ cars_to_generate_to 101
032B: 2@ = create_weapon_pickup #AK47 15 ammo 3000 at 2490.0
-1662.0 13.5
032B: 3@ = create_weapon_pickup #JETPACK 15 ammo 0 at 2492.0
-1662.0 13.5
0213: 4@ = create_pickup #BODYARMOUR type 15 at 2494.0 -1662.0
13.5
0213: 5@ = create_pickup #GUN_PARA type 15 at 2496.0 -1662.0
13.5
0213: 6@ = create_pickup #BRIBE type 15 at 2498.0 -1662.0 13.5
004E: end_thread
//-------------Mission 1---------------
// Originally: TestMission
:TestMission_1
03A4: name_thread "TMISS"
0050: gosub @TestMission_main_1
if
0112: wasted_or_busted
else_jump @TestMission_end_1
0050: gosub @TestMission_fail_1
:TestMission_end_1
0050: gosub @TestMission_clep_1
004E: end_thread
:TestMission_main_1
0317: increment_mission_attempts//here starts the missionscript
0004: $ONMISSION = 1
0247: request_model #VMAFF4
0247: request_model #AK47
:Load_models1
0001: wait 0 ms
00D6: if 1
0248: model #VMAFF4 available
0248: model #AK47 available
else_jump @Load_models1
009A: 1@ = create_actor 24 #VMAFF4 at 2486.5 -1664.5 13.45
0173: set_actor 1@ z_angle_to 180.0
01B2: give_actor 1@ weapon 30 ammo 99999 // Load the weapon
model before using this
02E2: set_actor 1@ weapon_accuracy_to 100
0223: set_actor 1@ health_to 1000
05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR
0249: release_model #VMAFF4
:Loop_1
0001: wait 0 ms
if
8118: NOT actor 1@ dead
else_jump @TestMission_passed_1
if
0104: actor $PLAYER_ACTOR near_actor 1@ radius 80.0 80.0
10.0 sphere 0
else_jump @TestMission_fail_1
jump @Loop_1
:TestMission_passed_1
00BA: text_styled 'M_PASSD' 5000 ms 1
0110: clear_player $PLAYER_CHAR wanted_level
0109: player $PLAYER_CHAR money += 5000
0394: play_music 1
0051: return
:TestMission_fail_1
00BA: text_styled 'M_FAIL' 5000 ms 1 // MISSION FAILED!
0051: return
:TestMission_clep_1
01C2: remove_references_to_actor 1@ // Like turning an actor
into a random pedestrian
0004: $ONMISSION = 0 // integer values
00D8: mission_cleanup
0051: return[/CODE]
*****************************************************
Page 1 of 1