181 lines
7.9 KiB
SourcePawn
181 lines
7.9 KiB
SourcePawn
#pragma newdecls required
|
|
|
|
#include <sourcemod>
|
|
#include <sdktools>
|
|
#include <zombiereloaded>
|
|
|
|
#pragma semicolon 1
|
|
|
|
int g_iConsole;
|
|
int g_iCounter = 0;
|
|
|
|
#include "items\balrog.inc"
|
|
#include "items\doghuman.inc"
|
|
#include "items\tnt.inc"
|
|
#include "items\vortigaunt.inc"
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public Plugin myinfo =
|
|
{
|
|
name = "ItemSpawn",
|
|
author = "Neon",
|
|
description = "",
|
|
version = "1.1",
|
|
url = "https://steamcommunity.com/id/n3ontm"
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnPluginStart()
|
|
{
|
|
HookEvent("round_start", OnRoundStart, EventHookMode_Post);
|
|
|
|
RegAdminCmd("sm_tnt", Command_TNT, ADMFLAG_KICK);
|
|
RegAdminCmd("sm_balrog", Command_Balrog, ADMFLAG_KICK);
|
|
RegAdminCmd("sm_humandog", Command_HumanDog, ADMFLAG_KICK);
|
|
RegAdminCmd("sm_vortigaunt", Command_Vortigaunt, ADMFLAG_KICK);
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnMapStart()
|
|
{
|
|
// Physbox
|
|
PrecacheModel("models/props/cs_militia/crate_extrasmallmill.mdl");
|
|
|
|
// Vortigaunt
|
|
PrecacheModel("models/vortigaunt_slave.mdl");
|
|
|
|
// Balrog
|
|
PrecacheModel("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl");
|
|
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.dx80.vtx");
|
|
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.dx90.vtx");
|
|
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl");
|
|
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.sw.vtx");
|
|
AddFileToDownloadsTable("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.vvd");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_body.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_body.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_body_2.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_eyes.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon_blade.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_weapon_bump.vtf");
|
|
AddFileToDownloadsTable("materials/models/player/slow/amberlyn/lotr/balrog/slow_wings.vmt");
|
|
AddFileToDownloadsTable("sound/unloze/balrog_scream.mp3");
|
|
|
|
// TNT
|
|
PrecacheModel("models/props/furnitures/humans/barrel01b.mdl");
|
|
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.dx80.vtx");
|
|
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.dx90.vtx");
|
|
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.mdl");
|
|
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.phy");
|
|
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.sw.vtx");
|
|
AddFileToDownloadsTable("models/props/furnitures/humans/barrel01b.vvd");
|
|
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b.vmt");
|
|
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b.vtf");
|
|
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b_broken.vmt");
|
|
AddFileToDownloadsTable("materials/models/barrel01b/wood_barrel01b_no_metal.vtf");
|
|
|
|
// Dog
|
|
PrecacheModel("models/player/pil/re1/dog/dog_pil.mdl");
|
|
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.dx80.vtx");
|
|
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.dx90.vtx");
|
|
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.mdl");
|
|
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.phy");
|
|
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.sw.vtx");
|
|
AddFileToDownloadsTable("models/player/pil/re1/dog/dog_pil.vvd");
|
|
AddFileToDownloadsTable("materials/models/player/pil/re1/dog/0000a.vmt");
|
|
AddFileToDownloadsTable("materials/models/player/pil/re1/dog/0000a.vtf");
|
|
|
|
// Dog Poo
|
|
PrecacheModel("models/poo/curlygpoo.mdl");
|
|
AddFileToDownloadsTable("models/poo/curlygpoo.dx80.vtx");
|
|
AddFileToDownloadsTable("models/poo/curlygpoo.dx90.vtx");
|
|
AddFileToDownloadsTable("models/poo/curlygpoo.mdl");
|
|
AddFileToDownloadsTable("models/poo/curlygpoo.phy");
|
|
AddFileToDownloadsTable("models/poo/curlygpoo.sw.vtx");
|
|
AddFileToDownloadsTable("models/poo/curlygpoo.vvd");
|
|
AddFileToDownloadsTable("materials/models/poo/curlypoo.vmt");
|
|
AddFileToDownloadsTable("materials/models/poo/curlypoo.vtf");
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
stock int CreateEntityAtOrigin(const char[] classname, const float origin[3])
|
|
{
|
|
int entity = INVALID_ENT_REFERENCE;
|
|
if ((entity = CreateEntityByName(classname)) != INVALID_ENT_REFERENCE)
|
|
DispatchKeyValueVector(entity, "origin", origin);
|
|
|
|
return entity;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
stock bool DispatchKeyFormat(int entity, const char[] key, const char[] value, any ...)
|
|
{
|
|
char buffer[1024];
|
|
VFormat(buffer, sizeof(buffer), value, 4);
|
|
|
|
return DispatchKeyValue(entity, key, buffer);
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
stock bool ActivateAndSpawn(int entity)
|
|
{
|
|
ActivateEntity(entity);
|
|
|
|
return DispatchSpawn(entity);
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
stock bool ParentToEntity(int entity, int parent)
|
|
{
|
|
SetVariantString("!activator");
|
|
|
|
return AcceptEntityInput(entity, "SetParent", parent, parent);
|
|
}
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
// Purpose:
|
|
//----------------------------------------------------------------------------------------------------
|
|
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
|
{
|
|
g_iCounter = 0;
|
|
|
|
// player_weaponstrip
|
|
int iPlayerStrip = CreateEntityByName("player_weaponstrip");
|
|
DispatchKeyFormat(iPlayerStrip, "targetname", "item_spawn_weaponstrip");
|
|
ActivateAndSpawn(iPlayerStrip);
|
|
|
|
// player_speedmod
|
|
int iPlayerSpeed = CreateEntityByName("player_speedmod");
|
|
DispatchKeyFormat(iPlayerSpeed, "targetname", "item_spawn_speedmod");
|
|
ActivateAndSpawn(iPlayerSpeed);
|
|
|
|
// filter_activator_team humans
|
|
int iHumanFilter = CreateEntityByName("filter_activator_team");
|
|
DispatchKeyFormat(iHumanFilter, "targetname", "item_spawn_human_filter");
|
|
DispatchKeyFormat(iHumanFilter, "Negated", "0");
|
|
DispatchKeyFormat(iHumanFilter, "filterteam", "3");
|
|
ActivateAndSpawn(iHumanFilter);
|
|
|
|
// filter_activator_team zombies
|
|
int iZombieFilter = CreateEntityByName("filter_activator_team");
|
|
DispatchKeyFormat(iZombieFilter, "targetname", "item_spawn_zombie_filter");
|
|
DispatchKeyFormat(iZombieFilter, "Negated", "0");
|
|
DispatchKeyFormat(iZombieFilter, "filterteam", "2");
|
|
ActivateAndSpawn(iZombieFilter);
|
|
}
|