Weapons in GTA 2 Coding

A guard with no gun is pretty pointless, so the script below will allow you to give your characters, and even the player, weapons. You can only give characters one weapon, but they have infinite rounds, but you can give the player as many weapons as you like, but you can specify how much ammo you give him otherwise it will be default. This is also true for vehicles as well, such as the Tanks battle cannon or the Jeeps machine gun.

Character Weapons

Script Name Game Name Picture
PISTOL Pistol Pistol
MACHINE_GUN S-Uzi Machine Gun Machine Gun
GRENADE Grenade Grenade
MOLOTOV Molotov Cocktail Molotov Cocktail
ROCKET_LAUNCHER Rocket Launcher Rocket Launcher
FLAME_THROWER Flame Thrower Flamethrower
ELECTRO_GUN Electro Gun Electro Gun
ELECTRO_BATON Electro Baton (not supposed to be in game) Electro Baton
DUAL_PISTOL Dual Pistol Dual Pistol
SHOTGUN Shotgun Shotgun
SILENCED_MACHINE_GUN Silenced S-Uzi Machine Gun Silenced Machine Gun
MICROWAVE Illegal model which crashes the game. (No image.)

Vehicle Weapons

Script Name Game Name Picture
CAR_BOMB Vehicle Bomb Car Bomb
CAR_OIL Vehicle Oil Slick Vehicle Oil
CAR_MINE Vehicle Mines Vehicle Mines
CAR_MACHINE_GUN Vehicle Machine Guns Vehicle Machine Guns
TANK_GUN Tank Gun Tank Gun
CAR_FLAMETHROWER Car Flamethrower Vehicle Flamethrower
WATER_CANNON Water Cannon Firetruck Water Cannon
JEEP_GUN Jeep Mounted Machine Gun Jeep Machine Gun
CAR_BOMB_INSTANT Instant Vehicle Bomb Vehicle Instant Bomb

If you want to give a mission character of vehicle, just copy an example:

GIVE_WEAPON ( name , weapon )
GIVE_WEAPON ( name , weapon , ammount of ammo )

The name can either be a created character, a car or a player. An example could be:

GIVE_WEAPON ( p1, pistol , 50 )

This would give the player p1 a pistol with 50 rounds of ammunition. Simple.

Weapon Generators

Generators are usually found by gang phones and spawn a weapon or other item after a set amount of time for ever until it is switched off by a command. They can only be of the types in the table below, which include the icon they create in-game.

Static Object Moving Object Game Name Picture
COLLECT_00 MOVING_COLLECT_00 Pistol Pistol generator
COLLECT_01 MOVING_COLLECT_01 S-Uzi Machine Gun Machine Gun generator
COLLECT_02 MOVING_COLLECT_02 Rocket Launcher Rocket Launcher generator
COLLECT_03 MOVING_COLLECT_03 Electro Gun Electro Gun generator
COLLECT_04 MOVING_COLLECT_04 Molotov Cocktail Molotov Cocktail generator
COLLECT_05 MOVING_COLLECT_05 Grenade Grenade generator
COLLECT_06 MOVING_COLLECT_06 Shotgun Shotgun generator
COLLECT_08 MOVING_COLLECT_08 Flamethrower Flamethrower generator
COLLECT_09 MOVING_COLLECT_09 Silenced S-Uzi Machine Gun Silenced Machine Gun generator
COLLECT_10 MOVING_COLLECT_10 Dual Pistol Dual Pistol generator
COLLECT_15 MOVING_COLLECT_15 Vehicle Bomb Vehicle Bomb generator
COLLECT_16 MOVING_COLLECT_16 Vehicle Oil Vehicle Oil generator
COLLECT_17 MOVING_COLLECT_17 Vehicle Mine Vehicle Mine generator
COLLECT_18 MOVING_COLLECT_18 Vehicle Machine Gun Vehicle Machine Gun generator
COLLECT_19 MOVING_COLLECT_19 Tank Gun (not collectable) (No image.)
COLLECT_20 MOVING_COLLECT_20 Water Cannon (not collectable) (No image.)
COLLECT_21 MOVING_COLLECT_21 Vehicle Flamethrower (not collectable) (No image.)
COLLECT_22 MOVING_COLLECT_22 Jeep Gun (not collectable) (No image.)
COLLECT_23 MOVING_COLLECT_23 Vehicle Instant Bomb (No image.)
COLLECT_28 MOVING_COLLECT_28 Multiplier Bonus Multiplier
COLLECT_29 MOVING_COLLECT_29 Life Bonus Extra Life
COLLECT_30 MOVING_COLLECT_30 Helath Bonus Health
COLLECT_31 MOVING_COLLECT_31 Armour Bonus Armour
COLLECT_32 MOVING_COLLECT_32 Get Out of Jail Free Bonus Get Out Of Jail Free Card
COLLECT_33 MOVING_COLLECT_33 Cop Bribe Bonus Cop Bribe
COLLECT_34 MOVING_COLLECT_34 Invulnerability Bonus Invulnerability
COLLECT_35 MOVING_COLLECT_35 Double Damage Bonus Double Damage
COLLECT_36 MOVING_COLLECT_36 Double Fire Rate Bonus Rapid Fire
COLLECT_37 MOVING_COLLECT_37 Electro Fingers Bonus Electro Fingers
COLLECT_38 MOVING_COLLECT_38 Respect Bonus Respect
COLLECT_39 MOVING_COLLECT_39 Invisibility Bonus Invisibility
COLLECT_40 MOVING_COLLECT_40 Temporary Gang Bonus (multiplayer only) Temporary Gang

Any numbers left out of here (e.g. COLLECT_07) has nothing affiliated to it, but they can actually be used for making special weapons or something. If you put down the Vehicle Instant Bomb, a wierd blue letter I will appear. You will have to make some new graphics to use this.

To use these in your script, just use the following commands:

GENERATOR uniquename = ( X , Y , Z ) rotation object-type mindelay max delay ammo

So, you could have one like this:

GENERATOR flamer01 = ( 10.5 , 42.5 , 3.0 ) 0 COLLECT_08 1500 1500 20

And after a set amount of time, this generator will appear. Since the generators are default set to OFF, you need to switch them on. To do this, type this in after the LEVELSTART command:

SWITCH_GENERATOR ( uniquename , ON )
SWITCH_GENERATOR ( uniquename , OFF )

The latter is best used for a mission only, and so won’t be included when the player does nothing.

Powerups Which Do Not Respawn

Instead of making a generator that produces weapons, you can make one-off powerups by using the OBJECT_DATA command. Below is an example of a single flamethrower pickup but any generator type can be used:

OBJECT_DATA weapon = ( 127.5 , 127.5 , 2.0 ) 180 COLLECT_08 // flamethrower

The ammo given is the default setting (such as 10 for machine gun) and cannot be changed. This is just a very basic powerup.

(Originally written by Chris “Pyro” Hockley and formatted by Ben “Cerbera” Millard with full permission.)