2009-04-29 01:58:41 +02:00
|
|
|
/*
|
|
|
|
* ============================================================================
|
|
|
|
*
|
2009-07-05 08:49:23 +02:00
|
|
|
* Zombie:Reloaded
|
2009-04-29 01:58:41 +02:00
|
|
|
*
|
2009-06-12 05:51:26 +02:00
|
|
|
* File: zombiereloaded.sp
|
|
|
|
* Type: Base
|
|
|
|
* Description: Plugin's base file.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Greyscale, Richard Helgeby
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-04-29 01:58:41 +02:00
|
|
|
*
|
|
|
|
* ============================================================================
|
2008-10-04 22:59:11 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma semicolon 1
|
|
|
|
#include <sourcemod>
|
|
|
|
#include <sdktools>
|
2009-06-20 09:15:43 +02:00
|
|
|
#include <clientprefs>
|
2008-10-04 22:59:11 +02:00
|
|
|
#include <cstrike>
|
2009-05-11 04:47:09 +02:00
|
|
|
#include <zrtools>
|
2008-10-04 22:59:11 +02:00
|
|
|
|
2009-07-25 14:42:45 +02:00
|
|
|
#define VERSION "3.0.0-b2-dev"
|
2008-10-04 22:59:11 +02:00
|
|
|
|
2009-06-01 23:29:26 +02:00
|
|
|
// Header includes.
|
|
|
|
#include "zr/log.h"
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
// Core includes.
|
2008-10-04 22:59:11 +02:00
|
|
|
#include "zr/zombiereloaded"
|
2009-05-14 09:32:01 +02:00
|
|
|
#include "zr/translation"
|
2009-04-27 04:00:38 +02:00
|
|
|
#include "zr/cvars"
|
2009-05-14 09:32:01 +02:00
|
|
|
#include "zr/log"
|
2009-04-30 07:36:57 +02:00
|
|
|
#include "zr/config"
|
2009-06-21 07:24:31 +02:00
|
|
|
#include "zr/steamidcache"
|
2009-05-08 04:57:21 +02:00
|
|
|
#include "zr/sayhooks"
|
2009-04-29 01:58:41 +02:00
|
|
|
#include "zr/tools"
|
2009-06-20 09:15:43 +02:00
|
|
|
#include "zr/cookies"
|
2009-05-30 04:17:01 +02:00
|
|
|
#include "zr/paramtools"
|
2008-10-04 22:59:11 +02:00
|
|
|
#include "zr/models"
|
2009-05-18 06:26:13 +02:00
|
|
|
#include "zr/downloads"
|
2009-05-14 02:28:26 +02:00
|
|
|
#include "zr/overlays"
|
2009-04-20 02:56:26 +02:00
|
|
|
#include "zr/playerclasses/playerclasses"
|
2009-04-22 04:53:19 +02:00
|
|
|
#include "zr/weapons/weapons"
|
2009-04-23 06:39:11 +02:00
|
|
|
#include "zr/hitgroups"
|
2009-05-20 06:24:43 +02:00
|
|
|
#include "zr/roundstart"
|
2009-04-18 01:44:41 +02:00
|
|
|
#include "zr/roundend"
|
2009-04-22 04:53:19 +02:00
|
|
|
#include "zr/infect"
|
2009-04-19 19:54:21 +02:00
|
|
|
#include "zr/damage"
|
2009-04-29 01:58:41 +02:00
|
|
|
#include "zr/menu"
|
|
|
|
#include "zr/event"
|
|
|
|
#include "zr/zadmin"
|
|
|
|
#include "zr/commands"
|
|
|
|
//#include "zr/global"
|
2009-04-19 19:54:21 +02:00
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
// Modules
|
2009-04-22 04:53:19 +02:00
|
|
|
#include "zr/account"
|
2009-06-08 00:07:30 +02:00
|
|
|
#include "zr/visualeffects/visualeffects"
|
2009-04-16 22:21:32 +02:00
|
|
|
#include "zr/soundeffects/soundeffects"
|
2009-04-17 01:09:52 +02:00
|
|
|
#include "zr/antistick"
|
2009-04-14 22:05:20 +02:00
|
|
|
#include "zr/knockback"
|
2009-04-15 11:27:03 +02:00
|
|
|
#include "zr/spawnprotect"
|
2009-04-16 05:30:26 +02:00
|
|
|
#include "zr/respawn"
|
2009-04-17 10:20:04 +02:00
|
|
|
#include "zr/napalm"
|
2009-05-15 07:25:07 +02:00
|
|
|
#include "zr/jumpboost"
|
2009-04-29 01:58:41 +02:00
|
|
|
#include "zr/zspawn"
|
2009-05-05 06:56:34 +02:00
|
|
|
#include "zr/ztele"
|
2009-04-16 01:18:08 +02:00
|
|
|
#include "zr/zhp"
|
2009-06-22 06:08:26 +02:00
|
|
|
#include "zr/zcookies"
|
2009-04-29 01:58:41 +02:00
|
|
|
#include "zr/jumpboost"
|
2009-05-16 01:37:23 +02:00
|
|
|
#include "zr/volfeatures/volfeatures"
|
2009-07-16 10:05:40 +02:00
|
|
|
#include "zr/debugtools"
|
2009-04-27 04:00:38 +02:00
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
2009-05-19 00:58:42 +02:00
|
|
|
* Record plugin info.
|
2009-04-29 01:58:41 +02:00
|
|
|
*/
|
2008-10-04 22:59:11 +02:00
|
|
|
public Plugin:myinfo =
|
|
|
|
{
|
2009-04-29 01:58:41 +02:00
|
|
|
name = "Zombie:Reloaded",
|
2009-05-08 04:57:21 +02:00
|
|
|
author = "Greyscale | Richard Helgeby",
|
2009-04-29 01:58:41 +02:00
|
|
|
description = "Infection/survival style gameplay",
|
|
|
|
version = VERSION,
|
2009-05-30 04:17:01 +02:00
|
|
|
url = "http://www.zombiereloaded.com"
|
2008-10-04 22:59:11 +02:00
|
|
|
};
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* Called before plugin is loaded.
|
|
|
|
*
|
|
|
|
* @param myself The plugin handle.
|
|
|
|
* @param late True if the plugin was loaded after map change, false on map start.
|
|
|
|
* @param error Error message if load failed.
|
|
|
|
* @param err_max Max length of the error message.
|
|
|
|
*/
|
2008-10-04 22:59:11 +02:00
|
|
|
public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max)
|
|
|
|
{
|
2009-04-29 01:58:41 +02:00
|
|
|
// TODO: EXTERNAL API
|
2008-10-04 22:59:11 +02:00
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
// Let plugin load.
|
2008-10-04 22:59:11 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* Plugin is loading.
|
|
|
|
*/
|
2008-10-04 22:59:11 +02:00
|
|
|
public OnPluginStart()
|
|
|
|
{
|
2009-05-14 09:32:01 +02:00
|
|
|
// Forward event to modules.
|
2009-06-14 19:10:30 +02:00
|
|
|
LogInit(); // Doesn't depend on CVARs.
|
2009-05-14 09:32:01 +02:00
|
|
|
TranslationInit();
|
2009-04-20 02:56:26 +02:00
|
|
|
CvarsInit();
|
2009-04-29 01:58:41 +02:00
|
|
|
ToolsInit();
|
2009-06-20 09:15:43 +02:00
|
|
|
CookiesInit();
|
2009-05-14 02:28:26 +02:00
|
|
|
CommandsInit();
|
2009-04-13 20:33:13 +02:00
|
|
|
WeaponsInit();
|
2009-04-27 04:00:38 +02:00
|
|
|
EventInit();
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* The map is starting.
|
|
|
|
*/
|
2008-10-04 22:59:11 +02:00
|
|
|
public OnMapStart()
|
|
|
|
{
|
2009-04-13 04:35:11 +02:00
|
|
|
// Forward event to modules.
|
2009-05-14 02:28:26 +02:00
|
|
|
OverlaysOnMapStart();
|
2009-04-22 04:53:19 +02:00
|
|
|
RoundEndOnMapStart();
|
|
|
|
InfectOnMapStart();
|
2009-04-20 02:56:26 +02:00
|
|
|
SEffectsOnMapStart();
|
2009-05-06 03:04:55 +02:00
|
|
|
ZSpawnOnMapStart();
|
2009-07-16 10:05:40 +02:00
|
|
|
|
2009-01-19 22:45:58 +01:00
|
|
|
}
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* The map is ending.
|
|
|
|
*/
|
2009-01-19 22:45:58 +01:00
|
|
|
public OnMapEnd()
|
|
|
|
{
|
2009-04-17 01:09:52 +02:00
|
|
|
// Forward event to modules.
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* Configs just finished getting executed.
|
|
|
|
*/
|
2008-10-04 22:59:11 +02:00
|
|
|
public OnConfigsExecuted()
|
|
|
|
{
|
2009-05-29 08:43:15 +02:00
|
|
|
// Forward event to modules. (OnConfigsExecuted)
|
2009-04-30 07:36:57 +02:00
|
|
|
ConfigLoad();
|
|
|
|
ModelsLoad();
|
2009-05-18 06:26:13 +02:00
|
|
|
DownloadsLoad();
|
2009-04-23 06:39:11 +02:00
|
|
|
WeaponsLoad();
|
|
|
|
HitgroupsLoad();
|
|
|
|
InfectLoad();
|
2009-04-24 05:02:19 +02:00
|
|
|
VEffectsLoad();
|
2009-04-17 01:09:52 +02:00
|
|
|
SEffectsLoad();
|
2009-07-02 08:23:12 +02:00
|
|
|
AntiStickLoad();
|
2009-04-25 14:19:14 +02:00
|
|
|
ClassLoad();
|
2009-05-30 04:17:01 +02:00
|
|
|
VolLoad();
|
2009-05-09 17:45:19 +02:00
|
|
|
|
2009-05-29 08:43:15 +02:00
|
|
|
// Forward event to modules. (OnModulesLoaded)
|
2009-05-09 17:45:19 +02:00
|
|
|
ConfigOnModulesLoaded();
|
2009-05-10 18:49:47 +02:00
|
|
|
ClassOnModulesLoaded();
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* Client is joining the server.
|
|
|
|
*
|
|
|
|
* @param client The client index.
|
|
|
|
*/
|
2008-10-04 22:59:11 +02:00
|
|
|
public OnClientPutInServer(client)
|
|
|
|
{
|
2009-04-13 04:35:11 +02:00
|
|
|
// Forward event to modules.
|
2009-04-20 02:56:26 +02:00
|
|
|
ClassClientInit(client);
|
2009-05-14 02:28:26 +02:00
|
|
|
OverlaysClientInit(client);
|
2009-04-22 04:53:19 +02:00
|
|
|
WeaponsClientInit(client);
|
|
|
|
InfectClientInit(client);
|
2009-04-19 19:54:21 +02:00
|
|
|
DamageClientInit(client);
|
2009-04-17 01:09:52 +02:00
|
|
|
SEffectsClientInit(client);
|
2009-07-02 08:23:12 +02:00
|
|
|
AntiStickClientInit(client);
|
2009-04-16 01:18:08 +02:00
|
|
|
SpawnProtectClientInit(client);
|
2009-04-16 05:30:26 +02:00
|
|
|
RespawnClientInit(client);
|
2009-05-05 06:56:34 +02:00
|
|
|
ZTeleClientInit(client);
|
2009-04-16 01:18:08 +02:00
|
|
|
ZHPClientInit(client);
|
2008-10-04 22:59:11 +02:00
|
|
|
}
|
|
|
|
|
2009-04-29 01:58:41 +02:00
|
|
|
/**
|
|
|
|
* Client is leaving the server.
|
|
|
|
*
|
|
|
|
* @param client The client index.
|
|
|
|
*/
|
2008-10-04 22:59:11 +02:00
|
|
|
public OnClientDisconnect(client)
|
|
|
|
{
|
2009-04-13 04:35:11 +02:00
|
|
|
// Forward event to modules.
|
|
|
|
ClassOnClientDisconnect(client);
|
2009-04-16 01:18:08 +02:00
|
|
|
WeaponsOnClientDisconnect(client);
|
2009-04-22 04:53:19 +02:00
|
|
|
InfectOnClientDisconnect(client);
|
|
|
|
DamageOnClientDisconnect(client);
|
2009-07-02 08:23:12 +02:00
|
|
|
AntiStickOnClientDisconnect(client);
|
2009-04-29 01:58:41 +02:00
|
|
|
ZSpawnOnClientDisconnect(client);
|
2009-05-30 04:17:01 +02:00
|
|
|
VolOnPlayerDisconnect(client);
|
2009-05-01 11:22:45 +02:00
|
|
|
}
|