73 Commits

Author SHA1 Message Date
3c28f57786 Tagged 0.16 2006-07-20 05:48:53 +00:00
05cf53e1b9 nothing important 2004-03-25 18:37:02 +00:00
a3c9489360 plugins using localinfo paths now 2004-03-25 16:52:04 +00:00
63e1d7e43b added password description 2004-03-25 14:30:33 +00:00
a82b5383d7 added amxx_customdir and amxx_configsdir 2004-03-25 13:35:24 +00:00
9b551916f1 making sure amxx_customdir and amxx_configsdir are set 2004-03-25 13:35:02 +00:00
64a7afa371 added localinfo stocks 2004-03-25 13:34:27 +00:00
c7981eb54b added build_path() 2004-03-25 13:33:58 +00:00
a6473737a2 entity_set_model should take const strings 2004-03-25 11:42:34 +00:00
3fc4049b0a Placed meta_api.cpp under right folder in workspace 2004-03-25 08:33:48 +00:00
4f6450abf0 amxx_pluginsdir and amxx_modulesdir added 2004-03-24 19:00:03 +00:00
130f274f86 more localinfos 2004-03-24 18:59:37 +00:00
98c63e8efd new localinfos 2004-03-24 18:39:25 +00:00
2b7b1a844c get_modulesnum function updated (using UTIL_GetModulesNum now) 2004-03-24 18:35:42 +00:00
012507c38a fixed getline function 2004-03-24 18:35:04 +00:00
a9a46e20b2 fixed size() function, added empty() function 2004-03-24 18:34:47 +00:00
ab110d3d27 added localinfo paths, fixed amx_version and amxmodx_version cvars (module count) 2004-03-24 18:34:18 +00:00
cfb45c1302 added UTIL_GetModulesNum function 2004-03-24 18:33:41 +00:00
e40daf1315 another fix 2004-03-24 12:56:21 +00:00
5967f7d951 fixed entity_set_string to take const strings 2004-03-24 08:53:40 +00:00
ca0c0bfce2 disabled restrictmenu by default 2004-03-24 08:30:49 +00:00
079f824a81 updated version information 2004-03-24 08:30:08 +00:00
d850e62a02 updated amxx version 2004-03-24 08:24:35 +00:00
10b887147e added [AMXX] before messages 2004-03-24 08:24:19 +00:00
df2a96e2d7 removed map descriptions 2004-03-24 08:21:13 +00:00
63bc246264 changed ban commands 2004-03-24 08:20:35 +00:00
16e3582ef5 nothing important 2004-03-24 08:19:08 +00:00
0a582d4635 Didn't work - fixed a lot of stuff 2004-03-24 08:18:07 +00:00
cd3f57987b updated to new ban command 2004-03-24 08:16:43 +00:00
ecbf698486 removed descriptions 2004-03-24 08:16:29 +00:00
64a0c95bfa Engine is deactivated by default 2004-03-24 08:16:14 +00:00
894d650593 welcomemsg and stats_logging are deactivated by default 2004-03-24 08:15:58 +00:00
8d89be8de3 confirmed WON offset: OFFSET_CLIPAMMO as 51 2004-03-24 07:54:15 +00:00
b9bb70d410 fixed maxclients bug 2004-03-24 07:54:13 +00:00
8c7938d47a Fixed workspace 2004-03-24 07:28:49 +00:00
c78e2bcf7e new makefile 2004-03-24 06:33:39 +00:00
0bea18ca9f New makefile 2004-03-24 06:33:03 +00:00
7937c77eed imported jghg2 support 2004-03-24 05:10:11 +00:00
8110271bdd imported jghg2 support 2004-03-24 05:01:33 +00:00
f566ac2eb7 new file names+headers 2004-03-24 03:39:37 +00:00
b311a9ccc3 new file names+headers 2004-03-24 02:10:20 +00:00
2a7b5b714d Fixed header files in makefile. 2004-03-24 01:40:10 +00:00
f711baf3df new file names 2004-03-24 01:35:44 +00:00
5c82095e81 removed useless hook 2004-03-24 01:10:38 +00:00
15904761e8 compiles now 2004-03-24 00:54:35 +00:00
6d58afcedb undid some stuff 2004-03-23 13:25:59 +00:00
1b0cc63b5b amx.cfg --> amxx.cfg 2004-03-23 10:15:26 +00:00
94b9bc9939 fixed give_item 2004-03-23 01:18:22 +00:00
95445293a2 Fixed anim after cs_set_weapon_silenc 2004-03-22 12:20:00 +00:00
431bfbb4d9 Updated set_entity_visibility 2004-03-22 11:44:47 +00:00
e47104aa29 Fixed reference to find_ent_by_classname in find_ent
Added set_entity_visibility and get_entity_visibility
2004-03-22 11:29:29 +00:00
180fa52acb Added cs_get_weapon_ammo/cs_set_weapon_ammo 2004-03-22 09:10:11 +00:00
bbbe0cda78 Added cs_get_weapon_ammo/cs_set_weapon_ammo 2004-03-22 08:57:23 +00:00
b21bbcbf90 Fixed prototype of set_offset_short
Fixed all offset natives (they checked ent index above maxClients, should've been maxEntities (some also checked if player is online))
Added s/get_offset_char()
Fixed set_pdata_float to set float value from parameter properly
Fixed set_pdata_short to set short value from parameter properly
Reimplemented find_ent_by_owner
2004-03-22 08:27:52 +00:00
66a1f11387 Shortened all natives that had longer names than old compiler limit of 19 characters. 2004-03-22 07:23:47 +00:00
2b366a354c fixed amx_show_activity 2004-03-22 06:33:11 +00:00
cebf782a90 amx_show_activity is now registered 2004-03-22 06:30:37 +00:00
4ffa954055 Fixed bug with get_offset 2004-03-22 05:43:47 +00:00
556e9cee57 removed a forgotten debug message 2004-03-21 17:10:35 +00:00
421c62c6a0 Added native support for set_speak and get_speak and SetSpeak 2004-03-21 09:17:55 +00:00
9bec921fd8 Added set_speak and get_speak 2004-03-21 09:13:55 +00:00
b7b2d59613 Changed set_user_maxspeed 2004-03-21 08:59:18 +00:00
db41e1830a Added CSW_GALI for backwards support 2004-03-21 07:14:40 +00:00
9061e13e11 Fixed access level bug. 2004-03-21 06:32:27 +00:00
a72b749fac Fixed fun include from amxmodx and cs_set_user_nvg 2004-03-20 23:58:26 +00:00
cd0cd140ac Fixed native character length for cs_set_user_nvgoggles 2004-03-20 23:57:24 +00:00
7fef5aad34 Includes were broken - it is fixed. 2004-03-18 01:32:39 +00:00
38af364744 fixed filters bug 2004-03-17 18:57:36 +00:00
a7c4f5a147 typo fix courtesy of pimp daddy 2004-03-17 11:38:23 +00:00
96b79cd24f fixed find_entity 2004-03-17 07:30:07 +00:00
bbb5adc70f added get_user_wonid() 2004-03-16 19:40:02 +00:00
a4eccaa4bb removed get_user_wonid() 2004-03-16 19:39:48 +00:00
6a10397641 Fixed xtrafun include 2004-03-16 05:21:42 +00:00
92 changed files with 4399 additions and 553 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

2562
amxmodx/amxmodx.cpp Executable file

File diff suppressed because it is too large Load Diff

247
amxmodx/amxmodx.h Executable file
View File

@ -0,0 +1,247 @@
/* 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

11
amxmodx/amxx_mm.def Executable file
View File

@ -0,0 +1,11 @@
; /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 <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
int gmsgAmmoPickup; int gmsgAmmoPickup;
int gmsgAmmoX; int gmsgAmmoX;

View File

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

View File

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

View File

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

6
amxmodx/msvc/amxmodx_mm.def Executable file
View File

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

288
amxmodx/msvc/amxmodx_mm.dsp Executable file
View File

@ -0,0 +1,288 @@
# 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

29
amxmodx/msvc/amxmodx_mm.dsw Executable file
View File

@ -0,0 +1,29 @@
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>
{{{
}}}
###############################################################################

21
amxmodx/msvc/amxmodx_mm.sln Executable file
View File

@ -0,0 +1,21 @@
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

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@
#include <meta_api.h> #include <meta_api.h>
#include <time.h> #include <time.h>
#include "amxmod.h" #include "amxmodx.h"
int UTIL_ReadFlags(const char* c) int UTIL_ReadFlags(const char* c)
{ {
@ -330,3 +330,36 @@ void UTIL_Log(const char *fmt, ...)
fclose(pF); fclose(pF);
print_srvconsole("L %s: %s\n", date, msg); 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 <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "CVault.h" #include "CVault.h"
#include "amxmod.h" #include "amxmodx.h"
Vault g_vault; Vault g_vault;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,6 +34,10 @@
; d - this is ip ; d - this is ip
; e - password is not checked (only name/ip/steamid needed) ; 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: ; Format of admin account:
; <name|ip|steamid> <password> <access flags> <account flags> ; <name|ip|steamid> <password> <access flags> <account flags>

View File

@ -1,5 +1,5 @@
MODNAME = cstrike_amx MODNAME = cstrike_amx
SRCFILES = cstrike.cpp CstrikePlayer.cpp SRCFILES = CstrikePlayer.cpp cstrike.cpp
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
EXTRA_LIBS_WIN32 = EXTRA_LIBS_WIN32 =
@ -10,6 +10,7 @@ EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
AMXDIR=../amxmodx
SDKTOP=../hlsdk SDKTOP=../hlsdk
METADIR=../metamodx METADIR=../metamodx
@ -25,7 +26,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc-2.95 CC_LINUX=gcc
ifeq "$(OS)" "WIN32" ifeq "$(OS)" "WIN32"
CC_WIN32=gcc CC_WIN32=gcc
LD_WINDLL=dllwrap LD_WINDLL=dllwrap
@ -52,43 +53,34 @@ else
ASRCFILES := $(shell dir /b) ASRCFILES := $(shell dir /b)
endif endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.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 \ -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$(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$(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 CFLAGS=-Wall -Wno-unknown-pragmas
ODEF = -DOPT_TYPE=\"optimized\" ODEF = -DOPT_TYPE=\"optimized\"
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS) CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $< DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ 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) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@ LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c
$(DO_CC_LINUX)
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_LINUX) $(DO_CC_LINUX)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.c
$(DO_CC_WIN32)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_WIN32) $(DO_CC_WIN32)
default: $(DEFAULT) default: $(DEFAULT)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(OBJC_LINUX) $(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
$(LINK_LINUX) $(LINK_LINUX)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(OBJC_WIN32) $(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
$(LINK_WIN32) $(LINK_WIN32)
$(OBJDIR_LINUX): $(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); int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
switch (weapontype) { switch (weapontype) {
case CSW_M4A1: case CSW_M4A1:
if (*silencemode == M4A1_SILENCED) if (*silencemode & M4A1_SILENCED)
return 1; return 1;
case CSW_USP: case CSW_USP:
if (*silencemode == USP_SILENCED) if (*silencemode & USP_SILENCED)
return 1; 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. // Silence/unsilence gun. Does only work on M4A1 and USP.
// params[1] = weapon index // 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 // Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities) if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
@ -281,22 +281,41 @@ static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs
switch (weapontype) { switch (weapontype) {
case CSW_M4A1: case CSW_M4A1:
if (params[2]) if (params[2] == 1) {
*silencemode = M4A1_SILENCED; if (!(*silencemode & M4A1_SILENCED)) { // want to silence - can't already be silenced
else *silencemode |= M4A1_SILENCED;
*silencemode = M4A1_UNSILENCED; // 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;
}
break; break;
case CSW_USP: case CSW_USP:
if (params[2]) if (params[2] == 1) {
*silencemode = USP_SILENCED; if (!(*silencemode & USP_SILENCED)) { // want to silence - can't already be silenced
else *silencemode |= USP_SILENCED;
*silencemode = USP_UNSILENCED; // If this weapon has an owner that is a player, play animation for that player.
break; 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;
default: default:
return 0; return 0;
} }
return 1; return 1;
} }
@ -927,7 +946,7 @@ static cell AMX_NATIVE_CALL cs_set_user_backpackammo(AMX *amx, cell *params) //
return 1; return 1;
} }
static cell AMX_NATIVE_CALL cs_get_user_nvgoggles(AMX *amx, cell *params) // cs_get_user_nvgoggles(index); = 1 param static cell AMX_NATIVE_CALL cs_get_user_nvg(AMX *amx, cell *params) // cs_get_user_nvg(index); = 1 param
{ {
// Does user have night vision goggles? // Does user have night vision goggles?
// params[1] = user index // params[1] = user index
@ -954,7 +973,7 @@ static cell AMX_NATIVE_CALL cs_get_user_nvgoggles(AMX *amx, cell *params) // cs_
return 0; return 0;
} }
static cell AMX_NATIVE_CALL cs_set_user_nvgoggles(AMX *amx, cell *params) // cs_set_user_nvgoggles(index, nvgoggles = 1); = 2 params static cell AMX_NATIVE_CALL cs_set_user_nvg(AMX *amx, cell *params) // cs_set_user_nvg(index, nvgoggles = 1); = 2 params
{ {
// Give/take nvgoggles.. // Give/take nvgoggles..
// params[1] = user index // params[1] = user index
@ -1185,35 +1204,88 @@ static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_
return 1; 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[] = { AMX_NATIVE_INFO cstrike_Exports[] = {
{"cs_set_user_money", cs_set_user_money}, {"cs_set_user_money", cs_set_user_money},
{"cs_get_user_money", cs_get_user_money}, {"cs_get_user_money", cs_get_user_money},
{"cs_get_user_deaths", cs_get_user_deaths}, {"cs_get_user_deaths", cs_get_user_deaths},
{"cs_set_user_deaths", cs_set_user_deaths}, {"cs_set_user_deaths", cs_set_user_deaths},
{"cs_get_hostage_id", cs_get_hostage_id}, {"cs_get_hostage_id", cs_get_hostage_id},
{"cs_get_weapon_silenced", cs_get_weapon_silenced}, {"cs_get_weapon_silen", cs_get_weapon_silenced},
{"cs_set_weapon_silenced", cs_set_weapon_silenced}, {"cs_set_weapon_silen", cs_set_weapon_silenced},
{"cs_get_weapon_burstmode", cs_get_weapon_burstmode}, {"cs_get_weapon_burst", cs_get_weapon_burstmode},
{"cs_set_weapon_burstmode", cs_set_weapon_burstmode}, {"cs_set_weapon_burst", cs_set_weapon_burstmode},
{"cs_get_user_vip", cs_get_user_vip}, {"cs_get_user_vip", cs_get_user_vip},
{"cs_set_user_vip", cs_set_user_vip}, {"cs_set_user_vip", cs_set_user_vip},
{"cs_get_user_team", cs_get_user_team}, {"cs_get_user_team", cs_get_user_team},
{"cs_set_user_team", cs_set_user_team}, {"cs_set_user_team", cs_set_user_team},
{"cs_get_user_inside_buyzone", cs_get_user_inside_buyzone}, {"cs_get_user_buyzone", cs_get_user_inside_buyzone},
{"cs_get_user_plant", cs_get_user_plant}, {"cs_get_user_plant", cs_get_user_plant},
{"cs_set_user_plant", cs_set_user_plant}, {"cs_set_user_plant", cs_set_user_plant},
{"cs_get_user_defusekit", cs_get_user_defusekit}, {"cs_get_user_defuse", cs_get_user_defusekit},
{"cs_set_user_defusekit", cs_set_user_defusekit}, {"cs_set_user_defuse", cs_set_user_defusekit},
{"cs_get_user_backpackammo", cs_get_user_backpackammo}, {"cs_get_user_bpammo", cs_get_user_backpackammo},
{"cs_set_user_backpackammo", cs_set_user_backpackammo}, {"cs_set_user_bpammo", cs_set_user_backpackammo},
{"cs_get_user_nvgoggles", cs_get_user_nvgoggles}, {"cs_get_user_nvg", cs_get_user_nvg},
{"cs_set_user_nvgoggles", cs_set_user_nvgoggles}, {"cs_set_user_nvg", cs_set_user_nvg},
{"cs_get_hostage_follow", cs_get_hostage_follow}, {"cs_get_hostage_foll", cs_get_hostage_follow},
{"cs_set_hostage_follow", cs_set_hostage_follow}, {"cs_set_hostage_foll", cs_set_hostage_follow},
{"cs_get_user_model", cs_get_user_model}, {"cs_get_user_model", cs_get_user_model},
{"cs_set_user_model", cs_set_user_model}, {"cs_set_user_model", cs_set_user_model},
{"cs_reset_user_model", cs_reset_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} {NULL, NULL}
}; };
@ -1266,7 +1338,7 @@ void PlayerPostThink(edict_t* pPlayer) {
if(g_players[entityIndex].GetModelled()) { if(g_players[entityIndex].GetModelled()) {
if (g_players[entityIndex].GetInspectModel() && strcmp(g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model")) != 0) { 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()); SETCLIENTKEYVALUE(entityIndex, GETINFOKEYBUFFER(pPlayer), "model", (char*)g_players[entityIndex].GetModel());
g_players[entityIndex].SetInspectModel(false); g_players[entityIndex].SetInspectModel(false);
} }

View File

@ -83,7 +83,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe 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 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_amxx_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_amx_debug.dll" /pdbtype:sept
!ENDIF !ENDIF

View File

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

View File

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

View File

@ -10,6 +10,7 @@ EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
AMXDIR=../amxmodx
SDKTOP=../hlsdk SDKTOP=../hlsdk
METADIR=../metamodx METADIR=../metamodx
@ -25,7 +26,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc CC_LINUX=gcc-2.95
ifeq "$(OS)" "WIN32" ifeq "$(OS)" "WIN32"
CC_WIN32=gcc CC_WIN32=gcc
LD_WINDLL=dllwrap LD_WINDLL=dllwrap
@ -52,43 +53,34 @@ else
ASRCFILES := $(shell dir /b) ASRCFILES := $(shell dir /b)
endif endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.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 \ -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$(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$(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 CFLAGS=-Wall -Wno-unknown-pragmas
ODEF = -DOPT_TYPE=\"optimized\" ODEF = -DOPT_TYPE=\"optimized\"
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS) CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $< DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ 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) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@ LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c
$(DO_CC_LINUX)
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_LINUX) $(DO_CC_LINUX)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.c
$(DO_CC_WIN32)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_WIN32) $(DO_CC_WIN32)
default: $(DEFAULT) default: $(DEFAULT)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(OBJC_LINUX) $(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
$(LINK_LINUX) $(LINK_LINUX)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(OBJC_WIN32) $(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
$(LINK_WIN32) $(LINK_WIN32)
$(OBJDIR_LINUX): $(OBJDIR_LINUX):

View File

@ -1,8 +0,0 @@
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

@ -17,7 +17,7 @@ CFG=engine - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "engine_mm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "engine_amx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "engine - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "engine - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE !MESSAGE
@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe MTL=midl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "engine_mm - Win32 Release" !IF "$(CFG)" == "engine_amx - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
@ -52,7 +52,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe 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 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_mm.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_amx.dll"
!ELSEIF "$(CFG)" == "engine - Win32 Debug" !ELSEIF "$(CFG)" == "engine - Win32 Debug"
@ -83,19 +83,19 @@ LINK32=link.exe
# Begin Target # Begin Target
# Name "engine_mm - Win32 Release" # Name "engine_amx - Win32 Release"
# Name "engine - Win32 Debug" # Name "engine - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File # Begin Source File
SOURCE=.\meta_api.cpp SOURCE=.\meta_api.cpp
# End Source File # End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File # Begin Source File
SOURCE=.\engine.h SOURCE=.\engine.h
@ -110,7 +110,7 @@ SOURCE=.\engine.inc
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\engine.def SOURCE=.\engine_amx.def
# End Source File # End Source File
# End Group # End Group
# End Target # End Target

View File

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

View File

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

View File

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

View File

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

View File

@ -45,6 +45,7 @@
GlobalInfo GlInfo; GlobalInfo GlInfo;
MessageInfo *msgd = NULL; MessageInfo *msgd = NULL;
bool isMsgHooked[MAX_MESSAGES]; bool isMsgHooked[MAX_MESSAGES];
bool is_PlayerOn[33];
int inHookProcess; int inHookProcess;
edict_t *valid_ent(int ent); edict_t *valid_ent(int ent);
edict_t *valid_player(int ent); edict_t *valid_player(int ent);
@ -375,18 +376,23 @@ static cell AMX_NATIVE_CALL set_offset_short(AMX *amx, cell *params)
int index = params[1]; int index = params[1];
int off = params[2]; int off = params[2];
if (index < 1 || index > gpGlobals->maxClients) { if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0; return 0;
} }
edict_t *Player = INDEXENT(index); if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__ #ifndef __linux__
off -= 5; off -= 5;
#endif #endif
*((short *)Player->pvPrivateData + off) = params[3]; *((short *)pEnt->pvPrivateData + off) = (short)params[3];
return 1; return 1;
} }
@ -398,18 +404,53 @@ static cell AMX_NATIVE_CALL set_offset(AMX *amx, cell *params)
int index = params[1]; int index = params[1];
int off = params[2]; int off = params[2];
if (index < 1 || index > gpGlobals->maxClients) { if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0; return 0;
} }
edict_t *Player = INDEXENT(index); if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__ #ifndef __linux__
off -= 5; off -= 5;
#endif #endif
*((int *)Player->pvPrivateData + off) = params[3]; *((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;
return 1; return 1;
} }
@ -421,18 +462,25 @@ static cell AMX_NATIVE_CALL set_offset_float(AMX *amx, cell *params)
int index = params[1]; int index = params[1];
int off = params[2]; int off = params[2];
if (index < 1 || index > gpGlobals->maxClients) { float fNewValue = *(float *)((void *)&params[3]);
if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0; return 0;
} }
edict_t *Player = INDEXENT(index); if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__ #ifndef __linux__
off -= 5; off -= 5;
#endif #endif
*((float *)Player->pvPrivateData + off) = params[3]; *((float *)pEnt->pvPrivateData + off) = fNewValue;
return 1; return 1;
} }
@ -444,18 +492,51 @@ static cell AMX_NATIVE_CALL get_offset_short(AMX *amx, cell *params)
int index = params[1]; int index = params[1];
int off = params[2]; int off = params[2];
if (index < 1 || index > gpGlobals->maxClients) { if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0; return 0;
} }
edict_t *Player = INDEXENT(index); if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__ #ifndef __linux__
off -= 5; off -= 5;
#endif #endif
return (int)*((short *)Player->pvPrivateData + off); 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);
} }
@ -466,19 +547,24 @@ static cell AMX_NATIVE_CALL get_offset(AMX *amx, cell *params)
int index = params[1]; int index = params[1];
int off = params[2]; int off = params[2];
if (index < 1 || index > gpGlobals->maxClients) { if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0; return 0;
} }
edict_t *Player = INDEXENT(index); //jghg comment this out again and I bite you
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__ #ifndef __linux__
off -= 5; off -= 5;
#endif #endif
return (int)*((int *)Player->pvPrivateData + off); return *((int *)pEnt->pvPrivateData + off);
} }
//(BAILOPAN) //(BAILOPAN)
@ -489,22 +575,54 @@ static cell AMX_NATIVE_CALL get_offset_float(AMX *amx, cell *params)
int off = params[2]; int off = params[2];
float retVal; float retVal;
if (index < 1 || index > gpGlobals->maxClients) { if (index < 1 || index > gpGlobals->maxEntities) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0; return 0;
} }
edict_t *Player = INDEXENT(index); //jghg comment this out again and I bite you
if ((index <= gpGlobals->maxClients) && !is_PlayerOn[index]) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
edict_t *pEnt = INDEXENT(index);
#ifndef __linux__ #ifndef __linux__
off -= 5; off -= 5;
#endif #endif
retVal = ((float)*((float *)Player->pvPrivateData + off)); //no jghg this actually works!
retVal = ((float)*((float *)pEnt->pvPrivateData + off));
return *(cell*)((void *)&retVal); return *(cell*)((void *)&retVal);
}
return 1; //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]);
} }
//is an entity valid? //is an entity valid?
@ -1770,6 +1888,31 @@ static cell AMX_NATIVE_CALL create_entity(AMX *amx, cell *params) {
return ENTINDEX(pNewEntity); 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 //ej ref'd by jghg
static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param */
{ {
@ -1786,6 +1929,58 @@ static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param
return 0; 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. // DispatchKeyValue, sets a key-value pair for a newly created entity.
// Use DispatchSpawn after doing ALL DispatchKeyValues on an entity. // Use DispatchSpawn after doing ALL DispatchKeyValues on an entity.
@ -1970,45 +2165,46 @@ static cell AMX_NATIVE_CALL find_ent_by_tname(AMX *amx, cell *params) {
return iReturnEnt; return iReturnEnt;
} }
// FindEntityByOwner (BAILOPAN) 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
// Works like FindEntity except only returns by owner. {
// Searches by classname. // Check index to start searching at, 0 must be possible.
static cell AMX_NATIVE_CALL find_ent_by_owner(AMX *amx, cell *params) { if (params[1] < 0 || params[1] > gpGlobals->maxEntities) {
int iStartEnt = params[1]; AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
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; return 0;
} }
return checkEnt; // 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;
} }
//returns current number of entities in game (BAILOPAN) //returns current number of entities in game (BAILOPAN)
@ -2691,10 +2887,59 @@ static cell AMX_NATIVE_CALL set_size(AMX *amx, cell *params)
return 1; 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 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. //Added by BAILOPAN. ClientKill() forward.
void ClientKill(edict_t *pEntity) void ClientKill(edict_t *pEntity)
@ -2838,6 +3083,11 @@ void ClientDisconnect(edict_t *pEntity) {
PlInfo[ENTINDEX(pEntity)].iRenderMode = 0; PlInfo[ENTINDEX(pEntity)].iRenderMode = 0;
PlInfo[ENTINDEX(pEntity)].fRenderAmt = 0; PlInfo[ENTINDEX(pEntity)].fRenderAmt = 0;
int iPlayer = ENTINDEX(pEntity);
if (iPlayer > 0 && iPlayer < 33) {
is_PlayerOn[iPlayer] = false;
}
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }
@ -3084,6 +3334,10 @@ void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ){
isMsgHooked[i] = false; isMsgHooked[i] = false;
} }
for (i=0; i<33; i++) {
is_PlayerOn[i] = false;
}
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }
@ -3172,11 +3426,8 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
gpGamedllFuncs=pGamedllFuncs; gpGamedllFuncs=pGamedllFuncs;
return(TRUE); return(TRUE);
} }
C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) { C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) { if(now > Plugin_info.unloadable && reason != PNL_CMD_FORCED) {
@ -3189,8 +3440,6 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
} }
#ifdef __linux__ #ifdef __linux__
C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) { C_DLLEXPORT void GiveFnptrsToDll( enginefuncs_t* pengfuncsFromEngine, globalvars_t *pGlobals ) {
#else #else
@ -3202,6 +3451,13 @@ 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; DLL_FUNCTIONS gFunctionTable;
@ -3249,6 +3505,7 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
meta_engfuncs.pfnWriteString = WriteString; meta_engfuncs.pfnWriteString = WriteString;
meta_engfuncs.pfnWriteEntity = WriteEntity; meta_engfuncs.pfnWriteEntity = WriteEntity;
meta_engfuncs.pfnLightStyle = LightStyle; meta_engfuncs.pfnLightStyle = LightStyle;
meta_engfuncs.pfnVoice_SetClientListening = Voice_SetClientListening;
if(*interfaceVersion!=ENGINE_INTERFACE_VERSION) { if(*interfaceVersion!=ENGINE_INTERFACE_VERSION) {
LOG_ERROR(PLID, "GetEngineFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION); LOG_ERROR(PLID, "GetEngineFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
@ -3262,23 +3519,17 @@ 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) {
enginefuncs_t meta_engfuncs_post; LOG_ERROR(PLID, "GetEntityAPI2_Post version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION);
*interfaceVersion = INTERFACE_VERSION;
C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *interfaceVersion ) { return(FALSE);
}
memcpy( pFunctionTable, &gFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
if(*interfaceVersion!=ENGINE_INTERFACE_VERSION) { return(TRUE);
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) { C_DLLEXPORT int AMX_Query(module_info_s** info) {
@ -3289,8 +3540,6 @@ C_DLLEXPORT int AMX_Query(module_info_s** info) {
} }
C_DLLEXPORT int AMX_Attach(pfnamx_engine_g* amxeng,pfnmodule_engine_g* meng) { C_DLLEXPORT int AMX_Attach(pfnamx_engine_g* amxeng,pfnmodule_engine_g* meng) {
g_engAmxFunc = amxeng; g_engAmxFunc = amxeng;
@ -3316,10 +3565,13 @@ C_DLLEXPORT int AMX_Detach() {
AMX_NATIVE_INFO Engine_Natives[] = { AMX_NATIVE_INFO Engine_Natives[] = {
{"set_offset_float", set_offset_float}, {"set_offset_float", set_offset_float},
{"set_offset_short", set_offset_short}, {"set_offset_short", set_offset_short},
{"set_offset_char", set_offset_char},
{"set_offset", set_offset}, {"set_offset", set_offset},
{"get_offset_float", get_offset_float}, {"get_offset_float", get_offset_float},
{"get_offset_short", get_offset_short}, {"get_offset_short", get_offset_short},
{"get_offset_char", get_offset_char},
{"get_offset", get_offset}, {"get_offset", get_offset},
{"get_entity_pointer", get_entity_pointer},
{"entity_get_float", entity_get_float}, {"entity_get_float", entity_get_float},
{"entity_set_float", entity_set_float}, {"entity_set_float", entity_set_float},
@ -3356,6 +3608,8 @@ AMX_NATIVE_INFO Engine_Natives[] = {
{"find_ent_by_target", find_ent_by_target}, {"find_ent_by_target", find_ent_by_target},
{"find_ent_by_tname", find_ent_by_tname}, {"find_ent_by_tname", find_ent_by_tname},
{"find_ent_by_model", find_ent_by_model}, {"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}, {"entity_count", entity_count},
{"DispatchKeyValue", DispatchKeyValue}, {"DispatchKeyValue", DispatchKeyValue},
{"DispatchSpawn", DispatchSpawn}, {"DispatchSpawn", DispatchSpawn},
@ -3365,6 +3619,8 @@ AMX_NATIVE_INFO Engine_Natives[] = {
{"set_lights", set_lights}, {"set_lights", set_lights},
{"set_view", set_view}, {"set_view", set_view},
{"attach_view", attach_view}, {"attach_view", attach_view},
{"set_speak", set_speak},
{"get_speak", get_speak},
{"precache_generic", precache_generic}, {"precache_generic", precache_generic},
{"register_message", register_message}, {"register_message", register_message},

View File

@ -55,9 +55,9 @@ endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \ CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG -lstdc++ -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$(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 CFLAGS=-Wall -Wno-unknown-pragmas

View File

@ -213,19 +213,46 @@ static cell AMX_NATIVE_CALL give_item(AMX *amx, cell *params) // native give_ite
int length; int length;
const char *szItem = GET_AMXSTRING(amx, params[2], 1, 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 = 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... 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 // Create the entity, returns to pointer
pItemEntity = CREATE_NAMED_ENTITY(item); pItemEntity = CREATE_NAMED_ENTITY(item);
VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I //VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I
pItemEntity->v.spawnflags |= SF_NORESPAWN; //I'm not sure, normally I use macros too =P
pItemEntity->v.origin = pPlayer->v.origin;
pItemEntity->v.spawnflags |= (1<<30); //SF_NORESPAWN;
MDLL_Spawn(pItemEntity); MDLL_Spawn(pItemEntity);
int save = pItemEntity->v.solid;
MDLL_Touch(pItemEntity, ENT(pPlayer)); MDLL_Touch(pItemEntity, ENT(pPlayer));
return 1; //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);
} }
static cell AMX_NATIVE_CALL spawn(AMX *amx, cell *params) // spawn(id) = 1 param static cell AMX_NATIVE_CALL spawn(AMX *amx, cell *params) // spawn(id) = 1 param
@ -404,6 +431,8 @@ static cell AMX_NATIVE_CALL set_user_maxspeed(AMX *amx, cell *params) // set_use
// params[1] = index // params[1] = index
// params[2] = speed (should be -1.0 if not specified) (JGHG: unspecified parameters seems to always be -1.0!) // 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 // Check index
if (params[1] < 1 || params[1] > gpGlobals->maxClients) if (params[1] < 1 || params[1] > gpGlobals->maxClients)
{ {
@ -420,7 +449,8 @@ 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 //pPlayer->v.maxspeed = ; // JGHG: Gotta love the way to get floats from parameters :-P
SETCLIENTMAXSPEED(pPlayer, *(float *)((void *)&params[2])); SETCLIENTMAXSPEED(pPlayer, fNewSpeed);
pPlayer->v.maxspeed = fNewSpeed;
return 1; return 1;
} }

View File

@ -4,7 +4,7 @@
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=fun - Win32 Debug CFG=fun_amx - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
@ -17,8 +17,8 @@ CFG=fun - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "fun - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "fun_amx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "fun - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "fun_amx - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe MTL=midl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "fun - Win32 Release" !IF "$(CFG)" == "fun_amx - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 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 # 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 # Begin Special Build Tool
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
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 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
# End Special Build Tool # End Special Build Tool
!ELSEIF "$(CFG)" == "fun - Win32 Debug" !ELSEIF "$(CFG)" == "fun_amx - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
@ -89,8 +89,8 @@ LINK32=link.exe
# Begin Target # Begin Target
# Name "fun - Win32 Release" # Name "fun_amx - Win32 Release"
# Name "fun - Win32 Debug" # Name "fun_amx - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@ -100,7 +100,7 @@ SOURCE=.\fun.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\fun.def SOURCE=.\fun_amx.def
# End Source File # End Source File
# End Group # End Group
# Begin Group "Header Files" # Begin Group "Header Files"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

@ -54,7 +54,7 @@ new bool:g_execResult
new Float:g_voteRatio new Float:g_voteRatio
public plugin_init() { public plugin_init() {
register_plugin("Admin Votes","0.15","AMXX Dev Team") register_plugin("Admin Votes","0.16","AMXX Dev Team")
register_menucmd(register_menuid("Change map to ") ,(1<<0)|(1<<1),"voteCount") 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("Choose map: ") ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"voteCount")
register_menucmd(register_menuid("Kick ") ,(1<<0)|(1<<1),"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() public plugin_init()
{ {
register_plugin("Anti Flood","0.15","AMXX Dev Team") register_plugin("Anti Flood","0.16","AMXX Dev Team")
register_clcmd("say","chkFlood") register_clcmd("say","chkFlood")
register_clcmd("say_team","chkFlood") register_clcmd("say_team","chkFlood")
register_cvar("amx_flood_time","0.75") register_cvar("amx_flood_time","0.75")

View File

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

View File

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

View File

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

View File

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

View File

@ -91,10 +91,20 @@ stock is_running(const arg[]) {
return equal(mod_name,arg) return equal(mod_name,arg)
} }
stock build_path( path[] , len , {Float,_}:... ) { stock get_basedir(name[],len)
format_args( path , len , 2 ) return get_localinfo("amxx_basedir",name,len)
return replace( path , len , "$basedir", "addons/amxx" )
}
stock get_basedir( name[], len ) stock get_configsdir(name[],len)
return copy(name,len,"addons/amxx") 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)
}
#endif

View File

@ -21,9 +21,6 @@ stock user_spawn(index)
stock get_logfile( name[], len ) stock get_logfile( name[], len )
return get_time("admin%m%d.log",name,len) return get_time("admin%m%d.log",name,len)
stock get_user_wonid(index)
return 0
stock get_user_money(index) stock get_user_money(index)
return cs_get_user_money(index) return cs_get_user_money(index)
@ -35,3 +32,11 @@ stock numtostr(num,string[],len)
stock strtonum(const string[]) stock strtonum(const string[])
return str_to_num(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)
}

View File

@ -17,10 +17,10 @@ native cs_get_user_deaths(index);
native cs_set_user_deaths(index, newdeaths); 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. */ /* 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_follow(index); native cs_get_hostage_foll(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. */ /* 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_follow(index, followedindex = 0); native cs_set_hostage_foll(index, followedindex = 0);
/* Get unique hostage id. */ /* Get unique hostage id. */
native cs_get_hostage_id(index); native cs_get_hostage_id(index);
@ -41,21 +41,21 @@ native cs_get_hostage_id(index);
* flash * flash
* he * he
* smoke */ * smoke */
native cs_get_user_backpackammo(index, weapon); native cs_get_user_bpammo(index, weapon);
/* Restock/remove ammo in a user's backpack. */ /* Restock/remove ammo in a user's backpack. */
native cs_set_user_backpackammo(index, weapon, amount); native cs_set_user_bpammo(index, weapon, amount);
/* Returns 1 if user has a defuse kit. */ /* Returns 1 if user has a defuse kit. */
native cs_get_user_defusekit(index); native cs_get_user_defuse(index);
/* If defusekit is 1, the user will have a defuse kit. /* 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 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. */ * You can specify an icon. Default is "defuser". Set flash to 1 if you want the icon to flash red. */
native cs_set_user_defusekit(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0); native cs_set_user_defuse(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0);
/* Is user in buyzone? Returns 1 when true, 0 when false. */ /* Is user in buyzone? Returns 1 when true, 0 when false. */
native cs_get_user_inside_buyzone(index); native cs_get_user_buyzone(index);
/* Get user model. */ /* Get user model. */
native cs_get_user_model(index, model[], len); 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); native cs_set_user_money(index, money, flash = 1);
/* Does user have night vision goggles? */ /* Does user have night vision goggles? */
native cs_get_user_nvgoggles(index); native cs_get_user_nvg(index);
/* Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them. */ /* Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them. */
native cs_set_user_nvgoggles(index, nvgoggles = 1); native cs_set_user_nvg(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. */ /* 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); native cs_get_user_plant(index);
@ -104,14 +104,20 @@ native cs_get_user_vip(index);
native cs_set_user_vip(index, vip = 1); native cs_set_user_vip(index, vip = 1);
/* Returns 1 if specified weapon is in burst mode. */ /* Returns 1 if specified weapon is in burst mode. */
native cs_get_weapon_burstmode(index); native cs_get_weapon_burst(index);
/* If burstmode = 1, weapon will be changed to burst mode, 0 and non-burst mode (semiautomatic/automatic) will be activated. /* 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. */ * Only GLOCK and FAMAS can enter/leave burst mode. */
native cs_set_weapon_burstmode(index, burstmode = 1); native cs_set_weapon_burst(index, burstmode = 1);
/* Returns 1 if weapon is silenced, else 0. */ /* Returns 1 if weapon is silenced, else 0. */
native cs_get_weapon_silenced(index); native cs_get_weapon_silen(index);
/* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced. */ /* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced. */
native cs_set_weapon_silenced(index, silence = 1); 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);

View File

@ -51,17 +51,26 @@ native set_msg_arg_string(argn, szString[]);
native get_offset(id, offset); native get_offset(id, offset);
native Float:get_offset_float(id, offset); native Float:get_offset_float(id, offset);
native get_offset_short(id, offset); native get_offset_short(id, offset);
native get_offset_char(id, offset);
/* sets pvPrivateData offset. */ /* sets pvPrivateData offset. */
native set_offset(id, offset, value); native set_offset(id, offset, value);
native set_offset_float(id, offset, Float:value); native set_offset_float(id, offset, Float:value);
native set_offset_short(id, offset); 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);
/* Precaches any file. */ /* Precaches any file. */
native precache_generic(szFile[]); native precache_generic(szFile[]);
/* Precaches an event. */ /* Precaches an event. */
native precache_event(type, Name[], {float,_}:...); 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?) //Drops an entity to the floor (work?)
native drop_to_floor(entity) native drop_to_floor(entity)
@ -95,7 +104,7 @@ native entity_set_vector(iIndex, iKey, Float:vNewVector[3]);
native entity_get_edict(iIndex, iKey); native entity_get_edict(iIndex, iKey);
native entity_set_edict(iIndex, iKey, iNewIndex); native entity_set_edict(iIndex, iKey, iNewIndex);
native entity_get_string(iIndex, iKey, szReturn[], iRetLen); native entity_get_string(iIndex, iKey, szReturn[], iRetLen);
native entity_set_string(iIndex, iKey, szNewVal[]); native entity_set_string(iIndex, iKey, const szNewVal[]);
native entity_get_byte(iIndex, iKey); native entity_get_byte(iIndex, iKey);
native entity_set_byte(iIndex, iKey, iVal); native entity_set_byte(iIndex, iKey, iVal);
@ -104,10 +113,13 @@ native create_entity(szClassname[]);
/* Finds an entity in the world, will return 0 if nothing is found */ /* Finds an entity in the world, will return 0 if nothing is found */
native find_ent_by_class(iIndex, szClass[]); native find_ent_by_class(iIndex, szClass[]);
native find_ent_by_owner(iIndex, szClass[], iOwner); //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_target(iIndex, szClass[]); native find_ent_by_target(iIndex, szClass[]);
native find_ent_by_tname(iIndex, szClass[]); native find_ent_by_tname(iIndex, szClass[]);
native find_ent_by_model(iIndex, szClass[], szModel[]); 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 //this will CBaseEntity::Think() or something from the entity
native call_think(entity) native call_think(entity)
@ -119,7 +131,7 @@ native is_valid_ent(iIndex);
native entity_set_origin(iIndex, Float:fNewOrigin[3]); native entity_set_origin(iIndex, Float:fNewOrigin[3]);
/* Sets the model of an Entity. */ /* Sets the model of an Entity. */
native entity_set_model(iIndex, szModel[]); native entity_set_model(iIndex, const szModel[]);
/* Remove an entity from the world. */ /* Remove an entity from the world. */
native remove_entity(iIndex); native remove_entity(iIndex);
@ -194,4 +206,12 @@ forward client_kill(id);
forward client_PreThink(id); forward client_PreThink(id);
forward client_PostThink(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> #include <engine_stocks>

View File

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

View File

@ -14,7 +14,7 @@
//wrapper for find_ent_by_class //wrapper for find_ent_by_class
stock find_ent(iStart, szClassname[]) stock find_ent(iStart, szClassname[])
{ {
return find_ent_by_classname(iStart, szClassname) return find_ent_by_class(iStart, szClassname)
} }
/* Changes an integer vec to a floating vec */ /* Changes an integer vec to a floating vec */
@ -192,3 +192,15 @@ stock set_entity_flags(ent,flag,onoff)
return 0 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,6 +5,11 @@
* This file is provided as is (no warranties). * 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. */ /* Returns 1 if receiver hears sender via voice communication. */
native get_client_listen(receiver, sender); native get_client_listen(receiver, sender);

172
plugins/include/jghg2.inc Executable file
View File

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

View File

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

View File

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

View File

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

View File

@ -146,7 +146,7 @@ new g_teamsNames[2][] = {
} }
public plugin_init(){ public plugin_init(){
register_plugin("CS Misc. Stats","0.15","AMXX Dev Team") register_plugin("CS Misc. Stats","0.16","AMXX Dev Team")
register_event("DeathMsg","eDeathMsg","a") register_event("DeathMsg","eDeathMsg","a")
register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w") 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") 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() public plugin_init()
{ {
register_plugin("NextMap","0.15","AMXX Dev Team") register_plugin("NextMap","0.16","AMXX Dev Team")
register_event("30","changeMap","a") register_event("30","changeMap","a")
register_clcmd("say nextmap","sayNextMap",0,"- displays nextmap") register_clcmd("say nextmap","sayNextMap",0,"- displays nextmap")
register_cvar("amx_nextmap","",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY) register_cvar("amx_nextmap","",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

View File

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

View File

@ -55,7 +55,7 @@ new g_cstrikeRunning
public plugin_init() public plugin_init()
{ {
register_plugin("Players Menu","0.15","AMXX Dev Team") register_plugin("Players Menu","0.16","AMXX Dev Team")
register_clcmd("amx_kickmenu","cmdKickMenu",ADMIN_KICK,"- displays kick menu") register_clcmd("amx_kickmenu","cmdKickMenu",ADMIN_KICK,"- displays kick menu")
register_clcmd("amx_banmenu","cmdBanMenu",ADMIN_BAN,"- displays ban menu") register_clcmd("amx_banmenu","cmdBanMenu",ADMIN_BAN,"- displays ban menu")
register_clcmd("amx_slapmenu","cmdSlapMenu",ADMIN_SLAY,"- displays slap/slay menu") register_clcmd("amx_slapmenu","cmdSlapMenu",ADMIN_SLAY,"- displays slap/slay menu")
@ -70,7 +70,10 @@ public plugin_init()
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
load_settings("addons/amxx/configs/clcmds.ini") 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)
} }
/* Ban menu */ /* Ban menu */

View File

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

View File

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

View File

@ -71,7 +71,7 @@ new g_teamScore[2]
new g_disabledMsg[] = "Server has disabled that option" new g_disabledMsg[] = "Server has disabled that option"
public plugin_init() { public plugin_init() {
register_plugin("CS Stats","0.15","AMXX Dev Team") register_plugin("CS Stats","0.16","AMXX Dev Team")
register_event("CS_DeathMsg","eCSDeathMsg","a") register_event("CS_DeathMsg","eCSDeathMsg","a")
register_event("ResetHUD","eResetHud","b") register_event("ResetHUD","eResetHud","b")
register_event("SendAudio","eRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw") 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] new g_pingCount[33]
public plugin_init() public plugin_init()
register_plugin("CS Stats Logging","0.15","AMXX Dev Team") register_plugin("CS Stats Logging","0.16","AMXX Dev Team")
public client_disconnect(id) { public client_disconnect(id) {
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE 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_menuDataId[MAX_MENU_DATA]
new g_menuDataNum new g_menuDataNum
new g_menuPosition[33] new g_menuPosition[33]
new g_fileToSave[] = "addons/amxx/configs/stats.ini" new g_fileToSave[64]
new bool:g_modified new bool:g_modified
public plugin_precache(){ public plugin_precache(){
@ -51,8 +51,10 @@ public plugin_precache(){
} }
public plugin_init() { public plugin_init() {
register_plugin("Stats Configuration","0.15","AMXX Dev Team") register_plugin("Stats Configuration","0.16","AMXX Dev Team")
register_menucmd(register_menuid("\yStats Configuration"),1023,"actionCfgMenu") 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) loadSettings(g_fileToSave)
} }

View File

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

View File

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

View File

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

View File

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