// Pure Zooka Arena by TommySprat
// Script by Sektor, tweaked by Ben Millard

// Players:
PLAYER_PED p1 = (109.0,133.5, 255.0) 10 270 // Red
PLAYER_PED p2 = (118.0,133.5,1.0) 09 090 // Orange
PLAYER_PED p3 = (117.5,132.5,1.0) 07 180 // Yellow
PLAYER_PED p4 = (117.5,134.5,1.0) 11 000 // Green
PLAYER_PED p5 = (117.0,132.5,1.0) 13 225 // Blue
PLAYER_PED p6 = (118.0,134.5,1.0) 08 045 // Black

COUNTER loop = 1
GENERATOR pistol = (110.0,130.0,2.0) 0 COLLECT_00 0 0 99
GENERATOR dualpistol = (110.0,130.5,2.0) 0 COLLECT_10 0 0 99
GENERATOR smac = (110.0,131.5,2.0) 0 COLLECT_09 0 0 99
GENERATOR flame = (110.0,132.5,2.0) 0 COLLECT_08 0 0 99
GENERATOR zooka = (110.0,133.5,2.0) 0 COLLECT_02 0 0 99
GENERATOR grenade = (110.0,134.0,2.0) 0 COLLECT_05 0 0 99
GENERATOR molotov = (110.0,134.5,2.0) 0 COLLECT_04 0 0 99
GENERATOR finger = (110.0,135.0,1.0) 0 COLLECT_37 0 0 99
GENERATOR machinegun = (110.0,135.5,2.0) 0 COLLECT_01 0 0 99
GENERATOR electro = (110.0,136.0,2.0) 0 COLLECT_03 0 0 99
GENERATOR shotgun = (110.0,137.0,2.0) 0 COLLECT_06 0 0 99

COUNTER gotpistol
COUNTER gotdual_pistol
COUNTER gotsmachine_gun
COUNTER gotshotgun
COUNTER gotflame_thrower
COUNTER gotelectro_gun
COUNTER gotrocket_launcher
COUNTER gotgrenade
COUNTER gotmolotov
COUNTER gotmachinegun
COUNTER random

LEVELSTART 

// Basic level of brightness:
SET_AMBIENT_LEVEL  (0.33, 0) 

SWITCH_GENERATOR ( pistol , on )
SWITCH_GENERATOR ( dualpistol , on )
SWITCH_GENERATOR ( smac , on )
SWITCH_GENERATOR ( machinegun , on )
SWITCH_GENERATOR ( shotgun , on )
SWITCH_GENERATOR ( flame , on )
SWITCH_GENERATOR ( electro , on )
SWITCH_GENERATOR ( zooka , on )
SWITCH_GENERATOR ( grenade , on )
SWITCH_GENERATOR ( molotov , on )
SWITCH_GENERATOR ( machinegun , on )

WHILE_EXEC (loop=1)
IF (CHECK_CHAR_CURR_WEAPON (p1,pistol))
  SET gotpistol = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,dual_pistol))
  SET gotdual_pistol = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,silenced_machine_gun))
  SET gotsmachine_gun = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,shotgun))
  SET gotshotgun = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,flame_thrower))
  SET gotflame_thrower = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,electro_gun))
  SET gotelectro_gun = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,rocket_launcher))
  SET gotrocket_launcher = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,grenade))
  SET gotgrenade = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,molotov))
  SET gotmolotov = 1
  SET loop=0
ENDIF

IF (CHECK_CHAR_CURR_WEAPON (p1,machine_gun))
  SET gotmachinegun = 1
  SET loop=0
ENDIF

ENDWHILE

KILL_CHAR ( p1 )
KILL_CHAR ( p2 )
KILL_CHAR ( p3 )
KILL_CHAR ( p4 )
KILL_CHAR ( p5 )
KILL_CHAR ( p6 )

SET loop = 1

// Weapons:
WHILE_EXEC (loop=1)

++random

/*
SET gotpistol = 1
SET gotdual_pistol = 1
SET gotsmachine_gun = 1
SET gotshotgun = 1
SET gotflame_thrower = 1
SET gotelectro_gun = 1
SET gotrocket_launcher = 1
SET gotgrenade = 1
SET gotmolotov = 1
SET gotmachinegun = 1
*/

IF (HAS_CHARACTER_DIED (p1))
KILL_CHAR ( p1 )
KILL_CHAR ( p2 )
KILL_CHAR ( p3 )
KILL_CHAR ( p4 )
KILL_CHAR ( p5 )
KILL_CHAR ( p6 )
ENDIF

IF (HAS_CHARACTER_DIED (p2))
KILL_CHAR ( p1 )
KILL_CHAR ( p2 )
KILL_CHAR ( p3 )
KILL_CHAR ( p4 )
KILL_CHAR ( p5 )
KILL_CHAR ( p6 )
ENDIF

IF (HAS_CHARACTER_DIED (p3))
KILL_CHAR ( p1 )
KILL_CHAR ( p2 )
KILL_CHAR ( p3 )
KILL_CHAR ( p4 )
KILL_CHAR ( p5 )
KILL_CHAR ( p6 )
ENDIF

IF (HAS_CHARACTER_DIED (p4))
KILL_CHAR ( p1 )
KILL_CHAR ( p2 )
KILL_CHAR ( p3 )
KILL_CHAR ( p4 )
KILL_CHAR ( p5 )
KILL_CHAR ( p6 )
ENDIF

IF (HAS_CHARACTER_DIED (p5))
KILL_CHAR ( p1 )
KILL_CHAR ( p2 )
KILL_CHAR ( p3 )
KILL_CHAR ( p4 )
KILL_CHAR ( p5 )
KILL_CHAR ( p6 )
ENDIF

IF (HAS_CHARACTER_DIED (p5))
KILL_CHAR ( p1 )
KILL_CHAR ( p2 )
KILL_CHAR ( p3 )
KILL_CHAR ( p4 )
KILL_CHAR ( p5 )
KILL_CHAR ( p6 )
ENDIF

/*
REMOVE_WEAPONS ( p2 )
REMOVE_WEAPONS ( p3 )
REMOVE_WEAPONS ( p4 )
REMOVE_WEAPONS ( p5 )
REMOVE_WEAPONS ( p6 )
*/


IF ( random = 0 )
SET gotpistol = 1
ENDIF

IF ( random = 1 )
SET gotdual_pistol = 1
ENDIF

IF ( random = 2 )
SET gotsmachine_gun = 1
ENDIF

IF ( random = 3 )
SET gotshotgun = 1
ENDIF

IF ( random = 4 )
SET gotflame_thrower = 1
ENDIF

IF ( random = 5 )
SET gotelectro_gun = 1
ENDIF

IF ( random = 6 )
SET gotrocket_launcher = 1
ENDIF

IF ( random = 7 )
SET gotgrenade = 1
ENDIF

IF ( random = 8 )
SET gotmolotov = 1
ENDIF

IF ( random = 9 )
SET gotmachinegun = 1
ENDIF

 IF (CHECK_CHARACTER_HEALTH(p1, 0))
  IF ( gotsmachine_gun = 1 )
 	  GIVE_WEAPON (p1, SILENCED_MACHINE_GUN,99) 
  ENDIF

IF ( gotpistol = 1 )
  GIVE_WEAPON (p1,pistol,99) 
ENDIF

IF ( gotdual_pistol = 1 )
  GIVE_WEAPON (p1,dual_pistol,99) 
ENDIF

IF (gotsmachine_gun = 1)
 GIVE_WEAPON (p1,silenced_machine_gun,99) 
ENDIF

IF (gotshotgun = 1)
 GIVE_WEAPON (p1,shotgun,99) 
ENDIF

IF (gotflame_thrower = 1)
 GIVE_WEAPON (p1,flame_thrower,99) 
ENDIF

IF (gotelectro_gun = 1)
 GIVE_WEAPON (p1,electro_gun,99) 
ENDIF

IF (gotrocket_launcher = 1)
 GIVE_WEAPON (p1,rocket_launcher,99) 
ENDIF

IF (gotgrenade = 1)
 GIVE_WEAPON (p1,grenade,99) 
ENDIF

IF (gotmolotov = 1)
 GIVE_WEAPON (p1,molotov,99) 
ENDIF

IF (gotmachinegun = 1)
 GIVE_WEAPON (p1,electro_baton,99) 
ENDIF

  IF ( CHECK_WEAPON_TYPE_HIT_CHAR ( p1 , BY_ANY_WEAPON ))
    KILL_CHAR ( p1 )
  ENDIF
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p2, 0))
  IF ( gotdual_pistol = 1 )
  GIVE_WEAPON (p2,dual_pistol,99) 
ENDIF

IF ( gotpistol = 1 )
  GIVE_WEAPON (p2,pistol,99) 
ENDIF

IF (gotsmachine_gun = 1)
 GIVE_WEAPON (p2,silenced_machine_gun,99) 
ENDIF

IF (gotshotgun = 1)
 GIVE_WEAPON (p2,shotgun,99) 
ENDIF

IF (gotflame_thrower = 1)
 GIVE_WEAPON (p2,flame_thrower,99) 
ENDIF

IF (gotelectro_gun = 1)
 GIVE_WEAPON (p2,electro_gun,99) 
ENDIF

IF (gotrocket_launcher = 1)
 GIVE_WEAPON (p2,rocket_launcher,99) 
ENDIF

IF (gotgrenade = 1)
 GIVE_WEAPON (p2,grenade,99) 
ENDIF

IF (gotmolotov = 1)
 GIVE_WEAPON (p2,molotov,99) 
ENDIF

IF (gotmachinegun = 1)
 GIVE_WEAPON (p2,electro_baton,99) 
ENDIF

  IF ( CHECK_WEAPON_TYPE_HIT_CHAR ( p2 , BY_ANY_WEAPON ))
    KILL_CHAR ( p2 )
  ENDIF
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p3, 0))
 IF ( gotdual_pistol = 1 )
  GIVE_WEAPON (p3,dual_pistol,99) 
ENDIF

IF ( gotpistol = 1 )
  GIVE_WEAPON (p3,pistol,99) 
ENDIF

IF (gotsmachine_gun = 1)
 GIVE_WEAPON (p3,silenced_machine_gun,99) 
ENDIF

IF (gotshotgun = 1)
 GIVE_WEAPON (p3,shotgun,99) 
ENDIF

IF (gotflame_thrower = 1)
 GIVE_WEAPON (p3,flame_thrower,99) 
ENDIF

IF (gotelectro_gun = 1)
 GIVE_WEAPON (p3,electro_gun,99) 
ENDIF

IF (gotrocket_launcher = 1)
 GIVE_WEAPON (p3,rocket_launcher,99) 
ENDIF

IF (gotgrenade = 1)
 GIVE_WEAPON (p3,grenade,99) 
ENDIF

IF (gotmolotov = 1)
 GIVE_WEAPON (p3,molotov,99) 
ENDIF

IF (gotmachinegun = 1)
 GIVE_WEAPON (p3,electro_baton,99) 
ENDIF

  IF ( CHECK_WEAPON_TYPE_HIT_CHAR ( p3 , BY_ANY_WEAPON ))
    KILL_CHAR ( p3 )
  ENDIF
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p4, 0))
  IF ( gotdual_pistol = 1 )
  GIVE_WEAPON (p4,dual_pistol,99) 
ENDIF

IF ( gotpistol = 1 )
  GIVE_WEAPON (p4,pistol,99) 
ENDIF

IF (gotsmachine_gun = 1)
 GIVE_WEAPON (p4,silenced_machine_gun,99) 
ENDIF

IF (gotshotgun = 1)
 GIVE_WEAPON (p4,shotgun,99) 
ENDIF

IF (gotflame_thrower = 1)
 GIVE_WEAPON (p4,flame_thrower,99) 
ENDIF

IF (gotelectro_gun = 1)
 GIVE_WEAPON (p4,electro_gun,99) 
ENDIF

IF (gotrocket_launcher = 1)
 GIVE_WEAPON (p4,rocket_launcher,99) 
ENDIF

IF (gotgrenade = 1)
 GIVE_WEAPON (p4,grenade,99) 
ENDIF

IF (gotmolotov = 1)
 GIVE_WEAPON (p4,molotov,99) 
ENDIF

IF (gotmachinegun = 1)
 GIVE_WEAPON (p4,electro_baton,99) 
ENDIF

  IF ( CHECK_WEAPON_TYPE_HIT_CHAR ( p4 , BY_ANY_WEAPON ))
    KILL_CHAR ( p4 )
  ENDIF
 ENDIF

 IF (CHECK_CHARACTER_HEALTH(p5, 0))
IF ( gotdual_pistol = 1 )
  GIVE_WEAPON (p5,dual_pistol,99) 
ENDIF

IF ( gotpistol = 1 )
  GIVE_WEAPON (p5,pistol,99) 
ENDIF

IF (gotsmachine_gun = 1)
 GIVE_WEAPON (p5,silenced_machine_gun,99) 
ENDIF

IF (gotshotgun = 1)
 GIVE_WEAPON (p5,shotgun,99) 
ENDIF

IF (gotflame_thrower = 1)
 GIVE_WEAPON (p5,flame_thrower,99) 
ENDIF

IF (gotelectro_gun = 1)
 GIVE_WEAPON (p5,electro_gun,99) 
ENDIF

IF (gotrocket_launcher = 1)
 GIVE_WEAPON (p5,rocket_launcher,99) 
ENDIF

IF (gotgrenade = 1)
 GIVE_WEAPON (p5,grenade,99) 
ENDIF

IF (gotmolotov = 1)
 GIVE_WEAPON (p5,molotov,99) 
ENDIF

IF (gotmachinegun = 1)
 GIVE_WEAPON (p5,electro_baton,99) 
ENDIF

  IF ( CHECK_WEAPON_TYPE_HIT_CHAR ( p5 , BY_ANY_WEAPON ))
    KILL_CHAR ( p5 )
  ENDIF
 ENDIF
 
 IF (CHECK_CHARACTER_HEALTH(p6, 0))
  IF ( gotdual_pistol = 1 )
  GIVE_WEAPON (p6,dual_pistol,99) 
ENDIF

IF (gotsmachine_gun = 1)
 GIVE_WEAPON (p6,silenced_machine_gun,99) 
ENDIF

IF ( gotpistol = 1 )
  GIVE_WEAPON (p6,pistol,99) 
ENDIF

IF (gotshotgun = 1)
 GIVE_WEAPON (p6,shotgun,99) 
ENDIF

IF (gotflame_thrower = 1)
 GIVE_WEAPON (p6,flame_thrower,99) 
ENDIF

IF (gotelectro_gun = 1)
 GIVE_WEAPON (p6,electro_gun,99) 
ENDIF

IF (gotrocket_launcher = 1)
 GIVE_WEAPON (p6,rocket_launcher,99) 
ENDIF

IF (gotgrenade = 1)
 GIVE_WEAPON (p6,grenade,99) 
ENDIF

IF (gotmolotov = 1)
 GIVE_WEAPON (p6,molotov,99) 
ENDIF

IF (gotmachinegun = 1)
 GIVE_WEAPON (p6,electro_baton,99) 
ENDIF

  IF ( CHECK_WEAPON_TYPE_HIT_CHAR ( p6 , BY_ANY_WEAPON ))
    KILL_CHAR ( p6 )
  ENDIF
 ENDIF
ENDWHILE

SET random = 0

LEVELEND
