2009-04-29 01:58:41 +02:00
/ *
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
*
2008-10-04 22:59:11 +02:00
* Zombie : Reloaded
2009-04-29 01:58:41 +02:00
*
2009-05-06 02:28:09 +02:00
* File : zombiereloaded . sp
* Type : Base
2009-05-11 04:47:09 +02:00
* Description : Plugin ' s base file .
2009-04-29 01:58:41 +02:00
*
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
2008-10-04 22:59:11 +02:00
* /
# pragma semicolon 1
# include <sourcemod>
# include <sdktools>
# include <cstrike>
2009-05-11 04:47:09 +02:00
# include <zrtools>
2008-10-04 22:59:11 +02:00
# undef REQUIRE_PLUGIN
# include <market>
2009-04-01 19:10:10 +02:00
# define VERSION "3.0-dev"
2008-10-04 22:59:11 +02:00
2009-04-29 01:58:41 +02:00
// Core includes.
2008-10-04 22:59:11 +02:00
# include "zr/zombiereloaded"
2009-04-20 05:43:20 +02:00
# include "zr/log"
2009-04-27 04:00:38 +02:00
# include "zr/cvars"
2009-04-30 07:36:57 +02:00
# include "zr/config"
2008-10-04 22:59:11 +02:00
# include "zr/translation"
2009-05-08 04:57:21 +02:00
# include "zr/sayhooks"
2009-04-29 01:58:41 +02:00
# include "zr/tools"
2008-10-04 22:59:11 +02:00
# include "zr/models"
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-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-04-24 05:02:19 +02:00
# include "zr/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-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-04-29 01:58:41 +02:00
# include "zr/jumpboost"
2009-04-20 02:56:26 +02:00
# include "zr/anticamp"
2009-04-27 04:00:38 +02:00
2009-04-29 01:58:41 +02:00
// Almost replaced! :)
# include "zr/zombie"
2008-10-04 22:59:11 +02:00
2009-04-29 01:58:41 +02:00
/ * *
* Tell SM ZR ' s info .
* /
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 ,
2008-10-04 22:59:11 +02:00
url = " "
} ;
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-04-29 01:58:41 +02:00
// Load translations phrases used by plugin.
2008-10-04 22:59:11 +02:00
LoadTranslations ( " common.phrases.txt " ) ;
LoadTranslations ( " zombiereloaded.phrases.txt " ) ;
2009-04-29 01:58:41 +02:00
// Start loading ZR init functions.
2008-10-04 22:59:11 +02:00
ZR_PrintToServer ( " Plugin loading " ) ;
2009-04-27 04:00:38 +02:00
// Log
LogInit ( ) ;
2009-04-20 02:56:26 +02:00
// Cvars
CvarsInit ( ) ;
2009-04-29 01:58:41 +02:00
// Tools
ToolsInit ( ) ;
2009-04-20 02:56:26 +02:00
// TODO: Be modulized/recoded.
2008-10-04 22:59:11 +02:00
CreateCommands ( ) ;
HookCommands ( ) ;
2009-04-13 20:33:13 +02:00
// Weapons
WeaponsInit ( ) ;
2009-04-19 19:54:21 +02:00
// Damage
DamageInit ( ) ;
2008-10-04 22:59:11 +02:00
2009-04-29 01:58:41 +02:00
// Say Hooks
SayHooksInit ( ) ;
2009-04-27 04:00:38 +02:00
// Event
EventInit ( ) ;
2009-04-29 01:58:41 +02:00
// Set market variable to true if market is installed.
2009-04-17 12:16:44 +02:00
g_bMarket = LibraryExists ( " market " ) ;
2008-10-04 22:59:11 +02:00
2009-04-29 01:58:41 +02:00
// Create public cvar for tracking.
2008-10-04 22:59:11 +02:00
CreateConVar ( " gs_zombiereloaded_version " , VERSION , " [ZR] Current version of this plugin " , FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_UNLOGGED | FCVAR_DONTRECORD | FCVAR_REPLICATED | FCVAR_NOTIFY ) ;
2009-04-29 01:58:41 +02:00
// Finish loading ZR init functions.
2008-10-04 22:59:11 +02:00
ZR_PrintToServer ( " Plugin loaded " ) ;
}
2009-04-29 01:58:41 +02:00
/ * *
* Library is being removed .
*
* @ param name The name of the library .
* /
2008-10-04 22:59:11 +02:00
public OnLibraryRemoved ( const String : name [ ] )
{
2009-04-29 01:58:41 +02:00
// If market is being removed, then set variable to false.
if ( StrEqual ( name , " market " , false ) )
{
g_bMarket = false ;
}
2008-10-04 22:59:11 +02:00
}
2009-04-29 01:58:41 +02:00
/ * *
* Library is being added .
*
* @ param name The name of the library .
* /
2008-10-04 22:59:11 +02:00
public OnLibraryAdded ( const String : name [ ] )
{
2009-04-29 01:58:41 +02:00
// If market is being added, then set variable to true.
if ( StrEqual ( name , " market " , false ) )
{
g_bMarket = true ;
}
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-04-22 04:53:19 +02:00
RoundEndOnMapStart ( ) ;
InfectOnMapStart ( ) ;
2009-04-20 02:56:26 +02:00
SEffectsOnMapStart ( ) ;
2009-04-21 02:03:35 +02:00
AntiStickOnMapStart ( ) ;
2009-05-06 03:04:55 +02:00
ZSpawnOnMapStart ( ) ;
2009-01-19 22:45:58 +01:00
Anticamp_Startup ( ) ;
}
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.
2009-01-19 22:45:58 +01:00
Anticamp_Disable ( ) ;
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-04-17 01:09:52 +02:00
// Forward event to modules.
2009-04-30 07:36:57 +02:00
ConfigLoad ( ) ;
ModelsLoad ( ) ;
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-04-25 14:19:14 +02:00
ClassLoad ( ) ;
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-04-22 04:53:19 +02:00
WeaponsClientInit ( client ) ;
2009-04-19 19:54:21 +02:00
RoundEndClientInit ( client ) ;
2009-04-22 04:53:19 +02:00
InfectClientInit ( client ) ;
2009-04-19 19:54:21 +02:00
DamageClientInit ( client ) ;
2009-04-17 01:09:52 +02:00
SEffectsClientInit ( 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-04-29 01:58:41 +02:00
ZSpawnOnClientDisconnect ( client ) ;
2009-05-01 11:22:45 +02:00
}