// File created by Sixten Hilborn

#include serverapi.jss



Func Equip(PlayerIndex, Weapon, Ammo)
{
	Var ID = GetPlayerEntity(PlayerIndex);
	Var Pos = GetPos(ID);
	
	Var SndPos[3];
	SndPos[0] = Pos[6];
	SndPos[1] = Pos[0];
	SndPos[2] = Pos[1];
	PlaySound("pickup.wav", -1, SndPos, -1);
	
	EquipWeapon(PlayerIndex, Weapon, Ammo);
	
	return 0;
}


Func Shotgun(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Shotgun", 5);
}

Func Minigun(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Minigun", 100);
}

Func Rocketlauncher(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Rocketlauncher", 3);
}

Func Grenade(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Grenade", 1);
}

Func SuperGrenade(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Super Grenade", 1);
}

Func NukeGrenade(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Nuke Grenade", 1);
}

Func Crawler(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Crawler", 4);
}

Func bfg9000(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "BFG 9000", 1);
}

Func Landmine(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Landmine", 2);
}

Func Railgun(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Railgun", 5);
}

Func Ammo_Shotgun(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Shotgun", -4);
}

Func Ammo_Rocketlauncher(PlayerIndex, PowerupID)
{
	return Equip(PlayerIndex, "Rocketlauncher", -2);
}


Func _Main()
{

	AddWeapon(0, // The weapon type - 0 is Pistol
		"Pistol", // Weapon name - "Pistol"
		"bullet:Pistol", // Script to be called - Pistol() in script bullet(.jss)
		"pistol", // Weapon animation
		400, -1); // Cooldown - Maxammo
		
	AddWeapon(1, // The weapon type - 1 is Shotgun
		"Shotgun", // Weapon name - "Shotgun"
		"bullet:shotgun", // Script to be called - shotgun() in script bullet(.jss)
		"shotgun", // Weapon animation
		800, 10); // Cooldown - Maxammo
		
	AddWeapon(2, // The weapon type - 2 is Rifles & machineguns
		"Minigun", // Weapon name - "Minigun"
		"bullet:minigun", // Script to be called - shotgun() in script bullet(.jss)
		"minigun", // Weapon animation
		100, 200); // Cooldown - Maxammo
			
	AddWeapon(2, // The weapon type - 2 is Rifles & machineguns
		"Railgun", // Weapon name - "Minigun"
		"bullet:railgun", // Script to be called - shotgun() in script bullet(.jss)
		"railgun", // Weapon animation
		1000, 10); // Cooldown - Maxammo
			
	AddWeapon(3, // The weapon type - 4 is Explosives
		"Rocketlauncher", // Weapon name - "Rocketlauncher"
		"bullet:Rocketlauncher", // Script to be called - Rocketlauncher() in script bullet(.jss)
		"rocketlauncher", // Weapon animation
		1200, 6); // Cooldown - Maxammo
		
	AddWeapon(4, // The weapon type - 4 is Explosives
		"Grenade", // Weapon name - "Grenade"
		"bullet:Grenade", // Script to be called - Grenade() in script bullet(.jss)
		"grenade", // Weapon animation
		1500, 4); // Cooldown - Maxammo
		
	AddWeapon(3, // The weapon type - 3 is Crawler?
		"Crawler", // Weapon name - "Crawler"
		"bullet:Crawler", // Script to be called - lulzgun() in script bullet(.jss)
		"crawler", // Weapon animation
		1500, 10); // Cooldown - Maxammo
		
	AddWeapon(3, // The weapon type - 3 is Crawler?
		"BFG 9000", // Weapon name - "BFG 9000"
		"bullet:bfg9000", // Script to be called - bfg9000() in script bullet(.jss)
		"bfg9000", // Weapon animation
		1500, 10); // Cooldown - Maxammo
		
	AddWeapon(4, // The weapon type - 4 is Explosives
		"Super Grenade", // Weapon name - "Super Grenade"
		"bullet:SuperGrenade", // Script to be called - SuperGrenade() in script bullet(.jss)
		"supergrenade", // Weapon animation
		5000, 1); // Cooldown - Maxammo
	
	AddWeapon(4, // The weapon type - 4 is Explosives
		"Nuke Grenade", // Weapon name - "Nuke Grenade"
		"bullet:NukeGrenade", // Script to be called - NukeGrenade() in script bullet(.jss)
		"nukegrenade", // Weapon animation
		5000, 1); // Cooldown - Maxammo
	
	AddWeapon(4, // The weapon type - 4 is Explosives
		"Landmine", // Weapon name - "Landmine"
		"bullet:Landmine", // Script to be called - Landmine() in script bullet(.jss)
		"landmine", // Weapon animation
		2000, 3); // Cooldown - Maxammo
}
