// Decompiled from "tiny_ra2z.scr" Using Epic GTA2 Script Decompiler by T.M.

PLAYER_PED p1 = (104.5, 238.5, 255.0) 8 225
PLAYER_PED p2 = (104.5, 230.5, 255.0) 13 315
PLAYER_PED p3 = (96.5, 230.5, 255.0) 11 45
PLAYER_PED p4 = (96.5, 238.5, 255.0) 10 135
PLAYER_PED p5 = (109.5, 235.5, 255.0) 6 90
PLAYER_PED p6 = (95.5, 234.5, 255.0) 9 90
GENERATOR gen1 = (103.5, 237.5) 0 COLLECT_02 0 0 99
GENERATOR gen2 = (103.5, 231.5) 0 COLLECT_02 0 0 99
GENERATOR gen3 = (97.5, 231.5) 0 COLLECT_02 0 0 99
GENERATOR gen4 = (97.5, 237.5) 0 COLLECT_02 0 0 99
GENERATOR gen5 = (109.5, 235.5) 0 COLLECT_02 0 0 99
GENERATOR gen6 = (95.5, 234.5) 0 COLLECT_02 0 0 99
GENERATOR gen7 = (110.5, 241.5) 0 COLLECT_02 0 0 99
GENERATOR gen8 = (101.5, 242.5) 0 COLLECT_04 0 0 99
GENERATOR gen9 = (111.5, 230.0) 0 COLLECT_06 0 0 99
PARKED_CAR_DATA auto1 = (91.5, 237.5) 17 90 BUS
PARKED_CAR_DATA auto2 = (91.5, 239.5) 17 90 BUS
PARKED_CAR_DATA auto3 = (91.5, 230.5) 17 90 BUS
PARKED_CAR_DATA auto4 = (91.5, 232.5) 17 90 BUS
PARKED_CAR_DATA auto5 = (111.5, 228.5) 17 270 BUS
PARKED_CAR_DATA auto6 = (111.5, 236.5) 17 180 BUS
PARKED_CAR_DATA auto7 = (100.5, 241.5) 17 180 BUS
PARKED_CAR_DATA auto8 = (112.5, 233.5) 17 180 BUS

COUNTER count1 = 1
CHAR_DATA p
COUNTER player=0
COUNTER neverends=1
COUNTER in=0
COUNTER out=0
COUNTER reload=0

LEVELSTART
SET_AMBIENT_LEVEL (0.30, 3)
DECLARE_POLICELEVEL (5)
SWITCH_GENERATOR (gen1, ON)
SWITCH_GENERATOR (gen2, ON)
SWITCH_GENERATOR (gen3, ON)
SWITCH_GENERATOR (gen4, ON)
SWITCH_GENERATOR (gen5, ON)
SWITCH_GENERATOR (gen6, ON)
SWITCH_GENERATOR (gen7, ON)
SWITCH_GENERATOR (gen8, ON)
SWITCH_GENERATOR (gen9, ON)
GIVE_WEAPON (auto1, CAR_MACHINE_GUN, 50)
GIVE_WEAPON (auto2, CAR_MACHINE_GUN, 50)
GIVE_WEAPON (auto3, CAR_MACHINE_GUN, 50)
GIVE_WEAPON (auto4, CAR_MACHINE_GUN, 50)
GIVE_WEAPON (auto5, CAR_MACHINE_GUN, 50)
GIVE_WEAPON (auto6, CAR_MACHINE_GUN, 50)
GIVE_WEAPON (auto7, CAR_MACHINE_GUN, 50)
GIVE_WEAPON (auto8, CAR_MACHINE_GUN, 50)

WHILE_EXEC ( neverends = 1 )
	SET player=0
	WHILE_EXEC(player<6)
		//{ //PlayerPointers
		++player
		if(player=1)
			SET p=(p1+0)
		endif
		if(player=2)
			SET p=(p2+0)
		endif
		if(player=3)
			SET p=(p3+0)
		endif
		if(player=4)
			SET p=(p4+0)
		endif
		if(player=5)
			SET p=(p5+0)
		endif
		if(player=6)
			SET p=(p6+0)
		endif
		//}

		IF (CHECK_CHARACTER_HEALTH(p, 0))
			IF(CHECK_CHAR_CURR_WEAPON(p,SHOTGUN))
				SET in=(p+368) //player + 368 is a pointer to the player ammo (only for first weapon slot)
				CHANGE_GANG_CHAR_RESPECT (in,out,104) //read those 4 bytes
				IF (out>0)
					SET reload=(out+2) //we don't care about ammo, reload countdown is located at ammo location + 2
					CHANGE_GANG_CHAR_RESPECT (reload,out,101) //read 1 byte
					IF (out>2)  // change to 0 for instant reload
					  SET out=2 // change to 0 for instant reload
					  CHANGE_GANG_CHAR_RESPECT (reload,out,111) //write 1 byte
					ENDIF
				ENDIF				
			ENDIF
		ENDIF
	ENDWHILE
ENDWHILE
LEVELEND
