Quantcast

Jump to content

» «
Photo

[Tut] Make your own GTA:SA interactive menu

No replies to this topic
Manfred Von Karma
  • Manfred Von Karma

    Trick

  • Members
  • Joined: 16 Jun 2009
  • None

#1

Posted 14 October 2012 - 01:12 AM


Hi There , today i'm gonna show you the way to include a custom User Interface into GTA:SA via coding ...

So here are the steps to procceed with :



1. We will collect first some images from Google that are related to our theme of the project , in my case , i chose " Hitman 2 ".

2.Then , we will create a new TXD dictionary that will hold the pictures as textures for the game.

3.And the finale step will be of course Coding the script , wich will be in this case a MissionPack (MPACK)




So lets begin ...




______________________________________________________________________________

Downloading the pictures
______________________________________________________________________________


We will need for this Hitman 2 UI :

1. A cursor icon

2. Some cool hitman background

3. Menu text ( Start Game , Load Game ...) wich can be done by urself without download ...


Cursor Background


user posted image , http://www.zastavki...._2_001426_1.jpg



Save your pictures at your desktop , rename the cursor picture "Cursor" and the Background "Menu" , Note that the pictures should either be one of the following formats : BMP , PNG or TGA , if not then convert them .


______________________________________________________________________________

Setting up the TXD file
______________________________________________________________________________

Using Txd workshop 4.5 open a txd file that u find at /Models/Txd folder , any one , it doesn't matter ... then Click >> File >> Save as >> and name the new file Hitman.txd , click Save .
Now Close the txd file and open Hitman.txd , then delete all the images that you find in it , and start sliding the ones that you downloaded ( Cursor , background ...) on top of the Software ... now you should see you pics added in the list , Compress them by clicking on Image >> Compress All .
Save the TXD



______________________________________________________________________________

Coding
______________________________________________________________________________

Now its coding time , the file that i attached with the topic contains he MPACK folder , put it at GTA SA USER FILES /

Open the SCR.scm file using Sanny Builder, you should already see that the script header is set up , now we need to script the User Interface ...

CODE
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
DEFINE OBJECTS 339
DEFINE OBJECT SANNY BUILDER 3.04  
DEFINE OBJECT CJ_MONEY_BAG     // Object number -1
DEFINE OBJECT TRAFFICCONE      // Object number -2
DEFINE OBJECT CLOTHESP     // Object number -3
DEFINE OBJECT GREEN_GLOOP      // Object number -4
DEFINE OBJECT BRIEFCASE    // Object number -5
DEFINE OBJECT KMB_RHYMESBOOK   // Object number -6
DEFINE OBJECT IMY_SHASH_WALL   // Object number -7
DEFINE OBJECT HEALTH       // Object number -8
DEFINE OBJECT BODYARMOUR   // Object number -9
DEFINE OBJECT BRIBE    // Object number -10
DEFINE OBJECT KEYCARD      // Object number -11
DEFINE OBJECT GUNPARA      // Object number -12
DEFINE OBJECT INFO     // Object number -13
DEFINE OBJECT CAMERAPICKUP     // Object number -14
DEFINE OBJECT MONEY    // Object number -15
DEFINE OBJECT CIGAR_GLOW   // Object number -16
DEFINE OBJECT WATERJUMP1   // Object number -17
DEFINE OBJECT LANDJUMP2    // Object number -18
DEFINE OBJECT WATERJUMPX2      // Object number -19
DEFINE OBJECT DYN_RAMP     // Object number -20
DEFINE OBJECT AD_JUMP      // Object number -21
DEFINE OBJECT ROADWORKBARRIER1     // Object number -22
DEFINE OBJECT DYN_ROADBARRIER_2    // Object number -23
DEFINE OBJECT DYN_ROADBARRIER_3    // Object number -24
DEFINE OBJECT DYN_ROADBARRIER_4    // Object number -25
DEFINE OBJECT IMY_TRACK_BARRIER    // Object number -26
DEFINE OBJECT BARRIER_4ANDY    // Object number -27
DEFINE OBJECT WS_APGATE    // Object number -28
DEFINE OBJECT GATE_AUTOL   // Object number -29
DEFINE OBJECT GATE_AUTOR   // Object number -30
DEFINE OBJECT WONGS_GATE   // Object number -31
DEFINE OBJECT CT_GATEXR    // Object number -32
DEFINE OBJECT KMB_SHUTTER      // Object number -33
DEFINE OBJECT SFCOPDR      // Object number -34
DEFINE OBJECT AD_FLATDOOR      // Object number -35
DEFINE OBJECT KB_BANDIT_U      // Object number -36
DEFINE OBJECT ROULETTE_TBL     // Object number -37
DEFINE OBJECT OTB_MACHINE      // Object number -38
DEFINE OBJECT CJ_COIN_OP_3     // Object number -39
DEFINE OBJECT CJ_COIN_OP_2     // Object number -40
DEFINE OBJECT CJ_COIN_OP_1     // Object number -41
DEFINE OBJECT CJ_COIN_OP   // Object number -42
DEFINE OBJECT SWANK_CONSOLE    // Object number -43
DEFINE OBJECT SNESISH      // Object number -44
DEFINE OBJECT LOW_CONSOLE      // Object number -45
DEFINE OBJECT VENDMACHFD   // Object number -46
DEFINE OBJECT VENDIN3      // Object number -47
DEFINE OBJECT CJ_SPRUNK1   // Object number -48
DEFINE OBJECT CJ_CANDYVENDOR   // Object number -49
DEFINE OBJECT CJ_EXT_CANDY     // Object number -50
DEFINE OBJECT CJ_EXT_SPRUNK    // Object number -51
DEFINE OBJECT ICESCART_PROP    // Object number -52
DEFINE OBJECT CHILLIDOGCART    // Object number -53
DEFINE OBJECT NOODLECART_PROP  // Object number -54
DEFINE OBJECT GYM_BIKE     // Object number -55
DEFINE OBJECT GYM_BENCH1   // Object number -56
DEFINE OBJECT GYM_TREADMILL    // Object number -57
DEFINE OBJECT GYM_MAT1     // Object number -58
DEFINE OBJECT BSKBALL_LAX      // Object number -59
DEFINE OBJECT VGSXREFBBALLNET  // Object number -60
DEFINE OBJECT VGSXREFBBALLNET2     // Object number -61
DEFINE OBJECT K_POOLTABLESM    // Object number -62
DEFINE OBJECT NEIL_SLOT    // Object number -63
DEFINE OBJECT CJ_SLOT_BANK     // Object number -64
DEFINE OBJECT BLCK_JACK    // Object number -65
DEFINE OBJECT WHEEL_O_FORTUNE  // Object number -66
DEFINE OBJECT WOODENBOX    // Object number -67
DEFINE OBJECT NF_BLACKBOARD    // Object number -68
DEFINE OBJECT GEN_DOOREXT03    // Object number -69
DEFINE OBJECT GEN_DOOREXT07    // Object number -70
DEFINE OBJECT GEN_DOORSHOP02   // Object number -71
DEFINE OBJECT GEN_DOOREXT04    // Object number -72
DEFINE OBJECT GEN_DOORSHOP3    // Object number -73
DEFINE OBJECT c*ntGIRLDOOR     // Object number -74
DEFINE OBJECT PIZZAHIGH    // Object number -75
DEFINE OBJECT CJ_PIZZA_1   // Object number -76
DEFINE OBJECT CJ_PIZZA_2   // Object number -77
DEFINE OBJECT BURGERHIGH   // Object number -78
DEFINE OBJECT CJ_BURG_1    // Object number -79
DEFINE OBJECT CJ_BURG_2    // Object number -80
DEFINE OBJECT CIGAR    // Object number -81
DEFINE OBJECT TRDCSGRGDOOR_LVS     // Object number -82
DEFINE OBJECT CR_DOOR_01   // Object number -83
DEFINE OBJECT CR_DOOR_03   // Object number -84
DEFINE OBJECT SHUTTER_VEGAS    // Object number -85
DEFINE OBJECT CR1_DOOR     // Object number -86
DEFINE OBJECT A51_BLASTDOORR   // Object number -87
DEFINE OBJECT A51_BLASTDOORL   // Object number -88
DEFINE OBJECT A51_LABDOOR      // Object number -89
DEFINE OBJECT A51_JETDOOR      // Object number -90
DEFINE OBJECT PORTAKABIN   // Object number -91
DEFINE OBJECT FREIGHT_SFW_DOOR     // Object number -92
DEFINE OBJECT AB_CASDORLOK     // Object number -93
DEFINE OBJECT IMY_SHASH_WALL   // Object number -94
DEFINE OBJECT TWRCRANE_M_04    // Object number -95
DEFINE OBJECT TWRCRANE_M_01    // Object number -96
DEFINE OBJECT A51_VENTCOVERB   // Object number -97
DEFINE OBJECT CARRIER_DOOR_SFSE    // Object number -98
DEFINE OBJECT CARRIER_LIFT2_SFSE   // Object number -99
DEFINE OBJECT CARRIER_LIFT1_SFSE   // Object number -100
DEFINE OBJECT GWFORUM1_LAE     // Object number -101
DEFINE OBJECT GANGSHOPS4_LAE2  // Object number -102
DEFINE OBJECT K_POOLQ      // Object number -103
DEFINE OBJECT K_POOLBALLCUE    // Object number -104
DEFINE OBJECT K_POOLBALLSPT01  // Object number -105
DEFINE OBJECT K_POOLBALLSPT02  // Object number -106
DEFINE OBJECT K_POOLBALLSPT03  // Object number -107
DEFINE OBJECT K_POOLBALLSPT04  // Object number -108
DEFINE OBJECT K_POOLBALLSPT05  // Object number -109
DEFINE OBJECT K_POOLBALLSPT06  // Object number -110
DEFINE OBJECT K_POOLBALLSPT07  // Object number -111
DEFINE OBJECT K_POOLBALL8      // Object number -112
DEFINE OBJECT K_POOLBALLSTP01  // Object number -113
DEFINE OBJECT K_POOLBALLSTP02  // Object number -114
DEFINE OBJECT K_POOLBALLSTP03  // Object number -115
DEFINE OBJECT K_POOLBALLSTP04  // Object number -116
DEFINE OBJECT K_POOLBALLSTP05  // Object number -117
DEFINE OBJECT K_POOLBALLSTP06  // Object number -118
DEFINE OBJECT K_POOLBALLSTP07  // Object number -119
DEFINE OBJECT K_POOLQ2     // Object number -120
DEFINE OBJECT DYN_WINE_BIG     // Object number -121
DEFINE OBJECT KB_BEER      // Object number -122
DEFINE OBJECT CASKET_LAW   // Object number -123
DEFINE OBJECT BD_WINDOW    // Object number -124
DEFINE OBJECT CR_AMMOBOX   // Object number -125
DEFINE OBJECT BD_WINDOW_SHATTER    // Object number -126
DEFINE OBJECT SEC_KEYPAD   // Object number -127
DEFINE OBJECT KMB_RAMP     // Object number -128
DEFINE OBJECT IMCMPTRKDRL_LAS  // Object number -129
DEFINE OBJECT IMCMPTRKDRR_LAS  // Object number -130
DEFINE OBJECT IMCOMPMOVEDR1_LAS    // Object number -131
DEFINE OBJECT BARREL4      // Object number -132
DEFINE OBJECT IMY_BBOX     // Object number -133
DEFINE OBJECT IMY_LA_DOOR      // Object number -134
DEFINE OBJECT DB_AMMO      // Object number -135
DEFINE OBJECT MED_BED_8    // Object number -136
DEFINE OBJECT CR_GUNCRATE      // Object number -137
DEFINE OBJECT GUNBOX       // Object number -138
DEFINE OBJECT TMP_BIN      // Object number -139
DEFINE OBJECT AMMOTRN_OBJ      // Object number -140
DEFINE OBJECT KMB_FRONTGATE    // Object number -141
DEFINE OBJECT WAREHOUSE_DOOR2B     // Object number -142
DEFINE OBJECT WAREHOUSE_DOOR1  // Object number -143
DEFINE OBJECT CJ_CARDBRD_PICKUP    // Object number -144
DEFINE OBJECT CM_BOX       // Object number -145
DEFINE OBJECT FAKE_MULE_COL    // Object number -146
DEFINE OBJECT CARDBOARDBOX2    // Object number -147
DEFINE OBJECT LAE_SMOKECUTSCENE    // Object number -148
DEFINE OBJECT IMMMCRAN     // Object number -149
DEFINE OBJECT KMB_SKIP     // Object number -150
DEFINE OBJECT STORM_DRAIN_COVER    // Object number -151
DEFINE OBJECT WHEEL_OR1    // Object number -152
DEFINE OBJECT DYN_WOODPILE2    // Object number -153
DEFINE OBJECT KMB_RHYMESBOOK   // Object number -154
DEFINE OBJECT CJ_JUICE_CAN     // Object number -155
DEFINE OBJECT KMB_GOFLAG   // Object number -156
DEFINE OBJECT IMY_SKYLIGHT     // Object number -157
DEFINE OBJECT KMB_TROLLEY      // Object number -158
DEFINE OBJECT LXR_MOTEL_DOORSIM    // Object number -159
DEFINE OBJECT LXR_MOTELVENT    // Object number -160
DEFINE OBJECT DYN_SCAFFOLD_4B  // Object number -161
DEFINE OBJECT MUNCH_DONUT      // Object number -162
DEFINE OBJECT WD_FENCE_ANIM    // Object number -163
DEFINE OBJECT CHOPCOP_ARMR     // Object number -164
DEFINE OBJECT CHOPCOP_LEGR     // Object number -165
DEFINE OBJECT CHOPCOP_HEAD     // Object number -166
DEFINE OBJECT CHOPCOP_TORSO    // Object number -167
DEFINE OBJECT CHOPCOP_ARML     // Object number -168
DEFINE OBJECT CHOPCOP_LEGL     // Object number -169
DEFINE OBJECT DYN_SCAFFOLD_3B  // Object number -170
DEFINE OBJECT KMB_ATM1     // Object number -171
DEFINE OBJECT KMB_ATM2     // Object number -172
DEFINE OBJECT KMB_ATM3     // Object number -173
DEFINE OBJECT MTSAFE       // Object number -174
DEFINE OBJECT MAN_SAFENEW      // Object number -175
DEFINE OBJECT KEV_SAFE     // Object number -176
DEFINE OBJECT RIDER1_DOOR      // Object number -177
DEFINE OBJECT KMB_MARIJUANA    // Object number -178
DEFINE OBJECT SW_HAYBREAK02    // Object number -179
DEFINE OBJECT GRASSPLANT   // Object number -180
DEFINE OBJECT PARKBENCH1   // Object number -181
DEFINE OBJECT PORTALOO     // Object number -182
DEFINE OBJECT CLOTHESP     // Object number -183
DEFINE OBJECT LAMPPOST3    // Object number -184
DEFINE OBJECT CT_STALL1    // Object number -185
DEFINE OBJECT CT_TABLE     // Object number -186
DEFINE OBJECT CHINATGARAGEDOOR     // Object number -187
DEFINE OBJECT CHINA_TOWN_GATEB     // Object number -188
DEFINE OBJECT A51_SPOTBASE     // Object number -189
DEFINE OBJECT A51_SPOTHOUSING  // Object number -190
DEFINE OBJECT A51_SPOTBULB     // Object number -191
DEFINE OBJECT KMB_CONTAINER_RED    // Object number -192
DEFINE OBJECT CJ_CHRIS_CRATE   // Object number -193
DEFINE OBJECT CJ_CHRIS_CRATE_LD    // Object number -194
DEFINE OBJECT CJ_CHRIS_CRATE_RD    // Object number -195
DEFINE OBJECT CJ_PADLOCK   // Object number -196
DEFINE OBJECT MOBILE1993B      // Object number -197
DEFINE OBJECT KMB_PACKET   // Object number -198
DEFINE OBJECT NTO_B_S      // Object number -199
DEFINE OBJECT CARDBOARDBOX     // Object number -200
DEFINE OBJECT DYN_DUMPSTER     // Object number -201
DEFINE OBJECT KMB_CONTAINER_BLUE   // Object number -202
DEFINE OBJECT KMB_CONTAINER_YEL    // Object number -203
DEFINE OBJECT KMB_CONTAINER_OPEN   // Object number -204
DEFINE OBJECT TEMP_STINGER2    // Object number -205
DEFINE OBJECT TRAFFICCONE      // Object number -206
DEFINE OBJECT GARYS_LUV_RAMP   // Object number -207
DEFINE OBJECT AD_ROADMARK1     // Object number -208
DEFINE OBJECT AD_ROADMARK2     // Object number -209
DEFINE OBJECT AD_FINISH    // Object number -210
DEFINE OBJECT MINIGUN_BASE     // Object number -211
DEFINE OBJECT WONGS_ERECTION   // Object number -212
DEFINE OBJECT WONGS_ERECTION2  // Object number -213
DEFINE OBJECT RCBOMB       // Object number -214
DEFINE OBJECT BARREL2      // Object number -215
DEFINE OBJECT MINI_MAGNET      // Object number -216
DEFINE OBJECT KMB_PLANK    // Object number -217
DEFINE OBJECT KMB_HOLDALL      // Object number -218
DEFINE OBJECT KMB_PARACHUTE    // Object number -219
DEFINE OBJECT AMMO_CAPSULE     // Object number -220
DEFINE OBJECT BARREL1      // Object number -221
DEFINE OBJECT KB_BARREL    // Object number -222
DEFINE OBJECT CR_CRATESTACK    // Object number -223
DEFINE OBJECT D9_RUNWAY    // Object number -224
DEFINE OBJECT CARGO_TEST   // Object number -225
DEFINE OBJECT CARGO_STUFF      // Object number -226
DEFINE OBJECT CARGO_STORE      // Object number -227
DEFINE OBJECT KMILITARY_CRATE  // Object number -228
DEFINE OBJECT KMILITARY_BASE   // Object number -229
DEFINE OBJECT BLOCKPALLET      // Object number -230
DEFINE OBJECT TEMP_CRATE1      // Object number -231
DEFINE OBJECT K_SMASHBOXES     // Object number -232
DEFINE OBJECT K_CARGO1     // Object number -233
DEFINE OBJECT K_CARGO4     // Object number -234
DEFINE OBJECT BASEJUMP_TARGET  // Object number -235
DEFINE OBJECT DES_QUARRYGATE2  // Object number -236
DEFINE OBJECT DES_QUARRYGATE   // Object number -237
DEFINE OBJECT CJ_DYN_PLUNGE_1  // Object number -238
DEFINE OBJECT DYNAMITE     // Object number -239
DEFINE OBJECT DYNO_BOX_A   // Object number -240
DEFINE OBJECT DYNO_BOX_B   // Object number -241
DEFINE OBJECT PRIVATESIGN3     // Object number -242
DEFINE OBJECT PRIVATESIGN1     // Object number -243
DEFINE OBJECT CJ_CHIP_MAKER_BITS   // Object number -244
DEFINE OBJECT CJ_CHIP_MAKER    // Object number -245
DEFINE OBJECT CJ_WHEELCHAIR1   // Object number -246
DEFINE OBJECT AB_CARCASS   // Object number -247
DEFINE OBJECT AB_HOOK      // Object number -248
DEFINE OBJECT FREEZER_DOOR     // Object number -249
DEFINE OBJECT CJ_MEAT_BAG_1    // Object number -250
DEFINE OBJECT CJ_MEAT_1    // Object number -251
DEFINE OBJECT CJ_MEAT_2    // Object number -252
DEFINE OBJECT JET_BAGGAGE_DOOR     // Object number -253
DEFINE OBJECT JET_INTERIOR     // Object number -254
DEFINE OBJECT SMLPLANE_DOOR    // Object number -255
DEFINE OBJECT JET_DOOR     // Object number -256
DEFINE OBJECT SMASH_BOX_STAY   // Object number -257
DEFINE OBJECT SMASH_BOX_BRK    // Object number -258
DEFINE OBJECT SMASHBOXPILE     // Object number -259
DEFINE OBJECT ST_ARCH_PLAN     // Object number -260
DEFINE OBJECT GEN_DOORINT01    // Object number -261
DEFINE OBJECT KMB_LOCKEDDOOR   // Object number -262
DEFINE OBJECT DYN_AIRCON   // Object number -263
DEFINE OBJECT GENERATOR_BIG    // Object number -264
DEFINE OBJECT AB_VAULTDOOR     // Object number -265
DEFINE OBJECT GENERATOR_BIG_D  // Object number -266
DEFINE OBJECT CARGO_REAR   // Object number -267
DEFINE OBJECT D9_RAMP      // Object number -268
DEFINE OBJECT OPMANS01_c*ntE   // Object number -269
DEFINE OBJECT MISSILE_07_SFXR  // Object number -270
DEFINE OBJECT KMB_KEYPAD   // Object number -271
DEFINE OBJECT BBALL_INGAME     // Object number -272
DEFINE OBJECT LA_f*ckCAR1      // Object number -273
DEFINE OBJECT LA_f*ckCAR2      // Object number -274
DEFINE OBJECT TARGET_FRAME     // Object number -275
DEFINE OBJECT TARGET_LLEG      // Object number -276
DEFINE OBJECT TARGET_RLEG      // Object number -277
DEFINE OBJECT TARGET_LTORSO    // Object number -278
DEFINE OBJECT TARGET_RTORSO    // Object number -279
DEFINE OBJECT TARGET_LARM      // Object number -280
DEFINE OBJECT TARGET_RARM      // Object number -281
DEFINE OBJECT TARGET_HEAD      // Object number -282
DEFINE OBJECT DEAD_TIED_COP    // Object number -283
DEFINE OBJECT DYN_QUARRYROCK03     // Object number -284
DEFINE OBJECT BLACKBAG2    // Object number -285
DEFINE OBJECT DYN_WOODPILE     // Object number -286
DEFINE OBJECT DYN_QUARRYROCK02     // Object number -287
DEFINE OBJECT BOUY     // Object number -288
DEFINE OBJECT BB_PICKUP    // Object number -289
DEFINE OBJECT CHIP_STACK07     // Object number -290
DEFINE OBJECT CHIP_STACK08     // Object number -291
DEFINE OBJECT CHIP_STACK12     // Object number -292
DEFINE OBJECT CHIP_STACK09     // Object number -293
DEFINE OBJECT CHIP_STACK11     // Object number -294
DEFINE OBJECT WHEEL_WEE    // Object number -295
DEFINE OBJECT ROULETTE_MARKER  // Object number -296
DEFINE OBJECT KMB_BPRESS   // Object number -297
DEFINE OBJECT BEACHTOWEL01     // Object number -298
DEFINE OBJECT BEACHTOWEL03     // Object number -299
DEFINE OBJECT BEACHTOWEL04     // Object number -300
DEFINE OBJECT KMB_DUMBBELL_R   // Object number -301
DEFINE OBJECT KMB_DUMBBELL_L   // Object number -302
DEFINE OBJECT BBALL_COL    // Object number -303
DEFINE OBJECT KMB_ROCK     // Object number -304
DEFINE OBJECT CHIP_STACK10     // Object number -305
DEFINE OBJECT CHIP_STACK13     // Object number -306
DEFINE OBJECT CHIP_STACK14     // Object number -307
DEFINE OBJECT WHEEL_SUPPORT    // Object number -308
DEFINE OBJECT WHEEL_TABLE      // Object number -309
DEFINE OBJECT CLICKER      // Object number -310
DEFINE OBJECT CJ_FF_TILL_QUE   // Object number -311
DEFINE OBJECT CJ_BURG_CHAIR    // Object number -312
DEFINE OBJECT CJ_PIZZA_CHAIR   // Object number -313
DEFINE OBJECT CJ_PIZZA_CHAIR2  // Object number -314
DEFINE OBJECT CJ_PIZZA_CHAIR3  // Object number -315
DEFINE OBJECT CJ_BARSTOOL      // Object number -316
DEFINE OBJECT CJ_BINCO_DOOR    // Object number -317
DEFINE OBJECT CJ_SUBURB_DOOR_2     // Object number -318
DEFINE OBJECT CJ_PRO_DOOR_01   // Object number -319
DEFINE OBJECT CJ_GAP_DOOR_     // Object number -320
DEFINE OBJECT CJ_VICTIM_DOOR   // Object number -321
DEFINE OBJECT CJ_DS_DOOR   // Object number -322
DEFINE OBJECT PIZZALOW     // Object number -323
DEFINE OBJECT PIZZAMED     // Object number -324
DEFINE OBJECT PIZZA_HEALTHY    // Object number -325
DEFINE OBJECT CLUCKLOW     // Object number -326
DEFINE OBJECT CLUCKMED     // Object number -327
DEFINE OBJECT CLUCKHIGH    // Object number -328
DEFINE OBJECT CLUCK_HEALTHY    // Object number -329
DEFINE OBJECT BURGERLOW    // Object number -330
DEFINE OBJECT BURGERMED    // Object number -331
DEFINE OBJECT BURGER_HEALTHY   // Object number -332
DEFINE OBJECT POLICE_BARRIER   // Object number -333
DEFINE OBJECT LAESKATETUBE1    // Object number -334
DEFINE OBJECT CELLPHONE    // Object number -335
DEFINE OBJECT PARACHUTE    // Object number -336
DEFINE OBJECT PARA_COLLISION   // Object number -337
DEFINE OBJECT TERROR       // Object number -338

DEFINE MISSIONS 0

DEFINE EXTERNAL_SCRIPTS 0 // Use -1 in order not to compile AAA script

DEFINE UNKNOWN_EMPTY_SEGMENT 0

DEFINE UNKNOWN_THREADS_MEMORY 0

{$VERSION 3.1.0027}

//-------------MAIN---------------
thread 'MAIN'
01F0: set_max_wanted_level_to 0
set_wb_check_to 0
00C0: set_current_time_hours_to 0 minutes_to 30
04E4: unknown_refresh_game_renderer_at 2488.56 -1666.84
Camera.SetAtPos(2488.56, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.56, -1666.84, 12.38)
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
Camera.SetBehindPlayer
set_weather 3
wait 0
Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)
Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)
Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)
Player.Build($PLAYER_CHAR)
Player.CanMove($PLAYER_CHAR) = True
Player.Money($PLAYER_CHAR) += 10000
select_interior 0
0629: change_integer_stat 181 to 4
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here
03E6: remove_text_box
06C8: enable_riot 0
03BA: clear_cars_from_cube_cornerA -3000.0 -3000.0 -100.0 cornerB 3000.0 3000.0 2000.0
042B: clear_peds_from_cube_cornerA -3000.0 -3000.0 -100.0 cornerB 3000.0 3000.0 2000.0
01EB: set_traffic_density_multiplier_to 0.0
03DE: set_pedestrians_density_multiplier_to 0.0
016C: restart_if_wasted_at 2027.77 -1420.52 15.99 angle 137.0 town_number 0
016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0
0169: set_fade_color_RGB 255 255 255
0489: set_actor $PLAYER_ACTOR muted 1
08F8: display_stat_update_box 0  
09BA: show_entered_zone_name 0
0960: enable_player $PLAYER_CHAR stats_box 0
fade 0 0
wait 500
create_thread @Load
create_thread @Menu
create_thread @Check


I created 3 threads : Load , Menu and Check .

The "Load" Thread will be used to load your models that you'll need for your missions , we dont need any models in our UI ...

Menu will hold our script of the User Interface .

Check will be used for loop .


_____________________

thread 'Load'
_____________________

CODE
:Load
thread 'Load'
wait 0
end_thread  


Empty as we dont need any models ...

_____________________

thread 'Menu'
_____________________

CODE
:Menu
thread 'Menu'
wait 0
$GUI = 0
0390: load_txd_dictionary 'hitman'
038F: load_texture "cursor" as 1 // Load dictionary with 0390 first  
038F: load_texture "menu" as 2 // Load dictionary with 0390 first
038F: load_texture "none" as 3 // Load dictionary with 0390 first  
038F: load_texture "selec" as 4 // Load dictionary with 0390 first
0A8C: write_memory 0xBA6745 size 1 value 0 virtual_protect 0
03F0: enable_text_draw 1
$x = 320.0
$y = 224.0
$sl == 3
Player.CanMove($PLAYER_CHAR,0)
0826: enable_hud 0
0581: enable_radar 0
fade 1 800
$GUI = 1
:Menu
wait 0
if and
$sl == 4
0AB0:  key_pressed 1
then
jump @StartGame
else
0A4A: store_joystick_X_offset_to 0@ Y_offset_to 1@
0059: $x += 0@ // (float)
0059: $y += 1@ // (float)
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 2 position 320.0 224.0 size 640.0 448.0 RGBA 255 255 255 255
038D: draw_texture $sl position 100.0 210.0 size 100.0 25.0 RGBA 255 255 255 255
038D: draw_texture 1 position $x $y size 20.0 20.0 RGBA 255 255 255 255
end
jump @Menu



:StartGame
wait 0
fade 0 0
wait 500
0391: release_txd_dictionary
Player.CanMove($PLAYER_CHAR,1)
0A8C: write_memory 0xBA6745 size 1 value 1 virtual_protect 0  
Audiostream.PerformAction($rollo,STOP)
$GUI = 0
01B2: give_actor $PLAYER_ACTOR weapon 23 ammo 100 // Load the weapon model before using this
01B2: give_actor $PLAYER_ACTOR weapon 29 ammo 100 // Load the weapon model before using this
wait 1000
fade 1 500
end_thread  



QUOTE
$GUI = 0
$x = 320.0
$y = 224.0
$sl == 3

Its a variable that i declared that will let the game to check if the menu is active or not : $GUI = 1 means Menu is shown , 0 means not shown. $x and $y reffers to the position of the Cursor , $sl ( selected ) will be used at the Check thread to see if the cursor is on the "Start Game" if true , $sl becomes 4 ( Start game turns red ) if not , $sl is 3 ( Start game is grey , not selected )


QUOTE
0390: load_txd_dictionary 'hitman'
038F: load_texture "cursor" as 1 // Load dictionary with 0390 first 
038F: load_texture "menu" as 2 // Load dictionary with 0390 first
038F: load_texture "none" as 3 // Load dictionary with 0390 first 
038F: load_texture "selec" as 4 // Load dictionary with 0390 first

Loads the Hitman.tx that we've made earlier along with the 4 textures


QUOTE
03F0: enable_text_draw 1

We will start to draw on the screen , so we need this .

QUOTE

if and
$sl == 4
0AB0:  key_pressed 1
then
jump @StartGame


As you know the Menu thread and the Check thread are running simultaneously , they are cooperating , this Check ( if and ) will see if the cursor is on "Start game" ( if you habe selected it ) and if you pressed it ( key pressed 1 means you pressed Left Mouse Button ) then the Game starts . ( jump@ startgame )



QUOTE
else
0A4A: store_joystick_X_offset_to 0@ Y_offset_to 1@
0059: $x += 0@ // (float)
0059: $y += 1@ // (float)
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 2 position 320.0 224.0 size 640.0 448.0 RGBA 255 255 255 255
038D: draw_texture $sl position 100.0 210.0 size 100.0 25.0 RGBA 255 255 255 255
038D: draw_texture 1 position $x $y size 20.0 20.0 RGBA 255 255 255 255
end
jump @Menu


If you didn't press Start Game , then the script continues updating the Cursor's positions , notice that
: 0A4A: store_joystick_X_offset_to 0@ Y_offset_to 1@ does not store the actual position of the cursor , instead it just checks within you move your mouse left ( negative float ) or right ( positive float ) up ( positive float ) or down ( negative float ) , so if you dont move your mouse , the value becomes 0.0 , therefore , i used the :
0059: $x += 0@ // (float)
0059: $y += 1@ // (float)
And it turned out that it just fits perfectly , pure luck ...

_____________________

thread 'Check'
_____________________

CODE

:Check
thread 'Check'
wait 0
0509: 0@ = distance_between_XY $x $y and_XY 100.0 210.0
008E: 1@ = float 0@ to_integer  
if
1@ <= 20  
then
$sl = 4
else
$sl = 3
end
jump @Check
end_thread



QUOTE
wait 0
0509: 0@ = distance_between_XY $x $y and_XY 100.0 210.0
008E: 1@ = float 0@ to_integer   



0509: Calculates the distance between $x , $y our cursor's positions and 100.0 210.0 the positions of "Start Game" texture , i converted it to a int variable , better to get rid of the comma ,


QUOTE
if
1@ <= 20 
then
$sl = 4
else
$sl = 3
end 


If the distance is accuratly enough ( <= 20 ) then $sl = 4 , Start game is selected , else start game is not selected .




______________________________________________________________________________

Preview
______________________________________________________________________________




Hi There , today i'm gonna show you the way to include a custom User Interface into GTA:SA via coding ...

So here are the steps to procceed with :



1. We will collect first some images from Google that are related to our theme of the project , in my case , i chose " Hitman 2 ".

2.Then , we will create a new TXD dictionary that will hold the pictures as textures for the game.

3.And the finale step will be of course Coding the script , wich will be in this case a MissionPack (MPACK)




So lets begin ...




______________________________________________________________________________

Downloading the pictures
______________________________________________________________________________


We will need for this Hitman 2 UI :

1. A cursor icon

2. Some cool hitman background

3. Menu text ( Start Game , Load Game ...) wich can be done by urself without download ...


Cursor Background


user posted image , http://www.zastavki...._2_001426_1.jpg



Save your pictures at your desktop , rename the cursor picture "Cursor" and the Background "Menu" , Note that the pictures should either be one of the following formats : BMP , PNG or TGA , if not then convert them .


______________________________________________________________________________

Setting up the TXD file
______________________________________________________________________________

Using Txd workshop 4.5 open a txd file that u find at /Models/Txd folder , any one , it doesn't matter ... then Click >> File >> Save as >> and name the new file Hitman.txd , click Save .
Now Close the txd file and open Hitman.txd , then delete all the images that you find in it , and start sliding the ones that you downloaded ( Cursor , background ...) on top of the Software ... now you should see you pics added in the list , Compress them by clicking on Image >> Compress All .
Save the TXD



______________________________________________________________________________

Coding
______________________________________________________________________________

Now its coding time , the file that i attached with the topic contains he MPACK folder , put it at GTA SA USER FILES /

Open the SCR.scm file using Sanny Builder, you should already see that the script header is set up , now we need to script the User Interface ...

CODE
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007
DEFINE OBJECTS 339
DEFINE OBJECT SANNY BUILDER 3.04
DEFINE OBJECT CJ_MONEY_BAG   // Object number -1
DEFINE OBJECT TRAFFICCONE    // Object number -2
DEFINE OBJECT CLOTHESP      // Object number -3
DEFINE OBJECT GREEN_GLOOP    // Object number -4
DEFINE OBJECT BRIEFCASE     // Object number -5
DEFINE OBJECT KMB_RHYMESBOOK     // Object number -6
DEFINE OBJECT IMY_SHASH_WALL     // Object number -7
DEFINE OBJECT HEALTH    // Object number -8
DEFINE OBJECT BODYARMOUR    // Object number -9
DEFINE OBJECT BRIBE    // Object number -10
DEFINE OBJECT KEYCARD   // Object number -11
DEFINE OBJECT GUNPARA   // Object number -12
DEFINE OBJECT INFO     // Object number -13
DEFINE OBJECT CAMERAPICKUP   // Object number -14
DEFINE OBJECT MONEY    // Object number -15
DEFINE OBJECT CIGAR_GLOW    // Object number -16
DEFINE OBJECT WATERJUMP1    // Object number -17
DEFINE OBJECT LANDJUMP2     // Object number -18
DEFINE OBJECT WATERJUMPX2    // Object number -19
DEFINE OBJECT DYN_RAMP      // Object number -20
DEFINE OBJECT AD_JUMP   // Object number -21
DEFINE OBJECT ROADWORKBARRIER1    // Object number -22
DEFINE OBJECT DYN_ROADBARRIER_2   // Object number -23
DEFINE OBJECT DYN_ROADBARRIER_3   // Object number -24
DEFINE OBJECT DYN_ROADBARRIER_4   // Object number -25
DEFINE OBJECT IMY_TRACK_BARRIER   // Object number -26
DEFINE OBJECT BARRIER_4ANDY  // Object number -27
DEFINE OBJECT WS_APGATE     // Object number -28
DEFINE OBJECT GATE_AUTOL    // Object number -29
DEFINE OBJECT GATE_AUTOR    // Object number -30
DEFINE OBJECT WONGS_GATE    // Object number -31
DEFINE OBJECT CT_GATEXR     // Object number -32
DEFINE OBJECT KMB_SHUTTER    // Object number -33
DEFINE OBJECT SFCOPDR   // Object number -34
DEFINE OBJECT AD_FLATDOOR    // Object number -35
DEFINE OBJECT KB_BANDIT_U    // Object number -36
DEFINE OBJECT ROULETTE_TBL   // Object number -37
DEFINE OBJECT OTB_MACHINE    // Object number -38
DEFINE OBJECT CJ_COIN_OP_3   // Object number -39
DEFINE OBJECT CJ_COIN_OP_2   // Object number -40
DEFINE OBJECT CJ_COIN_OP_1   // Object number -41
DEFINE OBJECT CJ_COIN_OP    // Object number -42
DEFINE OBJECT SWANK_CONSOLE  // Object number -43
DEFINE OBJECT SNESISH   // Object number -44
DEFINE OBJECT LOW_CONSOLE    // Object number -45
DEFINE OBJECT VENDMACHFD    // Object number -46
DEFINE OBJECT VENDIN3   // Object number -47
DEFINE OBJECT CJ_SPRUNK1    // Object number -48
DEFINE OBJECT CJ_CANDYVENDOR     // Object number -49
DEFINE OBJECT CJ_EXT_CANDY   // Object number -50
DEFINE OBJECT CJ_EXT_SPRUNK  // Object number -51
DEFINE OBJECT ICESCART_PROP  // Object number -52
DEFINE OBJECT CHILLIDOGCART  // Object number -53
DEFINE OBJECT NOODLECART_PROP    // Object number -54
DEFINE OBJECT GYM_BIKE      // Object number -55
DEFINE OBJECT GYM_BENCH1    // Object number -56
DEFINE OBJECT GYM_TREADMILL  // Object number -57
DEFINE OBJECT GYM_MAT1      // Object number -58
DEFINE OBJECT BSKBALL_LAX    // Object number -59
DEFINE OBJECT VGSXREFBBALLNET    // Object number -60
DEFINE OBJECT VGSXREFBBALLNET2    // Object number -61
DEFINE OBJECT K_POOLTABLESM  // Object number -62
DEFINE OBJECT NEIL_SLOT     // Object number -63
DEFINE OBJECT CJ_SLOT_BANK   // Object number -64
DEFINE OBJECT BLCK_JACK     // Object number -65
DEFINE OBJECT WHEEL_O_FORTUNE    // Object number -66
DEFINE OBJECT WOODENBOX     // Object number -67
DEFINE OBJECT NF_BLACKBOARD  // Object number -68
DEFINE OBJECT GEN_DOOREXT03  // Object number -69
DEFINE OBJECT GEN_DOOREXT07  // Object number -70
DEFINE OBJECT GEN_DOORSHOP02     // Object number -71
DEFINE OBJECT GEN_DOOREXT04  // Object number -72
DEFINE OBJECT GEN_DOORSHOP3  // Object number -73
DEFINE OBJECT c*ntGIRLDOOR   // Object number -74
DEFINE OBJECT PIZZAHIGH     // Object number -75
DEFINE OBJECT CJ_PIZZA_1    // Object number -76
DEFINE OBJECT CJ_PIZZA_2    // Object number -77
DEFINE OBJECT BURGERHIGH    // Object number -78
DEFINE OBJECT CJ_BURG_1     // Object number -79
DEFINE OBJECT CJ_BURG_2     // Object number -80
DEFINE OBJECT CIGAR    // Object number -81
DEFINE OBJECT TRDCSGRGDOOR_LVS    // Object number -82
DEFINE OBJECT CR_DOOR_01    // Object number -83
DEFINE OBJECT CR_DOOR_03    // Object number -84
DEFINE OBJECT SHUTTER_VEGAS  // Object number -85
DEFINE OBJECT CR1_DOOR      // Object number -86
DEFINE OBJECT A51_BLASTDOORR     // Object number -87
DEFINE OBJECT A51_BLASTDOORL     // Object number -88
DEFINE OBJECT A51_LABDOOR    // Object number -89
DEFINE OBJECT A51_JETDOOR    // Object number -90
DEFINE OBJECT PORTAKABIN    // Object number -91
DEFINE OBJECT FREIGHT_SFW_DOOR    // Object number -92
DEFINE OBJECT AB_CASDORLOK   // Object number -93
DEFINE OBJECT IMY_SHASH_WALL     // Object number -94
DEFINE OBJECT TWRCRANE_M_04  // Object number -95
DEFINE OBJECT TWRCRANE_M_01  // Object number -96
DEFINE OBJECT A51_VENTCOVERB     // Object number -97
DEFINE OBJECT CARRIER_DOOR_SFSE   // Object number -98
DEFINE OBJECT CARRIER_LIFT2_SFSE  // Object number -99
DEFINE OBJECT CARRIER_LIFT1_SFSE  // Object number -100
DEFINE OBJECT GWFORUM1_LAE   // Object number -101
DEFINE OBJECT GANGSHOPS4_LAE2    // Object number -102
DEFINE OBJECT K_POOLQ   // Object number -103
DEFINE OBJECT K_POOLBALLCUE  // Object number -104
DEFINE OBJECT K_POOLBALLSPT01    // Object number -105
DEFINE OBJECT K_POOLBALLSPT02    // Object number -106
DEFINE OBJECT K_POOLBALLSPT03    // Object number -107
DEFINE OBJECT K_POOLBALLSPT04    // Object number -108
DEFINE OBJECT K_POOLBALLSPT05    // Object number -109
DEFINE OBJECT K_POOLBALLSPT06    // Object number -110
DEFINE OBJECT K_POOLBALLSPT07    // Object number -111
DEFINE OBJECT K_POOLBALL8    // Object number -112
DEFINE OBJECT K_POOLBALLSTP01    // Object number -113
DEFINE OBJECT K_POOLBALLSTP02    // Object number -114
DEFINE OBJECT K_POOLBALLSTP03    // Object number -115
DEFINE OBJECT K_POOLBALLSTP04    // Object number -116
DEFINE OBJECT K_POOLBALLSTP05    // Object number -117
DEFINE OBJECT K_POOLBALLSTP06    // Object number -118
DEFINE OBJECT K_POOLBALLSTP07    // Object number -119
DEFINE OBJECT K_POOLQ2      // Object number -120
DEFINE OBJECT DYN_WINE_BIG   // Object number -121
DEFINE OBJECT KB_BEER   // Object number -122
DEFINE OBJECT CASKET_LAW    // Object number -123
DEFINE OBJECT BD_WINDOW     // Object number -124
DEFINE OBJECT CR_AMMOBOX    // Object number -125
DEFINE OBJECT BD_WINDOW_SHATTER   // Object number -126
DEFINE OBJECT SEC_KEYPAD    // Object number -127
DEFINE OBJECT KMB_RAMP      // Object number -128
DEFINE OBJECT IMCMPTRKDRL_LAS    // Object number -129
DEFINE OBJECT IMCMPTRKDRR_LAS    // Object number -130
DEFINE OBJECT IMCOMPMOVEDR1_LAS   // Object number -131
DEFINE OBJECT BARREL4   // Object number -132
DEFINE OBJECT IMY_BBOX      // Object number -133
DEFINE OBJECT IMY_LA_DOOR    // Object number -134
DEFINE OBJECT DB_AMMO   // Object number -135
DEFINE OBJECT MED_BED_8     // Object number -136
DEFINE OBJECT CR_GUNCRATE    // Object number -137
DEFINE OBJECT GUNBOX    // Object number -138
DEFINE OBJECT TMP_BIN   // Object number -139
DEFINE OBJECT AMMOTRN_OBJ    // Object number -140
DEFINE OBJECT KMB_FRONTGATE  // Object number -141
DEFINE OBJECT WAREHOUSE_DOOR2B    // Object number -142
DEFINE OBJECT WAREHOUSE_DOOR1    // Object number -143
DEFINE OBJECT CJ_CARDBRD_PICKUP   // Object number -144
DEFINE OBJECT CM_BOX    // Object number -145
DEFINE OBJECT FAKE_MULE_COL  // Object number -146
DEFINE OBJECT CARDBOARDBOX2  // Object number -147
DEFINE OBJECT LAE_SMOKECUTSCENE   // Object number -148
DEFINE OBJECT IMMMCRAN      // Object number -149
DEFINE OBJECT KMB_SKIP      // Object number -150
DEFINE OBJECT STORM_DRAIN_COVER   // Object number -151
DEFINE OBJECT WHEEL_OR1     // Object number -152
DEFINE OBJECT DYN_WOODPILE2  // Object number -153
DEFINE OBJECT KMB_RHYMESBOOK     // Object number -154
DEFINE OBJECT CJ_JUICE_CAN   // Object number -155
DEFINE OBJECT KMB_GOFLAG    // Object number -156
DEFINE OBJECT IMY_SKYLIGHT   // Object number -157
DEFINE OBJECT KMB_TROLLEY    // Object number -158
DEFINE OBJECT LXR_MOTEL_DOORSIM   // Object number -159
DEFINE OBJECT LXR_MOTELVENT  // Object number -160
DEFINE OBJECT DYN_SCAFFOLD_4B    // Object number -161
DEFINE OBJECT MUNCH_DONUT    // Object number -162
DEFINE OBJECT WD_FENCE_ANIM  // Object number -163
DEFINE OBJECT CHOPCOP_ARMR   // Object number -164
DEFINE OBJECT CHOPCOP_LEGR   // Object number -165
DEFINE OBJECT CHOPCOP_HEAD   // Object number -166
DEFINE OBJECT CHOPCOP_TORSO  // Object number -167
DEFINE OBJECT CHOPCOP_ARML   // Object number -168
DEFINE OBJECT CHOPCOP_LEGL   // Object number -169
DEFINE OBJECT DYN_SCAFFOLD_3B    // Object number -170
DEFINE OBJECT KMB_ATM1      // Object number -171
DEFINE OBJECT KMB_ATM2      // Object number -172
DEFINE OBJECT KMB_ATM3      // Object number -173
DEFINE OBJECT MTSAFE    // Object number -174
DEFINE OBJECT MAN_SAFENEW    // Object number -175
DEFINE OBJECT KEV_SAFE      // Object number -176
DEFINE OBJECT RIDER1_DOOR    // Object number -177
DEFINE OBJECT KMB_MARIJUANA  // Object number -178
DEFINE OBJECT SW_HAYBREAK02  // Object number -179
DEFINE OBJECT GRASSPLANT    // Object number -180
DEFINE OBJECT PARKBENCH1    // Object number -181
DEFINE OBJECT PORTALOO      // Object number -182
DEFINE OBJECT CLOTHESP      // Object number -183
DEFINE OBJECT LAMPPOST3     // Object number -184
DEFINE OBJECT CT_STALL1     // Object number -185
DEFINE OBJECT CT_TABLE      // Object number -186
DEFINE OBJECT CHINATGARAGEDOOR    // Object number -187
DEFINE OBJECT CHINA_TOWN_GATEB    // Object number -188
DEFINE OBJECT A51_SPOTBASE   // Object number -189
DEFINE OBJECT A51_SPOTHOUSING    // Object number -190
DEFINE OBJECT A51_SPOTBULB   // Object number -191
DEFINE OBJECT KMB_CONTAINER_RED   // Object number -192
DEFINE OBJECT CJ_CHRIS_CRATE     // Object number -193
DEFINE OBJECT CJ_CHRIS_CRATE_LD   // Object number -194
DEFINE OBJECT CJ_CHRIS_CRATE_RD   // Object number -195
DEFINE OBJECT CJ_PADLOCK    // Object number -196
DEFINE OBJECT MOBILE1993B    // Object number -197
DEFINE OBJECT KMB_PACKET    // Object number -198
DEFINE OBJECT NTO_B_S   // Object number -199
DEFINE OBJECT CARDBOARDBOX   // Object number -200
DEFINE OBJECT DYN_DUMPSTER   // Object number -201
DEFINE OBJECT KMB_CONTAINER_BLUE  // Object number -202
DEFINE OBJECT KMB_CONTAINER_YEL   // Object number -203
DEFINE OBJECT KMB_CONTAINER_OPEN  // Object number -204
DEFINE OBJECT TEMP_STINGER2  // Object number -205
DEFINE OBJECT TRAFFICCONE    // Object number -206
DEFINE OBJECT GARYS_LUV_RAMP     // Object number -207
DEFINE OBJECT AD_ROADMARK1   // Object number -208
DEFINE OBJECT AD_ROADMARK2   // Object number -209
DEFINE OBJECT AD_FINISH     // Object number -210
DEFINE OBJECT MINIGUN_BASE   // Object number -211
DEFINE OBJECT WONGS_ERECTION     // Object number -212
DEFINE OBJECT WONGS_ERECTION2    // Object number -213
DEFINE OBJECT RCBOMB    // Object number -214
DEFINE OBJECT BARREL2   // Object number -215
DEFINE OBJECT MINI_MAGNET    // Object number -216
DEFINE OBJECT KMB_PLANK     // Object number -217
DEFINE OBJECT KMB_HOLDALL    // Object number -218
DEFINE OBJECT KMB_PARACHUTE  // Object number -219
DEFINE OBJECT AMMO_CAPSULE   // Object number -220
DEFINE OBJECT BARREL1   // Object number -221
DEFINE OBJECT KB_BARREL     // Object number -222
DEFINE OBJECT CR_CRATESTACK  // Object number -223
DEFINE OBJECT D9_RUNWAY     // Object number -224
DEFINE OBJECT CARGO_TEST    // Object number -225
DEFINE OBJECT CARGO_STUFF    // Object number -226
DEFINE OBJECT CARGO_STORE    // Object number -227
DEFINE OBJECT KMILITARY_CRATE    // Object number -228
DEFINE OBJECT KMILITARY_BASE     // Object number -229
DEFINE OBJECT BLOCKPALLET    // Object number -230
DEFINE OBJECT TEMP_CRATE1    // Object number -231
DEFINE OBJECT K_SMASHBOXES   // Object number -232
DEFINE OBJECT K_CARGO1      // Object number -233
DEFINE OBJECT K_CARGO4      // Object number -234
DEFINE OBJECT BASEJUMP_TARGET    // Object number -235
DEFINE OBJECT DES_QUARRYGATE2    // Object number -236
DEFINE OBJECT DES_QUARRYGATE     // Object number -237
DEFINE OBJECT CJ_DYN_PLUNGE_1    // Object number -238
DEFINE OBJECT DYNAMITE      // Object number -239
DEFINE OBJECT DYNO_BOX_A    // Object number -240
DEFINE OBJECT DYNO_BOX_B    // Object number -241
DEFINE OBJECT PRIVATESIGN3   // Object number -242
DEFINE OBJECT PRIVATESIGN1   // Object number -243
DEFINE OBJECT CJ_CHIP_MAKER_BITS  // Object number -244
DEFINE OBJECT CJ_CHIP_MAKER  // Object number -245
DEFINE OBJECT CJ_WHEELCHAIR1     // Object number -246
DEFINE OBJECT AB_CARCASS    // Object number -247
DEFINE OBJECT AB_HOOK   // Object number -248
DEFINE OBJECT FREEZER_DOOR   // Object number -249
DEFINE OBJECT CJ_MEAT_BAG_1  // Object number -250
DEFINE OBJECT CJ_MEAT_1     // Object number -251
DEFINE OBJECT CJ_MEAT_2     // Object number -252
DEFINE OBJECT JET_BAGGAGE_DOOR    // Object number -253
DEFINE OBJECT JET_INTERIOR   // Object number -254
DEFINE OBJECT SMLPLANE_DOOR  // Object number -255
DEFINE OBJECT JET_DOOR      // Object number -256
DEFINE OBJECT SMASH_BOX_STAY     // Object number -257
DEFINE OBJECT SMASH_BOX_BRK  // Object number -258
DEFINE OBJECT SMASHBOXPILE   // Object number -259
DEFINE OBJECT ST_ARCH_PLAN   // Object number -260
DEFINE OBJECT GEN_DOORINT01  // Object number -261
DEFINE OBJECT KMB_LOCKEDDOOR     // Object number -262
DEFINE OBJECT DYN_AIRCON    // Object number -263
DEFINE OBJECT GENERATOR_BIG  // Object number -264
DEFINE OBJECT AB_VAULTDOOR   // Object number -265
DEFINE OBJECT GENERATOR_BIG_D    // Object number -266
DEFINE OBJECT CARGO_REAR    // Object number -267
DEFINE OBJECT D9_RAMP   // Object number -268
DEFINE OBJECT OPMANS01_c*ntE     // Object number -269
DEFINE OBJECT MISSILE_07_SFXR    // Object number -270
DEFINE OBJECT KMB_KEYPAD    // Object number -271
DEFINE OBJECT BBALL_INGAME   // Object number -272
DEFINE OBJECT LA_f*ckCAR1    // Object number -273
DEFINE OBJECT LA_f*ckCAR2    // Object number -274
DEFINE OBJECT TARGET_FRAME   // Object number -275
DEFINE OBJECT TARGET_LLEG    // Object number -276
DEFINE OBJECT TARGET_RLEG    // Object number -277
DEFINE OBJECT TARGET_LTORSO  // Object number -278
DEFINE OBJECT TARGET_RTORSO  // Object number -279
DEFINE OBJECT TARGET_LARM    // Object number -280
DEFINE OBJECT TARGET_RARM    // Object number -281
DEFINE OBJECT TARGET_HEAD    // Object number -282
DEFINE OBJECT DEAD_TIED_COP  // Object number -283
DEFINE OBJECT DYN_QUARRYROCK03    // Object number -284
DEFINE OBJECT BLACKBAG2     // Object number -285
DEFINE OBJECT DYN_WOODPILE   // Object number -286
DEFINE OBJECT DYN_QUARRYROCK02    // Object number -287
DEFINE OBJECT BOUY     // Object number -288
DEFINE OBJECT BB_PICKUP     // Object number -289
DEFINE OBJECT CHIP_STACK07   // Object number -290
DEFINE OBJECT CHIP_STACK08   // Object number -291
DEFINE OBJECT CHIP_STACK12   // Object number -292
DEFINE OBJECT CHIP_STACK09   // Object number -293
DEFINE OBJECT CHIP_STACK11   // Object number -294
DEFINE OBJECT WHEEL_WEE     // Object number -295
DEFINE OBJECT ROULETTE_MARKER    // Object number -296
DEFINE OBJECT KMB_BPRESS    // Object number -297
DEFINE OBJECT BEACHTOWEL01   // Object number -298
DEFINE OBJECT BEACHTOWEL03   // Object number -299
DEFINE OBJECT BEACHTOWEL04   // Object number -300
DEFINE OBJECT KMB_DUMBBELL_R     // Object number -301
DEFINE OBJECT KMB_DUMBBELL_L     // Object number -302
DEFINE OBJECT BBALL_COL     // Object number -303
DEFINE OBJECT KMB_ROCK      // Object number -304
DEFINE OBJECT CHIP_STACK10   // Object number -305
DEFINE OBJECT CHIP_STACK13   // Object number -306
DEFINE OBJECT CHIP_STACK14   // Object number -307
DEFINE OBJECT WHEEL_SUPPORT  // Object number -308
DEFINE OBJECT WHEEL_TABLE    // Object number -309
DEFINE OBJECT CLICKER   // Object number -310
DEFINE OBJECT CJ_FF_TILL_QUE     // Object number -311
DEFINE OBJECT CJ_BURG_CHAIR  // Object number -312
DEFINE OBJECT CJ_PIZZA_CHAIR     // Object number -313
DEFINE OBJECT CJ_PIZZA_CHAIR2    // Object number -314
DEFINE OBJECT CJ_PIZZA_CHAIR3    // Object number -315
DEFINE OBJECT CJ_BARSTOOL    // Object number -316
DEFINE OBJECT CJ_BINCO_DOOR  // Object number -317
DEFINE OBJECT CJ_SUBURB_DOOR_2    // Object number -318
DEFINE OBJECT CJ_PRO_DOOR_01     // Object number -319
DEFINE OBJECT CJ_GAP_DOOR_   // Object number -320
DEFINE OBJECT CJ_VICTIM_DOOR     // Object number -321
DEFINE OBJECT CJ_DS_DOOR    // Object number -322
DEFINE OBJECT PIZZALOW      // Object number -323
DEFINE OBJECT PIZZAMED      // Object number -324
DEFINE OBJECT PIZZA_HEALTHY  // Object number -325
DEFINE OBJECT CLUCKLOW      // Object number -326
DEFINE OBJECT CLUCKMED      // Object number -327
DEFINE OBJECT CLUCKHIGH     // Object number -328
DEFINE OBJECT CLUCK_HEALTHY  // Object number -329
DEFINE OBJECT BURGERLOW     // Object number -330
DEFINE OBJECT BURGERMED     // Object number -331
DEFINE OBJECT BURGER_HEALTHY     // Object number -332
DEFINE OBJECT POLICE_BARRIER     // Object number -333
DEFINE OBJECT LAESKATETUBE1  // Object number -334
DEFINE OBJECT CELLPHONE     // Object number -335
DEFINE OBJECT PARACHUTE     // Object number -336
DEFINE OBJECT PARA_COLLISION     // Object number -337
DEFINE OBJECT TERROR    // Object number -338

DEFINE MISSIONS 0

DEFINE EXTERNAL_SCRIPTS 0 // Use -1 in order not to compile AAA script

DEFINE UNKNOWN_EMPTY_SEGMENT 0

DEFINE UNKNOWN_THREADS_MEMORY 0

{$VERSION 3.1.0027}

//-------------MAIN---------------
thread 'MAIN'
01F0: set_max_wanted_level_to 0
set_wb_check_to 0
00C0: set_current_time_hours_to 0 minutes_to 30
04E4: unknown_refresh_game_renderer_at 2488.56 -1666.84
Camera.SetAtPos(2488.56, -1666.84, 13.38)
$PLAYER_CHAR = Player.Create(#NULL, 2488.56, -1666.84, 12.38)
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
Camera.SetBehindPlayer
set_weather 3
wait 0
Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)
Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)
Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)
Player.Build($PLAYER_CHAR)
Player.CanMove($PLAYER_CHAR) = True
Player.Money($PLAYER_CHAR) += 10000
select_interior 0
0629: change_integer_stat 181 to 4
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here
03E6: remove_text_box
06C8: enable_riot 0
03BA: clear_cars_from_cube_cornerA -3000.0 -3000.0 -100.0 cornerB 3000.0 3000.0 2000.0
042B: clear_peds_from_cube_cornerA -3000.0 -3000.0 -100.0 cornerB 3000.0 3000.0 2000.0
01EB: set_traffic_density_multiplier_to 0.0
03DE: set_pedestrians_density_multiplier_to 0.0
016C: restart_if_wasted_at 2027.77 -1420.52 15.99 angle 137.0 town_number 0
016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0
0169: set_fade_color_RGB 255 255 255
0489: set_actor $PLAYER_ACTOR muted 1
08F8: display_stat_update_box 0  
09BA: show_entered_zone_name 0
0960: enable_player $PLAYER_CHAR stats_box 0
fade 0 0
wait 500
create_thread @Load
create_thread @Menu
create_thread @Check


I created 3 threads : Load , Menu and Check .

The "Load" Thread will be used to load your models that you'll need for your missions , we dont need any models in our UI ...

Menu will hold our script of the User Interface .

Check will be used for loop .


_____________________

thread 'Load'
_____________________

CODE
:Load
thread 'Load'
wait 0
end_thread  


Empty as we dont need any models ...

_____________________

thread 'Menu'
_____________________

CODE
:Menu
thread 'Menu'
wait 0
$GUI = 0
0390: load_txd_dictionary 'hitman'
038F: load_texture "cursor" as 1 // Load dictionary with 0390 first  
038F: load_texture "menu" as 2 // Load dictionary with 0390 first
038F: load_texture "none" as 3 // Load dictionary with 0390 first  
038F: load_texture "selec" as 4 // Load dictionary with 0390 first
0A8C: write_memory 0xBA6745 size 1 value 0 virtual_protect 0
03F0: enable_text_draw 1
$x = 320.0
$y = 224.0
$sl == 3
Player.CanMove($PLAYER_CHAR,0)
0826: enable_hud 0
0581: enable_radar 0
fade 1 800
$GUI = 1
:Menu
wait 0
if and
$sl == 4
0AB0:  key_pressed 1
then
jump @StartGame
else
0A4A: store_joystick_X_offset_to 0@ Y_offset_to 1@
0059: $x += 0@ // (float)
0059: $y += 1@ // (float)
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 2 position 320.0 224.0 size 640.0 448.0 RGBA 255 255 255 255
038D: draw_texture $sl position 100.0 210.0 size 100.0 25.0 RGBA 255 255 255 255
038D: draw_texture 1 position $x $y size 20.0 20.0 RGBA 255 255 255 255
end
jump @Menu



:StartGame
wait 0
fade 0 0
wait 500
0391: release_txd_dictionary
Player.CanMove($PLAYER_CHAR,1)
0A8C: write_memory 0xBA6745 size 1 value 1 virtual_protect 0  
Audiostream.PerformAction($rollo,STOP)
$GUI = 0
01B2: give_actor $PLAYER_ACTOR weapon 23 ammo 100 // Load the weapon model before using this
01B2: give_actor $PLAYER_ACTOR weapon 29 ammo 100 // Load the weapon model before using this
wait 1000
fade 1 500
end_thread  



QUOTE
$GUI = 0
$x = 320.0
$y = 224.0
$sl == 3

Its a variable that i declared that will let the game to check if the menu is active or not : $GUI = 1 means Menu is shown , 0 means not shown. $x and $y reffers to the position of the Cursor , $sl ( selected ) will be used at the Check thread to see if the cursor is on the "Start Game" if true , $sl becomes 4 ( Start game turns red ) if not , $sl is 3 ( Start game is grey , not selected )


QUOTE
0390: load_txd_dictionary 'hitman'
038F: load_texture "cursor" as 1 // Load dictionary with 0390 first 
038F: load_texture "menu" as 2 // Load dictionary with 0390 first
038F: load_texture "none" as 3 // Load dictionary with 0390 first 
038F: load_texture "selec" as 4 // Load dictionary with 0390 first

Loads the Hitman.tx that we've made earlier along with the 4 textures


QUOTE
03F0: enable_text_draw 1

We will start to draw on the screen , so we need this .

QUOTE

if and
$sl == 4
0AB0:  key_pressed 1
then
jump @StartGame


As you know the Menu thread and the Check thread are running simultaneously , they are cooperating , this Check ( if and ) will see if the cursor is on "Start game" ( if you habe selected it ) and if you pressed it ( key pressed 1 means you pressed Left Mouse Button ) then the Game starts . ( jump@ startgame )



QUOTE
else
0A4A: store_joystick_X_offset_to 0@ Y_offset_to 1@
0059: $x += 0@ // (float)
0059: $y += 1@ // (float)
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 2 position 320.0 224.0 size 640.0 448.0 RGBA 255 255 255 255
038D: draw_texture $sl position 100.0 210.0 size 100.0 25.0 RGBA 255 255 255 255
038D: draw_texture 1 position $x $y size 20.0 20.0 RGBA 255 255 255 255
end
jump @Menu


If you didn't press Start Game , then the script continues updating the Cursor's positions , notice that
: 0A4A: store_joystick_X_offset_to 0@ Y_offset_to 1@ does not store the actual position of the cursor , instead it just checks within you move your mouse left ( negative float ) or right ( positive float ) up ( positive float ) or down ( negative float ) , so if you dont move your mouse , the value becomes 0.0 , therefore , i used the :
0059: $x += 0@ // (float)
0059: $y += 1@ // (float)
And it turned out that it just fits perfectly , pure luck ...

_____________________

thread 'Check'
_____________________

CODE

:Check
thread 'Check'
wait 0
0509: 0@ = distance_between_XY $x $y and_XY 100.0 210.0
008E: 1@ = float 0@ to_integer  
if
1@ <= 20  
then
$sl = 4
else
$sl = 3
end
jump @Check
end_thread



QUOTE
wait 0
0509: 0@ = distance_between_XY $x $y and_XY 100.0 210.0
008E: 1@ = float 0@ to_integer   



0509: Calculates the distance between $x , $y our cursor's positions and 100.0 210.0 the positions of "Start Game" texture , i converted it to a int variable , better to get rid of the comma ,


QUOTE
if
1@ <= 20 
then
$sl = 4
else
$sl = 3
end 


If the distance is accuratly enough ( <= 20 ) then $sl = 4 , Start game is selected , else start game is not selected .




______________________________________________________________________________

Preview
______________________________________________________________________________







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users