2018-08-04 17:30:59 +02:00
|
|
|
#pragma newdecls required
|
|
|
|
|
2018-07-29 19:33:41 +02:00
|
|
|
#include <sourcemod>
|
|
|
|
#include <sdktools>
|
2018-11-24 14:01:09 +01:00
|
|
|
#include <sdkhooks>
|
2018-07-29 19:33:41 +02:00
|
|
|
#include <zombiereloaded>
|
2018-08-17 20:29:56 +02:00
|
|
|
#include <cstrike>
|
2018-07-29 19:33:41 +02:00
|
|
|
|
|
|
|
#pragma semicolon 1
|
|
|
|
|
|
|
|
int g_iCounter = 0;
|
|
|
|
|
2018-11-24 14:01:09 +01:00
|
|
|
bool g_bClientHasItem[MAXPLAYERS+1] = false;
|
|
|
|
|
2018-08-17 20:29:56 +02:00
|
|
|
Handle g_hGetSlot;
|
|
|
|
Handle g_hBumpWeapon;
|
|
|
|
Handle g_hOnPickedUp;
|
|
|
|
|
2019-07-25 00:14:52 +02:00
|
|
|
#include "items/balrog.inc"
|
|
|
|
#include "items/doghuman.inc"
|
|
|
|
#include "items/earth.inc"
|
|
|
|
#include "items/jumper.inc"
|
|
|
|
#include "items/tnt.inc"
|
|
|
|
#include "items/vortigaunt.inc"
|
|
|
|
#include "items/whiteknight.inc"
|
2018-07-30 23:07:56 +02:00
|
|
|
|
2018-07-29 19:33:41 +02:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
public Plugin myinfo =
|
|
|
|
{
|
|
|
|
name = "ItemSpawn",
|
|
|
|
author = "Neon",
|
|
|
|
description = "",
|
2018-08-02 12:13:03 +02:00
|
|
|
version = "1.1",
|
2018-07-29 19:33:41 +02:00
|
|
|
url = "https://steamcommunity.com/id/n3ontm"
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
public void OnPluginStart()
|
|
|
|
{
|
|
|
|
HookEvent("round_start", OnRoundStart, EventHookMode_Post);
|
2018-08-28 15:07:58 +02:00
|
|
|
|
2018-08-04 17:30:59 +02:00
|
|
|
RegAdminCmd("sm_balrog", Command_Balrog, ADMFLAG_KICK);
|
2018-08-03 16:17:09 +02:00
|
|
|
RegAdminCmd("sm_humandog", Command_HumanDog, ADMFLAG_KICK);
|
2018-08-17 20:29:56 +02:00
|
|
|
RegAdminCmd("sm_earth", Command_Earth, ADMFLAG_KICK);
|
2018-08-14 18:39:55 +02:00
|
|
|
RegAdminCmd("sm_jumper", Command_Jumper, ADMFLAG_KICK);
|
2018-08-17 20:29:56 +02:00
|
|
|
RegAdminCmd("sm_tnt", Command_TNT, ADMFLAG_KICK);
|
2018-08-04 17:30:59 +02:00
|
|
|
RegAdminCmd("sm_vortigaunt", Command_Vortigaunt, ADMFLAG_KICK);
|
2018-08-07 21:54:11 +02:00
|
|
|
RegAdminCmd("sm_whiteknight", Command_WhiteKnight, ADMFLAG_KICK);
|
2018-08-11 16:36:11 +02:00
|
|
|
|
2018-08-08 17:36:02 +02:00
|
|
|
LoadTranslations("common.phrases");
|
2018-08-28 15:07:58 +02:00
|
|
|
|
2018-08-17 20:29:56 +02:00
|
|
|
Handle hGameConf = LoadGameConfigFile("plugin.entWatch");
|
|
|
|
if(hGameConf == INVALID_HANDLE)
|
|
|
|
{
|
|
|
|
SetFailState("Couldn't load plugin.ItemSpawn game config!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(GameConfGetOffset(hGameConf, "GetSlot") == -1)
|
|
|
|
{
|
2019-07-07 22:44:43 +02:00
|
|
|
delete hGameConf;
|
2018-08-17 20:29:56 +02:00
|
|
|
SetFailState("Couldn't get GetSlot offset from game config!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(GameConfGetOffset(hGameConf, "BumpWeapon") == -1)
|
|
|
|
{
|
2019-07-07 22:44:43 +02:00
|
|
|
delete hGameConf;
|
2018-08-17 20:29:56 +02:00
|
|
|
SetFailState("Couldn't get BumpWeapon offset from game config!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(GameConfGetOffset(hGameConf, "OnPickedUp") == -1)
|
|
|
|
{
|
2019-07-07 22:44:43 +02:00
|
|
|
delete hGameConf;
|
2018-08-17 20:29:56 +02:00
|
|
|
SetFailState("Couldn't get OnPickedUp offset from game config!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 320 CBaseCombatWeapon::GetSlot(void)const
|
|
|
|
StartPrepSDKCall(SDKCall_Entity);
|
|
|
|
if(!PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, "GetSlot"))
|
|
|
|
{
|
2019-07-07 22:44:43 +02:00
|
|
|
delete hGameConf;
|
2018-08-17 20:29:56 +02:00
|
|
|
SetFailState("PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, \"GetSlot\" failed!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
|
|
|
|
g_hGetSlot = EndPrepSDKCall();
|
|
|
|
|
|
|
|
// 397 CCSPlayer::BumpWeapon(CBaseCombatWeapon *)
|
|
|
|
StartPrepSDKCall(SDKCall_Player);
|
|
|
|
if(!PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, "BumpWeapon"))
|
|
|
|
{
|
2019-07-07 22:44:43 +02:00
|
|
|
delete hGameConf;
|
2018-08-17 20:29:56 +02:00
|
|
|
SetFailState("PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, \"BumpWeapon\" failed!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
PrepSDKCall_SetReturnInfo(SDKType_Bool, SDKPass_Plain);
|
|
|
|
PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);
|
|
|
|
g_hBumpWeapon = EndPrepSDKCall();
|
|
|
|
|
|
|
|
// 300 CBaseCombatWeapon::OnPickedUp(CBaseCombatCharacter *)
|
|
|
|
StartPrepSDKCall(SDKCall_Entity);
|
|
|
|
if(!PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, "OnPickedUp"))
|
|
|
|
{
|
2019-07-07 22:44:43 +02:00
|
|
|
delete hGameConf;
|
2018-08-17 20:29:56 +02:00
|
|
|
SetFailState("PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, \"OnPickedUp\" failed!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer);
|
|
|
|
g_hOnPickedUp = EndPrepSDKCall();
|
|
|
|
|
|
|
|
if(g_hGetSlot == INVALID_HANDLE)
|
|
|
|
{
|
|
|
|
SetFailState("Couldn't prepare GetSlot SDKCall!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(g_hGetSlot == INVALID_HANDLE)
|
|
|
|
{
|
|
|
|
SetFailState("Couldn't prepare BumpWeapon SDKCall!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(g_hOnPickedUp == INVALID_HANDLE)
|
|
|
|
{
|
|
|
|
SetFailState("Couldn't prepare OnPickedUp SDKCall!");
|
|
|
|
return;
|
|
|
|
}
|
2018-07-29 19:33:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
public void OnMapStart()
|
|
|
|
{
|
2018-08-07 18:18:46 +02:00
|
|
|
// Yeeaass (Physbox model)
|
|
|
|
PrecacheModel("models/props/cs_militia/crate_extrasmallmill.mdl");
|
2018-07-29 19:33:41 +02:00
|
|
|
|
|
|
|
// Balrog
|
2018-08-04 17:30:59 +02:00
|
|
|
PrecacheModel("models/player/slow/amberlyn/lotr/balrog/balrog_rafuron_hannibal.mdl");
|
2018-07-29 19:33:41 +02:00
|
|
|
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");
|
2018-08-02 12:13:03 +02:00
|
|
|
|
2018-08-03 16:17:09 +02:00
|
|
|
// Dog
|
2018-08-04 17:30:59 +02:00
|
|
|
PrecacheModel("models/player/pil/re1/dog/dog_pil.mdl");
|
2018-08-03 16:17:09 +02:00
|
|
|
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");
|
|
|
|
|
2018-08-04 17:30:59 +02:00
|
|
|
// Dog Poo
|
|
|
|
PrecacheModel("models/poo/curlygpoo.mdl");
|
2018-08-03 16:17:09 +02:00
|
|
|
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");
|
2018-08-28 15:07:58 +02:00
|
|
|
AddFileToDownloadsTable("materials/models/poo/curlypoo.vtf");
|
|
|
|
|
2018-08-17 20:29:56 +02:00
|
|
|
// Earth Staff
|
|
|
|
PrecacheModel("models/staff/staff.mdl");
|
|
|
|
AddFileToDownloadsTable("models/staff/staff.dx80.vtx");
|
|
|
|
AddFileToDownloadsTable("models/staff/staff.dx90.vtx");
|
|
|
|
AddFileToDownloadsTable("models/staff/staff.mdl");
|
|
|
|
AddFileToDownloadsTable("models/staff/staff.phy");
|
|
|
|
AddFileToDownloadsTable("models/staff/staff.sw.vtx");
|
|
|
|
AddFileToDownloadsTable("models/staff/staff.vvd");
|
|
|
|
AddFileToDownloadsTable("materials/models/Staff/staffofmagnus.vmt");
|
|
|
|
AddFileToDownloadsTable("materials/models/Staff/staffofmagnus.vtf");
|
2018-08-28 15:07:58 +02:00
|
|
|
|
2018-08-17 20:29:56 +02:00
|
|
|
// Earth Prop
|
|
|
|
PrecacheModel("models/ffxii/earthmodel1.mdl");
|
|
|
|
AddFileToDownloadsTable("models/ffxii/earthmodel1.dx80.vtx");
|
|
|
|
AddFileToDownloadsTable("models/ffxii/earthmodel1.dx90.vtx");
|
|
|
|
AddFileToDownloadsTable("models/ffxii/earthmodel1.mdl");
|
|
|
|
AddFileToDownloadsTable("models/ffxii/earthmodel1.phy");
|
|
|
|
AddFileToDownloadsTable("models/ffxii/earthmodel1.sw.vtx");
|
|
|
|
AddFileToDownloadsTable("models/ffxii/earthmodel1.vvd");
|
|
|
|
AddFileToDownloadsTable("materials/models/ffxii/earthmodel1/rockwall01.vmt");
|
2018-08-28 15:07:58 +02:00
|
|
|
|
2018-08-07 21:54:11 +02:00
|
|
|
// 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");
|
|
|
|
|
|
|
|
// Vortigaunt
|
|
|
|
PrecacheModel("models/vortigaunt_slave.mdl");
|
|
|
|
|
|
|
|
// WhiteKnight
|
|
|
|
PrecacheModel("models/dog_jugger.mdl");
|
|
|
|
AddFileToDownloadsTable("models/dog_jugger.dx80.vtx");
|
|
|
|
AddFileToDownloadsTable("models/dog_jugger.dx90.vtx");
|
|
|
|
AddFileToDownloadsTable("models/dog_jugger.mdl");
|
|
|
|
AddFileToDownloadsTable("models/dog_jugger.sw.vtx");
|
|
|
|
AddFileToDownloadsTable("models/dog_jugger.vvd");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/dog_sheet.vmt");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/dog_sheet.vtf");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/dog_sheet_phong.vtf");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/eyeglass.vmt");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/eyeglass.vtf");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/weapon107_000_001.vmt");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/weapon107_000_001.vtf");
|
|
|
|
AddFileToDownloadsTable("materials/models/dog_gondor/weapon107_000_002.vtf");
|
2018-07-29 19:33:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
2018-08-04 17:30:59 +02:00
|
|
|
stock int CreateEntityAtOrigin(const char[] classname, const float origin[3])
|
2018-07-29 19:33:41 +02:00
|
|
|
{
|
2018-08-07 21:54:11 +02:00
|
|
|
int entity = CreateEntityByName(classname);
|
|
|
|
|
|
|
|
TeleportEntity(entity, origin, NULL_VECTOR, NULL_VECTOR);
|
2018-07-29 19:33:41 +02:00
|
|
|
|
2018-08-04 17:30:59 +02:00
|
|
|
return entity;
|
2018-07-29 19:33:41 +02:00
|
|
|
}
|
|
|
|
|
2018-08-03 16:17:09 +02:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
2018-08-04 17:30:59 +02:00
|
|
|
stock bool DispatchKeyFormat(int entity, const char[] key, const char[] value, any ...)
|
2018-08-03 16:17:09 +02:00
|
|
|
{
|
2018-08-04 17:30:59 +02:00
|
|
|
char buffer[1024];
|
|
|
|
VFormat(buffer, sizeof(buffer), value, 4);
|
2018-07-30 23:09:08 +02:00
|
|
|
|
2018-08-07 21:54:11 +02:00
|
|
|
DispatchKeyValue(entity, key, buffer);
|
2018-07-30 23:09:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
2018-08-04 17:30:59 +02:00
|
|
|
stock void SpawnAndActivate(int entity)
|
2018-07-30 23:09:08 +02:00
|
|
|
{
|
2018-08-04 17:30:59 +02:00
|
|
|
DispatchSpawn(entity);
|
|
|
|
ActivateEntity(entity);
|
2018-07-29 19:33:41 +02:00
|
|
|
}
|
|
|
|
|
2018-08-03 16:17:09 +02:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
2018-08-04 17:30:59 +02:00
|
|
|
stock void ParentToEntity(int entity, int parent)
|
2018-08-03 16:17:09 +02:00
|
|
|
{
|
|
|
|
SetVariantString("!activator");
|
2018-08-04 17:30:59 +02:00
|
|
|
AcceptEntityInput(entity, "SetParent", parent, parent);
|
2018-07-29 19:33:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
2018-08-04 17:30:59 +02:00
|
|
|
stock void SetEntityBBox(int entity, const float mins[3], const float maxs[3])
|
2018-07-29 19:33:41 +02:00
|
|
|
{
|
2018-08-04 17:30:59 +02:00
|
|
|
SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
|
|
|
|
SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
|
2018-07-30 23:07:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
2018-08-07 21:54:11 +02:00
|
|
|
stock void SetEntityProps(int entity)
|
2018-07-30 23:07:56 +02:00
|
|
|
{
|
2018-08-04 17:30:59 +02:00
|
|
|
SetEntProp(entity, Prop_Send, "m_nSolidType", 3);
|
|
|
|
SetEntProp(entity, Prop_Send, "m_fEffects", 32);
|
2018-08-02 12:13:03 +02:00
|
|
|
}
|
|
|
|
|
2018-11-24 14:01:09 +01:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
stock void AddItemFilter(int entity)
|
|
|
|
{
|
|
|
|
SDKHook(entity, SDKHook_StartTouch, OnTriggerTouch);
|
|
|
|
SDKHook(entity, SDKHook_EndTouch, OnTriggerTouch);
|
|
|
|
SDKHook(entity, SDKHook_Touch, OnTriggerTouch);
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
public Action OnTriggerTouch(int trigger, int client)
|
|
|
|
{
|
|
|
|
return (IsValidClient(client) && g_bClientHasItem[client]) ? Plugin_Handled : Plugin_Continue;
|
|
|
|
}
|
|
|
|
|
2018-08-12 18:25:03 +02:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
public Action EquipWeapons(Handle timer, any userid)
|
|
|
|
{
|
|
|
|
int client = GetClientOfUserId(userid);
|
|
|
|
|
|
|
|
if (client != 0)
|
|
|
|
{
|
|
|
|
GivePlayerItem(client, "weapon_p90");
|
|
|
|
GivePlayerItem(client, "weapon_elite");
|
|
|
|
GivePlayerItem(client, "item_kevlar");
|
|
|
|
GivePlayerItem(client, "weapon_hegrenade");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-28 15:07:58 +02:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
public bool IsValidClient(int client)
|
|
|
|
{
|
|
|
|
if (client <= 0)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (client > GetMaxClients())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!IsClientInGame(client))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!IsClientAuthorized(client))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-11-24 14:01:09 +01:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
public void OnClientDisconnect(int client)
|
|
|
|
{
|
|
|
|
g_bClientHasItem[client] = false;
|
|
|
|
}
|
|
|
|
|
2018-08-02 12:13:03 +02:00
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
// Purpose:
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
2018-08-04 17:30:59 +02:00
|
|
|
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
2018-08-02 12:13:03 +02:00
|
|
|
{
|
2018-11-24 14:01:09 +01:00
|
|
|
for (int client = 1; client <= MaxClients; client++)
|
|
|
|
{
|
|
|
|
g_bClientHasItem[client] = false;
|
|
|
|
}
|
|
|
|
|
2018-08-04 17:30:59 +02:00
|
|
|
g_iCounter = 0;
|
2018-08-02 12:13:03 +02:00
|
|
|
|
2018-08-04 17:30:59 +02:00
|
|
|
// player_weaponstrip.
|
|
|
|
int iPlayerStrip = CreateEntityByName("player_weaponstrip");
|
2018-08-11 16:36:11 +02:00
|
|
|
DispatchKeyFormat(iPlayerStrip, "targetname", "item_spawn_weaponstrip");
|
2018-08-04 17:30:59 +02:00
|
|
|
SpawnAndActivate(iPlayerStrip);
|
2018-08-02 12:13:03 +02:00
|
|
|
|
2018-08-04 17:30:59 +02:00
|
|
|
// player_speedmod.
|
|
|
|
int iPlayerSpeed = CreateEntityByName("player_speedmod");
|
2018-08-11 16:36:11 +02:00
|
|
|
DispatchKeyFormat(iPlayerSpeed, "targetname", "item_spawn_speedmod");
|
2018-08-04 17:30:59 +02:00
|
|
|
SpawnAndActivate(iPlayerSpeed);
|
2018-08-02 12:13:03 +02:00
|
|
|
|
2018-08-11 20:32:16 +02:00
|
|
|
// filter_activator_class nodamage.
|
|
|
|
int iNoDamageFilter = CreateEntityByName("filter_activator_class");
|
2018-08-12 16:43:30 +02:00
|
|
|
DispatchKeyFormat(iNoDamageFilter, "targetname", "item_filter_nodamage");
|
2018-08-11 20:32:16 +02:00
|
|
|
DispatchKeyFormat(iNoDamageFilter, "Negated", "0");
|
|
|
|
DispatchKeyFormat(iNoDamageFilter, "filterclass", "light");
|
|
|
|
SpawnAndActivate(iNoDamageFilter);
|
|
|
|
|
2018-08-12 16:43:30 +02:00
|
|
|
// filter_activator_team human.
|
|
|
|
int iHumanFilter1 = CreateEntityByName("filter_activator_team");
|
|
|
|
DispatchKeyFormat(iHumanFilter1, "targetname", "item_filter_human");
|
|
|
|
DispatchKeyFormat(iHumanFilter1, "Negated", "0");
|
|
|
|
DispatchKeyFormat(iHumanFilter1, "filterteam", "3");
|
|
|
|
SpawnAndActivate(iHumanFilter1);
|
|
|
|
|
|
|
|
// filter_activator_team human ignored.
|
|
|
|
int iHumanFilter2 = CreateEntityByName("filter_activator_team");
|
|
|
|
DispatchKeyFormat(iHumanFilter2, "targetname", "item_filter_human_ignored");
|
|
|
|
DispatchKeyFormat(iHumanFilter2, "Negated", "1");
|
|
|
|
DispatchKeyFormat(iHumanFilter2, "filterteam", "3");
|
|
|
|
SpawnAndActivate(iHumanFilter2);
|
|
|
|
|
|
|
|
// filter_damage_type human items.
|
|
|
|
int iHumanFilter3 = CreateEntityByName("filter_damage_type");
|
|
|
|
DispatchKeyFormat(iHumanFilter3, "targetname", "item_filter_human_items");
|
|
|
|
DispatchKeyFormat(iHumanFilter3, "Negated", "0");
|
|
|
|
DispatchKeyFormat(iHumanFilter3, "damagetype", "512");
|
|
|
|
SpawnAndActivate(iHumanFilter3);
|
|
|
|
|
|
|
|
// filter_multi humans.
|
|
|
|
int iHumanFilter4 = CreateEntityByName("filter_multi");
|
|
|
|
DispatchKeyFormat(iHumanFilter4, "targetname", "item_filter_humans");
|
|
|
|
DispatchKeyFormat(iHumanFilter4, "Negated", "0");
|
|
|
|
DispatchKeyFormat(iHumanFilter4, "filtertype", "1");
|
|
|
|
DispatchKeyFormat(iHumanFilter4, "filter01", "item_filter_human");
|
|
|
|
DispatchKeyFormat(iHumanFilter4, "filter02", "item_filter_human_items");
|
|
|
|
SpawnAndActivate(iHumanFilter4);
|
|
|
|
|
|
|
|
// filter_activator_team zombie.
|
|
|
|
int iZombieFilter1 = CreateEntityByName("filter_activator_team");
|
|
|
|
DispatchKeyFormat(iZombieFilter1, "targetname", "item_filter_zombie");
|
|
|
|
DispatchKeyFormat(iZombieFilter1, "Negated", "0");
|
|
|
|
DispatchKeyFormat(iZombieFilter1, "filterteam", "2");
|
|
|
|
SpawnAndActivate(iZombieFilter1);
|
|
|
|
|
|
|
|
// filter_activator_team zombie ignored.
|
|
|
|
int iZombieFilter2 = CreateEntityByName("filter_activator_team");
|
|
|
|
DispatchKeyFormat(iZombieFilter2, "targetname", "item_filter_zombie_ignored");
|
|
|
|
DispatchKeyFormat(iZombieFilter2, "Negated", "1");
|
|
|
|
DispatchKeyFormat(iZombieFilter2, "filterteam", "2");
|
|
|
|
SpawnAndActivate(iZombieFilter2);
|
|
|
|
|
|
|
|
// filter_damage_type zombie items.
|
|
|
|
int iZombieFilter3 = CreateEntityByName("filter_damage_type");
|
2018-08-12 16:45:20 +02:00
|
|
|
DispatchKeyFormat(iZombieFilter3, "targetname", "item_filter_zombie_items");
|
|
|
|
DispatchKeyFormat(iZombieFilter3, "Negated", "0");
|
|
|
|
DispatchKeyFormat(iZombieFilter3, "damagetype", "128");
|
2018-08-12 16:43:30 +02:00
|
|
|
SpawnAndActivate(iZombieFilter3);
|
|
|
|
|
|
|
|
// filter_multi zombies.
|
2018-08-12 16:45:20 +02:00
|
|
|
int iZombieFilter4 = CreateEntityByName("filter_multi");
|
|
|
|
DispatchKeyFormat(iZombieFilter4, "targetname", "item_filter_zombies");
|
|
|
|
DispatchKeyFormat(iZombieFilter4, "Negated", "0");
|
|
|
|
DispatchKeyFormat(iZombieFilter4, "filtertype", "1");
|
|
|
|
DispatchKeyFormat(iZombieFilter4, "filter01", "item_filter_zombie");
|
|
|
|
DispatchKeyFormat(iZombieFilter4, "filter02", "item_filter_zombie_items");
|
|
|
|
SpawnAndActivate(iZombieFilter4);
|
2018-08-03 16:17:09 +02:00
|
|
|
}
|