Weapons module added, still needs better validations

This commit is contained in:
Greyscale
2009-04-12 08:04:00 +02:00
parent d063def554
commit 035d6182a9
12 changed files with 930 additions and 201 deletions

View File

@ -33,12 +33,11 @@
#include "zr/zombie"
#include "zr/menu"
#include "zr/sayhooks"
#include "zr/zadmin"
// Weapons
#include "zr/weapons/restrict"
#include "zr/weapons/markethandler"
#include "zr/weapons/weapons"
#include "zr/zadmin"
#include "zr/damagecontrol"
#include "zr/commands"
#include "zr/event"
@ -120,8 +119,16 @@ public OnMapStart()
LoadModelData();
LoadDownloadData();
// Forward event to modules.
WeaponRestrictMapStart();
// Weapons
WeaponsOnMapStart();
new i;
new classindex = GetDefaultClassIndex();
for (i = 1; i <= MAXPLAYERS; i++)
{
pClass[i] = classindex;
}
Anticamp_Startup();
}
@ -132,6 +139,11 @@ public OnMapEnd()
public OnConfigsExecuted()
{
FindMapSky();
LoadClassData();
LoadAmbienceData();
decl String:mapconfig[PLATFORM_MAX_PATH];
GetCurrentMap(mapconfig, sizeof(mapconfig));
@ -143,17 +155,8 @@ public OnConfigsExecuted()
if (FileExists(path))
{
ServerCommand("exec %s", mapconfig);
if (LogFlagCheck(LOG_CORE_EVENTS))
{
LogMessage("Executed map config file: %s", mapconfig);
}
LogMessage("Executed map config file: %s", mapconfig);
}
FindMapSky();
ClassLoad();
LoadClassData();
LoadAmbienceData();
}
public OnClientPutInServer(client)
@ -167,9 +170,8 @@ public OnClientPutInServer(client)
new bool:zhp = GetConVarBool(gCvars[CVAR_ZHP_DEFAULT]);
dispHP[client] = zhp;
// Forward event to modules.
// Weapon restrict
WeaponRestrictClientInit(client);
ClassClientInit(client);
ClientHookAttack(client);
@ -186,12 +188,12 @@ public OnClientPutInServer(client)
public OnClientDisconnect(client)
{
ClientUnHookAttack(client);
PlayerLeft(client);
// Forward event to modules.
// Weapon restrict
WeaponRestrictClientDisconnect(client);
ClassOnClientDisconnect(client);
ClientUnHookAttack(client);
PlayerLeft(client);
ZTeleResetClient(client);
AmbienceStop(client);
@ -233,8 +235,6 @@ ZREnd()
UnhookCvars();
UnhookEvents();
// TODO: Disable all modules! Teleport, ambience, overlays, antistick, etc.
new maxplayers = GetMaxClients();
for (new x = 1; x <= maxplayers; x++)
{