sm-zombiereloaded-3/src/zombiereloaded.sp

211 lines
4.8 KiB
SourcePawn
Raw Normal View History

2009-04-29 01:58:41 +02:00
/*
* ============================================================================
*
* Zombie:Reloaded
2009-04-29 01:58:41 +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>
#include <clientprefs>
2008-10-04 22:59:11 +02:00
#include <cstrike>
#include <zrtools>
2008-10-04 22:59:11 +02:00
#define VERSION "3.0.0-b2-dev"
2008-10-04 22:59:11 +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"
#include "zr/translation"
#include "zr/cvars"
#include "zr/log"
#include "zr/config"
#include "zr/steamidcache"
#include "zr/sayhooks"
2009-04-29 01:58:41 +02:00
#include "zr/tools"
#include "zr/menu"
#include "zr/cookies"
#include "zr/paramtools"
2008-10-04 22:59:11 +02:00
#include "zr/models"
#include "zr/downloads"
#include "zr/overlays"
#include "zr/playerclasses/playerclasses"
#include "zr/weapons/weapons"
#include "zr/hitgroups"
#include "zr/roundstart"
#include "zr/roundend"
#include "zr/infect"
#include "zr/damage"
2009-04-29 01:58:41 +02:00
#include "zr/event"
#include "zr/zadmin"
#include "zr/commands"
//#include "zr/global"
2009-04-29 01:58:41 +02:00
// Modules
#include "zr/account"
#include "zr/visualeffects/visualeffects"
#include "zr/soundeffects/soundeffects"
#include "zr/antistick"
#include "zr/knockback"
2009-04-15 11:27:03 +02:00
#include "zr/spawnprotect"
#include "zr/respawn"
#include "zr/napalm"
#include "zr/jumpboost"
2009-04-29 01:58:41 +02:00
#include "zr/zspawn"
#include "zr/ztele"
#include "zr/zhp"
#include "zr/zcookies"
2009-04-29 01:58:41 +02:00
#include "zr/jumpboost"
#include "zr/volfeatures/volfeatures"
#include "zr/debugtools"
2009-04-29 01:58:41 +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",
author = "Greyscale | Richard Helgeby",
2009-04-29 01:58:41 +02:00
description = "Infection/survival style gameplay",
version = VERSION,
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()
{
// Forward event to modules.
LogInit(); // Doesn't depend on CVARs.
TranslationInit();
CvarsInit();
2009-04-29 01:58:41 +02:00
ToolsInit();
CookiesInit();
CommandsInit();
WeaponsInit();
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()
{
// Forward event to modules.
OverlaysOnMapStart();
RoundEndOnMapStart();
InfectOnMapStart();
SEffectsOnMapStart();
2009-05-06 03:04:55 +02:00
ZSpawnOnMapStart();
}
2009-04-29 01:58:41 +02:00
/**
* The map is ending.
*/
public OnMapEnd()
{
// 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()
{
// Forward event to modules. (OnConfigsExecuted)
ConfigLoad();
ModelsLoad();
DownloadsLoad();
WeaponsLoad();
HitgroupsLoad();
InfectLoad();
VEffectsLoad();
SEffectsLoad();
AntiStickLoad();
ClassLoad();
VolLoad();
// Forward event to modules. (OnModulesLoaded)
ConfigOnModulesLoaded();
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)
{
// Forward event to modules.
ClassClientInit(client);
OverlaysClientInit(client);
WeaponsClientInit(client);
InfectClientInit(client);
DamageClientInit(client);
SEffectsClientInit(client);
AntiStickClientInit(client);
SpawnProtectClientInit(client);
RespawnClientInit(client);
ZTeleClientInit(client);
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)
{
// Forward event to modules.
ClassOnClientDisconnect(client);
WeaponsOnClientDisconnect(client);
InfectOnClientDisconnect(client);
DamageOnClientDisconnect(client);
AntiStickOnClientDisconnect(client);
2009-04-29 01:58:41 +02:00
ZSpawnOnClientDisconnect(client);
VolOnPlayerDisconnect(client);
}