1 Commits

Author SHA1 Message Date
a59c659d47 Tagged 0.15 2006-07-20 05:53:18 +00:00
92 changed files with 553 additions and 4399 deletions

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "CCmd.h"
// *****************************************************

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "CEvent.h"
// *****************************************************
@ -123,6 +123,12 @@ EventsMngr::EventsMngr()
EventsMngr::~EventsMngr()
{
clearEvents();
// delete parsevault
if (m_ParseVault)
{
delete [] m_ParseVault;
m_ParseVault = NULL;
}
}
@ -249,8 +255,8 @@ void EventsMngr::parserInit(int msg_type, float* timer, CPlayer* pPlayer, int in
{
m_ParsePos = 0;
NextParam();
m_ParseVault[0].type = MSG_INTEGER;
m_ParseVault[0].iValue = index;
m_ParseVault[m_ParsePos].type = MSG_INTEGER;
m_ParseVault[m_ParsePos].iValue = index;
}
m_ParseFun = &m_Events[msg_type];
}
@ -277,13 +283,12 @@ void EventsMngr::parseValue(int iValue)
continue; // already skipped; don't bother with parsing
// loop through conditions
bool execute = false;
bool anyConditions = false;
bool execute;
for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next)
{
if (condIter->paramId == m_ParsePos)
{
anyConditions = true;
execute = false;
switch(condIter->type)
{
case '=': if (condIter->iValue == iValue) execute=true; break;
@ -293,11 +298,11 @@ void EventsMngr::parseValue(int iValue)
case '>': if (iValue > condIter->iValue) execute=true; break;
}
if (execute)
break;
continue;
(*iter).m_Done = true; // don't execute
break;
}
}
if (anyConditions && !execute)
(*iter).m_Done = true; // don't execute
}
}
@ -323,13 +328,11 @@ void EventsMngr::parseValue(float fValue)
continue; // already skipped; don't bother with parsing
// loop through conditions
bool execute = false;
bool anyConditions = false;
for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next)
{
if (condIter->paramId == m_ParsePos)
{
anyConditions = true;
bool execute = false;
switch(condIter->type)
{
case '=': if (condIter->fValue == fValue) execute=true; break;
@ -338,11 +341,11 @@ void EventsMngr::parseValue(float fValue)
case '>': if (fValue > condIter->fValue) execute=true; break;
}
if (execute)
break;
continue;
(*iter).m_Done = true; // don't execute
break;
}
}
if (anyConditions && !execute)
(*iter).m_Done = true; // don't execute
}
}
@ -367,13 +370,11 @@ void EventsMngr::parseValue(const char *sz)
continue; // already skipped; don't bother with parsing
// loop through conditions
bool execute = false;
bool anyConditions = false;
for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next)
{
if (condIter->paramId == m_ParsePos)
{
anyConditions = true;
bool execute = false;
switch(condIter->type)
{
case '=': if (!strcmp(sz, condIter->sValue.str())) execute=true; break;
@ -381,11 +382,11 @@ void EventsMngr::parseValue(const char *sz)
case '&': if (strstr(sz, condIter->sValue.str())) execute=true; break;
}
if (execute)
break;
continue;
(*iter).m_Done = true; // don't execute
break;
}
}
if (anyConditions && !execute)
(*iter).m_Done = true; // don't execute
}
}
@ -412,7 +413,7 @@ void EventsMngr::executeEvents()
(*iter).m_Stamp = (float)*m_Timer;
if ((err = amx_Exec((*iter).m_Plugin->getAMX(), NULL, (*iter).m_Func, 1, m_ParseVault ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE)
if ((err = amx_Exec((*iter).m_Plugin->getAMX(), NULL, (*iter).m_Func, 1, m_ParseVaultSize ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE)
{
UTIL_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err,
(*iter).m_Plugin->getAMX()->curline, (*iter).m_Plugin->getName());
@ -493,13 +494,6 @@ void EventsMngr::clearEvents(void)
{
m_Events[i].clear();
}
// delete parsevault
if (m_ParseVault)
{
delete [] m_ParseVault;
m_ParseVault = NULL;
m_ParseVaultSize = 0;
}
}
int EventsMngr::getEventId(const char* msg)

View File

@ -94,7 +94,6 @@ File& operator>>( File& f, char* n )
int File::getline( char* buf, int sz )
{
int a = sz;
char *origBuf = buf;
if ( *this )
{
int c;
@ -102,15 +101,6 @@ int File::getline( char* buf, int sz )
*buf++ = c;
*buf = 0;
}
// trim 0x0a and 0x0d characters at the end
while (buf != origBuf)
{
if (*buf == 0x0a || *buf == 0x0d)
*buf = 0;
--buf;
}
return a - sz;
}

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "CForward.h"
void CForwardMngr::registerForward( CPluginMngr::CPlugin* p, int func , int type ){

View File

@ -51,28 +51,21 @@ public:
};
private:
CListEle *head;
int cur_size;
public:
CList<T,F>() { head = 0; }
CList<T,F>() { head = 0; cur_size = 0; }
~CList<T,F>() { clear(); }
void clear() {
iterator a = begin();
while( a ) a.remove();
}
bool empty() {
return (head ? false : true);
cur_size = 0;
}
void put( T* a ) {
head = new CListEle( a , head );
++cur_size;
}
int size() {
CListEle *p = head;
int i = 0;
while (p)
{
p = p->next;
++i;
}
return i;
return cur_size;
}
class iterator {
CListEle** a;

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "CLogEvent.h"
// *****************************************************

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "CMenu.h"
// *****************************************************

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
// *****************************************************
// class CPlayer

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#ifndef FAR // PM: Test: FAR
#define FAR

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "CPlugin.h"
#include "CForward.h"
#include "CFile.h"
@ -62,7 +62,7 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
// Find now folder
char pluginName[256], line[256], error[256];
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
const char pluginsDir[] = "addons/amxx/plugins"; // hardcoded; :TODO: make it localinfo
while ( fp.getline(line , 255 ) )

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "CTask.h"

View File

@ -1,7 +1,7 @@
MODNAME = amxx_mm
MODNAME = amx_mm
SRCFILES = meta_api.cpp CFile.cpp CString.cpp CVault.cpp vault.cpp\
float.cpp file.cpp modules.cpp CMisc.cpp CTask.cpp string.cpp\
amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp srvcmd.cpp strptime.cpp\
amxmod.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp srvcmd.cpp strptime.cpp\
CForward.cpp CPlugin.cpp CModule.cpp CMenu.cpp emsg.cpp util.cpp
CSRCFILES = amx.c amxcore.c amxtime.c power.c
@ -61,7 +61,7 @@ OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -O2 -march=i586 -ffast-math -funroll-loops \
CCOPT = -O2 -march=i686 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG

File diff suppressed because it is too large Load Diff

View File

@ -1,247 +0,0 @@
/* AMX Mod X
*
* by the AMX Mod X Development Team
* originally developed by OLO
*
*
* 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 2 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, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/
#ifndef AMXMODX_H
#define AMXMODX_H
#include "modules.h"
#include "CString.h"
#include "CList.h"
#include "CPlugin.h"
#include "CMisc.h"
#include "CVault.h"
#include "CModule.h"
#include "CTask.h"
#include "CLogEvent.h"
#include "CForward.h"
#include "CCmd.h"
#include "CMenu.h"
#include "CEvent.h"
#define AMX_VERSION "0.16"
#ifdef __cplusplus
extern "C" {
#endif
extern AMX_NATIVE_INFO core_Natives[];
extern AMX_NATIVE_INFO time_Natives[];
extern AMX_NATIVE_INFO power_Natives[];
#ifdef __cplusplus
}
#endif
extern AMX_NATIVE_INFO amxmod_Natives[];
extern AMX_NATIVE_INFO file_Natives[];
extern AMX_NATIVE_INFO float_Natives[];
extern AMX_NATIVE_INFO string_Natives[];
extern AMX_NATIVE_INFO vault_Natives[];
#ifndef __linux__
#define DLLOAD(path) (DLHANDLE)LoadLibrary(path);
#define DLPROC(m,func) GetProcAddress(m,func);
#define DLFREE(m) FreeLibrary(m);
#else
#define DLLOAD(path) (DLHANDLE)dlopen(path, RTLD_NOW);
#define DLPROC(m,func) dlsym(m,func);
#define DLFREE(m) dlclose(m);
#endif
#ifndef __linux__
typedef HINSTANCE DLHANDLE;
#else
typedef void* DLHANDLE;
#endif
#ifndef GETPLAYERAUTHID
#define GETPLAYERAUTHID (*g_engfuncs.pfnGetPlayerAuthId)
#endif
#define ANGLEVECTORS (*g_engfuncs.pfnAngleVectors)
#define CLIENT_PRINT (*g_engfuncs.pfnClientPrintf)
#define CVAR_DIRECTSET (*g_engfuncs.pfnCvar_DirectSet)
#define GETCLIENTLISTENING (*g_engfuncs.pfnVoice_GetClientListening)
#define RUNPLAYERMOVE (*g_engfuncs.pfnRunPlayerMove)
#define SETCLIENTLISTENING (*g_engfuncs.pfnVoice_SetClientListening)
#define SETCLIENTMAXSPEED (*g_engfuncs.pfnSetClientMaxspeed)
char* UTIL_SplitHudMessage(register const char *src);
int UTIL_ReadFlags(const char* c);
void UTIL_ClientPrint( edict_t *pEntity, int msg_dest, char *msg );
void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1 = NULL, const char *arg2 = NULL);
void UTIL_GetFlags(char* flags,int flag);
void UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, char *pMessage);
void UTIL_IntToString(int value, char *output);
void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name);
void UTIL_ShowMenu( edict_t* pEntity, int slots, int time, char *menu, int mlen );
void UTIL_MakeNewLogFile();
void UTIL_Log(const char *fmt, ...);
#define UTIL_MODULES_RUNNING 0
#define UTIL_MODULES_ALL 1
#define UTIL_MODULES_STOPPED 2
int UTIL_GetModulesNum(int mode);
#define GET_PLAYER_POINTER(e) (&g_players[ENTINDEX(e)])
//#define GET_PLAYER_POINTER(e) (&g_players[(((int)e-g_edict_point)/sizeof(edict_t ))])
#define GET_PLAYER_POINTER_I(i) (&g_players[i])
struct WeaponsVault {
String fullName;
short int iId;
short int ammoSlot;
};
struct fakecmd_t {
char args[256];
const char *argv[3];
//char argv[3][128];
int argc;
bool fake;
};
extern CPluginMngr g_plugins;
extern CTaskMngr g_tasksMngr;
extern CPlayer g_players[33];
extern CPlayer* mPlayer;
extern CmdMngr g_commands;
extern CList<CCVar> g_cvars;
extern CList<ForceObject> g_forcemodels;
extern CList<ForceObject> g_forcesounds;
extern CList<ForceObject> g_forcegeneric;
extern CList<CModule> g_modules;
extern CList<CPlayer*> g_auth;
extern EventsMngr g_events;
extern Grenades g_grenades;
extern LogEventsMngr g_logevents;
extern MenuMngr g_menucmds;
extern String g_log_dir;
extern String g_mod_name;
extern TeamIds g_teamsIds;
extern Vault g_vault;
extern CForwardMngr g_forwards;
extern WeaponsVault g_weaponsData[MAX_WEAPONS];
extern XVars g_xvars;
extern bool g_bmod_cstrike;
extern bool g_bmod_dod;
extern bool g_dontprecache;
extern bool g_initialized;
extern int g_srvindex;
extern cvar_t* amx_version;
extern cvar_t* amxmodx_version;
extern cvar_t* hostname;
extern cvar_t* mp_timelimit;
extern fakecmd_t g_fakecmd;
extern float g_game_restarting;
extern float g_game_timeleft;
extern float g_task_time;
extern float g_auth_time;
extern hudtextparms_t g_hudset;
//extern int g_edict_point;
extern int g_players_num;
extern int mPlayerIndex;
extern int mState;
extern void (*endfunction)(void*);
extern void (*function)(void*);
typedef void (*funEventCall)(void*);
extern funEventCall modMsgsEnd[MAX_REG_MSGS];
extern funEventCall modMsgs[MAX_REG_MSGS];
extern int gmsgAmmoPickup;
extern int gmsgAmmoX;
extern int gmsgBattery;
extern int gmsgCurWeapon;
extern int gmsgDamage;
extern int gmsgDeathMsg;
extern int gmsgHealth;
extern int gmsgMOTD;
extern int gmsgScoreInfo;
extern int gmsgSendAudio;
extern int gmsgServerName;
extern int gmsgShowMenu;
extern int gmsgTeamInfo;
extern int gmsgTextMsg;
extern int gmsgVGUIMenu;
extern int gmsgWeapPickup;
extern int gmsgWeaponList;
extern int gmsgintermission;
extern int gmsgResetHUD;
extern int gmsgRoundTime;
void Client_AmmoPickup(void*);
void Client_AmmoX(void*);
void Client_CurWeapon(void*);
void Client_ScoreInfo(void*);
void Client_ShowMenu(void*);
void Client_TeamInfo(void*);
void Client_TextMsg(void*);
void Client_VGUIMenu(void*);
void Client_WeaponList(void*);
void Client_DamageEnd(void*);
void Client_DeathMsg(void*);
void amx_command();
void plugin_srvcmd();
const char* stristr(const char* a,const char* b);
char *strptime(const char *buf, const char *fmt, struct tm *tm, short addthem);
int loadModules(const char* filename);
void dettachModules();
void dettachReloadModules();
void attachModules();
void attachMetaModModules( const char* filename );
void dettachMetaModModules( const char* filename );
int add_amxnatives(module_info_s* info,AMX_NATIVE_INFO*natives);
cell* get_amxaddr(AMX *amx,cell amx_addr);
char* build_pathname(char *fmt, ... );
char* format_amxstring(AMX *amx, cell *params, int parm,int& len);
AMX* get_amxscript(int, void**,const char**);
const char* get_amxscriptname(AMX* amx);
char* get_amxstring(AMX *amx,cell amx_addr,int id,int& len);
int amxstring_len(cell* cstr);
int load_amxscript(AMX* amx, void** program, const char* path, char error[64]);
int set_amxnatives(AMX* amx,char error[64]);
int set_amxstring(AMX *amx,cell amx_addr,const char *source,int max);
int unload_amxscript(AMX* amx,void** program);
void copy_amxmemory(cell* dest,cell* src,int len);
void get_modname(char*);
void print_srvconsole( char *fmt, ... );
void report_error( int code, char* fmt, ... );
void* alloc_amxmemory(void**, int size);
void free_amxmemory(void **ptr);
// get_localinfo
const char* get_localinfo( const char* name , const char* def );
#endif // AMXMODX_H

View File

@ -1,11 +0,0 @@
; /usr/local/cross-tools/bin/i386-mingw32msvc-dlltool --base-file /tmp/cc4kB6s0.base --output-exp amx_mm.exp --dllname amx_mm.dll --output-def amx_mm.def --add-stdcall-alias --exclude-symbol=DllMainCRTStartup@12 --def /tmp/ccyI7I7K.def
EXPORTS
GetEngineFunctions @ 1 ;
GetEngineFunctions_Post @ 2 ;
GetEntityAPI2 @ 3 ;
GetEntityAPI2_Post @ 4 ;
GiveFnptrsToDll = GiveFnptrsToDll@8 @ 5 ;
GiveFnptrsToDll@8 @ 6 ;
Meta_Attach @ 7 ;
Meta_Detach @ 8 ;
Meta_Query @ 9 ;

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
int gmsgAmmoPickup;
int gmsgAmmoX;

View File

@ -37,7 +37,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
// header file for unlink()
#ifdef __linux__

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
plugin_info_t Plugin_info = {
META_INTERFACE_VERSION, // ifvers
@ -216,7 +216,7 @@ int Spawn( edict_t *pent ) {
// so we clear g_log_dir in ServerDeactivate_Post to know we should create one...
if (g_log_dir.empty())
{
g_log_dir.set(get_localinfo("amxx_logs", "addons/amxx/logs"));
g_log_dir.set("addons/amxx/logs"); // :TODO: maybe not do this through String as an optimalization ( a #define or const char * ?)
UTIL_MakeNewLogFile();
}
@ -231,17 +231,22 @@ int Spawn( edict_t *pent ) {
g_commands.registerPrefix( "sm_" );
g_commands.registerPrefix( "cm_" );
// make sure localinfos are set
get_localinfo("amxx_basedir", "addons/amxx");
get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
get_localinfo("amxx_modulesdir", "addons/amxx/modules");
get_localinfo("amxx_configsdir", "addons/amxx/configs");
get_localinfo("amxx_customdir", "addons/amxx/custom");
Vault amx_config;
// ###### Load custom path configuration
amx_config.setSource(build_pathname("%s", "addons/amxx/configs/core.ini"));
if ( amx_config.loadVault() ){
Vault::iterator a = amx_config.begin();
while ( a != amx_config.end() ) {
SET_LOCALINFO( (char*)a.key().str() , (char*)a.value().str() );
++a;
}
amx_config.clear();
}
// ###### Load modules
loadModules(get_localinfo("amxx_modules", "addons/amxx/modules.ini"));
int loaded = loadModules( "addons/amxx/modules.ini" );
attachModules();
int loaded = UTIL_GetModulesNum(UTIL_MODULES_RUNNING); // Call after attachModules so all modules don't have pending stat
// Set some info about amx version and modules
if ( loaded ){
char buffer[64];
@ -256,7 +261,7 @@ int Spawn( edict_t *pent ) {
}
// ###### Load Vault
g_vault.setSource( build_pathname("%s", get_localinfo("amxx_vault", "addons/amxx/configs/vault.ini")) );
g_vault.setSource( build_pathname("%s", "addons/amxx/configs/vault.ini" ) );
g_vault.loadVault( );
@ -270,7 +275,7 @@ int Spawn( edict_t *pent ) {
memset(g_players[0].flags,-1,sizeof(g_players[0].flags));
// ###### Load AMX scripts
g_plugins.loadPluginsFromFile( get_localinfo("amxx_plugins", "addons/amxx/plugins.ini") ); // :TODO: Where the hell should this be!?!?!
g_plugins.loadPluginsFromFile( "addons/amxx/plugins.ini" ); // :TODO: Where the hell should this be!?!?!
// ###### Call precache forward function
g_dontprecache = false;
@ -968,25 +973,12 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
a = &gameDir[i];
g_mod_name.set(a);
// ###### Load custom path configuration
Vault amx_config;
amx_config.setSource(build_pathname("%s", get_localinfo("amxx_cfg", "addons/amxx/configs/core.ini")));
if ( amx_config.loadVault() ){
Vault::iterator a = amx_config.begin();
while ( a != amx_config.end() ) {
SET_LOCALINFO( (char*)a.key().str() , (char*)a.value().str() );
++a;
}
amx_config.clear();
}
// ###### Initialize logging here
g_log_dir.set(get_localinfo("amxx_logs", "addons/amxx/logs"));
g_log_dir.set("addons/amxx/logs"); // :TODO: maybe not do this through String as an optimalization ( a #define or const char * ?)
UTIL_MakeNewLogFile();
// ###### Now attach metamod modules
attachMetaModModules( get_localinfo("amxx_modules", "addons/amxx/modules.ini") );
attachMetaModModules( "addons/amxx/modules.ini" );
return(TRUE);
}
@ -1015,7 +1007,7 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
dettachModules();
// ###### Now dettach metamod modules
dettachMetaModModules( get_localinfo("amxx_modules", "addons/amxx/modules.ini") );
dettachMetaModModules( "addons/amxx/modules.ini" );
return(TRUE);
}

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
#include "osdep.h" // sleep, etc
#include "CFile.h"
@ -362,7 +362,7 @@ int loadModules(const char* filename)
if (!isalnum(*moduleName) || !validFile(moduleName) )
continue;
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* pathname = build_pathname("addons/amxx/modules/%s", line);
CList<CModule>::iterator a = g_modules.find( pathname );
@ -476,8 +476,8 @@ void dettachMetaModModules( const char* filename )
if (!isalnum(*moduleName) || !validFile(moduleName) )
continue;
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* pathname = build_pathname_addons("addons/amxx/modules/%s", line);
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line);
module = DLLOAD( pathname ); // link dll
@ -520,8 +520,8 @@ void attachMetaModModules( const char* filename )
if (!isalnum(*moduleName) || !validFile(moduleName) )
continue;
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* pathname = build_pathname("addons/amxx/modules/%s", line);
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line);
module = DLLOAD( pathname ); // link dll
if ( module )

View File

@ -2,7 +2,7 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="amxmodx_mm"
Name="amxmod_mm"
SccProjectName=""
SccLocalPath="">
<Platforms>
@ -23,12 +23,12 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_mm_EXPORTS"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmod_mm_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\release/amxmodx_mm.pch"
PrecompiledHeaderFile=".\release/amxmod_mm.pch"
AssemblerListingLocation=".\release/"
ObjectFile=".\release/"
ProgramDataBaseFileName=".\release/"
@ -42,13 +42,13 @@
Outputs="$(TargetName)"/>
<Tool
Name="VCLinkerTool"
OutputFile="release/amxx_mm.dll"
OutputFile="release/amx_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\extra\lib_win32"
ModuleDefinitionFile=".\amxmodx_mm.def"
ProgramDatabaseFile=".\release/amxx_mm.pdb"
ImportLibrary=".\release/amxx_mm.lib"
ModuleDefinitionFile=".\amxmod_mm.def"
ProgramDatabaseFile=".\release/amx_mm.pdb"
ImportLibrary=".\release/amx_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
@ -56,7 +56,7 @@
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\release/amxmodx_mm.tlb"
TypeLibraryName=".\release/amxmod_mm.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
@ -91,12 +91,12 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\metamod\metamod,..\...\hlsdk\sourcecode\common,..\...\hlsdk\sourcecode\engine,..\...\hlsdk\sourcecode\dlls,..\...\hlsdk\sourcecode\pm_shared,..\extra\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_mm_EXPORTS"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmod_mm_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
StructMemberAlignment="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\debug/amxmodx_mm.pch"
PrecompiledHeaderFile=".\debug/amxmod_mm.pch"
AssemblerListingLocation=".\debug/"
ObjectFile=".\debug/"
ProgramDataBaseFileName=".\debug/"
@ -111,14 +111,14 @@
Outputs="$(TargetName)"/>
<Tool
Name="VCLinkerTool"
OutputFile="debug/amxx_mm.dll"
OutputFile="debug/amx_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\extra\lib_win32"
ModuleDefinitionFile=".\amxmodx_mm.def"
ModuleDefinitionFile=".\amxmod_mm.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\debug/amxx_mm.pdb"
ImportLibrary=".\debug/amxx_mm.lib"
ProgramDatabaseFile=".\debug/amx_mm.pdb"
ImportLibrary=".\debug/amx_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
@ -126,7 +126,7 @@
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\debug/amxmodx_mm.tlb"
TypeLibraryName=".\debug/amxmod_mm.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
@ -164,7 +164,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -172,7 +172,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -184,7 +184,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -192,19 +192,19 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\amxmodx.cpp">
RelativePath="..\amxmod.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -212,7 +212,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -224,7 +224,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -232,7 +232,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -244,7 +244,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -252,7 +252,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -264,7 +264,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -272,7 +272,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -284,7 +284,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -292,7 +292,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -304,7 +304,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -312,7 +312,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -324,7 +324,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -332,7 +332,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -344,7 +344,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -352,7 +352,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -364,7 +364,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -372,7 +372,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -384,7 +384,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -392,7 +392,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -404,7 +404,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -412,7 +412,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -424,7 +424,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -432,7 +432,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -444,7 +444,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -452,7 +452,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -464,7 +464,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -472,7 +472,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -484,7 +484,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -492,7 +492,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -504,7 +504,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -512,7 +512,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -524,7 +524,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -532,7 +532,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -544,7 +544,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -552,7 +552,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -564,7 +564,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -572,7 +572,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -584,7 +584,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -592,7 +592,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -604,7 +604,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -612,7 +612,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -624,7 +624,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -632,7 +632,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -644,7 +644,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -652,7 +652,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -664,7 +664,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -672,7 +672,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -684,7 +684,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
@ -692,7 +692,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
@ -701,7 +701,7 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\amxmodx.h">
RelativePath="..\amxmod.h">
</File>
<File
RelativePath="..\CCmd.h">

View File

@ -1,6 +0,0 @@
LIBRARY amxx_mm
EXPORTS
GiveFnptrsToDll @1
SECTIONS
.data READ WRITE

View File

@ -1,288 +0,0 @@
# Microsoft Developer Studio Project File - Name="amxmodx_mm" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=amxmodx_mm - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "amxmodx_mm.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "amxmodx_mm.mak" CFG="amxmodx_mm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "amxmodx_mm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "amxmodx_mm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "amxmodx_mm - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\metamod\metamod" /I "..\..\hlsdk\sourcecode\common" /I "..\..\hlsdk\sourcecode\engine" /I "..\..\hlsdk\sourcecode\dlls" /I "..\..\hlsdk\sourcecode\pm_shared" /I "..\extra\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /def:".\amxmodx_mm.def" /out:"release/amxxmm.dll" /libpath:"..\extra\lib_win32"
# Begin Custom Build
TargetPath=.\release\amxxmm.dll
TargetName=amxxmm
InputPath=.\release\amxxmm.dll
SOURCE="$(InputPath)"
"$(TargetName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(TargetPath) D:\SIERRA\Half-Life\cstrike\addons\amx\dlls
# End Custom Build
!ELSEIF "$(CFG)" == "amxmodx_mm - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /Zp4 /MTd /W3 /Gm /GX /ZI /Od /I "..\..\metamod\metamod" /I "..\...\hlsdk\sourcecode\common" /I "..\...\hlsdk\sourcecode\engine" /I "..\...\hlsdk\sourcecode\dlls" /I "..\...\hlsdk\sourcecode\pm_shared" /I "..\extra\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /def:".\amxmodx_mm.def" /out:"debug/amxxmm.dll" /pdbtype:sept /libpath:"..\extra\lib_win32"
# SUBTRACT LINK32 /incremental:no /nodefaultlib
# Begin Custom Build
TargetPath=.\debug\amxxmm.dll
TargetName=amxxmm
InputPath=.\debug\amxxmm.dll
SOURCE="$(InputPath)"
"$(TargetName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(TargetPath) D:\SIERRA\Half-Life\cstrike\addons\amx\dlls
# End Custom Build
!ENDIF
# Begin Target
# Name "amxmodx_mm - Win32 Release"
# Name "amxmodx_mm - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\amx.c
# End Source File
# Begin Source File
SOURCE=..\amxcore.c
# End Source File
# Begin Source File
SOURCE=..\amxmodx.cpp
# End Source File
# Begin Source File
SOURCE=..\amxtime.c
# End Source File
# Begin Source File
SOURCE=..\CCmd.cpp
# End Source File
# Begin Source File
SOURCE=..\CEvent.cpp
# End Source File
# Begin Source File
SOURCE=..\CFile.cpp
# End Source File
# Begin Source File
SOURCE=..\CForward.cpp
# End Source File
# Begin Source File
SOURCE=..\CLogEvent.cpp
# End Source File
# Begin Source File
SOURCE=..\CMenu.cpp
# End Source File
# Begin Source File
SOURCE=..\CMisc.cpp
# End Source File
# Begin Source File
SOURCE=..\CModule.cpp
# End Source File
# Begin Source File
SOURCE=..\CPlugin.cpp
# End Source File
# Begin Source File
SOURCE=..\CString.cpp
# End Source File
# Begin Source File
SOURCE=..\CTask.cpp
# End Source File
# Begin Source File
SOURCE=..\CVault.cpp
# End Source File
# Begin Source File
SOURCE=..\emsg.cpp
# End Source File
# Begin Source File
SOURCE=..\file.cpp
# End Source File
# Begin Source File
SOURCE=..\float.cpp
# End Source File
# Begin Source File
SOURCE=..\meta_api.cpp
# End Source File
# Begin Source File
SOURCE=..\modules.cpp
# End Source File
# Begin Source File
SOURCE=..\power.c
# End Source File
# Begin Source File
SOURCE=..\srvcmd.cpp
# End Source File
# Begin Source File
SOURCE=..\string.cpp
# End Source File
# Begin Source File
SOURCE=..\strptime.cpp
# End Source File
# Begin Source File
SOURCE=..\util.cpp
# End Source File
# Begin Source File
SOURCE=..\vault.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\amxmodx.h
# End Source File
# Begin Source File
SOURCE=..\CCmd.h
# End Source File
# Begin Source File
SOURCE=..\CEvent.h
# End Source File
# Begin Source File
SOURCE=..\CFile.h
# End Source File
# Begin Source File
SOURCE=..\CForward.h
# End Source File
# Begin Source File
SOURCE=..\CList.h
# End Source File
# Begin Source File
SOURCE=..\CLogEvent.h
# End Source File
# Begin Source File
SOURCE=..\CMenu.h
# End Source File
# Begin Source File
SOURCE=..\CMisc.h
# End Source File
# Begin Source File
SOURCE=..\CModule.h
# End Source File
# Begin Source File
SOURCE=..\CPlugin.h
# End Source File
# Begin Source File
SOURCE=..\CString.h
# End Source File
# Begin Source File
SOURCE=..\CTask.h
# End Source File
# Begin Source File
SOURCE=..\CVault.h
# End Source File
# Begin Source File
SOURCE=..\modules.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "amxmodx_mm"=.\amxmodx_mm.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -1,21 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx_mm", "amxmodx_mm.vcproj", "{2FDEE868-4051-4918-81E9-5CBA63F3E785}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Debug.ActiveCfg = Debug|Win32
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Debug.Build.0 = Debug|Win32
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Release.ActiveCfg = Release|Win32
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -31,7 +31,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "amxmodx.h"
#include "amxmod.h"
void amx_command(){

View File

@ -32,7 +32,7 @@
#include <extdll.h>
#include <meta_api.h>
#include <ctype.h>
#include "amxmodx.h"
#include "amxmod.h"
const char* stristr(const char* str,const char* substr)
{

View File

@ -33,7 +33,7 @@
#include <meta_api.h>
#include <time.h>
#include "amxmodx.h"
#include "amxmod.h"
int UTIL_ReadFlags(const char* c)
{
@ -330,36 +330,3 @@ void UTIL_Log(const char *fmt, ...)
fclose(pF);
print_srvconsole("L %s: %s\n", date, msg);
}
// Get the number of running modules
int UTIL_GetModulesNum(int mode)
{
CList<CModule>::iterator iter;
int num;
switch (mode)
{
case UTIL_MODULES_ALL:
return g_modules.size();
case UTIL_MODULES_RUNNING:
iter = g_modules.begin();
num = 0;
while (iter)
{
if ((*iter).getStatusValue() == MODULE_LOADED)
++num;
++iter;
}
return num;
case UTIL_MODULES_STOPPED:
iter = g_modules.begin();
num = 0;
while (iter)
{
if ((*iter).getStatusValue() != MODULE_LOADED)
++num;
++iter;
}
return num;
}
return 0;
}

View File

@ -32,7 +32,7 @@
#include <extdll.h>
#include <meta_api.h>
#include "CVault.h"
#include "amxmodx.h"
#include "amxmod.h"
Vault g_vault;

View File

@ -15,4 +15,4 @@
"Kick player" "amx_kick #%userid%" "b" "u"
"Slay player" "amx_slay #%userid%" "bd" "u"
"Slap with 1 dmg." "amx_slap #%userid% 1" "b" "u"
"Ban for 5 minutes" "amx_ban #%userid% id 5" "b" "u"
"Ban for 5 minutes" "amx_banid #%userid% 5" "b" "u"

View File

@ -1,11 +1,7 @@
; Configuration file for AMX Mod X
amxx_logdir addons/amxx/logs
amxx_configsdir addons/amxx/configs
amxx_customdir addons/amxx/custom
amxx_modules addons/amxx/modules.ini
amxx_plugins addons/amxx/plugins.ini
amxx_pluginsdir addons/amxx/plugins
amxx_modulesdir addons/amxx/modules
amxx_vault addons/amxx/configs/vault.ini
csstats_score addons/amxx/custom/csstats.amx
csstats addons/amxx/custom/csstats.dat
amx_logdir addons/amxx/logs
amx_modules addons/amxx/modules.ini
amx_plugins addons/amxx/plugins/plugins.ini
amx_vault addons/amxx/vault.ini
csstats_score addons/amxx/csstats.amx
csstats addons/amxx/csstats.dat

View File

@ -2,28 +2,28 @@
; File location: $moddir/addons/amxx/configs/maps.ini
; To use with Maps Menu plugin
as_oilrig
cs_747
cs_assault
cs_backalley
cs_estate
cs_havana
cs_italy
cs_militia
cs_office
cs_siege
de_airstrip
de_aztec
de_cbble
de_chateau
de_dust
de_dust2
de_inferno
de_nuke
de_piranesi
de_prodigy
de_storm
de_survivor
de_torn
de_train
de_vertigo
as_oilrig "OilRig - Assassination"
cs_747 "747 Hijack - Hostage Rescue"
cs_assault "Assault - Hostage Rescue"
cs_backalley "Alleyway - Hostage Rescue"
cs_estate "Zaphod's Estate - Hostage Rescue"
cs_havana "Havana - Hostage Rescue"
cs_italy "Italy - Hostage Rescue"
cs_militia "Militia - Hostage Rescue"
cs_office "The Office Complex - Hostage Rescue"
cs_siege "Canyon Siege - Hostage Rescue"
de_airstrip "Airstrip - Defusion"
de_aztec "Aztec - Defusion"
de_cbble "Cobble - Defusion"
de_chateau "Chateau - Defusion"
de_dust "Dust - Defusion"
de_dust2 "Dust II - Defusion"
de_inferno "Inferno - Defusion"
de_nuke "Nuke - Defusion"
de_piranesi "Piranesi - Defusion"
de_prodigy "Prodigy - Defusion"
de_storm "Storm - Defusion"
de_survivor "Survivor - Defusion"
de_torn "Torn - Defusion"
de_train "Trainyard - Defusion"
de_vertigo "Vertigo - Defusion"

View File

@ -5,8 +5,8 @@ fun_amx.dll
fun_amx_i386.so
; Engine - This has engine functions core to half-life
;engine_amx.dll
;engine_amx_i386.so
engine_amx.dll
engine_amx_i386.so
; MySQL - This adds MySQL connection support
;mysql_amx.dll

View File

@ -8,7 +8,7 @@ adminslots.amx ; slot reservation
menufront.amx ; front-end for admin menus
cmdmenu.amx ; command menu (speech, settings)
plmenu.amx ; players menu (kick, ban, client cmds.)
;restmenu.amx ; restrict weapons menu
restmenu.amx ; restrict weapons menu
;telemenu.amx ; teleport menu (Fun Module required!)
mapsmenu.amx ; maps menu (vote, changelevel)
antiflood.amx ; prevent clients from chat-flooding the server
@ -19,9 +19,9 @@ timeleft.amx ; displays time left on map
mapchooser.amx ; allows to vote for next map
scrollmsg.amx ; displays a scrolling message
imessage.amx ; displays information messages
;welcomemsg.amx ; displays motd @ client connection
welcomemsg.amx ; displays motd @ client connection
pausecfg.amx ; allows to pause and unpause some plugins
stats.amx ; stats on death or round end (CSStats Module required!)
;stats_logging.amx ; weapons stats logging (CSStats Module required!)
stats_logging.amx ; weapons stats logging (CSStats Module required!)
miscstats.amx ; bunch of events announcement for Counter-Strike
statscfg.amx ; allows to manage stats plugins via menu and commands

View File

@ -34,10 +34,6 @@
; d - this is ip
; e - password is not checked (only name/ip/steamid needed)
; Password:
; Add to your autoexec.cfg: setinfo _pw "<password>"
; Change _pw to the value of amx_password_field
; Format of admin account:
; <name|ip|steamid> <password> <access flags> <account flags>

View File

@ -1,5 +1,5 @@
MODNAME = cstrike_amx
SRCFILES = CstrikePlayer.cpp cstrike.cpp
SRCFILES = cstrike.cpp CstrikePlayer.cpp
EXTRA_LIBS_LINUX =
EXTRA_LIBS_WIN32 =
@ -10,7 +10,6 @@ EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx
EXTRA_FLAGS = -Dstrcmpi=strcasecmp
AMXDIR=../amxmodx
SDKTOP=../hlsdk
METADIR=../metamodx
@ -26,7 +25,7 @@ else
OS=LINUX
endif
CC_LINUX=gcc
CC_LINUX=gcc-2.95
ifeq "$(OS)" "WIN32"
CC_WIN32=gcc
LD_WINDLL=dllwrap
@ -53,34 +52,43 @@ else
ASRCFILES := $(shell dir /b)
endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas
ODEF = -DOPT_TYPE=\"optimized\"
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c
$(DO_CC_LINUX)
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_LINUX)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.c
$(DO_CC_WIN32)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_WIN32)
default: $(DEFAULT)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(OBJC_LINUX)
$(LINK_LINUX)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(OBJC_WIN32)
$(LINK_WIN32)
$(OBJDIR_LINUX):

View File

@ -243,10 +243,10 @@ static cell AMX_NATIVE_CALL cs_get_weapon_silenced(AMX *amx, cell *params) // cs
int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
switch (weapontype) {
case CSW_M4A1:
if (*silencemode & M4A1_SILENCED)
if (*silencemode == M4A1_SILENCED)
return 1;
case CSW_USP:
if (*silencemode & USP_SILENCED)
if (*silencemode == USP_SILENCED)
return 1;
}
@ -258,7 +258,7 @@ static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs
{
// Silence/unsilence gun. Does only work on M4A1 and USP.
// params[1] = weapon index
// params[2] = 1, and we silence the gun, 0 and we unsilence gun.
// params[2] = 1, and we silence the gun, 0 and we unsilence gun-
// Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
@ -281,41 +281,22 @@ static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs
switch (weapontype) {
case CSW_M4A1:
if (params[2] == 1) {
if (!(*silencemode & M4A1_SILENCED)) { // want to silence - can't already be silenced
*silencemode |= M4A1_SILENCED;
// If this weapon has an owner that is a player, play animation for that player.
if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = M4A1_ATTACHSILENCEANIM;
}
}
else if (*silencemode & M4A1_SILENCED) { // want to unsilence - can't already be unsilenced
*silencemode &= ~M4A1_SILENCED;
// If this weapon has an owner that is a player, play animation for that player.
if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = M4A1_DETACHSILENCEANIM;
}
if (params[2])
*silencemode = M4A1_SILENCED;
else
*silencemode = M4A1_UNSILENCED;
break;
case CSW_USP:
if (params[2] == 1) {
if (!(*silencemode & USP_SILENCED)) { // want to silence - can't already be silenced
*silencemode |= USP_SILENCED;
// If this weapon has an owner that is a player, play animation for that player.
if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = USP_ATTACHSILENCEANIM;
}
}
else if (*silencemode & USP_SILENCED) { // want to unsilence - can't already be unsilenced
*silencemode &= ~USP_SILENCED;
// If this weapon has an owner that is a player, play animation for that player.
if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = USP_DETACHSILENCEANIM;
}
break;
if (params[2])
*silencemode = USP_SILENCED;
else
*silencemode = USP_UNSILENCED;
break;
default:
return 0;
}
return 1;
}
@ -946,7 +927,7 @@ static cell AMX_NATIVE_CALL cs_set_user_backpackammo(AMX *amx, cell *params) //
return 1;
}
static cell AMX_NATIVE_CALL cs_get_user_nvg(AMX *amx, cell *params) // cs_get_user_nvg(index); = 1 param
static cell AMX_NATIVE_CALL cs_get_user_nvgoggles(AMX *amx, cell *params) // cs_get_user_nvgoggles(index); = 1 param
{
// Does user have night vision goggles?
// params[1] = user index
@ -973,7 +954,7 @@ static cell AMX_NATIVE_CALL cs_get_user_nvg(AMX *amx, cell *params) // cs_get_us
return 0;
}
static cell AMX_NATIVE_CALL cs_set_user_nvg(AMX *amx, cell *params) // cs_set_user_nvg(index, nvgoggles = 1); = 2 params
static cell AMX_NATIVE_CALL cs_set_user_nvgoggles(AMX *amx, cell *params) // cs_set_user_nvgoggles(index, nvgoggles = 1); = 2 params
{
// Give/take nvgoggles..
// params[1] = user index
@ -1204,88 +1185,35 @@ static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_
return 1;
}
static cell AMX_NATIVE_CALL cs_get_weapon_ammo(AMX *amx, cell *params) // cs_get_weapon_ammo(index); = 1 param
{
// Get amount of ammo in weapon's clip
// params[1] = weapon index
// Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
{
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
// Make into edict pointer
edict_t *pWeapon = INDEXENT(params[1]);
// Check entity validity
if (FNullEnt(pWeapon)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
return *((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO);
}
static cell AMX_NATIVE_CALL cs_set_weapon_ammo(AMX *amx, cell *params) // cs_set_weapon_ammo(index, newammo); = 2 params
{
// Set amount of ammo in weapon's clip
// params[1] = weapon index
// params[2] = newammo
// Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
{
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
// Make into edict pointer
edict_t *pWeapon = INDEXENT(params[1]);
// Check entity validity
if (FNullEnt(pWeapon)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
*((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO) = params[2];
return 1;
}
AMX_NATIVE_INFO cstrike_Exports[] = {
{"cs_set_user_money", cs_set_user_money},
{"cs_get_user_money", cs_get_user_money},
{"cs_get_user_deaths", cs_get_user_deaths},
{"cs_set_user_deaths", cs_set_user_deaths},
{"cs_get_hostage_id", cs_get_hostage_id},
{"cs_get_weapon_silen", cs_get_weapon_silenced},
{"cs_set_weapon_silen", cs_set_weapon_silenced},
{"cs_get_weapon_burst", cs_get_weapon_burstmode},
{"cs_set_weapon_burst", cs_set_weapon_burstmode},
{"cs_get_weapon_silenced", cs_get_weapon_silenced},
{"cs_set_weapon_silenced", cs_set_weapon_silenced},
{"cs_get_weapon_burstmode", cs_get_weapon_burstmode},
{"cs_set_weapon_burstmode", cs_set_weapon_burstmode},
{"cs_get_user_vip", cs_get_user_vip},
{"cs_set_user_vip", cs_set_user_vip},
{"cs_get_user_team", cs_get_user_team},
{"cs_set_user_team", cs_set_user_team},
{"cs_get_user_buyzone", cs_get_user_inside_buyzone},
{"cs_get_user_inside_buyzone", cs_get_user_inside_buyzone},
{"cs_get_user_plant", cs_get_user_plant},
{"cs_set_user_plant", cs_set_user_plant},
{"cs_get_user_defuse", cs_get_user_defusekit},
{"cs_set_user_defuse", cs_set_user_defusekit},
{"cs_get_user_bpammo", cs_get_user_backpackammo},
{"cs_set_user_bpammo", cs_set_user_backpackammo},
{"cs_get_user_nvg", cs_get_user_nvg},
{"cs_set_user_nvg", cs_set_user_nvg},
{"cs_get_hostage_foll", cs_get_hostage_follow},
{"cs_set_hostage_foll", cs_set_hostage_follow},
{"cs_get_user_defusekit", cs_get_user_defusekit},
{"cs_set_user_defusekit", cs_set_user_defusekit},
{"cs_get_user_backpackammo", cs_get_user_backpackammo},
{"cs_set_user_backpackammo", cs_set_user_backpackammo},
{"cs_get_user_nvgoggles", cs_get_user_nvgoggles},
{"cs_set_user_nvgoggles", cs_set_user_nvgoggles},
{"cs_get_hostage_follow", cs_get_hostage_follow},
{"cs_set_hostage_follow", cs_set_hostage_follow},
{"cs_get_user_model", cs_get_user_model},
{"cs_set_user_model", cs_set_user_model},
{"cs_reset_user_model", cs_reset_user_model},
{"cs_set_weapon_ammo", cs_set_weapon_ammo},
{"cs_get_weapon_ammo", cs_get_weapon_ammo},
//------------------- <-- max 19 characters!
{NULL, NULL}
};
@ -1338,7 +1266,7 @@ void PlayerPostThink(edict_t* pPlayer) {
if(g_players[entityIndex].GetModelled()) {
if (g_players[entityIndex].GetInspectModel() && strcmp(g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model")) != 0) {
//LOG_CONSOLE(PLID, "%s should have model %s and currently has %s", STRING(pPlayer->v.netname), (char*)g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model"));
LOG_CONSOLE(PLID, "%s should have model %s and currently has %s", STRING(pPlayer->v.netname), (char*)g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model"));
SETCLIENTKEYVALUE(entityIndex, GETINFOKEYBUFFER(pPlayer), "model", (char*)g_players[entityIndex].GetModel());
g_players[entityIndex].SetInspectModel(false);
}

View File

@ -83,7 +83,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/cstrike_amx_debug.dll" /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/cstrike_amxx_debug.dll" /pdbtype:sept
!ENDIF

View File

@ -1,4 +1,5 @@
#define __cswonbuild__ // comment when compiling for STEAM
//#define __cswonbuild__ // comment when compiling for STEAM
//#define CS_WON_BUILD
/* AMX Mod X
* Counter-Strike Module
@ -67,9 +68,9 @@ pfnmodule_engine_g* g_engModuleFunc;
#define NAME "Counter-Strike"
#define AUTHOR "AMX Mod X Dev Team"
#if defined __cswonbuild__
#define VERSION "0.16 WON" // change both these versions
#define VERSION "0.15 WON" // change both these versions
#else
#define VERSION "0.16 STEAM" // change both these versions
#define VERSION "0.15 STEAM" // change both these versions
#endif // defined __cswonbuild__
#define URL "http://www.amxmodx.org"
#define LOGTAG "AMXCS"
@ -112,9 +113,9 @@ pfnmodule_engine_g* g_engModuleFunc;
#define OFFSET_CSDEATHS 448 + EXTRAOFFSET // differs -1 from STEAM
// "weapon_*" entities
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET // same as STEAM
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET // same as STEAM
#define OFFSET_SILENCER_FIREMODE 70 + EXTRAOFFSET // differs -4 from STEAM
// "hostage_entity" entities
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET // NOT YET CHECKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! find out before build
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET // same as STEAM
#define OFFSET_HOSTAGEID 487 + EXTRAOFFSET // same as STEAM
#else // from here STEAM build looks for offsets
@ -144,7 +145,6 @@ pfnmodule_engine_g* g_engModuleFunc;
#define OFFSET_CSDEATHS 449 + EXTRAOFFSET
// "weapon_*" entities
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET
#define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET
// "hostage_entity" entities
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET
@ -201,12 +201,10 @@ pfnmodule_engine_g* g_engModuleFunc;
//#define CSW_KNIFE 29
#define CSW_P90 30
#define M4A1_SILENCED (1<<2)
#define M4A1_ATTACHSILENCEANIM 6
#define M4A1_DETACHSILENCEANIM 13
#define USP_SILENCED (1<<0)
#define USP_ATTACHSILENCEANIM 7
#define USP_DETACHSILENCEANIM 15
#define M4A1_UNSILENCED 0
#define M4A1_SILENCED 4
#define USP_UNSILENCED 0
#define USP_SILENCED 1
#define GLOCK_SEMIAUTOMATIC 0
#define GLOCK_BURSTMODE 2

View File

@ -3,7 +3,6 @@
ProjectType="Visual C++"
Version="7.10"
Name="cstrike"
ProjectGUID="{AB148B92-4F47-42E6-8268-AB4E588EC6A2}"
SccProjectName=""
SccLocalPath="">
<Platforms>
@ -38,13 +37,13 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="Debug/cstrike_amx_debug.dll"
OutputFile="Debug/cstrike_amxx_debug.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\cstrike.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/cstrike_amx_debug.pdb"
ImportLibrary=".\Debug/cstrike_amx_debug.lib"
ProgramDatabaseFile=".\Debug/cstrike_amxx_debug.pdb"
ImportLibrary=".\Debug/cstrike_amxx_debug.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
@ -103,12 +102,12 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="Release/cstrike_amx.dll"
OutputFile="Release/cstrike_amxx.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\cstrike.def"
ProgramDatabaseFile=".\Release/cstrike_amx.pdb"
ImportLibrary=".\Release/cstrike_amx.lib"
ProgramDatabaseFile=".\Release/cstrike_amxx.pdb"
ImportLibrary=".\Release/cstrike_amxx.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
@ -121,9 +120,9 @@
<Tool
Name="VCPostBuildEventTool"
CommandLine="echo Copying dll...
copy Release\cstrike_amx.dll K:\S\cstrike\addons\amx\dlls
copy Release\cstrike_amxx.dll K:\S\cstrike\addons\amx\dlls
echo Copying inc...
copy cstrike_amx.inc K:\S\cstrike\addons\amx\examples\include
copy cstrike_amxx.inc K:\S\cstrike\addons\amx\examples\include
"/>
<Tool
Name="VCPreBuildEventTool"/>
@ -210,7 +209,7 @@ copy cstrike_amx.inc K:\S\cstrike\addons\amx\examples\include
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="cstrike_amx.inc">
RelativePath="cstrike_amxx.inc">
</File>
</Files>
<Globals>

View File

@ -10,7 +10,6 @@ EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx
EXTRA_FLAGS = -Dstrcmpi=strcasecmp
AMXDIR=../amxmodx
SDKTOP=../hlsdk
METADIR=../metamodx
@ -26,7 +25,7 @@ else
OS=LINUX
endif
CC_LINUX=gcc-2.95
CC_LINUX=gcc
ifeq "$(OS)" "WIN32"
CC_WIN32=gcc
LD_WINDLL=dllwrap
@ -53,34 +52,43 @@ else
ASRCFILES := $(shell dir /b)
endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas
ODEF = -DOPT_TYPE=\"optimized\"
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c
$(DO_CC_LINUX)
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_LINUX)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.c
$(DO_CC_WIN32)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_WIN32)
default: $(DEFAULT)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(OBJC_LINUX)
$(LINK_LINUX)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(OBJC_WIN32)
$(LINK_WIN32)
$(OBJDIR_LINUX):

8
dlls/engine/build.sh Executable file
View File

@ -0,0 +1,8 @@
rm meta_api.o
rm engine.so
#use VexD's optimizations
gcc -static -march=i686 -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -fno-exceptions -fno-rtti -s -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\" -lstdc++ -fPIC -I. -I../metamod/metamod -I../hlsdk/multiplayer/engine -I../hlsdk/multiplayer/common -I../hlsdk/multiplayer/pm_shared -I../hlsdk/multiplayer/dlls -I../hlsdk/multiplayer -I../amxmodx/ -c meta_api.cpp -o meta_api.o
gcc -static -march=i686 -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-exceptions -fno-rtti -s -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\" -shared -ldl -lm -lstdc++ meta_api.o -o engine.so

View File

@ -1,4 +1,4 @@
LIBRARY engine_amx
LIBRARY engine_mm
EXPORTS
GiveFnptrsToDll @1
Meta_Attach @2

View File

@ -17,7 +17,7 @@ CFG=engine - Win32 Debug
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "engine_amx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "engine_mm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "engine - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "engine_amx - Win32 Release"
!IF "$(CFG)" == "engine_mm - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@ -52,7 +52,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"release/engine_amx.dll"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"release/engine_mm.dll"
!ELSEIF "$(CFG)" == "engine - Win32 Debug"
@ -83,21 +83,21 @@ LINK32=link.exe
# Begin Target
# Name "engine_amx - Win32 Release"
# Name "engine_mm - Win32 Release"
# Name "engine - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\meta_api.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\meta_api.cpp
# End Source File
# Begin Source File
SOURCE=.\engine.h
# End Source File
# End Group
@ -110,7 +110,7 @@ SOURCE=.\engine.inc
# End Source File
# Begin Source File
SOURCE=.\engine_amx.def
SOURCE=.\engine.def
# End Source File
# End Group
# End Target

View File

@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
Project: "engine_amx"=".\engine.dsp" - Package Owner=<4>
Project: "engine_mm"=".\engine.dsp" - Package Owner=<4>
Package=<5>
{{{

View File

@ -32,7 +32,7 @@
* version.
*/
#define VERSION "0.16"
#define VERSION "0.15"
plugin_info_t Plugin_info = {

View File

@ -3,7 +3,6 @@
ProjectType="Visual C++"
Version="7.10"
Name="engine"
ProjectGUID="{7CAE7BDF-52CB-49D0-B82E-568259869811}"
SccProjectName=""
SccLocalPath="">
<Platforms>
@ -39,12 +38,12 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="release/engine_amx.dll"
OutputFile="release/engine_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\engine_amx.def"
ProgramDatabaseFile=".\Release/engine_amx.pdb"
ImportLibrary=".\Release/engine_amx.lib"
ModuleDefinitionFile=".\engine.def"
ProgramDatabaseFile=".\Release/engine_mm.pdb"
ImportLibrary=".\Release/engine_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
@ -104,7 +103,7 @@
OutputFile=".\Debug/engine.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\engine_amx.def"
ModuleDefinitionFile=".\engine.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/engine.pdb"
ImportLibrary=".\Debug/engine.lib"
@ -172,7 +171,7 @@
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath="engine_amx.def">
RelativePath="engine.def">
</File>
<File
RelativePath="engine.inc">

View File

@ -45,7 +45,6 @@
GlobalInfo GlInfo;
MessageInfo *msgd = NULL;
bool isMsgHooked[MAX_MESSAGES];
bool is_PlayerOn[33];
int inHookProcess;
edict_t *valid_ent(int ent);
edict_t *valid_player(int ent);
@ -376,23 +375,18 @@ static cell AMX_NATIVE_CALL set_offset_short(AMX *amx, cell *params)
int index = params[1];
int off = params[2];
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
if (index < 1 || index > gpGlobals->maxClients) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
edict_t *Player = INDEXENT(index);
#ifndef __linux__
off -= 5;
#endif
*((short *)pEnt->pvPrivateData + off) = (short)params[3];
*((short *)Player->pvPrivateData + off) = params[3];
return 1;
}
@ -404,53 +398,18 @@ static cell AMX_NATIVE_CALL set_offset(AMX *amx, cell *params)
int index = params[1];
int off = params[2];
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
if (index < 1 || index > gpGlobals->maxClients) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
edict_t *Player = INDEXENT(index);
#ifndef __linux__
off -= 5;
#endif
*((int *)pEnt->pvPrivateData + off) = params[3];
return 1;
}
//(BAILOPAN)
//Sets a pvPrivateData offset for a player (player, offset, val)
static cell AMX_NATIVE_CALL set_offset_char(AMX *amx, cell *params)
{
int index = params[1];
int off = params[2];
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__
off -= 5;
#endif
char data = params[3];
*((char *)pEnt->pvPrivateData + off) = data;
*((int *)Player->pvPrivateData + off) = params[3];
return 1;
}
@ -461,26 +420,19 @@ static cell AMX_NATIVE_CALL set_offset_float(AMX *amx, cell *params)
{
int index = params[1];
int off = params[2];
float fNewValue = *(float *)((void *)&params[3]);
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
if (index < 1 || index > gpGlobals->maxClients) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
edict_t *Player = INDEXENT(index);
#ifndef __linux__
off -= 5;
#endif
*((float *)pEnt->pvPrivateData + off) = fNewValue;
*((float *)Player->pvPrivateData + off) = params[3];
return 1;
}
@ -492,51 +444,18 @@ static cell AMX_NATIVE_CALL get_offset_short(AMX *amx, cell *params)
int index = params[1];
int off = params[2];
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
if (index < 1 || index > gpGlobals->maxClients) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
edict_t *Player = INDEXENT(index);
#ifndef __linux__
off -= 5;
off -= 5;
#endif
return *((short *)pEnt->pvPrivateData + off);
}
//(BAILOPAN)
//Gets a pvPrivateData offset for a player (player, offset)
static cell AMX_NATIVE_CALL get_offset_char(AMX *amx, cell *params)
{
int index = params[1];
int off = params[2];
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
//!!!1111 don't uncomment jghg or I will pull my hair out
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__
off -= 5;
#endif
return *((char *)pEnt->pvPrivateData + off);
return (int)*((short *)Player->pvPrivateData + off);
}
@ -547,24 +466,19 @@ static cell AMX_NATIVE_CALL get_offset(AMX *amx, cell *params)
int index = params[1];
int off = params[2];
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
//jghg comment this out again and I bite you
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
if (index < 1 || index > gpGlobals->maxClients) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
edict_t *Player = INDEXENT(index);
#ifndef __linux__
off -= 5;
off -= 5;
#endif
return *((int *)pEnt->pvPrivateData + off);
return (int)*((int *)Player->pvPrivateData + off);
}
//(BAILOPAN)
@ -575,54 +489,22 @@ static cell AMX_NATIVE_CALL get_offset_float(AMX *amx, cell *params)
int off = params[2];
float retVal;
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
//jghg comment this out again and I bite you
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
if (index < 1 || index > gpGlobals->maxClients) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
edict_t *Player = INDEXENT(index);
#ifndef __linux__
off -= 5;
off -= 5;
#endif
//no jghg this actually works!
retVal = ((float)*((float *)pEnt->pvPrivateData + off));
retVal = ((float)*((float *)Player->pvPrivateData + off));
return *(cell*)((void *)&retVal);
}
//jghg2
static cell AMX_NATIVE_CALL get_entity_pointer(AMX *amx, cell *params) // get_entity_pointer(index, pointer[], len); = 3 params
{
// Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
{
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
// Make into class pointer
edict_t *pEdict = INDEXENT(params[1]);
if (FNullEnt(pEdict)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
char buffer[100];
sprintf(buffer, "%d", pEdict);
if (params[3] == -1)
return (cell)pEdict;
return SET_AMXSTRING(amx, params[2], buffer, params[3]);
return 1;
}
//is an entity valid?
@ -1888,31 +1770,6 @@ static cell AMX_NATIVE_CALL create_entity(AMX *amx, cell *params) {
return ENTINDEX(pNewEntity);
}
//from jghg2
static cell AMX_NATIVE_CALL find_ent_in_sphere(AMX *amx, cell *params)
{
if (params[1] < 0 || params[1] > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pStartAfterEnt = INDEXENT(params[1]);
cell *originLong = GET_AMXADDR(amx, params[2]);
float origin[3] = {*(float *)((void *)&originLong[0]), *(float *)((void *)&originLong[1]), *(float *)((void *)&originLong[2])}; // float origin[3] = {originLong[0], originLong[1], originLong[2]};
float radius = *(float *)((void *)&params[3]);
int returnEnt = ENTINDEX(FIND_ENTITY_IN_SPHERE(pStartAfterEnt, origin, radius));
if (FNullEnt(returnEnt)) {
return 0;
}
return returnEnt;
}
//ej ref'd by jghg
static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param */
{
@ -1929,58 +1786,6 @@ static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param
return 0;
}
//from jghg2
static cell AMX_NATIVE_CALL find_sphere_class(AMX *amx, cell *params) // find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0}); // 6 params
{
// params[1] = index to find around, if this is less than 1 then use around origin in last parameter.
// params[2] = classname to find
int len;
char* classToFind = GET_AMXSTRING(amx, params[2], 0, len);
// params[3] = radius, float...
float radius = *(float *)((void *)&params[3]);
// params[4] = store ents in this list
cell *entList = GET_AMXADDR(amx, params[4]);
// params[5] = maximum ents to store in entlist[] in params[4]
// params[6] = origin, use this if params[1] is less than 1
vec3_t vecOrigin;
if (params[1] > 0) {
if (params[1] > gpGlobals->maxEntities)
{
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t* pEntity = INDEXENT(params[1]);
if (FNullEnt(pEntity)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
vecOrigin = pEntity->v.origin;
}
else {
cell *newVectorCell = GET_AMXADDR(amx, params[6]);
vecOrigin = Vector(*(float *)((void *)&newVectorCell[0]), *(float *)((void *)&newVectorCell[1]), *(float *)((void *)&newVectorCell[2]));
}
int entsFound = 0;
edict_t* pSearchEnt = INDEXENT(0);
while (entsFound < params[5]) {
pSearchEnt = FIND_ENTITY_IN_SPHERE(pSearchEnt, vecOrigin, radius); // takes const float origin
if (FNullEnt(pSearchEnt))
break;
else {
if (strcmp(STRING(pSearchEnt->v.classname), classToFind) == 0) {
// Add to entlist (params[4])
entList[entsFound++] = ENTINDEX(pSearchEnt); // raise entsFound
}
}
}
return entsFound;
}
// DispatchKeyValue, sets a key-value pair for a newly created entity.
// Use DispatchSpawn after doing ALL DispatchKeyValues on an entity.
@ -2165,46 +1970,45 @@ static cell AMX_NATIVE_CALL find_ent_by_tname(AMX *amx, cell *params) {
return iReturnEnt;
}
static cell AMX_NATIVE_CALL find_ent_by_owner(AMX *amx, cell *params) // native find_ent_by_owner(start_from_ent, classname[], owner_index); = 3 params
{
// Check index to start searching at, 0 must be possible.
if (params[1] < 0 || params[1] > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
// FindEntityByOwner (BAILOPAN)
// Works like FindEntity except only returns by owner.
// Searches by classname.
static cell AMX_NATIVE_CALL find_ent_by_owner(AMX *amx, cell *params) {
int iStartEnt = params[1];
int iEntOwner = params[3];
int iLengthSearchStrn;
char *szValue = AMX_GET_STRING(amx, params[2], iLengthSearchStrn);
edict_t *pStartEnt;
if(iStartEnt == -1) {
pStartEnt = NULL;
} else {
pStartEnt = INDEXENT(iStartEnt);
if(FNullEnt(pStartEnt)) {
return 0;
}
}
int checkEnt = ENTINDEX(FIND_ENTITY_BY_STRING(pStartEnt, "classname", szValue));
int iOwner = -1;
while ((checkEnt && FNullEnt(checkEnt)) && (iOwner!=-1)) {
iOwner = ENTINDEX(pStartEnt->v.owner);
if (iOwner == iEntOwner) {
return checkEnt;
} else {
pStartEnt = INDEXENT(checkEnt);
checkEnt = ENTINDEX(FIND_ENTITY_BY_STRING(pStartEnt, "classname", szValue));
}
}
if(!checkEnt || FNullEnt(checkEnt) || (iOwner == -1)) {
return 0;
}
// Check index of owner
if (params[3] < 1 || params[3] > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(params[1]);
edict_t *entOwner = INDEXENT(params[3]);
//optional fourth parameter is for jghg2 compatibility
char* sCategory = NULL;
switch(params[4]){
case 1: sCategory = "target"; break;
case 2: sCategory = "targetname"; break;
default: sCategory = "classname";
}
// No need to check if there is a real ent where entOwner points at since we don't access it anyway.
int len;
char* classname = GET_AMXSTRING(amx, params[2], 1, len);
while (true) {
pEnt = FIND_ENTITY_BY_STRING(pEnt, sCategory, classname);
if (!pEnt || FNullEnt(pEnt)) // break and return 0 if bad
break;
else if (pEnt->v.owner == entOwner) // compare pointers
return ENTINDEX(pEnt);
}
// If it comes here, the while loop ended because an ent failed (FNullEnt() == true)
return 0;
return checkEnt;
}
//returns current number of entities in game (BAILOPAN)
@ -2887,59 +2691,10 @@ static cell AMX_NATIVE_CALL set_size(AMX *amx, cell *params)
return 1;
}
// SetSpeak, this sets who a player can speak to/who he can listen to.
static cell AMX_NATIVE_CALL set_speak(AMX *amx, cell *params) {
int iIndex = params[1];
int iNewSpeakFlags = params[2];
if (iIndex < 1 || iIndex > gpGlobals->maxClients) {
AMX_RAISEERROR(amx,AMX_ERR_NATIVE);
return 0;
}
PlInfo[iIndex].iSpeakFlags = iNewSpeakFlags;
return 1;
}
//GetSpeak, this gets whether a player can speak to
// (BAILOPAN)
static cell AMX_NATIVE_CALL get_speak(AMX *amx, cell *params) {
int iIndex = params[1];
if (iIndex < 1 || iIndex > gpGlobals->maxClients)
{
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
return PlInfo[iIndex].iSpeakFlags;
}
/********************************************
METAMOD HOOKED FUNCTIONS
*****************************************/
// This checks who can hear who through voice comm. this reads flags set,
// and lets us choose who hears who based on the previously set flags.
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) {
if((PlInfo[iSender].iSpeakFlags & SPEAK_MUTED) != 0) {
(g_engfuncs.pfnVoice_SetClientListening)(iReceiver, iSender, false);
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
if((PlInfo[iSender].iSpeakFlags & SPEAK_ALL) != 0) {
(g_engfuncs.pfnVoice_SetClientListening)(iReceiver, iSender, true);
RETURN_META_VALUE(MRES_SUPERCEDE, true);
}
if((PlInfo[iReceiver].iSpeakFlags & SPEAK_LISTENALL) != 0) {
(g_engfuncs.pfnVoice_SetClientListening)(iReceiver, iSender, true);
RETURN_META_VALUE(MRES_SUPERCEDE, true);
}
RETURN_META_VALUE(MRES_IGNORED, bListen);
}
//Added by BAILOPAN. ClientKill() forward.
void ClientKill(edict_t *pEntity)
@ -3083,11 +2838,6 @@ void ClientDisconnect(edict_t *pEntity) {
PlInfo[ENTINDEX(pEntity)].iRenderMode = 0;
PlInfo[ENTINDEX(pEntity)].fRenderAmt = 0;
int iPlayer = ENTINDEX(pEntity);
if (iPlayer > 0 && iPlayer < 33) {
is_PlayerOn[iPlayer] = false;
}
RETURN_META(MRES_IGNORED);
}
@ -3334,10 +3084,6 @@ void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ){
isMsgHooked[i] = false;
}
for (i=0; i<33; i++) {
is_PlayerOn[i] = false;
}
RETURN_META(MRES_IGNORED);
}
@ -3426,8 +3172,11 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
gpGamedllFuncs=pGamedllFuncs;
return(TRUE);
}
C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) {
@ -3440,6 +3189,8 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
}
#ifdef __linux__
C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) {
#else
@ -3451,13 +3202,6 @@ void WINAPI GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *p
}
void ClientPutInServer_Post( edict_t *pEntity ) {
int iPlayer = ENTINDEX(pEntity);
if (iPlayer > 0 && iPlayer < 33) {
is_PlayerOn[iPlayer] = true;
}
RETURN_META(MRES_IGNORED);
}
DLL_FUNCTIONS gFunctionTable;
@ -3505,7 +3249,6 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
meta_engfuncs.pfnWriteString = WriteString;
meta_engfuncs.pfnWriteEntity = WriteEntity;
meta_engfuncs.pfnLightStyle = LightStyle;
meta_engfuncs.pfnVoice_SetClientListening = Voice_SetClientListening;
if(*interfaceVersion!=ENGINE_INTERFACE_VERSION) {
LOG_ERROR(PLID, "GetEngineFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
@ -3519,17 +3262,23 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
}
DLL_FUNCTIONS gFunctionTable_Post;
C_DLLEXPORT int GetEntityAPI2_Post( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ) {
gFunctionTable_Post.pfnClientPutInServer = ClientPutInServer_Post;
if(*interfaceVersion!=INTERFACE_VERSION) {
LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
*interfaceVersion = INTERFACE_VERSION;
return(FALSE);
}
memcpy( pFunctionTable, &gFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
return(TRUE);
enginefuncs_t meta_engfuncs_post;
C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion ) {
if(*interfaceVersion!=ENGINE_INTERFACE_VERSION) {
LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
*interfaceVersion = ENGINE_INTERFACE_VERSION;
return(FALSE);
}
memcpy(pengfuncsFromEngine, &meta_engfuncs_post, sizeof(enginefuncs_t));
return(TRUE);
}
C_DLLEXPORT int AMX_Query(module_info_s** info) {
@ -3540,6 +3289,8 @@ C_DLLEXPORT int AMX_Query(module_info_s** info) {
}
C_DLLEXPORT int AMX_Attach(pfnamx_engine_g* amxeng,pfnmodule_engine_g* meng) {
g_engAmxFunc = amxeng;
@ -3565,13 +3316,10 @@ C_DLLEXPORT int AMX_Detach() {
AMX_NATIVE_INFO Engine_Natives[] = {
{"set_offset_float", set_offset_float},
{"set_offset_short", set_offset_short},
{"set_offset_char", set_offset_char},
{"set_offset", set_offset},
{"get_offset_float", get_offset_float},
{"get_offset_short", get_offset_short},
{"get_offset_char", get_offset_char},
{"get_offset", get_offset},
{"get_entity_pointer", get_entity_pointer},
{"entity_get_float", entity_get_float},
{"entity_set_float", entity_set_float},
@ -3608,8 +3356,6 @@ AMX_NATIVE_INFO Engine_Natives[] = {
{"find_ent_by_target", find_ent_by_target},
{"find_ent_by_tname", find_ent_by_tname},
{"find_ent_by_model", find_ent_by_model},
{"find_ent_in_sphere", find_ent_in_sphere},
{"find_sphere_class", find_sphere_class},
{"entity_count", entity_count},
{"DispatchKeyValue", DispatchKeyValue},
{"DispatchSpawn", DispatchSpawn},
@ -3619,8 +3365,6 @@ AMX_NATIVE_INFO Engine_Natives[] = {
{"set_lights", set_lights},
{"set_view", set_view},
{"attach_view", attach_view},
{"set_speak", set_speak},
{"get_speak", get_speak},
{"precache_generic", precache_generic},
{"register_message", register_message},

View File

@ -55,9 +55,9 @@ endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG -lstdc++
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas

View File

@ -213,46 +213,19 @@ static cell AMX_NATIVE_CALL give_item(AMX *amx, cell *params) // native give_ite
int length;
const char *szItem = GET_AMXSTRING(amx, params[2], 1, length);
//check for valid item
if (strncmp(szItem, "weapon_", 7) &&
strncmp(szItem, "ammo_", 5) &&
strncmp(szItem, "item_", 5)) {
return 0;
}
//string_t item = MAKE_STRING(szItem);
string_t item = ALLOC_STRING(szItem); // Using MAKE_STRING makes "item" contents get lost when we leave this scope! ALLOC_STRING seems to allocate properly...
// Create the entity, returns to pointer
pItemEntity = CREATE_NAMED_ENTITY(item);
//VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I
//I'm not sure, normally I use macros too =P
pItemEntity->v.origin = pPlayer->v.origin;
pItemEntity->v.spawnflags |= (1<<30); //SF_NORESPAWN;
VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I
pItemEntity->v.spawnflags |= SF_NORESPAWN;
MDLL_Spawn(pItemEntity);
int save = pItemEntity->v.solid;
MDLL_Touch(pItemEntity, ENT(pPlayer));
//The problem with the original give_item was the
// item was not removed. I had tried this but it
// did not work. OLO's implementation is better.
/*
int iEnt = ENTINDEX(pItemEntity->v.owner);
if (iEnt > 32 || iEnt <1 ) {
MDLL_Think(pItemEntity);
}*/
if (pItemEntity->v.solid == save) {
REMOVE_ENTITY(pItemEntity);
//the function did not fail - we're just deleting the item
return -1;
}
return ENTINDEX(pItemEntity);
return 1;
}
static cell AMX_NATIVE_CALL spawn(AMX *amx, cell *params) // spawn(id) = 1 param
@ -431,8 +404,6 @@ static cell AMX_NATIVE_CALL set_user_maxspeed(AMX *amx, cell *params) // set_use
// params[1] = index
// params[2] = speed (should be -1.0 if not specified) (JGHG: unspecified parameters seems to always be -1.0!)
float fNewSpeed = *(float *)((void *)&params[2]);
// Check index
if (params[1] < 1 || params[1] > gpGlobals->maxClients)
{
@ -449,8 +420,7 @@ static cell AMX_NATIVE_CALL set_user_maxspeed(AMX *amx, cell *params) // set_use
}
//pPlayer->v.maxspeed = ; // JGHG: Gotta love the way to get floats from parameters :-P
SETCLIENTMAXSPEED(pPlayer, fNewSpeed);
pPlayer->v.maxspeed = fNewSpeed;
SETCLIENTMAXSPEED(pPlayer, *(float *)((void *)&params[2]));
return 1;
}

View File

@ -1,4 +1,4 @@
LIBRARY fun_amx
LIBRARY fun
EXPORTS
GiveFnptrsToDll @1
Meta_Attach @2

View File

@ -4,7 +4,7 @@
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=fun_amx - Win32 Debug
CFG=fun - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
@ -17,8 +17,8 @@ CFG=fun_amx - Win32 Debug
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "fun_amx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "fun_amx - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "fun - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "fun - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "fun_amx - Win32 Release"
!IF "$(CFG)" == "fun - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@ -56,10 +56,10 @@ LINK32=link.exe
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=echo Copying dll... copy Release\fun_amx.dll K:\S\cstrike\addons\amxx\modules\fun_amx.dll echo Copying inc... copy ..\plugins\include\fun.inc K:\S\cstrike\addons\amxx\scripting\include
PostBuild_Cmds=echo Copying dll... copy Release\fun.dll K:\S\cstrike\addons\amxx\modules\fun_amx.dll echo Copying inc... copy ..\plugins\include\fun.inc K:\S\cstrike\addons\amxx\scripting\include
# End Special Build Tool
!ELSEIF "$(CFG)" == "fun_amx - Win32 Debug"
!ELSEIF "$(CFG)" == "fun - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
@ -89,8 +89,8 @@ LINK32=link.exe
# Begin Target
# Name "fun_amx - Win32 Release"
# Name "fun_amx - Win32 Debug"
# Name "fun - Win32 Release"
# Name "fun - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@ -100,7 +100,7 @@ SOURCE=.\fun.cpp
# End Source File
# Begin Source File
SOURCE=.\fun_amx.def
SOURCE=.\fun.def
# End Source File
# End Group
# Begin Group "Header Files"

View File

@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
Project: "fun_amx"=".\fun.dsp" - Package Owner=<4>
Project: "fun"=".\fun.dsp" - Package Owner=<4>
Package=<5>
{{{

View File

@ -59,7 +59,7 @@ pfnmodule_engine_g* g_engModuleFunc; // These seem to be meta/amxmod related
#define NAME "Fun"
#define AUTHOR "AMX Mod X Dev Team"
#define VERSION "0.16"
#define VERSION "0.15"
#define URL "http://www.amxmodx.org"
#define LOGTAG "FUN"
#define DATE __DATE__

View File

@ -2,7 +2,7 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="fun_amx"
Name="fun"
SccProjectName=""
SccLocalPath="">
<Platforms>
@ -38,10 +38,10 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Release/fun_amx.dll"
OutputFile=".\Release/fun.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\fun_amx.def"
ModuleDefinitionFile=".\fun.def"
ProgramDatabaseFile=".\Release/fun.pdb"
ImportLibrary=".\Release/fun.lib"
TargetMachine="1"/>
@ -172,7 +172,7 @@ copy fun.inc K:\S\cstrike\addons\amx\plugins\include
</FileConfiguration>
</File>
<File
RelativePath="fun_amx.def">
RelativePath="fun.def">
</File>
</Filter>
<Filter

View File

@ -48,7 +48,7 @@ new g_cmdLoopback[16]
public plugin_init()
{
register_plugin("Admin Base","0.16","AMXX Dev Team")
register_plugin("Admin Base","0.15","AMXX Dev Team")
register_cvar("amx_mode","2.0")
register_cvar("amx_password_field","_pw")
register_cvar("amx_default_access","")
@ -58,7 +58,6 @@ public plugin_init()
register_cvar("amx_vote_answers","1")
register_cvar("amx_vote_delay","60")
register_cvar("amx_last_voting","0")
register_cvar("amx_show_activity","2")
set_cvar_float("amx_last_voting",0.0)
register_concmd("amx_reloadadmins","cmdReload",ADMIN_ADMIN)
@ -72,11 +71,7 @@ public plugin_init()
remove_user_flags(0,read_flags("z")) // Remove 'user' flag from server rights
new configsDir[128]
get_configsdir(configsDir, 127)
server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file
new users_ini_file[128]
format(users_ini_file, 127, "%s/users.ini", configsDir)
server_cmd("exec addons/amxx/amx.cfg") // Execute main configuration file
loadSettings("addons/amxx/configs/users.ini") // Load admins accounts
}
@ -85,26 +80,23 @@ loadSettings(szFilename[])
if (!file_exists(szFilename)) return 0
new szText[256], szFlags[32], szAccess[32]
new a, pos = 0, iAccess
new a, pos = 0
while ( g_aNum < MAX_ADMINS && read_file(szFilename,pos++,szText,255,a) )
{
if ( szText[0] == ';' ) continue
if ( parse(szText, g_aName[ g_aNum ] ,31, g_aPassword[ g_aNum ], 31, szAccess,31,szFlags,31 ) < 2 )
continue
iAccess = read_flags(szAccess)
if (!(iAccess & ADMIN_USER) && !(iAccess & ADMIN_ADMIN)) {
iAccess |= ADMIN_ADMIN
}
g_aAccess[ g_aNum ] = iAccess
if ( parse(szText, g_aName[ g_aNum ] ,31,
g_aPassword[ g_aNum ], 31, szAccess,31,szFlags,31 ) < 2 ) continue
if ( (containi(szAccess,"z")==-1) && (containi(szAccess,"y")==-1) )
szAccess[strlen(szAccess)] = 'y'
g_aAccess[ g_aNum ] = read_flags( szAccess )
g_aFlags[ g_aNum ] = read_flags( szFlags )
++g_aNum
}
server_print("[AMXX] Loaded %d admin%s from file",g_aNum, (g_aNum == 1) ? "" : "s" )
server_print("Loaded %d admin%s from file",g_aNum, (g_aNum == 1) ? "" : "s" )
return 1
}
@ -113,9 +105,9 @@ public cmdReload(id,level,cid)
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new filename[128]
get_configsdir(filename,127)
format(filename,63,"%s/users.ini", filename)
new filename[64]
get_basedir(filename,31)
format(filename,63,"%s/configs/users.ini",filename)
g_aNum = 0
loadSettings(filename) // Re-Load admins accounts
@ -192,8 +184,8 @@ getAccess(id,name[],authid[],ip[], password[])
else {
new defaccess[32]
get_cvar_string("amx_default_access",defaccess,31)
if (!strlen(defaccess))
copy(defaccess, 32, "z")
if (!defaccess[0])
defaccess[0] = 'z'
new idefaccess = read_flags(defaccess)
if (idefaccess){
result |= 8
@ -220,6 +212,7 @@ accessUser( id, name[] = "" )
#if !defined NO_STEAM
client_cmd(id,g_cmdLoopback)
#else
client_cmd(id,"echo ^"* You have no entry to the server...^";disconnect")
#endif
@ -255,4 +248,4 @@ public client_authorized(id)
#else
public client_connect(id)
#endif
return get_cvar_num( "amx_mode" ) ? accessUser( id ) : PLUGIN_CONTINUE
return get_cvar_num( "amx_mode" ) ? accessUser( id ) : PLUGIN_CONTINUE

View File

@ -49,7 +49,7 @@ new g_cmdLoopback[16]
public plugin_init()
{
register_plugin("Admin Base for MySQL","0.16","AMXX Dev Team")
register_plugin("Admin Base for MySQL","0.15","AMXX Dev Team")
register_cvar("amx_mode","2.0")
register_cvar("amx_password_field","_pw")
@ -68,7 +68,6 @@ public plugin_init()
register_cvar("amx_vote_answers","1")
register_cvar("amx_vote_delay","60")
register_cvar("amx_last_voting","0")
register_cvar("amx_show_activity","2")
set_cvar_float("amx_last_voting",0.0)
register_concmd("amx_reloadadmins","cmdReload",ADMIN_ADMIN)
@ -81,10 +80,8 @@ public plugin_init()
remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights
new configsDir[128]
get_configsdir(configsDir, 127)
server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file
server_cmd("exec %s/mysql.cfg;amx_sqladmins", configsDir)
server_cmd("exec addons/amxx/amx.cfg")
server_cmd("exec addons/amxx/configs/mysql.cfg;amx_sqladmins")
}
public adminSql() {
@ -96,7 +93,7 @@ public adminSql() {
new mysql = mysql_connect(host,user,pass,db,error,127)
if(mysql < 1){
server_print("[AMXX] MySQL error: can't connect: '%s'",error)
server_print("MySQL error: can't connect: '%s'",error)
return PLUGIN_HANDLED
}
@ -104,7 +101,7 @@ public adminSql() {
if(mysql_query(mysql,"SELECT auth,password,access,flags FROM admins") < 1) {
mysql_error(mysql,error,127)
server_print("[AMXX] MySQL error: can't load admins: '%s'",error)
server_print("MySQL error: can't load admins: '%s'",error)
return PLUGIN_HANDLED
}
@ -124,7 +121,7 @@ public adminSql() {
++g_aNum
}
server_print("[AMXX] Loaded %d admin%s from database",g_aNum, (g_aNum == 1) ? "" : "s" )
server_print("Loaded %d admin%s from database",g_aNum, (g_aNum == 1) ? "" : "s" )
mysql_close(mysql)
return PLUGIN_HANDLED
}
@ -269,4 +266,4 @@ public client_authorized(id)
#else
public client_connect(id)
#endif
return get_cvar_num( "amx_mode" ) ? accessUser( id ) : PLUGIN_CONTINUE
return get_cvar_num( "amx_mode" ) ? accessUser( id ) : PLUGIN_CONTINUE

View File

@ -47,7 +47,7 @@ new g_Values[MAX_CLR][] = {{255,255,255},{255,0,0},{0,255,0},{0,0,255},{255,255,
new Float:g_Pos[4][] = {{0.0,0.0},{0.05,0.55},{-1.0,0.2},{-1.0,0.7}}
public plugin_init(){
register_plugin("Admin Chat","0.16","AMXX Dev Team")
register_plugin("Admin Chat","0.15","AMXX Dev Team")
register_clcmd("say","cmdSayChat",ADMIN_CHAT,"@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
register_clcmd("say_team","cmdSayAdmin",0,"@<text> - displays message to admins")
register_concmd("amx_say","cmdSay",ADMIN_CHAT,"<message> - sends message to all players")

View File

@ -34,6 +34,7 @@
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define MAXRCONCVARS 16
new g_cvarRcon[ MAXRCONCVARS ][32]
@ -44,10 +45,11 @@ new bool:g_Paused
new g_addCvar[] = "amx_cvar add %s"
public plugin_init(){
register_plugin("Admin Commands","0.16","AMXX Dev Team")
register_plugin("Admin Commands","0.15","AMXX Dev Team")
register_concmd("amx_kick","cmdKick",ADMIN_KICK,"<name or #userid> [reason]")
register_concmd("amx_ban","cmdBan",ADMIN_BAN,"<name or #userid> <id/ip> <minutes> [reason]")
register_concmd("amx_addban","cmdAddBan",ADMIN_BAN,"<authid or ip> <minutes> [reason]")
register_concmd("amx_ban","cmdAddBan",ADMIN_BAN,"<authid or ip> <minutes> [reason]")
register_concmd("amx_banid","cmdBan",ADMIN_BAN,"<name or #userid> <minutes> [reason]")
register_concmd("amx_banip","cmdBan",ADMIN_BAN,"<name or #userid> <minutes> [reason]")
register_concmd("amx_unban","cmdUnban",ADMIN_BAN,"<authid or ip>")
register_concmd("amx_slay","cmdSlay",ADMIN_SLAY,"<name or #userid>")
register_concmd("amx_slap","cmdSlap",ADMIN_SLAY,"<name or #userid> [power]")
@ -112,7 +114,7 @@ public cmdKick(id,level,cid){
client_cmd(player,"echo ^"Kicked^";disconnect",reason)
#endif
}
console_print(id,"[AMXX] Client ^"%s^" kicked",name2)
console_print(id,"Client ^"%s^" kicked",name2)
return PLUGIN_HANDLED
}
@ -123,11 +125,11 @@ public cmdUnban(id,level,cid){
read_argv(1,arg,31)
if (contain(arg,".")!=-1) {
server_cmd("removeip ^"%s^";writeip",arg)
console_print(id,"[AMXX] Ip ^"%s^" removed from ban list", arg )
console_print(id,"Ip ^"%s^" removed from ban list", arg )
}
else {
server_cmd("removeid ^"%s^";writeid",arg)
console_print(id,"[AMXX] Authid ^"%s^" removed from ban list", arg )
console_print(id,"Authid ^"%s^" removed from ban list", arg )
}
get_user_name(id,name,31)
switch(get_cvar_num("amx_show_activity")) {
@ -149,11 +151,11 @@ public cmdAddBan(id,level,cid){
read_argv(3,reason,31)
if (contain(arg,".")!=-1) {
server_cmd("addip ^"%s^" ^"%s^";wait;writeip",minutes,arg)
console_print(id,"[AMXX] Ip ^"%s^" added to ban list", arg )
console_print(id,"Ip ^"%s^" added to ban list", arg )
}
else {
server_cmd("banid ^"%s^" ^"%s^";wait;writeid",minutes,arg)
console_print(id,"[AMXX] Authid ^"%s^" added to ban list", arg )
console_print(id,"Authid ^"%s^" added to ban list", arg )
}
get_user_name(id,name,31)
switch(get_cvar_num("amx_show_activity")) {
@ -167,32 +169,24 @@ public cmdAddBan(id,level,cid){
}
public cmdBan(id,level,cid){
if (!cmd_access(id,level,cid,4))
if (!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED
new target[32],mode[3],minutes[8],reason[32]
read_argv(1,target,31)
read_argv(2,mode,2)
strtolower(mode)
read_argv(3,minutes,7)
read_argv(4,reason,31)
if ( (!equal(mode,"id")) && (!equal(mode,"ip")) )
{
new hcmd[32],hinfo[128],hflag
get_concmd(cid,hcmd,31,hflag,hinfo,127,level)
console_print(id,"Usage: %s %s",hcmd,hinfo)
return PLUGIN_HANDLED
}
new player = cmd_target(id,target,9)
new arg[32], cmd[32]
read_argv(0,cmd,31)
read_argv(1,arg,31)
new player = cmd_target(id,arg,9)
if (!player) return PLUGIN_HANDLED
new authid[32],name2[32],authid2[32],name[32]
new minutes[32],authid[32],name2[32],authid2[32],name[32],reason[32]
new userid2 = get_user_userid(player)
read_argv(2,minutes,31)
get_user_authid(player,authid2,31)
get_user_authid(id,authid,31)
get_user_name(player,name2,31)
get_user_name(id,name,31)
userid2 = get_user_userid(player)
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (mode ^"%s^") (minutes ^"%s^") (reason ^"%s^")",
name,get_user_userid(id),authid, name2,userid2,authid2,mode,minutes,reason)
read_argv(3,reason,31)
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")",
name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason)
new temp[64]
if (str_to_num(minutes))
@ -200,7 +194,7 @@ public cmdBan(id,level,cid){
else
temp = "permanently"
if ( equal(mode,"ip") ){
if ( equal(cmd[7],"ip") || (!equal(cmd[7],"id") && get_cvar_num("sv_lan")) ){
new address[32]
get_user_ip(player,address,31,1)
#if !defined NO_STEAM
@ -242,7 +236,7 @@ public cmdBan(id,level,cid){
client_print(0,print_chat,"%s ban %s %s",temp2,name2,temp)
}
console_print(id,"[AMXX] Client ^"%s^" banned",name2)
console_print(id,"Client ^"%s^" banned",name2)
return PLUGIN_HANDLED
}
@ -267,7 +261,7 @@ public cmdSlay(id,level,cid){
case 1: client_print(0,print_chat,"ADMIN: slay %s",name2)
}
console_print(id,"[AMXX] Client ^"%s^" slayed",name2)
console_print(id,"Client ^"%s^" slayed",name2)
return PLUGIN_HANDLED
}
@ -294,7 +288,7 @@ public cmdSlap(id,level,cid){
case 1: client_print(0,print_chat,"ADMIN: slap %s with %d damage",name2,damage)
}
console_print(id,"[AMXX] Client ^"%s^" slaped with %d damage",name2,damage)
console_print(id,"Client ^"%s^" slaped with %d damage",name2,damage)
return PLUGIN_HANDLED
}
@ -307,7 +301,7 @@ public cmdMap(id,level,cid){
new arg[32]
new arglen = read_argv(1,arg,31)
if ( !is_map_valid(arg) ){
console_print(id,"[AMXX] Map with that name not found or map is invalid")
console_print(id,"Map with that name not found or map is invalid")
return PLUGIN_HANDLED
}
new authid[32],name[32]
@ -342,25 +336,25 @@ public cmdCvar(id,level,cid){
if ( g_cvarRconNum < MAXRCONCVARS )
copy( g_cvarRcon[ g_cvarRconNum++ ] , 31, arg2 )
else
console_print(id,"[AMXX] Can't add more cvars for rcon access!")
console_print(id,"Can't add more cvars for rcon access!")
}
return PLUGIN_HANDLED
}
if (!cvar_exists(arg)){
console_print(id,"[AMXX] Unknown cvar: %s",arg)
console_print(id,"Unknown cvar: %s",arg)
return PLUGIN_HANDLED
}
if ( onlyRcon(arg) && !(get_user_flags(id) & ADMIN_RCON)){
console_print(id,"[AMXX] You have no access to that cvar")
console_print(id,"You have no access to that cvar")
return PLUGIN_HANDLED
}
else if (equal(arg,"sv_password") && !(get_user_flags(id) & ADMIN_PASSWORD)){
console_print(id,"[AMXX] You have no access to that cvar")
console_print(id,"You have no access to that cvar")
return PLUGIN_HANDLED
}
if (read_argc() < 3){
get_cvar_string(arg,arg2,63)
console_print(id,"[AMXX] Cvar ^"%s^" is ^"%s^"",arg,arg2)
console_print(id,"Cvar ^"%s^" is ^"%s^"",arg,arg2)
return PLUGIN_HANDLED
}
new authid[32],name[32]
@ -382,7 +376,7 @@ public cmdCvar(id,level,cid){
client_print(0,print_chat,"%s set cvar %s to ^"%s^"",temp,arg,arg2)
}
console_print(id,"[AMXX] Cvar ^"%s^" changed to ^"%s^"",arg,arg2)
console_print(id,"Cvar ^"%s^" changed to ^"%s^"",arg,arg2)
return PLUGIN_HANDLED
}
@ -477,7 +471,7 @@ public cmdCfg(id,level,cid){
new arg[128]
read_argv(1,arg,127)
if (!file_exists(arg)){
console_print(id,"[AMXX] File ^"%s^" not found",arg)
console_print(id,"File ^"%s^" not found",arg)
return PLUGIN_HANDLED
}
new authid[32],name[32]
@ -485,7 +479,7 @@ public cmdCfg(id,level,cid){
get_user_name(id,name,31)
log_amx("Cmd: ^"%s<%d><%s><>^" execute cfg (file ^"%s^")",
name,get_user_userid(id),authid, arg)
console_print(id,"[AMXX] Executing file ^"%s^"",arg)
console_print(id,"Executing file ^"%s^"",arg)
server_cmd("exec %s",arg)
switch(get_cvar_num("amx_show_activity")) {
@ -498,7 +492,7 @@ public cmdCfg(id,level,cid){
public cmdLBack(){
set_cvar_float("pausable",g_pausAble)
console_print(g_pauseCon,"[AMXX] Server %s", g_Paused ? "unpaused" : "paused")
console_print(g_pauseCon,"Server %s", g_Paused ? "unpaused" : "paused")
if (g_Paused) g_Paused = false
else g_Paused = true
return PLUGIN_HANDLED
@ -513,14 +507,14 @@ public cmdPause(id,level,cid){
g_pausAble = get_cvar_float("pausable")
if (!slayer) slayer = find_player("h")
if (!slayer){
console_print(id,"[AMXX] Server was unable to pause the game. Real players on server are needed")
console_print(id,"Server was unable to pause the game. Real players on server are needed")
return PLUGIN_HANDLED
}
set_cvar_float("pausable",1.0)
client_cmd(slayer,"pause;pauseAck")
log_amx("Cmd: ^"%s<%d><%s><>^" %s server",
name,get_user_userid(id),authid, g_Paused ? "unpause" : "pause" )
console_print(id,"[AMXX] Server proceed %s", g_Paused ? "unpausing" : "pausing")
console_print(id,"Server proceed %s", g_Paused ? "unpausing" : "pausing")
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: %s server",name,g_Paused ? "unpause" : "pause")
@ -540,7 +534,7 @@ public cmdRcon(id,level,cid){
get_user_name(id,name,31)
log_amx("Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")",
name,get_user_userid(id),authid, arg)
console_print(id,"[AMXX] Commmand line ^"%s^" sent to server console",arg)
console_print(id,"Commmand line ^"%s^" sent to server console",arg)
server_cmd(arg)
return PLUGIN_HANDLED
}
@ -594,14 +588,14 @@ public cmdLeave(id,level,cid){
get_user_name(b,nick,31)
ires = hasTag(nick,ltags,ltagsnum)
if (ires!=-1){
console_print(id,"[AMXX] Skipping ^"%s^" (matching ^"%s^")",nick,ltags[ires])
console_print(id,"Skipping ^"%s^" (matching ^"%s^")",nick,ltags[ires])
continue
}
if (get_user_flags(b)&ADMIN_IMMUNITY){
console_print(id,"[AMXX] Skipping ^"%s^" (immunity)",nick)
console_print(id,"Skipping ^"%s^" (immunity)",nick)
continue
}
console_print(id,"[AMXX] Kicking ^"%s^"",nick)
console_print(id,"Kicking ^"%s^"",nick)
if (is_user_bot(b))
server_cmd("kick #%d",get_user_userid(b))
else
@ -614,7 +608,7 @@ public cmdLeave(id,level,cid){
}
count++
}
console_print(id,"[AMXX] Kicked %d clients",count)
console_print(id,"Kicked %d clients",count)
new authid[32],name[32]
get_user_authid(id,authid,31)
get_user_name(id,name,31)

View File

@ -41,7 +41,7 @@ new g_timeInfo1[] = "Time Left: %d:%02d min. Next Map: %s"
new g_timeInfo2[] = "No Time Limit. Next Map: %s"
public plugin_init() {
register_plugin("Admin Help","0.16","AMXX Dev Team")
register_plugin("Admin Help","0.15","AMXX Dev Team")
register_concmd("amx_help","cmdHelp",0,"- displays this help")
setHelp(0)
}
@ -55,7 +55,7 @@ public cmdHelp(id,level,cid){
if (--start < 0) start = 0
new clcmdsnum = get_concmdsnum(flags,id)
if (start >= clcmdsnum) start = clcmdsnum - 1
console_print(id,"^n----- AMX Mod X Help: Commands -----")
console_print(id,"^n----- AMX Help: Commands -----")
new info[128], cmd[32], eflags
new end = start + HELPAMOUNT
if (end > clcmdsnum) end = clcmdsnum

View File

@ -42,7 +42,7 @@ new g_cmdLoopback[16]
public plugin_init()
{
register_plugin("Slots Reservation","0.16","AMXX Dev Team")
register_plugin("Slots Reservation","0.15","AMXX Dev Team")
register_cvar("amx_reservation","1")
format( g_cmdLoopback, 15, "amxres%c%c%c%c" ,

View File

@ -54,7 +54,7 @@ new bool:g_execResult
new Float:g_voteRatio
public plugin_init() {
register_plugin("Admin Votes","0.16","AMXX Dev Team")
register_plugin("Admin Votes","0.15","AMXX Dev Team")
register_menucmd(register_menuid("Change map to ") ,(1<<0)|(1<<1),"voteCount")
register_menucmd(register_menuid("Choose map: ") ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"voteCount")
register_menucmd(register_menuid("Kick ") ,(1<<0)|(1<<1),"voteCount")

View File

@ -38,7 +38,7 @@ new Float:g_Flooding[33]
public plugin_init()
{
register_plugin("Anti Flood","0.16","AMXX Dev Team")
register_plugin("Anti Flood","0.15","AMXX Dev Team")
register_clcmd("say","chkFlood")
register_clcmd("say_team","chkFlood")
register_cvar("amx_flood_time","0.75")

View File

@ -88,24 +88,20 @@ new g_cstrikeRunning
public plugin_init()
{
register_plugin("Commands Menu","0.16","AMXX Dev Team")
register_plugin("Commands Menu","0.15","AMXX Dev Team")
new configsDir[64];
get_configsdir(configsDir, 63);
new config[64]
for(new a = 0; a < MAX_CMDS_LAYERS; ++a) {
register_menucmd(register_menuid( g_cmdMenuName[ a ] ),1023,"actionCmdMenu")
register_clcmd( g_cmdMenuCmd[ a ] ,"cmdCmdMenu",ADMIN_MENU, g_cmdMenuHelp[ a ] )
format(config,63,"%s/%s",configsDir,g_cmdMenuCfg[a])
loadCmdSettings(config,a)
format(config,63,"addons/amxx/configs/%s",g_cmdMenuCfg[a])
loadCmdSettings(config,a)
}
register_menucmd(register_menuid("Cvars Menu"),1023,"actionCvarMenu")
register_clcmd("amx_cvarmenu","cmdCvarMenu",ADMIN_CVAR,"- displays cvars menu")
new cvars_ini_file[64];
format(cvars_ini_file, 63, "%s/%s", configsDir, "cvars.ini");
loadCvarSettings(cvars_ini_file)
loadCvarSettings("addons/amxx/configs/cvars.ini")
g_cstrikeRunning = is_running("cstrike")
}

View File

@ -46,7 +46,7 @@ new g_MessagesNum
new g_Current
public plugin_init(){
register_plugin("Info. Messages","0.16","AMXX Dev Team")
register_plugin("Info. Messages","0.15","AMXX Dev Team")
register_srvcmd("amx_imessage","setMessage")
register_cvar("amx_freq_imessage","10")
new lastinfo[8]

View File

@ -96,9 +96,6 @@ stock AttachView(iIndex, iTargetIndex)
stock SetView(iIndex, ViewType)
return set_view(iIndex, ViewType)
stock SetSpeak(iIndex, iSpeakFlags)
return set_speak(iIndex, iSpeakFlags)
forward vexd_pfntouch(pToucher, pTouched)
forward ServerFrame()

View File

@ -11,7 +11,7 @@
#endif
#define _amxconst_included
#define AMXX_VERSION 0.16
#define AMXX_VERSION 0.1
/* Uncomment if you are not using Steam */
//#define NO_STEAM
@ -97,7 +97,6 @@
#define CSW_FIVESEVEN 11
#define CSW_UMP45 12
#define CSW_SG550 13
#define CSW_GALI 14
#define CSW_GALIL 14
#define CSW_FAMAS 15
#define CSW_USP 16

View File

@ -91,20 +91,10 @@ stock is_running(const arg[]) {
return equal(mod_name,arg)
}
stock get_basedir(name[],len)
return get_localinfo("amxx_basedir",name,len)
stock get_configsdir(name[],len)
return get_localinfo("amxx_configsdir",name,len)
stock get_customdir(name[],len)
return get_localinfo("amxx_customdir",name,len)
#if defined NO_STEAM
stock get_user_wonid(index)
{
new authid[32]
get_user_authid(index,authid,31)
return str_to_num(authid)
stock build_path( path[] , len , {Float,_}:... ) {
format_args( path , len , 2 )
return replace( path , len , "$basedir", "addons/amxx" )
}
#endif
stock get_basedir( name[], len )
return copy(name,len,"addons/amxx")

View File

@ -21,6 +21,9 @@ stock user_spawn(index)
stock get_logfile( name[], len )
return get_time("admin%m%d.log",name,len)
stock get_user_wonid(index)
return 0
stock get_user_money(index)
return cs_get_user_money(index)
@ -31,12 +34,4 @@ stock numtostr(num,string[],len)
return num_to_str(num,string,len)
stock strtonum(const string[])
return str_to_num(string)
stock build_path( path[] , len , {Float,_}:... )
{
new basedir[32]
get_localinfo("amxx_basedir",basedir,31)
format_args(path,len,2)
return replace(path,len,"$basedir",basedir)
}
return str_to_num(string)

View File

@ -618,4 +618,4 @@ forward inconsistent_file(id,const filename[], reason[64] );
/* Forces the client and server to be running with the same
* version of the specified file ( e.g., a player model ). */
native force_unmodified(force_type, mins[3] , maxs[3], const filename[]);
native force_unmodified(force_type, mins[3] , maxs[3], const filename[]);

View File

@ -17,10 +17,10 @@ native cs_get_user_deaths(index);
native cs_set_user_deaths(index, newdeaths);
/* Returns index of entity (does not have to be a player) which hostage is following. 0 is hostage doesn't follow anything. */
native cs_get_hostage_foll(index);
native cs_get_hostage_follow(index);
/* Set hostage to follow entity specified in followedindex. Does not have to be a player. If followedindex is 0 the hostage will stop following. */
native cs_set_hostage_foll(index, followedindex = 0);
native cs_set_hostage_follow(index, followedindex = 0);
/* Get unique hostage id. */
native cs_get_hostage_id(index);
@ -41,21 +41,21 @@ native cs_get_hostage_id(index);
* flash
* he
* smoke */
native cs_get_user_bpammo(index, weapon);
native cs_get_user_backpackammo(index, weapon);
/* Restock/remove ammo in a user's backpack. */
native cs_set_user_bpammo(index, weapon, amount);
native cs_set_user_backpackammo(index, weapon, amount);
/* Returns 1 if user has a defuse kit. */
native cs_get_user_defuse(index);
native cs_get_user_defusekit(index);
/* If defusekit is 1, the user will have a defuse kit.
* You can specify a different colour for the defuse kit icon showing on hud. Default is the normal green.
* You can specify an icon. Default is "defuser". Set flash to 1 if you want the icon to flash red. */
native cs_set_user_defuse(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0);
native cs_set_user_defusekit(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0);
/* Is user in buyzone? Returns 1 when true, 0 when false. */
native cs_get_user_buyzone(index);
native cs_get_user_inside_buyzone(index);
/* Get user model. */
native cs_get_user_model(index, model[], len);
@ -73,10 +73,10 @@ native cs_get_user_money(index);
native cs_set_user_money(index, money, flash = 1);
/* Does user have night vision goggles? */
native cs_get_user_nvg(index);
native cs_get_user_nvgoggles(index);
/* Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them. */
native cs_set_user_nvg(index, nvgoggles = 1);
native cs_set_user_nvgoggles(index, nvgoggles = 1);
/* Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb. */
native cs_get_user_plant(index);
@ -104,20 +104,14 @@ native cs_get_user_vip(index);
native cs_set_user_vip(index, vip = 1);
/* Returns 1 if specified weapon is in burst mode. */
native cs_get_weapon_burst(index);
native cs_get_weapon_burstmode(index);
/* If burstmode = 1, weapon will be changed to burst mode, 0 and non-burst mode (semiautomatic/automatic) will be activated.
* Only GLOCK and FAMAS can enter/leave burst mode. */
native cs_set_weapon_burst(index, burstmode = 1);
native cs_set_weapon_burstmode(index, burstmode = 1);
/* Returns 1 if weapon is silenced, else 0. */
native cs_get_weapon_silen(index);
native cs_get_weapon_silenced(index);
/* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced. */
native cs_set_weapon_silen(index, silence = 1);
/* Returns amount of ammo in weapon's clip. */
native cs_get_weapon_ammo(index);
/* Set amount of ammo in weapon's clip. */
native cs_set_weapon_ammo(index, newammo);
native cs_set_weapon_silenced(index, silence = 1);

View File

@ -51,26 +51,17 @@ native set_msg_arg_string(argn, szString[]);
native get_offset(id, offset);
native Float:get_offset_float(id, offset);
native get_offset_short(id, offset);
native get_offset_char(id, offset);
/* sets pvPrivateData offset. */
native set_offset(id, offset, value);
native set_offset_float(id, offset, Float:value);
native set_offset_short(id, offset, value);
native set_offset_char(id, offset, value);
/* Get entity pointer into string pointer[]. If pointer/len is 0 pointer is returned as integer. */
native get_entity_pointer(index, pointer[] = 0, len = 0);
native set_offset_short(id, offset);
/* Precaches any file. */
native precache_generic(szFile[]);
/* Precaches an event. */
native precache_event(type, Name[], {float,_}:...);
//set/get a user's speak flags
native set_speak(iIndex, iSpeakFlags)
native get_speak(iIndex)
//Drops an entity to the floor (work?)
native drop_to_floor(entity)
@ -104,7 +95,7 @@ native entity_set_vector(iIndex, iKey, Float:vNewVector[3]);
native entity_get_edict(iIndex, iKey);
native entity_set_edict(iIndex, iKey, iNewIndex);
native entity_get_string(iIndex, iKey, szReturn[], iRetLen);
native entity_set_string(iIndex, iKey, const szNewVal[]);
native entity_set_string(iIndex, iKey, szNewVal[]);
native entity_get_byte(iIndex, iKey);
native entity_set_byte(iIndex, iKey, iVal);
@ -113,13 +104,10 @@ native create_entity(szClassname[]);
/* Finds an entity in the world, will return 0 if nothing is found */
native find_ent_by_class(iIndex, szClass[]);
//optionally you can set a jghg2 type
// 1: target, 2:targetname, 0:classname (default)
native find_ent_by_owner(iIndex, szClass[], iOwner, iJghgType=0);
native find_ent_by_owner(iIndex, szClass[], iOwner);
native find_ent_by_target(iIndex, szClass[]);
native find_ent_by_tname(iIndex, szClass[]);
native find_ent_by_model(iIndex, szClass[], szModel[]);
native find_ent_in_sphere(start_from_ent, Float:origin[3], Float:radius);
//this will CBaseEntity::Think() or something from the entity
native call_think(entity)
@ -131,7 +119,7 @@ native is_valid_ent(iIndex);
native entity_set_origin(iIndex, Float:fNewOrigin[3]);
/* Sets the model of an Entity. */
native entity_set_model(iIndex, const szModel[]);
native entity_set_model(iIndex, szModel[]);
/* Remove an entity from the world. */
native remove_entity(iIndex);
@ -206,12 +194,4 @@ forward client_kill(id);
forward client_PreThink(id);
forward client_PostThink(id);
//from jghg2
/* As above, but returns number of ents stored in entlist. Use to find a specific type of entity classname (specify in _lookforclassname) around a
* certain entity specified in aroundent. All matching ents are stored in entlist. Specify max amount of entities to find in maxents.
* If aroundent is 0 its origin is not used, but origin in 6th parameter. Ie, do not specify 6th parameter (origin) if you specified an entity
* in aroundent.
*/
native find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0});
#include <engine_stocks>

View File

@ -309,10 +309,6 @@ enum {
#define EF_LIGHT 64 /* rocket flare glow sprite */
#define EF_NODRAW 128 /* don't draw entity */
#if defined _jghg_enums
#endinput
#endif
#define _jghg_enums
enum {
// Edict
GL_trace_ent = 0,

View File

@ -14,7 +14,7 @@
//wrapper for find_ent_by_class
stock find_ent(iStart, szClassname[])
{
return find_ent_by_class(iStart, szClassname)
return find_ent_by_classname(iStart, szClassname)
}
/* Changes an integer vec to a floating vec */
@ -191,16 +191,4 @@ stock set_entity_flags(ent,flag,onoff)
}
return 0
}
/* If visible = 1, entity will be set to be visible, else invisible. */
stock set_entity_visibility(entity, visible = 1) {
entity_set_int(entity, EV_INT_effects, visible == 1 ? entity_get_int(entity, EV_INT_effects) & ~EF_NODRAW : entity_get_int(entity, EV_INT_effects) | EF_NODRAW)
return 1
}
/* Returns 1 if entity is visible. */
stock get_entity_visibility(entity) {
return (entity_get_int(entity, EV_INT_effects) & EF_NODRAW)
}

View File

@ -5,11 +5,6 @@
* This file is provided as is (no warranties).
*/
#if defined _fun_included
#endinput
#endif
#define _fun_included
/* Returns 1 if receiver hears sender via voice communication. */
native get_client_listen(receiver, sender);
@ -83,4 +78,4 @@ native get_user_noclip(index);
/* Gives player silent footsteps.
* if set = 0 it will return footsteps to normal */
native set_user_footsteps(id, set = 1);
native set_user_footsteps(id, set = 1);

View File

@ -1,172 +0,0 @@
// JGHG2 module
//This file is provided for backwards compatibility.
//It includes the engine and cstrike modules automatically.
//It is intended for AMX Mod X
#if !defined INCLUDED_JGHG
#define INCLUDED_JGHG
#include <engine>
#include <cstrike>
#if !defined _jghg_enums
#define _jghg_enums
// Global member variables
enum {
// Edict
GL_trace_ent = 0,
// Float
GL_coop,
GL_deathmatch,
GL_force_retouch,
GL_found_secrets,
GL_frametime,
GL_serverflags,
GL_teamplay,
GL_time,
GL_trace_allsolid,
GL_trace_fraction,
GL_trace_inopen,
GL_trace_inwater,
GL_trace_plane_dist,
GL_trace_startsolid,
// Int
GL_cdAudioTrack,
GL_maxClients,
GL_maxEntities,
GL_msg_entity,
GL_trace_flags,
GL_trace_hitgroup,
// String
GL_pStringBase,
GL_mapname,
GL_startspot,
// Vector
GL_trace_endpos,
GL_trace_plane_normal,
GL_v_forward,
GL_v_right,
GL_v_up,
GL_vecLandmarkOffset,
// Void (not supported)
GL_pSaveData
}
// jghg_categories
enum {
jghg2_classname = 0,
jghg2_target = 1,
jghg2_targetname = 2
}
#endif
stock jghg_find_ent_owner(start_from_ent, jghg_category, value[], owner_index)
{
find_ent_by_owner(start_from_ent, value, owner_index, jghg_category)
}
stock find_ent_sphere(start_from_ent, Float:origin[3], Float:radius)
{
return find_ent_in_sphere(start_from_ent, origin, radius)
}
stock get_hostage_id(hostage)
{
return cs_get_hostage_id(hostage)
}
stock get_owner(id)
{
return entity_get_edict(id, EV_ENT_owner)
}
stock get_pdata(entity, offset)
{
return get_offset(entity, offset)
}
stock Float:get_pdata_float(entity, offset)
{
return get_offset_float(entity, offset)
}
stock get_pdata_char(entity, offset)
{
return get_offset_char(entity, offset)
}
stock get_pdata_short(entity, offset)
{
return get_offset_short(entity, offset)
}
stock set_pdata(entity, offset, value)
{
return set_offset(entity, offset, value)
}
stock set_pdata_float(entity, offset, Float:value)
{
return set_offset_float(entity, offset, value)
}
stock set_pdata_char(entity, offset, value)
{
return set_offset_char(entity, offset, value)
}
stock set_pdata_short(entity, offset, value)
{
return set_offset_short(entity, offset, value)
}
stock is_ent_valid(id)
{
return is_valid_ent(id)
}
stock number_of_entities()
{
return entity_count()
}
stock use(used, user)
{
return force_use(user, used)
}
stock Float:globals_get_float(variable)
{
return get_global_float(variable)
}
stock globals_get_int(variable)
{
return get_global_int(variable)
}
stock globals_get_string(variable, string[], maxlen)
{
return get_global_string(variable, string, maxlen)
}
stock globals_get_vector(variable, Float:vector[3])
{
return get_global_vector(variable, vector)
}
stock globals_get_edict(variable)
{
return get_global_edict(variable)
}
stock get_max_entities() {
return get_global_int(GL_maxEntities)
}
stock jghg2_set_size(index, Float:mins[3], Float:maxs[3])
{
return set_size(index, mins, maxs)
}
stock jghg2_think(index)
{
return call_think(index)
}
#endif // INCLUDED_JGHG

View File

@ -65,7 +65,7 @@ stock get_grenade_index(index, model[], len, grenadeindex = 0) {
new entowner = index
for (;;) {
entfind = find_ent_by_class(entfind, "grenade")
entfind = find_entity_by_class(entfind, "grenade")
if (entfind && is_valid_ent(entfind)) {
if (entity_get_edict(entFind, EV_ENT_owner) == entowner) {
@ -96,10 +96,10 @@ enum {
* "targetname", value is the name you are searching for */
stock find_entity(start_from_ent, category, value[]) {
switch (category) {
case target: return find_ent_by_target(start_from_ent, value)
case target: return find_entity_by_target(start_from_ent, value)
case targetname: return find_ent_by_tname(start_from_ent, value)
}
return find_ent_by_class(start_from_ent, value)
return find_entity_by_class(start_from_ent, value)
}
#endif // _xtrafun_included

View File

@ -52,7 +52,7 @@ new bool:g_selected = false
public plugin_init()
{
register_plugin("Nextmap Chooser","0.16","AMXX Dev Team")
register_plugin("Nextmap Chooser","0.15","AMXX Dev Team")
register_menucmd(register_menuid("AMX Choose nextmap:"),(-1^(-1<<(SELECTMAPS+2))),"countVote")
register_cvar("amx_extendmap_max","90")
register_cvar("amx_extendmap_step","15")
@ -63,10 +63,7 @@ public plugin_init()
get_localinfo("lastMap",g_lastMap,31)
set_localinfo("lastMap","")
new maps_ini_file[64];
get_configsdir(maps_ini_file, 63);
format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file);
if ( loadSettings(maps_ini_file) )
if ( loadSettings("addons/amxx/configs/maps.ini") )
set_task(15.0,"voteNextmap",987456,"",0,"b")
}

View File

@ -34,10 +34,12 @@
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define MAX_MAPS 64
new g_mapName[MAX_MAPS][32]
new g_mapDesc[MAX_MAPS][32]
new g_mapNums
new g_menuPosition[33]
@ -52,7 +54,7 @@ new g_choosed
public plugin_init()
{
register_plugin("Maps Menu","0.16","AMXX Dev Team")
register_plugin("Maps Menu","0.15","AMXX Dev Team")
register_clcmd("amx_mapmenu","cmdMapsMenu",ADMIN_MAP,"- displays changelevel menu")
register_clcmd("amx_votemapmenu","cmdVoteMapMenu",ADMIN_MAP,"- displays votemap menu")
@ -62,10 +64,7 @@ public plugin_init()
register_menucmd(register_menuid("Votemap Menu"),1023,"actionVoteMapMenu")
register_menucmd(register_menuid("The winner: ") ,3,"actionResult")
new maps_ini_file[64];
get_configsdir(maps_ini_file, 63);
format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file);
load_settings(maps_ini_file)
load_settings("addons/amxx/configs/maps.ini")
g_cstrikeRunning = is_running("cstrike")
}
@ -185,14 +184,14 @@ displayVoteMapsMenu(id,pos)
{
++b
if ( g_cstrikeRunning)
len += format(menuBody[len],511-len,"\d%d. %s^n\w", b ,g_mapName[ a ])
len += format(menuBody[len],511-len,"\d%d. %s^n\w", b ,g_mapDesc[ a ])
else
len += format(menuBody[len],511-len,"#. %s^n", g_mapName[ a ])
len += format(menuBody[len],511-len,"#. %s^n", g_mapDesc[ a ])
}
else
{
keys |= (1<<b)
len += format(menuBody[len],511-len,"%d. %s^n", ++b ,g_mapName[ a ])
len += format(menuBody[len],511-len,"%d. %s^n", ++b ,g_mapDesc[ a ])
}
}
@ -219,7 +218,7 @@ displayVoteMapsMenu(id,pos)
for(new c = 0; c < 4; c++)
{
if ( c < g_voteSelectedNum[id] )
len += format(menuBody[len],511-len,"%s^n", g_mapName[ g_voteSelected[id][ c ] ] )
len += format(menuBody[len],511-len,"%s^n", g_mapDesc[ g_voteSelected[id][ c ] ] )
else
len += format(menuBody[len],511-len,"^n" )
}
@ -311,7 +310,7 @@ public actionVoteMapMenu(id,key)
"\yWhich map do you want?^n\w^n" : "Which map do you want?^n^n")
for(new c = 0; c < g_voteSelectedNum[id] ; ++c)
{
len += format(menuBody[len],511,"%d. %s^n", c + 1 , g_mapName[ g_voteSelected[id][ c ] ] )
len += format(menuBody[len],511,"%d. %s^n", c + 1 , g_mapDesc[ g_voteSelected[id][ c ] ] )
keys |= (1<<c)
}
keys |= (1<<8)
@ -320,7 +319,7 @@ public actionVoteMapMenu(id,key)
else
{
len = format(menuBody,511, g_cstrikeRunning ? "\yChange map to^n%s?^n\w^n1. Yes^n2. No^n"
: "Change map to^n%s?^n^n1. Yes^n2. No^n" , g_mapName[ g_voteSelected[id][ 0 ] ] )
: "Change map to^n%s?^n^n1. Yes^n2. No^n" , g_mapDesc[ g_voteSelected[id][ 0 ] ] )
keys = (1<<0) | (1<<1)
}
@ -419,7 +418,7 @@ displayMapsMenu(id,pos)
for(new a = start; a < end; ++a)
{
keys |= (1<<b)
len += format(menuBody[len],511-len,"%d. %s^n",++b,g_mapName[ a ])
len += format(menuBody[len],511-len,"%d. %s^n",++b,g_mapDesc[ a ])
}
if (end != g_mapNums)
@ -437,17 +436,25 @@ load_settings(filename[])
if (!file_exists(filename))
return 0
new text[256]
new text[256], szDesc[48]
new a , pos = 0
while ( g_mapNums < MAX_MAPS && read_file(filename,pos++,text,255,a) )
{
if ( text[0] == ';' ) continue
if ( parse(text,g_mapName[g_mapNums],31) < 1 ) continue
if ( parse(text, g_mapName[g_mapNums] ,31, szDesc ,47) < 2 ) continue
if ( !is_map_valid( g_mapName[g_mapNums] ) ) continue
if ( strlen( szDesc ) > 31 )
{
copy(g_mapDesc[g_mapNums],28, szDesc )
g_mapDesc[g_mapNums][28] = g_mapDesc[g_mapNums][29] = g_mapDesc[g_mapNums][30] = '.'
g_mapDesc[g_mapNums][31] = 0
}
else copy(g_mapDesc[g_mapNums],31, szDesc )
g_mapNums++
}

View File

@ -122,7 +122,7 @@ new g_funModule
public plugin_init()
{
register_plugin("Menus Front-End","0.16","AMXX Dev Team")
register_plugin("Menus Front-End","0.15","AMXX Dev Team")
register_menucmd(register_menuid("AMX Mod X Menu"),1023,"actionMenu")
register_clcmd("amxmodmenu","cmdMenu",ADMIN_MENU,"- displays menus")

View File

@ -146,7 +146,7 @@ new g_teamsNames[2][] = {
}
public plugin_init(){
register_plugin("CS Misc. Stats","0.16","AMXX Dev Team")
register_plugin("CS Misc. Stats","0.15","AMXX Dev Team")
register_event("DeathMsg","eDeathMsg","a")
register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w")
register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")

View File

@ -45,7 +45,7 @@ new g_pos
public plugin_init()
{
register_plugin("NextMap","0.16","AMXX Dev Team")
register_plugin("NextMap","0.15","AMXX Dev Team")
register_event("30","changeMap","a")
register_clcmd("say nextmap","sayNextMap",0,"- displays nextmap")
register_cvar("amx_nextmap","",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

View File

@ -43,7 +43,7 @@
#define MAX_SYSTEM 32
new g_menuPos[33]
new g_fileToSave[64];
new g_fileToSave[] = "addons/amxx/configs/pausecfg.ini"
new g_cstrikeRunning
new g_Modified
new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^""
@ -53,7 +53,7 @@ new g_system[MAX_SYSTEM]
new g_systemNum
public plugin_init(){
register_plugin("Pause Plugins","0.16","AMXX Dev Team")
register_plugin("Pause Plugins","0.15","AMXX Dev Team")
register_concmd("amx_pausecfg","cmdPlugin",ADMIN_CFG,"- list commands for pause/unpause managment")
register_clcmd("amx_pausecfgmenu","cmdMenu",ADMIN_CFG,"- pause/unpause plugins with menu")
#if defined DIRECT_ONOFF
@ -62,9 +62,6 @@ public plugin_init(){
#endif
register_menucmd(register_menuid("Pause/Unpause Plugins"),1023,"actionMenu")
g_cstrikeRunning = is_running("cstrike")
get_configsdir(g_fileToSave, 63);
format(g_fileToSave, 63, "%s/pausecfg.ini", g_fileToSave);
return PLUGIN_CONTINUE
}

View File

@ -55,7 +55,7 @@ new g_cstrikeRunning
public plugin_init()
{
register_plugin("Players Menu","0.16","AMXX Dev Team")
register_plugin("Players Menu","0.15","AMXX Dev Team")
register_clcmd("amx_kickmenu","cmdKickMenu",ADMIN_KICK,"- displays kick menu")
register_clcmd("amx_banmenu","cmdBanMenu",ADMIN_BAN,"- displays ban menu")
register_clcmd("amx_slapmenu","cmdSlapMenu",ADMIN_SLAY,"- displays slap/slay menu")
@ -70,10 +70,7 @@ public plugin_init()
g_cstrikeRunning = is_running("cstrike")
new clcmds_ini_file[64];
get_configsdir(clcmds_ini_file, 63);
format(clcmds_ini_file, 63, "%s/clcmds.ini", clcmds_ini_file);
load_settings(clcmds_ini_file)
load_settings("addons/amxx/configs/clcmds.ini")
}
/* Ban menu */

View File

@ -336,7 +336,7 @@ new g_Aliases2[MAXMENUPOS][] = {
#endif
public plugin_init(){
register_plugin("Restrict Weapons","0.16","AMXX Dev Team")
register_plugin("Restrict Weapons","0.15","AMXX Dev Team")
register_clcmd("buyammo1","ammoRest1")
register_clcmd("buyammo2","ammoRest2")
#if !defined NO_STEAM
@ -363,14 +363,12 @@ public plugin_init(){
register_menucmd(-34,511,"menuItem")
register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction")
new configsDir[64];
get_configsdir(configsDir, 63);
#if defined MAPSETTINGS
new mapname[32]
get_mapname(mapname,31)
format(g_saveFile,63,"%s/weaprest_%s.ini",configsDir,mapname)
build_path(g_saveFile,63,"addons/amxx/configs/weaprest_%s.ini",mapname)
#else
format(g_saveFile,63,"%s/weaprest.ini",configsDir)
build_path(g_saveFile,63,"addons/amxx/configs/weaprest.ini")
#endif
loadSettings(g_saveFile)
}
@ -497,12 +495,8 @@ public cmdRest(id,level,cid){
else if ( equali( "load" , cmd ) ) {
setc( g_blockPos, 112, 0 ) // Clear current settings
new arg1[64]
if ( read_argv(2, arg1 , 63 ) )
{
new configsdir[32]
get_configsdir(configsdir,31)
format(arg1,63,"%s/%s",configsdir,arg1)
}
if ( read_argv(2, arg1 , 63 ) ) build_path( arg1 , 63, "$basedir/%s", arg1 )
else copy( arg1, 63, g_saveFile )
if ( loadSettings( arg1 ) ){
console_print( id , "Configuration has been loaded (file ^"%s^")" , arg1 )
g_Modified = true

View File

@ -46,7 +46,7 @@ new g_Length
new g_Frequency
public plugin_init(){
register_plugin("Scrolling Message","0.16","AMXX Dev Team")
register_plugin("Scrolling Message","0.15","AMXX Dev Team")
register_srvcmd("amx_scrollmsg","setMessage")
}

View File

@ -71,7 +71,7 @@ new g_teamScore[2]
new g_disabledMsg[] = "Server has disabled that option"
public plugin_init() {
register_plugin("CS Stats","0.16","AMXX Dev Team")
register_plugin("CS Stats","0.15","AMXX Dev Team")
register_event("CS_DeathMsg","eCSDeathMsg","a")
register_event("ResetHUD","eResetHud","b")
register_event("SendAudio","eRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")

View File

@ -39,7 +39,7 @@ new g_pingSum[33]
new g_pingCount[33]
public plugin_init()
register_plugin("CS Stats Logging","0.16","AMXX Dev Team")
register_plugin("CS Stats Logging","0.15","AMXX Dev Team")
public client_disconnect(id) {
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE

View File

@ -42,7 +42,7 @@ new g_menuDataVar[MAX_MENU_DATA][32]
new g_menuDataId[MAX_MENU_DATA]
new g_menuDataNum
new g_menuPosition[33]
new g_fileToSave[64]
new g_fileToSave[] = "addons/amxx/configs/stats.ini"
new bool:g_modified
public plugin_precache(){
@ -51,10 +51,8 @@ public plugin_precache(){
}
public plugin_init() {
register_plugin("Stats Configuration","0.16","AMXX Dev Team")
register_plugin("Stats Configuration","0.15","AMXX Dev Team")
register_menucmd(register_menuid("\yStats Configuration"),1023,"actionCfgMenu")
get_configsdir(g_fileToSave, 63)
format(g_fileToSave, 63, "%s/stats.ini", g_fileToSave)
loadSettings(g_fileToSave)
}

View File

@ -45,7 +45,7 @@ new g_cstrikeRunning
public plugin_init()
{
register_plugin("Teleport Menu","0.16","AMXX Dev Team")
register_plugin("Teleport Menu","0.15","AMXX Dev Team")
register_clcmd("amx_teleportmenu","cmdTelMenu",ADMIN_CFG,"- displays teleport menu")
register_menucmd(register_menuid("Teleport Menu"),1023,"actionTelMenu")

View File

@ -40,7 +40,7 @@ new g_CountDown
new g_Switch
public plugin_init() {
register_plugin("TimeLeft","0.16","AMXX Dev Team")
register_plugin("TimeLeft","0.15","AMXX Dev Team")
register_cvar("amx_time_voice","1")
register_srvcmd("amx_time_display","setDisplaying")
register_cvar("amx_timeleft","00:00",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)

View File

@ -45,15 +45,13 @@
new g_cstrikeRunning
#if defined READ_FROM_FILE
new g_motdFile[64]
new g_motdFile[] = "addons/amxx/configs/conmotd.txt"
#endif
public plugin_init()
{
register_plugin("Welcome Message","0.16","AMXX Dev Team")
register_plugin("Welcome Message","0.15","AMXX Dev Team")
g_cstrikeRunning = is_running("cstrike")
get_configsdir(g_motdFile, 63);
format(g_motdFile, 63, "%s/conmotd.txt", g_motdFile);
}
public plugin_cfg()

View File

@ -43,15 +43,13 @@
new g_cstrikeRunning
#if defined READ_FROM_FILE
new g_motdFile[64]
new g_motdFile[] = "addons/amxx/configs/conmotd.txt"
#endif
public plugin_init()
{
register_plugin("Welcome Message","0.16","AMXX Dev Team")
register_plugin("Welcome Message","0.15","AMXX Dev Team")
g_cstrikeRunning = is_running("cstrike")
get_configsdir(g_motdFile, 63);
format(g_motdFile, 63, "%s/conmotd.txt", g_motdFile);
}
new g_Bar[] = "=============="