Compare commits
103 Commits
amxmodx-0.
...
amxmodx-0.
Author | SHA1 | Date | |
---|---|---|---|
cf6c73e82f | |||
95b638dbcd | |||
c42fef6d48 | |||
d60d19a3d7 | |||
3f1c730863 | |||
89f5a45e1d | |||
2b2149b643 | |||
f074af039b | |||
30ec1eec60 | |||
0e279c5bc9 | |||
525dfceb1d | |||
83fa1aea27 | |||
6e3f2f9616 | |||
6a77edfa97 | |||
b24f44896c | |||
e23726ac54 | |||
fb2be2256f | |||
1ef7f8dd72 | |||
4008743091 | |||
bff11bc18e | |||
6ada631aaf | |||
9042efd195 | |||
04b88c16a9 | |||
1c6636b106 | |||
a6a03bf51e | |||
b05cf94a23 | |||
b641192e73 | |||
d14c107db1 | |||
2e24077b77 | |||
d819c76024 | |||
89b5496dfb | |||
de44b4382a | |||
c71fc25a9d | |||
5527afc91e | |||
47eb690a89 | |||
bb662770e0 | |||
4d04072672 | |||
4c00d8b95d | |||
f828e1c8a0 | |||
34abaa1d56 | |||
768ea7519f | |||
3eed3b7f07 | |||
3419aa4dc5 | |||
54a00466e8 | |||
5133915e9c | |||
895948ca45 | |||
d0c51bd637 | |||
2e028ebe20 | |||
26349730e5 | |||
c0374c5fe5 | |||
ab2794d4bd | |||
e0af113cac | |||
f9a57a83a0 | |||
b7c0c47c05 | |||
2d9ec5295d | |||
b3f01faf38 | |||
58578690ad | |||
4754ccdd1d | |||
f6facb5349 | |||
1728c02561 | |||
c90d922443 | |||
2f1de39dd3 | |||
ec5f944c03 | |||
d43807a248 | |||
1980c524d3 | |||
31604d44a8 | |||
dba30f7ee6 | |||
1aaf540be4 | |||
d3751054da | |||
0c2dbdbc47 | |||
1485014229 | |||
0ea68c81dc | |||
8fbbda13c6 | |||
a96d26d573 | |||
fb7d1c0a7d | |||
d7d8ba1398 | |||
36c78421ae | |||
083fe35188 | |||
9e4a611b7f | |||
4ed906248d | |||
44bb871f7e | |||
c1a138f370 | |||
569ef4d494 | |||
26465afbf7 | |||
e287a2f202 | |||
91decabfde | |||
9a21e3e9d3 | |||
60940512e2 | |||
d4e69d97e0 | |||
f171842cf8 | |||
3d9bf8bc93 | |||
d7325f4209 | |||
5c177aada0 | |||
5c6289e1f0 | |||
844fbf581e | |||
22bac3c8f4 | |||
35ffbf8ca6 | |||
926f995a3a | |||
8589f0bcf5 | |||
1a2ef38588 | |||
fed8228712 | |||
09d0ba039d | |||
f2dcb89609 |
@ -419,8 +419,7 @@ void EventsMngr::executeEvents()
|
||||
|
||||
if ((err = amx_Exec((*iter).m_Plugin->getAMX(), NULL, (*iter).m_Func, 1, m_ParseVault ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE)
|
||||
{
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err,
|
||||
(*iter).m_Plugin->getAMX()->curline, (*iter).m_Plugin->getName());
|
||||
LogError((*iter).m_Plugin->getAMX(), err, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
||||
int err = amx_Execv(iter->pPlugin->getAMX(), &retVal, iter->func, m_NumParams, realParams);
|
||||
// log runtime error, if any
|
||||
if (err != AMX_ERR_NONE)
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err, iter->pPlugin->getAMX()->curline, iter->pPlugin->getName());
|
||||
LogError(iter->pPlugin->getAMX(), err, "");
|
||||
|
||||
// cleanup strings & arrays
|
||||
for (i = 0; i < m_NumParams; ++i)
|
||||
@ -128,16 +128,19 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
||||
else if (m_ParamTypes[i] == FP_ARRAY)
|
||||
{
|
||||
// copy back
|
||||
cell *tmp = physAddrs[i];
|
||||
if (preparedArrays[params[i]].type == Type_Cell)
|
||||
if (preparedArrays[params[i]].copyBack)
|
||||
{
|
||||
memcpy(preparedArrays[params[i]].ptr, tmp, preparedArrays[params[i]].size * sizeof(cell));
|
||||
}
|
||||
else
|
||||
{
|
||||
char *data = (char*)preparedArrays[params[i]].ptr;
|
||||
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
||||
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
||||
cell *tmp = physAddrs[i];
|
||||
if (preparedArrays[params[i]].type == Type_Cell)
|
||||
{
|
||||
memcpy(preparedArrays[params[i]].ptr, tmp, preparedArrays[params[i]].size * sizeof(cell));
|
||||
}
|
||||
else
|
||||
{
|
||||
char *data = (char*)preparedArrays[params[i]].ptr;
|
||||
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
||||
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
||||
}
|
||||
}
|
||||
amx_Release(iter->pPlugin->getAMX(), realParams[i]);
|
||||
}
|
||||
@ -190,6 +193,7 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
||||
{
|
||||
if (isFree)
|
||||
return 0;
|
||||
|
||||
const int STRINGEX_MAXLENGTH = 128;
|
||||
|
||||
cell realParams[FORWARD_MAX_PARAMS];
|
||||
@ -258,16 +262,19 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
||||
else if (m_ParamTypes[i] == FP_ARRAY)
|
||||
{
|
||||
// copy back
|
||||
cell *tmp = physAddrs[i];
|
||||
if (preparedArrays[params[i]].type == Type_Cell)
|
||||
if (preparedArrays[params[i]].copyBack)
|
||||
{
|
||||
memcpy(preparedArrays[params[i]].ptr, tmp, preparedArrays[params[i]].size * sizeof(cell));
|
||||
}
|
||||
else
|
||||
{
|
||||
char *data = (char*)preparedArrays[params[i]].ptr;
|
||||
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
||||
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
||||
cell *tmp = physAddrs[i];
|
||||
if (preparedArrays[params[i]].type == Type_Cell)
|
||||
{
|
||||
memcpy(preparedArrays[params[i]].ptr, tmp, preparedArrays[params[i]].size * sizeof(cell));
|
||||
}
|
||||
else
|
||||
{
|
||||
char *data = (char*)preparedArrays[params[i]].ptr;
|
||||
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
||||
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
||||
}
|
||||
}
|
||||
amx_Release(m_Amx, realParams[i]);
|
||||
}
|
||||
@ -288,18 +295,20 @@ int CForwardMngr::registerForward(const char *funcName, ForwardExecType et, int
|
||||
|
||||
int CForwardMngr::registerSPForward(int func, AMX *amx, int numParams, const ForwardParam *paramTypes)
|
||||
{
|
||||
int retVal = (m_SPForwards.size() << 1) | 1;
|
||||
int retVal = -1;
|
||||
CSPForward *pForward;
|
||||
if (!m_FreeSPForwards.empty())
|
||||
{
|
||||
pForward = m_SPForwards[m_FreeSPForwards.front() >> 1];
|
||||
pForward->Set(func, amx, numParams, paramTypes);
|
||||
if (pForward->getFuncsNum() == 0)
|
||||
retVal = m_FreeSPForwards.front();
|
||||
pForward = m_SPForwards[retVal >> 1];
|
||||
pForward->Set(func, amx, numParams, paramTypes);
|
||||
if (pForward->getFuncsNum() == 0)
|
||||
return -1;
|
||||
m_FreeSPForwards.pop();
|
||||
m_FreeSPForwards.pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = (m_SPForwards.size() << 1) | 1;
|
||||
pForward = new CSPForward();
|
||||
if (!pForward)
|
||||
return -1;
|
||||
@ -491,22 +500,23 @@ cell executeForwards(int id, ...)
|
||||
return g_forwards.executeForwards(id, params);
|
||||
}
|
||||
|
||||
cell CForwardMngr::prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type)
|
||||
cell CForwardMngr::prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type, bool copyBack)
|
||||
{
|
||||
m_TmpArrays[m_TmpArraysNum].ptr = ptr;
|
||||
m_TmpArrays[m_TmpArraysNum].size = size;
|
||||
m_TmpArrays[m_TmpArraysNum].type = type;
|
||||
m_TmpArrays[m_TmpArraysNum].copyBack = copyBack;
|
||||
return m_TmpArraysNum++;
|
||||
}
|
||||
|
||||
cell prepareCellArray(cell *ptr, unsigned int size)
|
||||
cell prepareCellArray(cell *ptr, unsigned int size, bool copyBack)
|
||||
{
|
||||
return g_forwards.prepareArray((void*)ptr, size, Type_Cell);
|
||||
return g_forwards.prepareArray((void*)ptr, size, Type_Cell, copyBack);
|
||||
}
|
||||
|
||||
cell prepareCharArray(char *ptr, unsigned int size)
|
||||
cell prepareCharArray(char *ptr, unsigned int size, bool copyBack)
|
||||
{
|
||||
return g_forwards.prepareArray((void*)ptr, size, Type_Char);
|
||||
return g_forwards.prepareArray((void*)ptr, size, Type_Char, copyBack);
|
||||
}
|
||||
|
||||
void unregisterSPForward(int id)
|
||||
|
@ -79,6 +79,7 @@ struct ForwardPreparedArray
|
||||
void *ptr;
|
||||
ForwardArrayElemType type;
|
||||
unsigned int size;
|
||||
bool copyBack;
|
||||
};
|
||||
|
||||
// Normal forward
|
||||
@ -185,7 +186,8 @@ public:
|
||||
int getParamsNum(int id) const; // get num of params of a forward
|
||||
int getFuncsNum(int id) const; // get num of found functions of a forward
|
||||
ForwardParam getParamType(int id, int paramId) const;
|
||||
cell prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type); // prepare array
|
||||
cell prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type,
|
||||
bool copyBack); // prepare array
|
||||
};
|
||||
|
||||
// (un)register forward
|
||||
@ -197,8 +199,8 @@ void unregisterSPForward(int id);
|
||||
// execute forwards
|
||||
cell executeForwards(int id, ...);
|
||||
// prepare array
|
||||
cell prepareCellArray(cell *ptr, unsigned int size);
|
||||
cell prepareCharArray(char *ptr, unsigned int size);
|
||||
cell prepareCellArray(cell *ptr, unsigned int size, bool copyBack = false);
|
||||
cell prepareCharArray(char *ptr, unsigned int size, bool copyBack = false);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1084,6 +1084,7 @@ int CLangMngr::MergeDefinitionFile(const char *file)
|
||||
{
|
||||
MergeDefinitions(language, Defq);
|
||||
}
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -173,8 +173,7 @@ void LogEventsMngr::executeLogEvents()
|
||||
|
||||
if (valid){
|
||||
if ((err = amx_Exec(a->plugin->getAMX(), NULL , a->func , 0)) != AMX_ERR_NONE)
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
||||
err,a->plugin->getAMX()->curline,a->plugin->getName());
|
||||
LogError(a->plugin->getAMX(), err, "");
|
||||
}
|
||||
|
||||
#ifdef ENABLEEXEPTIONS
|
||||
|
@ -50,7 +50,7 @@ void CPluginMngr::unloadPlugin( CPlugin** a ) {
|
||||
|
||||
int CPluginMngr::loadPluginsFromFile( const char* filename )
|
||||
{
|
||||
File fp( build_pathname("%s",filename) , "r" );
|
||||
FILE *fp = fopen(build_pathname("%s",filename) , "rt");
|
||||
|
||||
if ( !fp )
|
||||
{
|
||||
@ -59,25 +59,26 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
||||
}
|
||||
|
||||
// Find now folder
|
||||
char pluginName[256], line[256], error[256], debug[256];
|
||||
char pluginName[256], error[256], debug[256];
|
||||
int debugFlag = 0;
|
||||
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins");
|
||||
|
||||
String line;
|
||||
|
||||
while ( fp.getline(line , 255 ) )
|
||||
while ( !feof(fp) )
|
||||
{
|
||||
*pluginName = 0;
|
||||
*debug = 0;
|
||||
debugFlag = 0;
|
||||
sscanf(line,"%s %s",pluginName, debug);
|
||||
line.clear();
|
||||
line._fread(fp);
|
||||
sscanf(line.c_str(),"%s %s",pluginName, debug);
|
||||
if (!isalnum(*pluginName)) continue;
|
||||
|
||||
#ifdef JIT
|
||||
if (isalnum(*debug) && strcmp(debug, "debug") == 0)
|
||||
{
|
||||
debugFlag = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
CPlugin* plugin = loadPlugin( pluginsDir , pluginName , error, debugFlag);
|
||||
|
||||
@ -90,6 +91,8 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return pCounter;
|
||||
}
|
||||
|
||||
@ -130,7 +133,16 @@ CPluginMngr::CPlugin* CPluginMngr::findPlugin(const char* name) {
|
||||
|
||||
const char* CPluginMngr::CPlugin::getStatus() const {
|
||||
switch(status){
|
||||
case ps_running: return "running";
|
||||
case ps_running:
|
||||
{
|
||||
if (getAMX()->flags & AMX_FLAG_DEBUG)
|
||||
{
|
||||
return "debug";
|
||||
} else {
|
||||
return "running";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ps_paused: return "paused";
|
||||
case ps_bad_load: return "bad load";
|
||||
case ps_stopped: return "stopped";
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
inline int getStatusCode() { return status; }
|
||||
inline int getId() const { return id; }
|
||||
inline AMX* getAMX() { return &amx; }
|
||||
inline const AMX* getAMX() const { return &amx; }
|
||||
inline void setTitle( const char* n ) { title.assign(n); }
|
||||
inline void setAuthor( const char* n ) { author.assign(n); }
|
||||
inline void setVersion( const char* n ) { version.assign(n); }
|
||||
|
@ -187,7 +187,7 @@ public:
|
||||
{
|
||||
if (c == '\f' || c == '\n' ||
|
||||
c == '\t' || c == '\r' ||
|
||||
c == 'v' || c == ' ')
|
||||
c == '\v' || c == ' ')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -73,6 +73,11 @@ void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags,
|
||||
|
||||
void CTaskMngr::CTask::clear()
|
||||
{
|
||||
if (m_iFunc >= 0)
|
||||
{
|
||||
unregisterSPForward(m_iFunc);
|
||||
m_iFunc = -1;
|
||||
}
|
||||
m_bFree = true;
|
||||
if (m_pParams)
|
||||
{
|
||||
@ -122,6 +127,9 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
||||
executeForwards(m_iFunc, m_iId);
|
||||
}
|
||||
|
||||
if (isFree())
|
||||
return;
|
||||
|
||||
// set new exec time OR remove the task if needed
|
||||
if (m_bLoop || (--m_iRepeat > 0))
|
||||
{
|
||||
@ -130,7 +138,7 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
||||
else
|
||||
{
|
||||
unregisterSPForward(m_iFunc);
|
||||
m_iFunc = 0;
|
||||
m_iFunc = -1;
|
||||
m_bFree = true;
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,12 @@
|
||||
|
||||
; Revision History
|
||||
;------------------
|
||||
; 16 September 2004 by David "BAILOPAN" Anderson
|
||||
; Implemented a compile time toggleable debug hook on OP_CALL and OP_RET.
|
||||
; NOTE: JIT has not had debug hooks since 1999.
|
||||
; 8 September 2004 by David "BAILOPAN" Anderson
|
||||
; Changed OP_LINE call to be compile-time toggle-able between compiling
|
||||
; line ops or not.
|
||||
; 29 June 2004 by G.W.M. Vissers
|
||||
; Translated the thing into NASM. The actual generation of the code is
|
||||
; put into the data section because the code modifies itself whereas the
|
||||
@ -147,8 +153,15 @@ _dbgcode: resd 1
|
||||
_dbgaddr: resd 1
|
||||
_dbgparam: resd 1
|
||||
_dbgname: resd 1
|
||||
_usertags: resd 4 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata: resd 4 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
;usertags and userdata are 16 bytes on AMX Mod X
|
||||
_usertags1: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_usertags2: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_usertags3: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_usertags4: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata1: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata2: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata3: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata4: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_error: resd 1
|
||||
_pri: resd 1
|
||||
_alt: resd 1
|
||||
@ -265,6 +278,14 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
||||
|
||||
;
|
||||
; This is the work horse of the whole JIT: It actually copies the code.
|
||||
; Notes from ~dvander (with help of dJeyL)
|
||||
; This takes a source and ending address pointer in the assembled JIT code.
|
||||
; Then it subtracts them and copies the code in between.
|
||||
; The last parameter is the number of bytes the opcode is so it can jump
|
||||
; to the next one.
|
||||
; Also note that the "in between" code is NEVER executed during the compile
|
||||
; phase of the JIT. It's only assembled in memory, and copied into the
|
||||
; final output bytecode by this function.
|
||||
%macro GO_ON 2-3 4
|
||||
mov esi, %1 ;get source address of JIT code
|
||||
mov ecx,%2-%1 ;get number of bytes to copy
|
||||
@ -280,6 +301,8 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
||||
; Nasm can't handle the determination of the maximum code size as was done
|
||||
; in the Masm implementation, since it only does two passes. This macro is
|
||||
; called *after* the code for each Small instruction.
|
||||
; Notes by ~dvander: This just substracts a label's ip from the current ip.
|
||||
; Therefore you get an instant size check - see RELOC
|
||||
%macro CHECKCODESIZE 1
|
||||
%if MAXCODESIZE < $-%1
|
||||
%assign MAXCODESIZE $-%1
|
||||
@ -290,6 +313,11 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
||||
; Modify the argument of an x86 instruction with the Small opcode's parameter
|
||||
; before copying the code.
|
||||
;
|
||||
; Notes by ~dvander (thanks to dJeyL) - this will take an address and modify
|
||||
; the dword at it. Since the JIT copies already assembled code, you see
|
||||
; things like "call 12345678h". This is an arbitrary value as putval
|
||||
; will modify it in memory and then GO_ON will add it to the program.
|
||||
; It is important to get the putval address right - it's in bytes.
|
||||
%macro putval 1
|
||||
mov eax,[ebx+4]
|
||||
mov dword [%1],eax
|
||||
@ -298,7 +326,12 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
||||
;
|
||||
; Add an entry to the table of addresses which have to be relocated after the
|
||||
; code compilation is done.
|
||||
;
|
||||
; Notes by ~dvander: This is sort of what amx_BrowseRelocate() does, although
|
||||
; relocation is actually done after code generation (this just adds to a
|
||||
; table). Like putval, this takes in an address and marks it to be
|
||||
; rewritten. It is a good idea to just use labels to find relocation
|
||||
; offsets (see OP_CALL and OP_RETN). After code generation, this table
|
||||
; is browsed and the correct threaded jumps are placed.
|
||||
%macro RELOC 1-2 ; adr, dest
|
||||
mov ebp,[reloc_num]
|
||||
%if %0 < 2
|
||||
@ -1040,22 +1073,119 @@ OP_RET:
|
||||
;good
|
||||
OP_RETN:
|
||||
;nop;
|
||||
GO_ON j_retn, OP_CALL
|
||||
;save registers
|
||||
push eax
|
||||
push ebp
|
||||
;get .amx flags
|
||||
mov ebp,[amxhead]
|
||||
mov eax,[ebp+_h_flags]
|
||||
;check to see if the flag has line ops
|
||||
and eax,AMX_FLAG_DEBUG
|
||||
cmp eax,AMX_FLAG_DEBUG
|
||||
;restore registers
|
||||
pop ebp
|
||||
pop eax
|
||||
;if so, skip down to debug compiler
|
||||
jmp _go_jit_retn_debug
|
||||
|
||||
j_retn:
|
||||
_go_jit_retn_nodebug:
|
||||
GO_ON j_retn_nodebug, _go_jit_retn_go
|
||||
j_retn_nodebug:
|
||||
jmp [jit_retn]
|
||||
CHECKCODESIZE j_retn
|
||||
CHECKCODESIZE j_retn_nodebug
|
||||
_go_jit_retn_go:
|
||||
jmp _go_jit_retn_end
|
||||
|
||||
_go_jit_retn_debug:
|
||||
GO_ON j_retn, OP_CALL
|
||||
j_retn:
|
||||
push ebp
|
||||
push eax
|
||||
push edx
|
||||
;get AMX
|
||||
mov ebp,amx
|
||||
;get debug call ptr
|
||||
mov eax,[ebp+_userdata2]
|
||||
;check validity
|
||||
mov edx, dword 0
|
||||
cmp eax, edx
|
||||
je _go_jit_skip_debug
|
||||
xchg esp,esi ;switch stack
|
||||
push 1 ;param 2 mode 1 = pop
|
||||
push ebp ;param 1 - amx
|
||||
call eax ;indirect debug call
|
||||
add esp, 8 ;restore stack
|
||||
xchg esp,esi ;return to AMX stack
|
||||
mov ebp,amx ;restore AMX [necessary?]
|
||||
_go_jit_skip_debug:
|
||||
pop edx
|
||||
pop eax
|
||||
pop ebp
|
||||
jmp [jit_retn]
|
||||
CHECKCODESIZE j_retn
|
||||
_go_jit_retn_end:
|
||||
|
||||
;good
|
||||
OP_CALL:
|
||||
;nop;
|
||||
RELOC 1
|
||||
GO_ON j_call, OP_CALL_I, 8
|
||||
;save registers
|
||||
push eax
|
||||
push ebp
|
||||
;get .amx flags
|
||||
mov ebp,[amxhead]
|
||||
mov eax,[ebp+_h_flags]
|
||||
;check to see if the flag has line ops
|
||||
and eax,AMX_FLAG_DEBUG
|
||||
cmp eax,AMX_FLAG_DEBUG
|
||||
;restore registers
|
||||
pop ebp
|
||||
pop eax
|
||||
;if so, skip down to debug compiler
|
||||
jmp _go_jit_debug
|
||||
|
||||
j_call:
|
||||
;call 12345678h ; tasm chokes on this out of a sudden
|
||||
db 0e8h, 0, 0, 0, 0
|
||||
CHECKCODESIZE j_call
|
||||
_go_jit_nodebug:
|
||||
RELOC 1
|
||||
GO_ON j_call_nodebug, _j_call_go_on, 8
|
||||
j_call_nodebug:
|
||||
db 0e8h, 0, 0, 0, 0
|
||||
CHECKCODESIZE j_call_nodebug
|
||||
|
||||
_j_call_go_on:
|
||||
jmp _opcall_end
|
||||
|
||||
_go_jit_debug:
|
||||
;thanks to Julien "dJeyL" Laurent for code relocation explanation
|
||||
RELOC _go_jit_reloc-j_call+1
|
||||
GO_ON j_call, OP_CALL_I, 8
|
||||
j_call:
|
||||
; save some registers
|
||||
push ebp
|
||||
push eax
|
||||
push edx
|
||||
; get AMX
|
||||
mov ebp,amx
|
||||
; get debug call pointer
|
||||
mov eax,[ebp+_userdata2]
|
||||
; check to see if it's valid
|
||||
mov edx, dword 0
|
||||
cmp eax,edx
|
||||
je _go_jit_skip_call
|
||||
xchg esp,esi ;switch to caller stack
|
||||
push 2 ;param mode=2, push
|
||||
push ebp ;param amx
|
||||
call eax ;indirect call
|
||||
add esp, 8 ;restore stack
|
||||
xchg esp,esi ;return to AMX stack
|
||||
mov ebp,amx ;restore AMX [necessary?]
|
||||
_go_jit_skip_call:
|
||||
;restore original registers
|
||||
pop edx
|
||||
pop eax
|
||||
pop ebp
|
||||
_go_jit_reloc:
|
||||
db 0e8h, 0, 0, 0, 0
|
||||
CHECKCODESIZE j_call
|
||||
_opcall_end:
|
||||
|
||||
OP_CALL_I:
|
||||
;nop;
|
||||
@ -2223,7 +2353,6 @@ JIT_OP_LINE:
|
||||
pop eax
|
||||
jmp ecx ; jump back
|
||||
|
||||
|
||||
JIT_OP_SWITCH:
|
||||
pop ebp ; pop return address = table address
|
||||
mov ecx,[ebp] ; ECX = number of records
|
||||
@ -2241,7 +2370,6 @@ JIT_OP_SWITCH:
|
||||
jmp ebp
|
||||
%endif
|
||||
|
||||
|
||||
; The caller of asm_runJIT() can determine the maximum size of the compiled
|
||||
; code by multiplying the result of this function by the number of opcodes in
|
||||
; Small module.
|
||||
|
Binary file not shown.
Binary file not shown.
345
amxmodx/amx.cpp
345
amxmodx/amx.cpp
@ -39,11 +39,13 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h> /* for wchar_t */
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include "osdefs.h"
|
||||
#if defined LINUX
|
||||
#include <sclinux.h>
|
||||
@ -479,6 +481,62 @@ int AMXAPI amx_Debug(AMX *amx)
|
||||
return AMX_ERR_DEBUG;
|
||||
}
|
||||
|
||||
//Here is the actual debugger that AMX Mod X uses
|
||||
int AMXAPI amx_DebugCall(AMX *amx, int mode)
|
||||
{
|
||||
//right away, check for debugging
|
||||
AMX_HEADER *hdr;
|
||||
AMX_DBG *p = 0;
|
||||
AMX_TRACE *t = 0;
|
||||
hdr = (AMX_HEADER *)amx->base;
|
||||
if ( !(amx->flags & AMX_FLAG_DEBUG) || !(amx->flags & AMX_FLAG_LINEOPS))
|
||||
return AMX_ERR_NONE;
|
||||
p = (AMX_DBG *)(amx->userdata[0]);
|
||||
if ( !p )
|
||||
return AMX_ERR_NONE;
|
||||
if (mode == 2)
|
||||
{
|
||||
//mode - push onto the stack
|
||||
t = (AMX_TRACE *)malloc(sizeof(AMX_TRACE));
|
||||
memset(t, 0, sizeof(AMX_TRACE));
|
||||
if (!p->head)
|
||||
{
|
||||
p->head = t;
|
||||
t->prev = NULL;
|
||||
} else {
|
||||
t->prev = p->tail;
|
||||
p->tail->next = t;
|
||||
}
|
||||
p->tail = t;
|
||||
t->line = amx->curline;
|
||||
t->file = amx->curfile;
|
||||
} else if (mode == 1) {
|
||||
//mode <0 - pop from the stack
|
||||
t = p->tail;
|
||||
if (t)
|
||||
{
|
||||
p->tail = t->prev;
|
||||
free(t);
|
||||
}
|
||||
if (p->tail == NULL)
|
||||
p->head = NULL;
|
||||
} else if (mode == 0) {
|
||||
AMX_TRACE *m;
|
||||
//mode == 0 - clear stack
|
||||
t = p->head;
|
||||
while (t)
|
||||
{
|
||||
m = t->next;
|
||||
free(t);
|
||||
t = m;
|
||||
}
|
||||
p->head = 0;
|
||||
p->tail = 0;
|
||||
}
|
||||
|
||||
return AMX_ERR_NONE;
|
||||
}
|
||||
|
||||
#if defined JIT
|
||||
#if defined WIN32 || defined __cplusplus
|
||||
extern "C" int AMXAPI getMaxCodeSize(void);
|
||||
@ -508,7 +566,6 @@ static int amx_BrowseRelocate(AMX *amx)
|
||||
cell cip;
|
||||
long codesize;
|
||||
OPCODE op;
|
||||
int debug;
|
||||
int last_sym_global = 0;
|
||||
#if defined __GNUC__ || defined ASM32 || defined JIT
|
||||
cell *opcode_list;
|
||||
@ -535,13 +592,21 @@ static int amx_BrowseRelocate(AMX *amx)
|
||||
assert(OP_MOVS==117);
|
||||
assert(OP_SYMBOL==126);
|
||||
|
||||
/* check the debug hook */
|
||||
amx->dbgcode=DBG_INIT;
|
||||
assert(amx->flags==0);
|
||||
amx->flags=AMX_FLAG_BROWSE;
|
||||
debug= amx->debug(amx)==AMX_ERR_NONE;
|
||||
if (debug)
|
||||
amx->flags|=AMX_FLAG_DEBUG;
|
||||
|
||||
/* check the debug hook */
|
||||
if ((hdr->flags & AMX_FLAG_LINEOPS) && !(hdr->flags & AMX_FLAG_TRACED))
|
||||
{
|
||||
amx->userdata[0] = (AMX_DBG *)malloc(sizeof(AMX_DBG));
|
||||
amx->userdata[1] = (void *)amx_DebugCall;
|
||||
memset(amx->userdata[0], 0, sizeof(AMX_DBG));
|
||||
amx->flags |= AMX_FLAG_LINEOPS;
|
||||
amx->flags |= AMX_FLAG_TRACED;
|
||||
amx->flags |= AMX_FLAG_DEBUG;
|
||||
} else {
|
||||
amx->userdata[0] = 0;
|
||||
amx->userdata[1] = 0;
|
||||
}
|
||||
|
||||
#if defined __GNUC__ || defined ASM32 || defined JIT && !defined __64BIT__
|
||||
amx_Exec(amx, (cell*)&opcode_list, 0, 0);
|
||||
@ -722,21 +787,25 @@ static int amx_BrowseRelocate(AMX *amx)
|
||||
DBGPARAM(amx->curfile);
|
||||
amx->dbgname=(char *)(code+(int)cip);
|
||||
cip+=num - sizeof(cell);
|
||||
if (debug) {
|
||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
||||
amx->dbgcode=DBG_FILE;
|
||||
amx->debug(amx);
|
||||
if (!(hdr->flags & AMX_FLAG_TRACED) && amx->userdata[0] != NULL)
|
||||
{
|
||||
AMX_DBG *pDbg = (AMX_DBG *)(amx->userdata[0]);
|
||||
if (pDbg->numFiles == 0)
|
||||
{
|
||||
pDbg->numFiles++;
|
||||
pDbg->files = (char **)malloc(sizeof(char *) * 1);
|
||||
} else {
|
||||
pDbg->numFiles++;
|
||||
pDbg->files = (char **)realloc(pDbg->files, pDbg->numFiles * sizeof(char*));
|
||||
}
|
||||
pDbg->files[pDbg->numFiles-1] = (char *)malloc((sizeof(char) * strlen(amx->dbgname)) + 1);
|
||||
strcpy(pDbg->files[pDbg->numFiles-1], amx->dbgname);
|
||||
} /* if */
|
||||
break;
|
||||
} /* case */
|
||||
case OP_LINE:
|
||||
DBGPARAM(amx->curline);
|
||||
DBGPARAM(amx->curfile);
|
||||
if (debug) {
|
||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
||||
amx->dbgcode=DBG_LINE;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_SYMBOL: {
|
||||
cell num;
|
||||
@ -746,29 +815,14 @@ static int amx_BrowseRelocate(AMX *amx)
|
||||
amx->dbgname=(char *)(code+(int)cip);
|
||||
cip+=num - 2*sizeof(cell);
|
||||
last_sym_global = (amx->dbgparam >> 8)==0;
|
||||
if (debug && last_sym_global) { /* do global symbols only */
|
||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
||||
amx->dbgcode=DBG_SYMBOL;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
} /* case */
|
||||
case OP_SRANGE:
|
||||
DBGPARAM(amx->dbgaddr); /* dimension level */
|
||||
DBGPARAM(amx->dbgparam); /* length */
|
||||
if (debug && last_sym_global) { /* do global symbols only */
|
||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
||||
amx->dbgcode=DBG_SRANGE;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_SYMTAG:
|
||||
DBGPARAM(amx->dbgparam); /* tag id */
|
||||
if (debug && last_sym_global) { /* do global symbols only */
|
||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
||||
amx->dbgcode=DBG_SYMTAG;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_CASETBL: {
|
||||
cell num;
|
||||
@ -797,6 +851,7 @@ static int amx_BrowseRelocate(AMX *amx)
|
||||
|
||||
amx->flags &= ~AMX_FLAG_BROWSE;
|
||||
amx->flags |= AMX_FLAG_RELOC;
|
||||
amx->flags |= AMX_FLAG_TRACED;
|
||||
return AMX_ERR_NONE;
|
||||
}
|
||||
|
||||
@ -936,8 +991,6 @@ int AMXAPI amx_Init(AMX *amx,void *program)
|
||||
amx->stk=amx->stp;
|
||||
if (amx->callback==NULL)
|
||||
amx->callback=amx_Callback;
|
||||
if (amx->debug==NULL)
|
||||
amx->debug=amx_Debug;
|
||||
amx->curline=0;
|
||||
amx->curfile=0;
|
||||
amx->data=NULL;
|
||||
@ -1755,7 +1808,8 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
ucell codesize;
|
||||
int num,i;
|
||||
va_list ap;
|
||||
int debug;
|
||||
AMX_DEBUGCALL tracer = 0;
|
||||
AMX_DBG *pdbg = 0;
|
||||
|
||||
/* HACK: return label table (for amx_BrowseRelocate) if amx structure
|
||||
* has the AMX_FLAG_BROWSE flag set.
|
||||
@ -1763,7 +1817,12 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
if ((amx->flags & AMX_FLAG_BROWSE)==AMX_FLAG_BROWSE) {
|
||||
assert(sizeof(cell)==sizeof(void *));
|
||||
assert(retval!=NULL);
|
||||
*retval=(cell)((amx->flags & AMX_FLAG_DEBUG)==0 ? amx_opcodelist_nodebug : amx_opcodelist);
|
||||
if (amx->flags & AMX_FLAG_DEBUG)
|
||||
{
|
||||
*retval=(cell)(amx_opcodelist);
|
||||
} else {
|
||||
*retval=(cell)(amx_opcodelist_nodebug);
|
||||
}
|
||||
return 0;
|
||||
} /* if */
|
||||
|
||||
@ -1776,7 +1835,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
if ((amx->flags & AMX_FLAG_RELOC)==0)
|
||||
return AMX_ERR_INIT;
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
debug= (amx->flags & AMX_FLAG_DEBUG)!=0;
|
||||
|
||||
/* set up the registers */
|
||||
hdr=(AMX_HEADER *)amx->base;
|
||||
@ -1818,15 +1876,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
CHKHEAP();
|
||||
init_little_endian();
|
||||
|
||||
if (debug && index!=AMX_EXEC_CONT) {
|
||||
/* set the entry point in the debugger by marking a "call" to the
|
||||
* exported function
|
||||
*/
|
||||
amx->dbgcode=DBG_CALL;
|
||||
amx->dbgaddr=(ucell)((unsigned char*)cip-code);
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
|
||||
/* sanity checks */
|
||||
assert(OP_PUSH_PRI==36);
|
||||
assert(OP_PROC==46);
|
||||
@ -1869,6 +1918,20 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
/* check stack/heap before starting to run */
|
||||
CHKMARGIN();
|
||||
|
||||
if ((amx->flags & AMX_FLAG_DEBUG) && (amx->flags & AMX_FLAG_LINEOPS))
|
||||
{
|
||||
if (amx->userdata[0])
|
||||
{
|
||||
tracer = (AMX_DEBUGCALL)amx->userdata[1];
|
||||
pdbg = (AMX_DBG *)(amx->userdata[0]);
|
||||
if (tracer)
|
||||
{
|
||||
//as a precaution, clear the call stack
|
||||
(tracer)(amx, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* start running */
|
||||
NEXT(cip);
|
||||
|
||||
@ -2132,12 +2195,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
stk+=offs;
|
||||
CHKMARGIN();
|
||||
CHKSTACK();
|
||||
if (debug && offs>0) {
|
||||
amx->dbgcode=DBG_CLRSYM;
|
||||
amx->stk=stk;
|
||||
amx->hea=hea;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_stack_nodebug:
|
||||
GETPARAM(offs);
|
||||
@ -2159,19 +2216,16 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
CHKMARGIN();
|
||||
NEXT(cip);
|
||||
op_ret:
|
||||
if (tracer)
|
||||
{
|
||||
(tracer)(amx, 1);
|
||||
}
|
||||
POP(frm);
|
||||
POP(offs);
|
||||
/* verify the return address */
|
||||
if ((ucell)offs>=codesize)
|
||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||
cip=(cell *)(code+(int)offs);
|
||||
if (debug) {
|
||||
amx->stk=stk;
|
||||
amx->hea=hea;
|
||||
amx->dbgcode=DBG_RETURN;
|
||||
amx->dbgparam=pri; /* store "return value" */
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_ret_nodebug:
|
||||
POP(frm);
|
||||
@ -2182,6 +2236,10 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
cip=(cell *)(code+(int)offs);
|
||||
NEXT(cip);
|
||||
op_retn:
|
||||
if (tracer)
|
||||
{
|
||||
(tracer)(amx, 1);
|
||||
}
|
||||
POP(frm);
|
||||
POP(offs);
|
||||
/* verify the return address */
|
||||
@ -2189,15 +2247,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||
cip=(cell *)(code+(int)offs);
|
||||
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
||||
if (debug) {
|
||||
amx->stk=stk;
|
||||
amx->hea=hea;
|
||||
amx->dbgcode=DBG_RETURN;
|
||||
amx->dbgparam=pri; /* store "return value" */
|
||||
amx->debug(amx);
|
||||
amx->dbgcode=DBG_CLRSYM;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_retn_nodebug:
|
||||
POP(frm);
|
||||
@ -2209,26 +2258,24 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
||||
NEXT(cip);
|
||||
op_call:
|
||||
if (tracer)
|
||||
{
|
||||
(tracer)(amx, 2);
|
||||
}
|
||||
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* push address behind instruction */
|
||||
cip=JUMPABS(code, cip); /* jump to the address */
|
||||
if (debug) {
|
||||
amx->dbgcode=DBG_CALL;
|
||||
amx->dbgaddr=(ucell)((unsigned char*)cip-code);
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_call_nodebug:
|
||||
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* push address behind instruction */
|
||||
cip=JUMPABS(code, cip); /* jump to the address */
|
||||
NEXT(cip);
|
||||
op_call_pri:
|
||||
if (tracer)
|
||||
{
|
||||
(tracer)(amx, 2);
|
||||
}
|
||||
PUSH((unsigned char *)cip-code);
|
||||
cip=(cell *)(code+(int)pri);
|
||||
if (debug) {
|
||||
amx->dbgcode=DBG_CALL;
|
||||
amx->dbgaddr=pri;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_call_pri_nodebug:
|
||||
PUSH((unsigned char *)cip-code);
|
||||
@ -2560,12 +2607,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
amx->pri=pri;
|
||||
amx->alt=alt;
|
||||
amx->cip=(cell)((unsigned char*)cip-code);
|
||||
if (debug) {
|
||||
amx->dbgcode=DBG_TERMINATE;
|
||||
amx->dbgaddr=(cell)((unsigned char *)cip-code);
|
||||
amx->dbgparam=offs;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
if (offs==AMX_ERR_SLEEP) {
|
||||
amx->reset_stk=reset_stk;
|
||||
amx->reset_hea=reset_hea;
|
||||
@ -2642,23 +2683,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
GETPARAM(amx->curline);
|
||||
GETPARAM(amx->curfile);
|
||||
if (debug) {
|
||||
amx->frm=frm;
|
||||
amx->stk=stk;
|
||||
amx->hea=hea;
|
||||
amx->dbgcode=DBG_LINE;
|
||||
num=amx->debug(amx);
|
||||
if (num!=AMX_ERR_NONE) {
|
||||
if (num==AMX_ERR_SLEEP) {
|
||||
amx->pri=pri;
|
||||
amx->alt=alt;
|
||||
amx->cip=(cell)((unsigned char*)cip-code);
|
||||
amx->reset_stk=reset_stk;
|
||||
amx->reset_hea=reset_hea;
|
||||
} /* if */
|
||||
ABORT(amx,num);
|
||||
} /* if */
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_line_nodebug:
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
@ -2674,10 +2698,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
cip=(cell *)((unsigned char *)cip + (int)offs - 2*sizeof(cell));
|
||||
amx->dbgcode=DBG_SYMBOL;
|
||||
assert((amx->dbgparam >> 8)>0); /* local symbols only */
|
||||
if (debug) {
|
||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_symbol_nodebug:
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
@ -2689,10 +2709,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
GETPARAM(amx->dbgaddr); /* dimension level */
|
||||
GETPARAM(amx->dbgparam); /* length */
|
||||
amx->dbgcode=DBG_SRANGE;
|
||||
if (debug) {
|
||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_srange_nodebug:
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
@ -2702,10 +2718,6 @@ static void *amx_opcodelist_nodebug[] = {
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
GETPARAM(amx->dbgparam); /* tag id */
|
||||
amx->dbgcode=DBG_SYMTAG;
|
||||
if (debug) {
|
||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
NEXT(cip);
|
||||
op_symtag_nodebug:
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
@ -2798,7 +2810,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
ucell codesize;
|
||||
int i;
|
||||
va_list ap;
|
||||
int debug;
|
||||
#if defined ASM32 || defined JIT
|
||||
#ifdef __WATCOMC__
|
||||
#pragma aux amx_opcodelist "_*"
|
||||
@ -2810,6 +2821,8 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
cell offs;
|
||||
int num;
|
||||
#endif
|
||||
AMX_DEBUGCALL tracer = 0;
|
||||
AMX_DBG *pdbg = 0;
|
||||
|
||||
#if defined ASM32 || defined JIT
|
||||
/* HACK: return label table (for amx_BrowseRelocate) if amx structure
|
||||
@ -2825,12 +2838,27 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
*/
|
||||
*retval=(cell)amx_opcodelist;
|
||||
#else
|
||||
*retval=(cell)((amx->flags & AMX_FLAG_DEBUG)==0 ? amx_opcodelist_nodebug : amx_opcodelist);
|
||||
if (amx->flags & AMX_FLAG_DEBUG)
|
||||
{
|
||||
*retval=(cell)(amx_opcodelist);
|
||||
} else {
|
||||
*retval=(cell)(amx_opcodelist_nodebug);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
} /* if */
|
||||
#endif
|
||||
|
||||
|
||||
if ((amx->flags & AMX_FLAG_DEBUG) && (amx->flags & AMX_FLAG_LINEOPS))
|
||||
{
|
||||
if (amx->userdata[0])
|
||||
{
|
||||
tracer = (AMX_DEBUGCALL)amx->userdata[1];
|
||||
pdbg = (AMX_DBG *)(amx->userdata[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (amx->callback==NULL)
|
||||
return AMX_ERR_CALLBACK;
|
||||
i=amx_Register(amx,NULL,0); /* verify that all natives are registered */
|
||||
@ -2840,8 +2868,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
if ((amx->flags & AMX_FLAG_RELOC)==0)
|
||||
return AMX_ERR_INIT;
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
debug= (amx->flags & AMX_FLAG_DEBUG)!=0;
|
||||
|
||||
/* set up the registers */
|
||||
hdr=(AMX_HEADER *)amx->base;
|
||||
assert(hdr->magic==AMX_MAGIC);
|
||||
@ -2882,15 +2908,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
CHKHEAP();
|
||||
init_little_endian();
|
||||
|
||||
if (debug && index!=AMX_EXEC_CONT) {
|
||||
/* set the entry point in the debugger by marking a "call" to the
|
||||
* exported function
|
||||
*/
|
||||
amx->dbgcode=DBG_CALL;
|
||||
amx->dbgaddr=(ucell)((unsigned char *)cip-code);
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
|
||||
/* sanity checks */
|
||||
assert(OP_PUSH_PRI==36);
|
||||
assert(OP_PROC==46);
|
||||
@ -3228,12 +3245,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
stk+=offs;
|
||||
CHKMARGIN();
|
||||
CHKSTACK();
|
||||
if (debug && offs>0) {
|
||||
amx->dbgcode=DBG_CLRSYM;
|
||||
amx->hea=hea;
|
||||
amx->stk=stk;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_HEAP:
|
||||
GETPARAM(offs);
|
||||
@ -3254,13 +3265,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
if ((ucell)offs>=codesize)
|
||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||
cip=(cell *)(code+(int)offs);
|
||||
if (debug) {
|
||||
amx->stk=stk;
|
||||
amx->hea=hea;
|
||||
amx->dbgcode=DBG_RETURN;
|
||||
amx->dbgparam=pri; /* store "return value" */
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_RETN:
|
||||
POP(frm);
|
||||
@ -3271,33 +3275,22 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
cip=(cell *)(code+(int)offs);
|
||||
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
||||
amx->stk=stk;
|
||||
if (debug) {
|
||||
amx->stk=stk;
|
||||
amx->hea=hea;
|
||||
amx->dbgcode=DBG_RETURN;
|
||||
amx->dbgparam=pri; /* store "return value" */
|
||||
amx->debug(amx);
|
||||
amx->dbgcode=DBG_CLRSYM;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
if (tracer)
|
||||
{
|
||||
(tracer)(amx, 1);
|
||||
}
|
||||
break;
|
||||
case OP_CALL:
|
||||
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* skip address */
|
||||
cip=JUMPABS(code, cip); /* jump to the address */
|
||||
if (debug) {
|
||||
amx->dbgcode=DBG_CALL;
|
||||
amx->dbgaddr=(ucell)((unsigned char *)cip-code);
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
if (tracer)
|
||||
{
|
||||
(tracer)(amx, 2);
|
||||
}
|
||||
break;
|
||||
case OP_CALL_PRI:
|
||||
PUSH((unsigned char *)cip-code);
|
||||
cip=(cell *)(code+(int)pri);
|
||||
if (debug) {
|
||||
amx->dbgcode=DBG_CALL;
|
||||
amx->dbgaddr=pri;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_JUMP:
|
||||
/* since the GETPARAM() macro modifies cip, you cannot
|
||||
@ -3625,12 +3618,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
amx->pri=pri;
|
||||
amx->alt=alt;
|
||||
amx->cip=(cell)((unsigned char*)cip-code);
|
||||
if (debug) {
|
||||
amx->dbgcode=DBG_TERMINATE;
|
||||
amx->dbgaddr=(cell)((unsigned char *)cip-code);
|
||||
amx->dbgparam=offs;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
if (offs==AMX_ERR_SLEEP) {
|
||||
amx->reset_stk=reset_stk;
|
||||
amx->reset_hea=reset_hea;
|
||||
@ -3707,23 +3694,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
GETPARAM(amx->curline);
|
||||
GETPARAM(amx->curfile);
|
||||
if (debug) {
|
||||
amx->frm=frm;
|
||||
amx->stk=stk;
|
||||
amx->hea=hea;
|
||||
amx->dbgcode=DBG_LINE;
|
||||
num=amx->debug(amx);
|
||||
if (num!=AMX_ERR_NONE) {
|
||||
if (num==AMX_ERR_SLEEP) {
|
||||
amx->pri=pri;
|
||||
amx->alt=alt;
|
||||
amx->cip=(cell)((unsigned char*)cip-code);
|
||||
amx->reset_stk=reset_stk;
|
||||
amx->reset_hea=reset_hea;
|
||||
} /* if */
|
||||
ABORT(amx,num);
|
||||
} /* if */
|
||||
} /* if */
|
||||
break;
|
||||
case OP_SYMBOL:
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
@ -3733,30 +3703,15 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||
amx->dbgname=(char *)cip;
|
||||
cip=(cell *)((unsigned char *)cip + (int)offs - 2*sizeof(cell));
|
||||
assert((amx->dbgparam >> 8)>0); /* local symbols only */
|
||||
if (debug) {
|
||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
||||
amx->dbgcode=DBG_SYMBOL;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_SRANGE:
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
GETPARAM(amx->dbgaddr); /* dimension level */
|
||||
GETPARAM(amx->dbgparam); /* length */
|
||||
if (debug) {
|
||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
||||
amx->dbgcode=DBG_SRANGE;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_SYMTAG:
|
||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||
GETPARAM(amx->dbgparam); /* tag id */
|
||||
if (debug) {
|
||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
||||
amx->dbgcode=DBG_SYMTAG;
|
||||
amx->debug(amx);
|
||||
} /* if */
|
||||
break;
|
||||
case OP_JUMP_PRI:
|
||||
cip=(cell *)(code+(int)pri);
|
||||
|
@ -134,6 +134,7 @@ typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params);
|
||||
typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index,
|
||||
cell *result, cell *params);
|
||||
typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
|
||||
typedef int (AMXAPI *AMX_DEBUGCALL)(struct tagAMX *amx, int mode);
|
||||
#if !defined _FAR
|
||||
#define _FAR
|
||||
#endif
|
||||
@ -246,6 +247,23 @@ typedef struct tagAMX_HEADER {
|
||||
} AMX_HEADER PACKED;
|
||||
#define AMX_MAGIC 0xf1e0
|
||||
|
||||
//double linked list for stack
|
||||
typedef struct tagAMX_TRACE
|
||||
{
|
||||
cell line PACKED;
|
||||
cell file PACKED;
|
||||
struct tagAMX_TRACE *next PACKED;
|
||||
struct tagAMX_TRACE *prev PACKED;
|
||||
} AMX_TRACE PACKED;
|
||||
|
||||
typedef struct tagAMX_DBG
|
||||
{
|
||||
int32_t numFiles PACKED; /* number of chars in array */
|
||||
char **files PACKED; /* array of files */
|
||||
AMX_TRACE *head PACKED; /* begin of link list */
|
||||
AMX_TRACE *tail PACKED; /* end of link list */
|
||||
} AMX_DBG PACKED;
|
||||
|
||||
enum {
|
||||
AMX_ERR_NONE,
|
||||
/* reserve the first 15 error codes for exit codes of the abstract machine */
|
||||
@ -294,6 +312,7 @@ enum {
|
||||
#define AMX_FLAG_BIGENDIAN 0x08 /* big endian encoding */
|
||||
#define AMX_FLAG_NOCHECKS 0x10 /* no array bounds checking */
|
||||
#define AMX_FLAG_LINEOPS 0x20 /* line ops are parsed by the JIT [loadtime only flag] */
|
||||
#define AMX_FLAG_TRACED 0x40 /* the file has already been traced */
|
||||
#define AMX_FLAG_BROWSE 0x4000 /* browsing/relocating or executing */
|
||||
#define AMX_FLAG_RELOC 0x8000 /* jump/call addresses relocated */
|
||||
|
||||
@ -348,6 +367,7 @@ int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, cell *params);
|
||||
int AMXAPI amx_Cleanup(AMX *amx);
|
||||
int AMXAPI amx_Clone(AMX *amxClone, AMX *amxSource, void *data);
|
||||
int AMXAPI amx_Debug(AMX *amx); /* default debug procedure, does nothing */
|
||||
int AMXAPI amx_DebugCall(AMX *amx, int mode);
|
||||
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...);
|
||||
int AMXAPI amx_Execv(AMX *amx, cell *retval, int index, int numparams, cell params[]);
|
||||
int AMXAPI amx_FindNative(AMX *amx, const char *name, int *index);
|
||||
|
@ -117,8 +117,14 @@
|
||||
_dbgaddr EQU 38h ;DD ?
|
||||
_dbgparam EQU 3ch ;DD ?
|
||||
_dbgname EQU 40h ;DD ?
|
||||
_usertags EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_usertags1 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_usertags2 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_usertags3 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_usertags4 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata1 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata2 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata3 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_userdata4 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||
_error EQU 64h ;DD ?
|
||||
_pri EQU 68h ;DD ?
|
||||
_alt EQU 6ch ;DD ?
|
||||
@ -171,6 +177,8 @@
|
||||
|
||||
AMX_FLAG_CHAR16 EQU 0001h ; characters are 16-bit
|
||||
AMX_FLAG_DEBUG EQU 0002h ; symbolic info. available
|
||||
AMX_FLAG_LINEOPS EQU 0020h ; line op information
|
||||
AMX_FLAG_TRACED EQU 0040h ;
|
||||
AMX_FLAG_BROWSE EQU 4000h
|
||||
AMX_FLAG_RELOC EQU 8000h ; jump/call addresses relocated
|
||||
|
||||
|
@ -2304,16 +2304,16 @@ static cell AMX_NATIVE_CALL get_module(AMX *amx, cell *params)
|
||||
if ((*moduleIter).isAmxx())
|
||||
{
|
||||
const amxx_module_info_s *info = (*moduleIter).getInfoNew();
|
||||
set_amxstring(amx, params[2], info->name, params[3]);
|
||||
set_amxstring(amx, params[4], info->author, params[5]);
|
||||
set_amxstring(amx, params[6], info->version, params[7]);
|
||||
set_amxstring(amx, params[2], info && info->name ? info->name : "unk", params[3]);
|
||||
set_amxstring(amx, params[4], info && info->author ? info->author : "unk", params[5]);
|
||||
set_amxstring(amx, params[6], info && info->version ? info->version : "unk", params[7]);
|
||||
}
|
||||
else
|
||||
{
|
||||
module_info_s *info = (*moduleIter).getInfo();
|
||||
set_amxstring(amx, params[2], info->name, params[3]);
|
||||
set_amxstring(amx, params[4], info->author, params[5]);
|
||||
set_amxstring(amx, params[6], info->version, params[7]);
|
||||
set_amxstring(amx, params[2], info && info->name ? info->name : "unk", params[3]);
|
||||
set_amxstring(amx, params[4], info && info->author ? info->author : "unk", params[5]);
|
||||
set_amxstring(amx, params[6], info && info->version ? info->version : "unk", params[7]);
|
||||
}
|
||||
|
||||
// compatibility problem possible
|
||||
@ -2442,7 +2442,7 @@ static cell AMX_NATIVE_CALL callfunc_end(AMX *amx, cell *params)
|
||||
// actual call
|
||||
if ((err = amx_Execv(plugin->getAMX(), &retVal, func, curParam, gparams)) != AMX_ERR_NONE)
|
||||
{
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err, curPlugin->getAMX()->curline, curPlugin->getName());
|
||||
LogError(amx, err, "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -255,6 +255,7 @@ void free_amxmemory(void **ptr);
|
||||
// get_localinfo
|
||||
const char* get_localinfo( const char* name , const char* def );
|
||||
cell AMX_NATIVE_CALL require_module(AMX *amx, cell *params);
|
||||
void LogError(AMX *amx, int err, const char *fmt, ...);
|
||||
|
||||
enum ModuleCallReason
|
||||
{
|
||||
|
@ -87,6 +87,7 @@ float g_game_restarting;
|
||||
float g_game_timeleft;
|
||||
float g_task_time;
|
||||
float g_auth_time;
|
||||
bool g_initialized = false;
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
float g_next_memreport_time;
|
||||
@ -105,7 +106,7 @@ int g_srvindex;
|
||||
|
||||
cvar_t init_amxmodx_version = {"amxmodx_version", "", FCVAR_SERVER | FCVAR_SPONLY};
|
||||
cvar_t init_amxmodx_modules = {"amxmodx_modules", "", FCVAR_SPONLY};
|
||||
cvar_t init_amxmodx_debug = {"amx_debug", "", FCVAR_SPONLY};
|
||||
cvar_t init_amxmodx_debug = {"amx_debug", "1", FCVAR_SPONLY};
|
||||
cvar_t* amxmodx_version = NULL;
|
||||
cvar_t* amxmodx_modules = NULL;
|
||||
cvar_t* hostname = NULL;
|
||||
@ -200,6 +201,9 @@ const char* get_localinfo( const char* name , const char* def )
|
||||
// Initialize AMX stuff and load it's plugins from plugins.ini list
|
||||
// Call precache forward function from plugins
|
||||
int C_Spawn( edict_t *pent ) {
|
||||
if (g_initialized)
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
g_initialized = true;
|
||||
g_forcedmodules = false;
|
||||
g_forcedsounds = false;
|
||||
|
||||
@ -297,9 +301,6 @@ int C_Spawn( edict_t *pent ) {
|
||||
}
|
||||
|
||||
|
||||
// HACKHACK:
|
||||
// Make sure this function wont be called anymore
|
||||
g_FakeMeta.m_Plugins.begin()->GetDllFuncTable().pfnSpawn = NULL;
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
}
|
||||
|
||||
@ -441,20 +442,15 @@ void C_ServerDeactivate() {
|
||||
// However leave AMX modules which are loaded only once
|
||||
void C_ServerDeactivate_Post() {
|
||||
|
||||
// HACKHACK:
|
||||
// Make sure the spawn function will be called again
|
||||
// pft that's not really a hack
|
||||
g_FakeMeta.m_Plugins.begin()->GetDllFuncTable().pfnSpawn = C_Spawn;
|
||||
|
||||
detachReloadModules();
|
||||
g_auth.clear();
|
||||
g_forwards.clear();
|
||||
g_commands.clear();
|
||||
g_forcemodels.clear();
|
||||
g_forcesounds.clear();
|
||||
g_forcegeneric.clear();
|
||||
g_grenades.clear();
|
||||
g_tasksMngr.clear();
|
||||
g_forwards.clear();
|
||||
g_logevents.clearLogEvents();
|
||||
g_events.clearEvents();
|
||||
g_menucmds.clear();
|
||||
@ -464,7 +460,6 @@ void C_ServerDeactivate_Post() {
|
||||
g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxmodx/data")));
|
||||
g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxmodx/data")));
|
||||
g_langMngr.Clear();
|
||||
|
||||
//clear module name cache
|
||||
while (!CurModuleList.empty())
|
||||
{
|
||||
@ -524,6 +519,7 @@ void C_ServerDeactivate_Post() {
|
||||
}
|
||||
#endif // MEMORY_TEST
|
||||
|
||||
g_initialized = false;
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
@ -642,8 +638,7 @@ void C_ClientCommand( edict_t *pEntity ) {
|
||||
{
|
||||
|
||||
if ((err =amx_Exec((*aa).getPlugin()->getAMX(), &ret , (*aa).getFunction() , 3, pPlayer->index, (*aa).getFlags(),(*aa).getId() )) != AMX_ERR_NONE)
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
||||
err,(*aa).getPlugin()->getAMX()->curline,(*aa).getPlugin()->getName());
|
||||
LogError((*aa).getPlugin()->getAMX(), err, "");
|
||||
|
||||
if ( ret & 2 ) result = MRES_SUPERCEDE;
|
||||
if ( ret & 1 ) RETURN_META(MRES_SUPERCEDE);
|
||||
@ -682,8 +677,7 @@ void C_ClientCommand( edict_t *pEntity ) {
|
||||
{
|
||||
|
||||
if ( ( err = amx_Exec((*a).getPlugin()->getAMX(), &ret ,(*a).getFunction() , 2, pPlayer->index,pressed_key)) != AMX_ERR_NONE)
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
||||
err,(*a).getPlugin()->getAMX()->curline,(*a).getPlugin()->getName());
|
||||
LogError((*a).getPlugin()->getAMX(), err, "");
|
||||
|
||||
if ( ret & 2 ) result = MRES_SUPERCEDE;
|
||||
if ( ret & 1 ) RETURN_META(MRES_SUPERCEDE);
|
||||
@ -888,7 +882,7 @@ void C_MessageEnd_Post(void) {
|
||||
{
|
||||
|
||||
if ((err = amx_Exec((*a).getPlugin()->getAMX(), NULL , (*a).getFunction() , 1, mPlayerIndex /*g_events.getArgInteger(0)*/ )) != AMX_ERR_NONE)
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",err,(*a).getPlugin()->getAMX()->curline,(*a).getPlugin()->getName());
|
||||
LogError((*a).getPlugin()->getAMX(), err, "");
|
||||
|
||||
|
||||
++a;
|
||||
@ -1054,10 +1048,10 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
|
||||
g_mod_name.assign(a);
|
||||
|
||||
// ###### Print short GPL
|
||||
print_srvconsole( "\n AMX Mod X version %s Copyright (c) 2004 AMX Mod X Development Team \n"
|
||||
" AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'.\n", AMX_VERSION);
|
||||
print_srvconsole( " This is free software and you are welcome to redistribute it under \n"
|
||||
" certain conditions; type 'amxx gpl' for details.\n \n");
|
||||
print_srvconsole( "\n AMX Mod X version %s Copyright (c) 2004 AMX Mod X Development Team \n"
|
||||
" AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'.\n", AMX_VERSION);
|
||||
print_srvconsole( " This is free software and you are welcome to redistribute it under \n"
|
||||
" certain conditions; type 'amxx gpl' for details.\n \n");
|
||||
|
||||
// ###### Load custom path configuration
|
||||
Vault amx_config;
|
||||
|
@ -148,13 +148,12 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
||||
return (amx->error = AMX_ERR_FORMAT);
|
||||
}
|
||||
|
||||
#ifdef JIT
|
||||
if ( ((int)CVAR_GET_FLOAT("amx_debug") == 2 || (debug && (int)CVAR_GET_FLOAT("amx_debug"))) )
|
||||
if ( (int)CVAR_GET_FLOAT("amx_debug") >= 2 || debug)
|
||||
{
|
||||
//automatic debug mode
|
||||
hdr->flags |= AMX_FLAG_LINEOPS;
|
||||
hdr->flags |= AMX_FLAG_DEBUG;
|
||||
}
|
||||
#endif
|
||||
|
||||
int err;
|
||||
memset(amx, 0, sizeof(*amx));
|
||||
@ -1110,6 +1109,121 @@ void MNF_Log(const char *fmt, ...)
|
||||
AMXXLOG_Log("%s", msg);
|
||||
}
|
||||
|
||||
//by BAILOPAN
|
||||
// generic error printing routine
|
||||
void GenericError(AMX *amx, int err, int line, char buf[], const char *file)
|
||||
{
|
||||
static const char *amx_errs[] =
|
||||
{
|
||||
NULL,
|
||||
"forced exit",
|
||||
"assertion failed",
|
||||
"stack error",
|
||||
"index out of bounds",
|
||||
"memory access",
|
||||
"invalid instruction",
|
||||
"stack low",
|
||||
"heap low",
|
||||
"callback",
|
||||
"native",
|
||||
"divide",
|
||||
"sleep",
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"out of memory", //16
|
||||
"bad file format",
|
||||
"bad file version",
|
||||
"function not found",
|
||||
"invalid entry point",
|
||||
"debugger cannot run",
|
||||
"plugin un or re-initialized",
|
||||
"userdata table full",
|
||||
"JIT failed to initialize",
|
||||
"parameter error",
|
||||
"domain error",
|
||||
};
|
||||
//does this plugin have line ops?
|
||||
const char *geterr = NULL;
|
||||
if (err > 26 || err < 0)
|
||||
geterr = NULL;
|
||||
else
|
||||
geterr = amx_errs[err];
|
||||
if (!(amx->flags & AMX_FLAG_LINEOPS))
|
||||
{
|
||||
if (geterr == NULL)
|
||||
{
|
||||
sprintf(buf, "Run time error %d (plugin \"%s\" - debug not enabled).", err, g_plugins.findPluginFast(amx)->getName());
|
||||
} else {
|
||||
sprintf(buf, "Run time error %d (%s) (plugin \"%s\") - debug not enabled.", err, geterr, g_plugins.findPluginFast(amx)->getName());
|
||||
}
|
||||
} else {
|
||||
if (geterr == NULL)
|
||||
{
|
||||
sprintf(buf, "Run time error %d on line %d (%s \"%s\").", err, line, (file?"file":"plugin"), (file?file:g_plugins.findPluginFast(amx)->getName()));
|
||||
} else {
|
||||
sprintf(buf, "Run time error %d (%s) on line %d (%s \"%s\").", err, geterr, line, (file?"file":"plugin"), (file?file:g_plugins.findPluginFast(amx)->getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//by BAILOPAN
|
||||
// debugger engine front end
|
||||
void LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
{
|
||||
//does this plugin have debug info?
|
||||
va_list arg;
|
||||
AMX_DBG *dbg = (AMX_DBG *)(amx->userdata[0]);
|
||||
static char buf[1024];
|
||||
static char vbuf[1024];
|
||||
*buf = 0;
|
||||
*vbuf = 0;
|
||||
|
||||
va_start(arg, fmt);
|
||||
vsprintf(vbuf, fmt, arg);
|
||||
va_end(arg);
|
||||
|
||||
if (!dbg || !(dbg->tail))
|
||||
{
|
||||
GenericError(amx, err, amx->curline, buf, NULL);
|
||||
AMXXLOG_Log("[AMXX] %s %s", buf, vbuf);
|
||||
} else {
|
||||
AMX_TRACE *t = dbg->tail;
|
||||
AMX_DEBUGCALL tracer = (AMX_DEBUGCALL)(amx->userdata[1]);
|
||||
//actuall
|
||||
cell line = amx->curline;
|
||||
cell file = amx->curfile;
|
||||
int i = 0;
|
||||
if (file >= dbg->numFiles || file < 0)
|
||||
{
|
||||
GenericError(amx, err, line, buf, NULL);
|
||||
} else {
|
||||
GenericError(amx, err, line, buf, dbg->files[file]);
|
||||
}
|
||||
AMXXLOG_Log("[AMXX] %s", buf);
|
||||
if (*vbuf)
|
||||
{
|
||||
AMXXLOG_Log("[AMXX] %s", vbuf);
|
||||
}
|
||||
AMXXLOG_Log("[AMXX] Debug Trace =>");
|
||||
//log the error right away
|
||||
while (t != NULL)
|
||||
{
|
||||
line = t->line;
|
||||
file = t->file;
|
||||
if (file >= dbg->numFiles)
|
||||
{
|
||||
AMXXLOG_Log("[AMXX] [%d] Line %d, File \"%s\"", i++, line, g_plugins.findPluginFast(amx)->getName());
|
||||
} else {
|
||||
AMXXLOG_Log("[AMXX] [%d] Line %d, File \"%s\"", i++, line, dbg->files[file]);
|
||||
}
|
||||
if (tracer)
|
||||
(tracer)(amx, 1); //pop
|
||||
t = dbg->tail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MNF_MergeDefinitionFile(const char *file)
|
||||
{
|
||||
g_langMngr.MergeDefinitionFile(file);
|
||||
@ -1131,6 +1245,14 @@ const char *MNF_Format(const char *fmt, ...)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
const char *MNF_GetPlayerTeam(int id)
|
||||
{
|
||||
if (id < 1 || id > gpGlobals->maxClients)
|
||||
return NULL;
|
||||
|
||||
return (GET_PLAYER_POINTER_I(id)->team.c_str());
|
||||
}
|
||||
|
||||
#ifndef MEMORY_TEST
|
||||
void *MNF_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, const unsigned int allocationType, const size_t reportedSize)
|
||||
{
|
||||
@ -1148,6 +1270,18 @@ void MNF_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
||||
}
|
||||
#endif
|
||||
|
||||
// 09/18/2004 : added these two funcs that default to copyBack=false so we don't break all modules
|
||||
cell MNF_PrepareCellArray(cell *ptr, unsigned int size)
|
||||
{
|
||||
return prepareCellArray(ptr, size, false);
|
||||
}
|
||||
|
||||
cell MNF_PrepareCharArray(char *ptr, unsigned int size)
|
||||
{
|
||||
return prepareCharArray(ptr, size, false);
|
||||
}
|
||||
|
||||
|
||||
// Fnptr Request function for the new interface
|
||||
const char *g_LastRequestedFunc = NULL;
|
||||
#define REGISTER_FUNC(name, func) { name, (void*)func },
|
||||
@ -1165,6 +1299,7 @@ void *Module_ReqFnptr(const char *funcName)
|
||||
REGISTER_FUNC("PrintSrvConsole", print_srvconsole)
|
||||
REGISTER_FUNC("GetModname", MNF_GetModname)
|
||||
REGISTER_FUNC("Log", MNF_Log)
|
||||
REGISTER_FUNC("LogError", LogError)
|
||||
REGISTER_FUNC("MergeDefinitionFile", MNF_MergeDefinitionFile)
|
||||
REGISTER_FUNC("Format", MNF_Format)
|
||||
|
||||
@ -1199,8 +1334,10 @@ void *Module_ReqFnptr(const char *funcName)
|
||||
REGISTER_FUNC("RegisterSPForwardByName", registerSPForwardByName)
|
||||
REGISTER_FUNC("UnregisterSPForward", unregisterSPForward)
|
||||
REGISTER_FUNC("ExecuteForward", executeForwards)
|
||||
REGISTER_FUNC("PrepareCellArray", prepareCellArray)
|
||||
REGISTER_FUNC("PrepareCharArray", prepareCharArray)
|
||||
REGISTER_FUNC("PrepareCellArray", MNF_PrepareCellArray)
|
||||
REGISTER_FUNC("PrepareCharArray", MNF_PrepareCharArray)
|
||||
REGISTER_FUNC("PrepareCellArrayA", prepareCellArray)
|
||||
REGISTER_FUNC("PrepareCharArrayA", prepareCharArray)
|
||||
|
||||
// Player
|
||||
REGISTER_FUNC("GetPlayerFlags", MNF_GetPlayerFlags)
|
||||
@ -1214,6 +1351,7 @@ void *Module_ReqFnptr(const char *funcName)
|
||||
REGISTER_FUNC("GetPlayerPlayTime", MNF_GetPlayerPlayTime)
|
||||
REGISTER_FUNC("GetPlayerCurweapon", MNF_GetPlayerCurweapon)
|
||||
REGISTER_FUNC("GetPlayerTeamID", MNF_GetPlayerTeamID)
|
||||
REGISTER_FUNC("GetPlayerTeam", MNF_GetPlayerTeam)
|
||||
REGISTER_FUNC("GetPlayerDeaths", MNF_GetPlayerDeaths)
|
||||
REGISTER_FUNC("GetPlayerFrags", MNF_GetPlayerFrags)
|
||||
REGISTER_FUNC("GetPlayerMenu", MNF_GetPlayerMenu)
|
||||
|
804
amxmodx/msvc/amxmodx_mm.vcproj
Executable file
804
amxmodx/msvc/amxmodx_mm.vcproj
Executable file
@ -0,0 +1,804 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="amxmodx"
|
||||
ProjectGUID="{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
StructMemberAlignment="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\debug/amxmodx.pch"
|
||||
AssemblerListingLocation=".\debug/"
|
||||
ObjectFile=".\debug/"
|
||||
ProgramDataBaseFileName=".\debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||
OutputFile="debug/amxmodx_mm.dll"
|
||||
Version="0.1"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\debug/amxx_mm.pdb"
|
||||
ImportLibrary=".\debug/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\release/amxmodx.pch"
|
||||
AssemblerListingLocation=".\release/"
|
||||
ObjectFile=".\release/"
|
||||
ProgramDataBaseFileName=".\release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||
OutputFile="release/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\release/amxx_mm.pdb"
|
||||
ImportLibrary=".\release/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MemtestDebug|Win32"
|
||||
OutputDirectory="MemtestDebug"
|
||||
IntermediateDirectory="MemtestDebug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
StructMemberAlignment="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\memtestdebug/amxmodx.pch"
|
||||
AssemblerListingLocation=".\memtestdebug/"
|
||||
ObjectFile=".\memtestdebug/"
|
||||
ProgramDataBaseFileName=".\memtestdebug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||
OutputFile="memtestdebug/amxmodx_mm.dll"
|
||||
Version="0.1"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\memtestdebug/amxx_mm.pdb"
|
||||
ImportLibrary=".\memtestdebug/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MemtestRelease|Win32"
|
||||
OutputDirectory="MemtestRelease"
|
||||
IntermediateDirectory="MemtestRelease"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\memtestrelease/amxmodx.pch"
|
||||
AssemblerListingLocation=".\memtestrelease/"
|
||||
ObjectFile=".\memtestrelease/"
|
||||
ProgramDataBaseFileName=".\memtestrelease/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||
OutputFile="memtestrelease/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\memtestrelease/amxx_mm.pdb"
|
||||
ImportLibrary=".\memtestrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="JITDebug|Win32"
|
||||
OutputDirectory="JITDebug"
|
||||
IntermediateDirectory="JITDebug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
StructMemberAlignment="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\jitdebug/amxmodx.pch"
|
||||
AssemblerListingLocation=".\jitdebug/"
|
||||
ObjectFile=".\jitdebug/"
|
||||
ProgramDataBaseFileName=".\jitdebug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||
OutputFile="jitdebug/amxmodx_mm.dll"
|
||||
Version="0.1"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\jitdebug/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitdebug/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="JITRelease|Win32"
|
||||
OutputDirectory="JITRelease"
|
||||
IntermediateDirectory="JITRelease"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\jitrelease/amxmodx.pch"
|
||||
AssemblerListingLocation=".\jitrelease/"
|
||||
ObjectFile=".\jitrelease/"
|
||||
ProgramDataBaseFileName=".\jitrelease/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="..\jit\jits.obj ..\zlib\zlib.lib"
|
||||
OutputFile="jitrelease/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\jitrelease/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="JITMemtestRelease|Win32"
|
||||
OutputDirectory="JITMemtestRelease"
|
||||
IntermediateDirectory="JITMemtestRelease"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST;JIT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\jitmemtestrelease/amxmodx.pch"
|
||||
AssemblerListingLocation=".\jitmemtestrelease/"
|
||||
ObjectFile=".\jitmemtestrelease/"
|
||||
ProgramDataBaseFileName=".\jitmemtestrelease/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||
OutputFile="jitmemtestrelease/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\jitmemtestrelease/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitmemtestrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="MaximalSpeed|Win32"
|
||||
OutputDirectory="MaximalSpeed"
|
||||
IntermediateDirectory="MaximalSpeed"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="2"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="amxmodx.h"
|
||||
PrecompiledHeaderFile=".\MaximalSpeed/amxmodx.pch"
|
||||
AssemblerListingLocation=".\MaximalSpeed/"
|
||||
ObjectFile=".\MaximalSpeed/"
|
||||
ProgramDataBaseFileName=".\MaximalSpeed/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||
OutputFile="MaximalSpeed/amxmodx_mm.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\MaximalSpeede/amxx_mm.pdb"
|
||||
ImportLibrary=".\jitrelease/amxx_mm.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="..\amx.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxcore.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxmodx.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxtime.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxxfile.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxxlog.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CCmd.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CEvent.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CFile.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CForward.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CLang.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CLogEvent.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CMenu.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CMisc.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CModule.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CPlugin.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CTask.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CVault.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\emsg.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\fakemeta.cpp">
|
||||
<FileConfiguration
|
||||
Name="MemtestDebug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GeneratePreprocessedFile="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\file.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\float.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\md5.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\meta_api.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\modules.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\power.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\srvcmd.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\string.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\strptime.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\util.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\vault.cpp">
|
||||
</File>
|
||||
<Filter
|
||||
Name="mmgr"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\mmgr\mmgr.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITDebug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="JITRelease|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MaximalSpeed|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="..\amx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxmodx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxxfile.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\amxxlog.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CCmd.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CEvent.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CFile.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CForward.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CLang.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CList.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CLogEvent.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CMenu.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CMisc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CModule.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CPlugin.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CQueue.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CRList.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CString.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CTask.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CVault.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\CVector.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\fakemeta.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\md5.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\modules.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="mmgr"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\mmgr\mmgr.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\mmgr\nommgr.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc">
|
||||
<File
|
||||
RelativePath="..\version.rc">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -2439,11 +2439,14 @@ PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
||||
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||
PFN_LOG g_fn_Log;
|
||||
PFN_LOG_ERROR g_fn_LogError;
|
||||
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||
PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
||||
PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA;
|
||||
PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA;
|
||||
PFN_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
||||
@ -2453,6 +2456,7 @@ PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized;
|
||||
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
||||
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
||||
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
||||
PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
||||
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
||||
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
||||
@ -2525,6 +2529,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||
REQFUNC("LogError", g_fn_LogError, PFN_LOG_ERROR);
|
||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||
|
||||
@ -2560,7 +2565,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
||||
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
||||
REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY);
|
||||
|
||||
REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A);
|
||||
REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A);
|
||||
// Player
|
||||
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
||||
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
||||
@ -2572,6 +2578,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
||||
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
||||
REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID);
|
||||
REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM);
|
||||
REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS);
|
||||
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
||||
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
||||
@ -2649,11 +2656,14 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_GetAmxStringLen(NULL);
|
||||
MF_CopyAmxMemory(NULL, NULL, 0);
|
||||
MF_Log("str", "str", 0);
|
||||
MF_LogError(NULL, 0, NULL);
|
||||
MF_RaiseAmxError(NULL, 0);
|
||||
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
||||
MF_ExecuteForward(0, 0, 0);
|
||||
MF_PrepareCellArray(NULL, 0);
|
||||
MF_PrepareCharArray(NULL, 0);
|
||||
MF_PrepareCellArrayA(NULL, 0, true);
|
||||
MF_PrepareCharArrayA(NULL, 0, true);
|
||||
MF_IsPlayerValid(0);
|
||||
MF_GetPlayerName(0);
|
||||
MF_GetPlayerIP(0);
|
||||
@ -2664,6 +2674,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_GetPlayerPlayTime(0);
|
||||
MF_GetPlayerCurweapon(0);
|
||||
MF_GetPlayerTeamID(0);
|
||||
MF_GetPlayerTeam(0);
|
||||
MF_GetPlayerDeaths(0);
|
||||
MF_GetPlayerMenu(0);
|
||||
MF_GetPlayerKeys(0);
|
||||
|
@ -1919,11 +1919,14 @@ typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr);
|
||||
typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/);
|
||||
typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/);
|
||||
typedef void (*PFN_LOG) (const char * /*fmt*/, ...);
|
||||
typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...);
|
||||
typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/);
|
||||
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
||||
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
||||
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
||||
typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/);
|
||||
typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/);
|
||||
typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/);
|
||||
typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/);
|
||||
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
||||
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
||||
@ -1932,8 +1935,9 @@ typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/);
|
||||
typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/);
|
||||
typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/);
|
||||
typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/);
|
||||
typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/);
|
||||
typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/);
|
||||
typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/);
|
||||
typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/);
|
||||
typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/);
|
||||
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
||||
typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/);
|
||||
@ -1986,11 +1990,14 @@ extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
||||
extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||
extern PFN_LOG g_fn_Log;
|
||||
extern PFN_LOG_ERROR g_fn_LogError;
|
||||
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||
extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
||||
extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA;
|
||||
extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA;
|
||||
extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||
extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
||||
@ -2026,6 +2033,7 @@ extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||
extern PFN_FORMAT g_fn_Format;
|
||||
extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||
|
||||
#ifdef MAY_NEVER_BE_DEFINED
|
||||
// Function prototypes for intellisense and similar systems
|
||||
@ -2045,11 +2053,14 @@ int MF_GetAmxStringLen (const cell *ptr) { }
|
||||
char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { }
|
||||
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
||||
void MF_Log (const char * fmt, ...) { }
|
||||
void MF_LogError (AMX * amx, int err, const char *fmt, ...) { }
|
||||
int MF_RaiseAmxError (AMX * amx, int error) { }
|
||||
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
||||
int MF_ExecuteForward (int id, ...) { }
|
||||
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
||||
cell MF_PrepareCharArray (char * ptr, unsigned int size) { }
|
||||
cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { }
|
||||
cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { }
|
||||
int MF_IsPlayerValid (int id) { }
|
||||
const char * MF_GetPlayerName (int id) { }
|
||||
const char * MF_GetPlayerIP (int id) { }
|
||||
@ -2059,6 +2070,7 @@ int MF_IsPlayerAuthorized (int id) { }
|
||||
float MF_GetPlayerTime (int id) { }
|
||||
float MF_GetPlayerPlayTime (int id) { }
|
||||
int MF_GetPlayerCurweapon (int id) { }
|
||||
const char * MF_GetPlayerTeam (int id) { }
|
||||
int MF_GetPlayerTeamID (int id) { }
|
||||
int MF_GetPlayerDeaths (int id) { }
|
||||
int MF_GetPlayerMenu (int id) { }
|
||||
@ -2094,11 +2106,14 @@ const char * MF_Format (const char *fmt, ...) { }
|
||||
#define MF_GetAmxStringLen g_fn_GetAmxStringLen
|
||||
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
||||
void MF_Log(const char *fmt, ...);
|
||||
#define MF_LogError g_fn_LogError
|
||||
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
||||
#define MF_RegisterForward g_fn_RegisterForward
|
||||
#define MF_ExecuteForward g_fn_ExecuteForward
|
||||
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
||||
#define MF_PrepareCharArray g_fn_PrepareCharArray
|
||||
#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA
|
||||
#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA
|
||||
#define MF_IsPlayerValid g_fn_IsPlayerValid
|
||||
#define MF_GetPlayerName g_fn_GetPlayerName
|
||||
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
||||
@ -2108,6 +2123,7 @@ void MF_Log(const char *fmt, ...);
|
||||
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
||||
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
||||
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
||||
#define MF_GetPlayerTeam g_fn_GetPlayerTeam
|
||||
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
||||
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
||||
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
||||
@ -2133,7 +2149,7 @@ void MF_Log(const char *fmt, ...);
|
||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||
#define MF_Format g_fn_Format;
|
||||
#define MF_Format g_fn_Format
|
||||
|
||||
/*** Memory ***/
|
||||
void *operator new(size_t reportedSize);
|
||||
|
@ -283,10 +283,9 @@ void plugin_srvcmd()
|
||||
|
||||
if ((err = amx_Exec( (*a).getPlugin()->getAMX(), &ret , (*a).getFunction()
|
||||
, 3 , g_srvindex , (*a).getFlags() , (*a).getId() )) != AMX_ERR_NONE)
|
||||
|
||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
||||
err,(*a).getPlugin()->getAMX()->curline,(*a).getPlugin()->getName());
|
||||
|
||||
{
|
||||
LogError((*a).getPlugin()->getAMX(), err, "");
|
||||
}
|
||||
if ( ret ) break;
|
||||
}
|
||||
|
||||
|
@ -448,6 +448,60 @@ char* format_arguments(AMX *amx, int parm,int& len)
|
||||
return *buffer;
|
||||
}
|
||||
|
||||
//added by BAILOPAN for jtp10181
|
||||
//takes a string and breaks it into a 1st param and rest params
|
||||
//different from strbreak because it's more crafted for control
|
||||
static cell AMX_NATIVE_CALL amx_strtok(AMX *amx, cell *params)
|
||||
{
|
||||
int left_pos = 0;
|
||||
int right_pos = 0;
|
||||
unsigned int i = 0;
|
||||
bool done_flag = false;
|
||||
int len = 0;
|
||||
|
||||
//string[]
|
||||
char *string = get_amxstring(amx, params[1], 0, len);
|
||||
//left[]
|
||||
char *left = new char[len+1];
|
||||
//right[]
|
||||
char *right = new char[len+1];
|
||||
int leftMax = params[3];
|
||||
int rightMax = params[5];
|
||||
//token
|
||||
char token = params[6];
|
||||
//trim
|
||||
int trim = params[7];
|
||||
for (i=0; i<len; i++)
|
||||
{
|
||||
if (trim && !done_flag)
|
||||
{
|
||||
if (isspace(string[i]))
|
||||
{
|
||||
while (isspace(string[++i]));
|
||||
done_flag = true;
|
||||
}
|
||||
}
|
||||
if (!done_flag && string[i] == token)
|
||||
{
|
||||
done_flag = true;
|
||||
i++;
|
||||
}
|
||||
if (done_flag)
|
||||
{
|
||||
right[right_pos++] = string[i];
|
||||
} else {
|
||||
left[left_pos++] = string[i];
|
||||
}
|
||||
}
|
||||
right[right_pos] = 0;
|
||||
left[left_pos] = 0;
|
||||
set_amxstring(amx, params[2], left, leftMax);
|
||||
set_amxstring(amx, params[4], right, rightMax);
|
||||
delete [] left;
|
||||
delete [] right;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//added by BAILOPAN
|
||||
//Takes a string and breaks it into a 1st param and rest params
|
||||
//strbreak(String[], First[], FirstLen, Rest[], RestLen)
|
||||
@ -467,7 +521,7 @@ static cell AMX_NATIVE_CALL strbreak(AMX *amx, cell *params) /* 5 param */
|
||||
int LeftMax = params[3];
|
||||
int RightMax = params[5];
|
||||
|
||||
for (i=0; i<strlen(string); i++) {
|
||||
for (i=0; i<l; i++) {
|
||||
if (string[i] == '"' && !quote_flag) {
|
||||
quote_flag = true;
|
||||
} else if (string[i] == '"' && quote_flag) {
|
||||
@ -611,5 +665,6 @@ AMX_NATIVE_INFO string_Natives[] = {
|
||||
{ "str_to_num", strtonum },
|
||||
{ "trim", amx_trim },
|
||||
{ "ucfirst", amx_ucfirst },
|
||||
{ "strtok", amx_strtok },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
@ -13,4 +13,4 @@ amxx_vault addons/amxmodx/data/vault.ini
|
||||
; 1 - one logfile / day
|
||||
; 2 - one logfile / map
|
||||
; 3 - HL Logs
|
||||
amx_logging 1
|
||||
amxx_logging 1
|
||||
|
@ -15,4 +15,4 @@ csstats addons/amxmodx/data/csstats.dat
|
||||
; 1 - one logfile / day
|
||||
; 2 - one logfile / map
|
||||
; 3 - HL Logs
|
||||
amx_logging 1
|
||||
amxx_logging 1
|
||||
|
9
configs/cstrike/stats.ini
Executable file
9
configs/cstrike/stats.ini
Executable file
@ -0,0 +1,9 @@
|
||||
;Generated by Stats Configuration Plugin. Do not modify!
|
||||
;Variable Description
|
||||
ShowAttackers ;Show Attackers
|
||||
ShowVictims ;Show Victims
|
||||
ShowStats ;HUD-stats default
|
||||
SayRankStats ;Say /rankstats
|
||||
SayRank ;Say /rank
|
||||
SayTop15 ;Say /top15
|
||||
ShowStats ;HUD-stats default
|
@ -13,7 +13,7 @@ amxx_vault addons/amxmodx/data/vault.ini
|
||||
; 1 - one logfile / day
|
||||
; 2 - one logfile / map
|
||||
; 3 - HL Logs
|
||||
amx_logging 1
|
||||
amxx_logging 1
|
||||
|
||||
dodstats_score addons/amxmodx/data/dodstats.amxx
|
||||
dodstats addons/amxmodx/data/dodstats.dat
|
||||
|
@ -68,9 +68,6 @@ amx_extendmap_max 90
|
||||
// Step for each extending
|
||||
amx_extendmap_step 15
|
||||
|
||||
// Ignore the minimum and maximum settings for maps in the mapcycle
|
||||
amx_mapnum_ignore 0
|
||||
|
||||
//If you set this to 0, clients cannot chose their language
|
||||
amx_client_languages 1
|
||||
|
||||
@ -80,3 +77,14 @@ amx_client_languages 1
|
||||
// 2 - All plugins are put in debug mode
|
||||
// Note - debug mode will affect JIT performance
|
||||
amx_debug 1
|
||||
|
||||
// Ignore the minimum and maximum settings for maps in the mapcycle
|
||||
amx_mapnum_ignore 0
|
||||
|
||||
// Idle Kicker Settings:
|
||||
amx_idle_time 120 // Time players must be idle to be kicked
|
||||
amx_idle_min_players 8 // Minimum players on the server before kicking starts
|
||||
amx_idle_ignore_immunity 1 // Kick idle admins with immunity?
|
||||
|
||||
// Change this value to alter the frequency (in seconds) players can say /stuck to free themselves.
|
||||
//amx_unstuck_frequency 4
|
||||
|
@ -16,7 +16,6 @@ co_daimos
|
||||
ns_origin
|
||||
co_kestrel
|
||||
ns_tanith
|
||||
co_rebirth
|
||||
ns_nancy
|
||||
ns_veil
|
||||
co_core
|
||||
|
@ -5,8 +5,8 @@
|
||||
; ------------------------------
|
||||
; Fun - provides extra functions
|
||||
; ------------------------------
|
||||
fun_amxx_i386.so
|
||||
fun_amxx.dll
|
||||
;fun_amxx_i386.so
|
||||
;fun_amxx.dll
|
||||
|
||||
; ----------------------------------------------------
|
||||
; Engine - provides engine functions core to Half-Life
|
||||
@ -53,5 +53,5 @@ fun_amxx.dll
|
||||
; -----------------
|
||||
; Natural Selection
|
||||
; -----------------
|
||||
;ns_amxx_i386.so
|
||||
;ns_amxx.dll
|
||||
ns_amxx_i386.so
|
||||
ns_amxx.dll
|
||||
|
40
configs/ns/plugins.ini
Executable file
40
configs/ns/plugins.ini
Executable file
@ -0,0 +1,40 @@
|
||||
; AMX Mod X plugins
|
||||
|
||||
; Admin Base - Always one has to be activated
|
||||
admin.amxx ; admin base (required for any admin-related)
|
||||
;admin_sql.amxx ; admin base - SQL version (comment admin.amxx)
|
||||
|
||||
; Basic
|
||||
admincmd.amxx ; basic admin console commands
|
||||
adminhelp.amxx ; help command for admin console commands
|
||||
adminslots.amxx ; slot reservation
|
||||
multilingual.amxx ; Multi-Lingual management
|
||||
|
||||
; Menus
|
||||
menufront.amxx ; front-end for admin menus
|
||||
cmdmenu.amxx ; command menu (speech, settings)
|
||||
plmenu.amxx ; players menu (kick, ban, client cmds.)
|
||||
;telemenu.amxx ; teleport menu (Fun Module required!)
|
||||
mapsmenu.amxx ; maps menu (vote, changelevel)
|
||||
|
||||
; Chat / Messages
|
||||
adminchat.amxx ; console chat commands
|
||||
antiflood.amxx ; prevent clients from chat-flooding the server
|
||||
scrollmsg.amxx ; displays a scrolling message
|
||||
imessage.amxx ; displays information messages
|
||||
adminvote.amxx ; vote commands
|
||||
|
||||
; Map related
|
||||
nextmap.amxx ; displays next map in mapcycle
|
||||
mapchooser.amxx ; allows to vote for next map
|
||||
timeleft.amxx ; displays time left on map
|
||||
|
||||
; Configuration
|
||||
pausecfg.amxx ; allows to pause and unpause some plugins
|
||||
|
||||
; NS Specific plugins
|
||||
idlekicker.amxx ; kicks idle players
|
||||
nscommands.amxx ; extra commands for Natural-Selection
|
||||
unstuck.amxx ; Allows players to free themselves if they get stuck in the map (req engine & ns modules)
|
||||
|
||||
; Custom - Add 3rd party plugins here
|
49
configs/ns/users.ini
Executable file
49
configs/ns/users.ini
Executable file
@ -0,0 +1,49 @@
|
||||
; Users configuration file
|
||||
; File location: $moddir/addons/amxx/configs/users.ini
|
||||
|
||||
; Line starting with ; is a comment
|
||||
|
||||
; Access flags:
|
||||
; a - immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
|
||||
; b - reservation (can join on reserved slots)
|
||||
; c - amx_kick command
|
||||
; d - amx_ban and amx_unban commands
|
||||
; e - amx_slay and amx_slap commands
|
||||
; f - amx_map command
|
||||
; g - amx_cvar command (not all cvars will be available)
|
||||
; h - amx_cfg command
|
||||
; i - amx_chat and other chat commands
|
||||
; j - amx_vote and other vote commands
|
||||
; k - access to sv_password cvar (by amx_cvar command)
|
||||
; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
|
||||
; m - custom level A (for additional plugins)
|
||||
; n - custom level B
|
||||
; o - custom level C
|
||||
; p - custom level D
|
||||
; q - custom level E
|
||||
; r - custom level F
|
||||
; s - custom level G
|
||||
; t - ns commands (amx_random, amx_readyroom, amx_uncomm, amx_alien, amx_marine)
|
||||
; u - menu access
|
||||
; z - user (no admin)
|
||||
|
||||
; Account flags:
|
||||
; a - disconnect player on invalid password
|
||||
; b - clan tag
|
||||
; c - this is steamid/wonid
|
||||
; d - this is ip
|
||||
; e - password is not checked (only name/ip/steamid needed)
|
||||
|
||||
; Password:
|
||||
; Add to your autoexec.cfg: setinfo _pw "<password>"
|
||||
; Change _pw to the value of amx_password_field
|
||||
|
||||
; Format of admin account:
|
||||
; <name|ip|steamid> <password> <access flags> <account flags>
|
||||
|
||||
; Examples of admin accounts:
|
||||
; "STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"
|
||||
; "123.45.67.89" "" "abcdefghijklmnopqrstu" "de"
|
||||
; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"
|
||||
|
||||
"loopback" "" "abcdefghijklmnopqrstu" "de"
|
@ -15,4 +15,4 @@ tfcstats addons/amxmodx/data/tfcstats.dat
|
||||
; 1 - one logfile / day
|
||||
; 2 - one logfile / map
|
||||
; 3 - HL Logs
|
||||
amx_logging 1
|
||||
amxx_logging 1
|
||||
|
@ -2,7 +2,7 @@
|
||||
amxx_logdir addons/amxmodx/logs
|
||||
amxx_configsdir addons/amxmodx/configs
|
||||
amxx_datadir addons/amxmodx/data
|
||||
amxx_modules addons/amxmodx/configs/modules.inia
|
||||
amxx_modules addons/amxmodx/configs/modules.ini
|
||||
mxx_plugins addons/amxmodx/configs/plugins.ini
|
||||
amxx_pluginsdir addons/amxmodx/plugins
|
||||
amxx_modulesdir addons/amxmodx/modules
|
||||
@ -15,4 +15,4 @@ tsstats addons/amxmodx/data/tsstats.dat
|
||||
; 1 - one logfile / day
|
||||
; 2 - one logfile / map
|
||||
; 3 - HL Logs
|
||||
amx_logging 1
|
||||
amxx_logging 1
|
||||
|
@ -306,4 +306,3 @@ void RankSystem::saveRank( const char* filename )
|
||||
|
||||
fclose(bfp);
|
||||
}
|
||||
|
||||
|
@ -120,4 +120,3 @@ public:
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -26,7 +26,6 @@ bool rankBots;
|
||||
int gmsgCurWeapon;
|
||||
int gmsgDeathMsg;
|
||||
int gmsgDamage;
|
||||
int gmsgDamageEnd;
|
||||
int gmsgWeaponList;
|
||||
int gmsgResetHUD;
|
||||
int gmsgAmmoX;
|
||||
@ -57,7 +56,6 @@ struct sUserMsg {
|
||||
} g_user_msg[] = {
|
||||
{ "CurWeapon" , &gmsgCurWeapon , Client_CurWeapon, false },
|
||||
{ "Damage" , &gmsgDamage,Client_Damage, false },
|
||||
{ "Damage" , &gmsgDamageEnd, Client_Damage_End, true },
|
||||
{ "WeaponList" , &gmsgWeaponList, Client_WeaponList, false },
|
||||
{ "ResetHUD" , &gmsgResetHUD,Client_ResetHUD, true },
|
||||
{ "AmmoX" , &gmsgAmmoX, Client_AmmoX , false },
|
||||
@ -289,7 +287,7 @@ void OnMetaAttach() {
|
||||
|
||||
void OnAmxxAttach(){
|
||||
MF_AddNatives(stats_Natives);
|
||||
const char* path = get_localinfo("csstats_score","addons/amxmodx/data/csstats.amxx");
|
||||
const char* path = get_localinfo("csstats_score");
|
||||
if ( path && *path )
|
||||
{
|
||||
char error[128];
|
||||
@ -299,7 +297,7 @@ void OnAmxxAttach(){
|
||||
if ( !g_rank.begin() )
|
||||
{
|
||||
g_rank.loadRank( MF_BuildPathname("%s",
|
||||
get_localinfo("csstats","addons/amxmodx/data/csstats.dat") ) );
|
||||
get_localinfo("csstats") ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,6 @@ extern int mPlayerIndex;
|
||||
extern int mState;
|
||||
|
||||
extern int gmsgCurWeapon;
|
||||
extern int gmsgDamageEnd;
|
||||
extern int gmsgDamage;
|
||||
extern int gmsgWeaponList;
|
||||
extern int gmsgResetHUD;
|
||||
@ -69,7 +68,6 @@ void Client_CurWeapon(void*);
|
||||
void Client_Damage(void*);
|
||||
void Client_WeaponList(void*);
|
||||
void Client_AmmoPickup(void*);
|
||||
void Client_Damage_End(void*);
|
||||
void Client_ScoreInfo(void*);
|
||||
void Client_ResetHUD(void*);
|
||||
|
||||
|
@ -5,12 +5,6 @@
|
||||
|
||||
weaponsVault weaponData[MAX_WEAPONS];
|
||||
|
||||
int damage;
|
||||
int TK;
|
||||
int weapon;
|
||||
int aim;
|
||||
CPlayer *pAttacker;
|
||||
|
||||
int g_Planter;
|
||||
int g_Defuser;
|
||||
|
||||
@ -52,6 +46,13 @@ void Client_WeaponList(void* mValue){
|
||||
|
||||
void Client_Damage(void* mValue){
|
||||
static int bits;
|
||||
static int damage;
|
||||
static int TK;
|
||||
static int weapon;
|
||||
static int aim;
|
||||
static bool ignore;
|
||||
static CPlayer *pAttacker;
|
||||
|
||||
switch (mState++) {
|
||||
case 1:
|
||||
damage = *(int*)mValue;
|
||||
@ -60,7 +61,7 @@ void Client_Damage(void* mValue){
|
||||
bits = *(int*)mValue;
|
||||
break;
|
||||
case 3:
|
||||
if (!mPlayer || !damage || !*(float*)mValue || bits) break;
|
||||
if ( ignore = (!mPlayer || !damage || !*(float*)mValue || bits) ) break;
|
||||
edict_t *enemy;
|
||||
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
||||
|
||||
@ -79,19 +80,19 @@ void Client_Damage(void* mValue){
|
||||
}
|
||||
if( g_grenades.find(enemy , &pAttacker , &weapon ) )
|
||||
pAttacker->saveHit( mPlayer , weapon , damage, aim );
|
||||
}
|
||||
}
|
||||
|
||||
void Client_Damage_End(void* mValue){
|
||||
if ( !mPlayer || !damage || mPlayer->IsAlive() )
|
||||
return;
|
||||
|
||||
break;
|
||||
case 4:
|
||||
if ( ignore || mPlayer->IsAlive() )
|
||||
break;
|
||||
if ( !pAttacker )
|
||||
pAttacker = mPlayer;
|
||||
pAttacker = mPlayer;
|
||||
TK = 0;
|
||||
if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) )
|
||||
TK = 1;
|
||||
TK = 1;
|
||||
pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TK);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_CurWeapon(void* mValue){
|
||||
|
@ -1186,8 +1186,11 @@ static cell AMX_NATIVE_CALL cs_get_hostage_follow(AMX *amx, cell *params) // cs_
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined __amd64__
|
||||
int following = *((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW);
|
||||
|
||||
#else
|
||||
long following = *((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW);
|
||||
#endif
|
||||
if (following == 0)
|
||||
return following;
|
||||
|
||||
@ -1232,7 +1235,12 @@ static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_
|
||||
|
||||
// Set to not follow anything?
|
||||
if (params[2] == 0) {
|
||||
#if !defined __amd64__
|
||||
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = 0;
|
||||
#else
|
||||
*((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = 0;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1252,8 +1260,11 @@ static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined __amd64__
|
||||
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (int)pEntity;
|
||||
|
||||
#else
|
||||
*((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (long)pEntity;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* AMX Mod X
|
||||
/* AMX Mod X
|
||||
* Counter-Strike Module
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
@ -51,38 +51,73 @@
|
||||
#endif // defined __linux__
|
||||
|
||||
// "player" entities
|
||||
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
||||
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
||||
#define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET
|
||||
#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET
|
||||
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET
|
||||
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
||||
#define OFFSET_VIP 215 + EXTRAOFFSET
|
||||
#define OFFSET_BUYZONE 241 + EXTRAOFFSET
|
||||
#if !defined __amd64__
|
||||
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
||||
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
||||
#define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET
|
||||
#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET
|
||||
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET
|
||||
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
||||
#define OFFSET_VIP 215 + EXTRAOFFSET
|
||||
#define OFFSET_BUYZONE 241 + EXTRAOFFSET
|
||||
|
||||
#define OFFSET_AWM_AMMO 382 + EXTRAOFFSET
|
||||
#define OFFSET_SCOUT_AMMO 383 + EXTRAOFFSET
|
||||
#define OFFSET_PARA_AMMO 384 + EXTRAOFFSET
|
||||
#define OFFSET_FAMAS_AMMO 385 + EXTRAOFFSET
|
||||
#define OFFSET_M3_AMMO 386 + EXTRAOFFSET
|
||||
#define OFFSET_USP_AMMO 387 + EXTRAOFFSET
|
||||
#define OFFSET_FIVESEVEN_AMMO 388 + EXTRAOFFSET
|
||||
#define OFFSET_DEAGLE_AMMO 389 + EXTRAOFFSET
|
||||
#define OFFSET_P228_AMMO 390 + EXTRAOFFSET
|
||||
#define OFFSET_GLOCK_AMMO 391 + EXTRAOFFSET
|
||||
#define OFFSET_FLASH_AMMO 392 + EXTRAOFFSET
|
||||
#define OFFSET_HE_AMMO 393 + EXTRAOFFSET
|
||||
#define OFFSET_SMOKE_AMMO 394 + EXTRAOFFSET
|
||||
#define OFFSET_C4_AMMO 395 + EXTRAOFFSET
|
||||
#define OFFSET_AWM_AMMO 382 + EXTRAOFFSET
|
||||
#define OFFSET_SCOUT_AMMO 383 + EXTRAOFFSET
|
||||
#define OFFSET_PARA_AMMO 384 + EXTRAOFFSET
|
||||
#define OFFSET_FAMAS_AMMO 385 + EXTRAOFFSET
|
||||
#define OFFSET_M3_AMMO 386 + EXTRAOFFSET
|
||||
#define OFFSET_USP_AMMO 387 + EXTRAOFFSET
|
||||
#define OFFSET_FIVESEVEN_AMMO 388 + EXTRAOFFSET
|
||||
#define OFFSET_DEAGLE_AMMO 389 + EXTRAOFFSET
|
||||
#define OFFSET_P228_AMMO 390 + EXTRAOFFSET
|
||||
#define OFFSET_GLOCK_AMMO 391 + EXTRAOFFSET
|
||||
#define OFFSET_FLASH_AMMO 392 + EXTRAOFFSET
|
||||
#define OFFSET_HE_AMMO 393 + EXTRAOFFSET
|
||||
#define OFFSET_SMOKE_AMMO 394 + EXTRAOFFSET
|
||||
#define OFFSET_C4_AMMO 395 + EXTRAOFFSET
|
||||
|
||||
#define OFFSET_CSDEATHS 449 + EXTRAOFFSET
|
||||
// "weapon_*" entities
|
||||
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET
|
||||
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET
|
||||
#define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET
|
||||
// "hostage_entity" entities
|
||||
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET
|
||||
#define OFFSET_HOSTAGEID 487 + EXTRAOFFSET
|
||||
#define OFFSET_CSDEATHS 449 + EXTRAOFFSET
|
||||
// "weapon_*" entities
|
||||
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET
|
||||
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET
|
||||
#define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET
|
||||
// "hostage_entity" entities
|
||||
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET
|
||||
#define OFFSET_HOSTAGEID 487 + EXTRAOFFSET
|
||||
#else
|
||||
#define OFFSET_TEAM 139 + EXTRAOFFSET // +25
|
||||
#define OFFSET_CSMONEY 140 + EXTRAOFFSET // +25
|
||||
#define OFFSET_PRIMARYWEAPON 141 + EXTRAOFFSET // +25
|
||||
#define OFFSET_INTERNALMODEL 152 + EXTRAOFFSET // +26
|
||||
#define OFFSET_NVGOGGLES 155 + EXTRAOFFSET // +26
|
||||
#define OFFSET_DEFUSE_PLANT 219 + EXTRAOFFSET // +26
|
||||
#define OFFSET_VIP 242 + EXTRAOFFSET // +27
|
||||
#define OFFSET_BUYZONE 268 + EXTRAOFFSET // +27
|
||||
|
||||
#define OFFSET_AWM_AMMO 426 + EXTRAOFFSET // +44
|
||||
#define OFFSET_SCOUT_AMMO 427 + EXTRAOFFSET // +44
|
||||
#define OFFSET_PARA_AMMO 428 + EXTRAOFFSET // +44
|
||||
#define OFFSET_FAMAS_AMMO 429 + EXTRAOFFSET // +44
|
||||
#define OFFSET_M3_AMMO 430 + EXTRAOFFSET // +44
|
||||
#define OFFSET_USP_AMMO 431 + EXTRAOFFSET // +44
|
||||
#define OFFSET_FIVESEVEN_AMMO 432 + EXTRAOFFSET // +44
|
||||
#define OFFSET_DEAGLE_AMMO 433 + EXTRAOFFSET // +44
|
||||
#define OFFSET_P228_AMMO 434 + EXTRAOFFSET // +44
|
||||
#define OFFSET_GLOCK_AMMO 435 + EXTRAOFFSET // +44
|
||||
#define OFFSET_FLASH_AMMO 436 + EXTRAOFFSET // +44
|
||||
#define OFFSET_HE_AMMO 437 + EXTRAOFFSET // +44
|
||||
#define OFFSET_SMOKE_AMMO 438 + EXTRAOFFSET // +44
|
||||
#define OFFSET_C4_AMMO 439 + EXTRAOFFSET // +44
|
||||
|
||||
#define OFFSET_CSDEATHS 493 + EXTRAOFFSET // +44
|
||||
// "weapon_*" entities
|
||||
#define OFFSET_WEAPONTYPE 57 + EXTRAOFFSET // +14
|
||||
#define OFFSET_CLIPAMMO 65 + EXTRAOFFSET // +14
|
||||
#define OFFSET_SILENCER_FIREMODE 88 + EXTRAOFFSET // +14
|
||||
// "hostage_entity" entities
|
||||
#define OFFSET_HOSTAGEFOLLOW 51 + EXTRAOFFSET // +21, long=51, int=107! (must use the long* offset becuase pointers on amd64 are stored the size of longs, 8 bytes, instead of the usual int 4 bytes.)
|
||||
#define OFFSET_HOSTAGEID 516 + EXTRAOFFSET // +29
|
||||
#endif
|
||||
|
||||
// Ids of weapons in CS
|
||||
#define CSW_P228 1
|
||||
|
61
dlls/csx/plugins/include/csstats.inc
Executable file
61
dlls/csx/plugins/include/csstats.inc
Executable file
@ -0,0 +1,61 @@
|
||||
|
||||
#if defined _csstats_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _csstats_included
|
||||
|
||||
/* Gets stats from given weapon index. If wpnindex is 0
|
||||
* then the stats are from all weapons. If weapon has not been used function
|
||||
* returns 0 in other case 1. Fields in stats are:
|
||||
* 0 - kills
|
||||
* 1 - deaths
|
||||
* 2 - headshots
|
||||
* 3 - teamkilling
|
||||
* 4 - shots
|
||||
* 5 - hits
|
||||
* 6 - damage
|
||||
|
||||
* For body hits fields see amxconst.inc. */
|
||||
native get_user_wstats(index,wpnindex,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets round stats from given weapon index.*/
|
||||
native get_user_wrstats(index,wpnindex,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets overall stats which are stored in file on server
|
||||
* and updated on every respawn or user disconnect.
|
||||
* Function returns the position in stats by diff. kills to deaths. */
|
||||
native get_user_stats(index,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets round stats of player. */
|
||||
native get_user_rstats(index,stats[8],bodyhits[8]);
|
||||
|
||||
/* Gets stats with which user have killed/hurt his victim. If victim is 0
|
||||
* then stats are from all victims. If victim has not been hurt, function
|
||||
* returns 0 in other case 1. User stats are reset on his respawn. */
|
||||
native get_user_vstats(index,victim,stats[8],bodyhits[8],wpnname[]="",len=0);
|
||||
|
||||
/* Gets stats with which user have been killed/hurt. If killer is 0
|
||||
* then stats are from all attacks. If killer has not hurt user, function
|
||||
* returns 0 in other case 1. User stats are reset on his respawn. */
|
||||
native get_user_astats(index,wpnindex,stats[8],bodyhits[8],wpnname[]="",len=0);
|
||||
|
||||
/* Resets life, weapon, victims and attackers user stats. */
|
||||
native reset_user_wstats(index);
|
||||
|
||||
/* Gets overall stats which stored in stats.dat file in amx folder
|
||||
* and updated on every mapchange or user disconnect.
|
||||
* Function returns next index of stats entry or 0 if no more exists. */
|
||||
native get_stats(index,stats[8],bodyhits[8],name[],len);
|
||||
|
||||
/* Returns number of all entries in stats. */
|
||||
native get_statsnum();
|
||||
|
||||
/*
|
||||
* new stats:
|
||||
* 0 - total defusions
|
||||
* 1 - bomb defused
|
||||
* 2 - bomb plants
|
||||
* 3 - bomb explosions
|
||||
*/
|
||||
native get_user_stats2(index,stats[4]);
|
||||
native get_stats2(index,stats[4]);
|
59
dlls/csx/plugins/include/csx.inc
Executable file
59
dlls/csx/plugins/include/csx.inc
Executable file
@ -0,0 +1,59 @@
|
||||
/* CSX functions
|
||||
*
|
||||
* (c) 2004, SidLuke
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _csx_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _csx_included
|
||||
|
||||
#include <csstats>
|
||||
|
||||
/*
|
||||
* Forwards
|
||||
*/
|
||||
|
||||
/* Function is called after player to player attacks ,
|
||||
* if players were damaged by teammate TA is set to 1 */
|
||||
forward client_damage(attacker,victim,damage,wpnindex,hitplace,TA);
|
||||
|
||||
/* Function is called after player death ,
|
||||
* if player was killed by teammate TK is set to 1 */
|
||||
forward client_death(killer,victim,wpnindex,hitplace,TK);
|
||||
|
||||
forward grenade_throw( index,greindex,wId );
|
||||
|
||||
forward bomb_planting(planter);
|
||||
forward bomb_planted(planter);
|
||||
forward bomb_explode(planter,defuser);
|
||||
forward bomb_defusing(defuser);
|
||||
forward bomb_defused(defuser);
|
||||
|
||||
/************* Shared Natives Start ********************************/
|
||||
|
||||
/* Custom Weapon Support */
|
||||
/* function will return index of new weapon */
|
||||
native custom_weapon_add( wpnname[],melee = 0,logname[]="" );
|
||||
/* Function will pass damage done by this custom weapon to stats module and other plugins */
|
||||
native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 );
|
||||
/* Function will pass info about custom weapon shot to stats module */
|
||||
native custom_weapon_shot( weapon,index ); // weapon id , player id
|
||||
|
||||
/* function will return 1 if true */
|
||||
native xmod_is_melee_wpn(wpnindex);
|
||||
|
||||
/* Returns weapon name. */
|
||||
native xmod_get_wpnname(wpnindex,name[],len);
|
||||
|
||||
/* Returns weapon logname. */
|
||||
native xmod_get_wpnlogname(wpnindex,name[],len);
|
||||
|
||||
/* Returns weapons array size */
|
||||
native xmod_get_maxweapons();
|
||||
|
||||
/* Returns stats array size */
|
||||
native xmod_get_stats_size();
|
||||
|
||||
/************* Shared Natives End ********************************/
|
515
dlls/csx/plugins/miscstats.sma
Executable file
515
dlls/csx/plugins/miscstats.sma
Executable file
@ -0,0 +1,515 @@
|
||||
/* AMX Mod X
|
||||
* Misc. Stats Plugin
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is part of AMX Mod X.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
|
||||
public MultiKill
|
||||
public MultiKillSound
|
||||
public BombPlanting
|
||||
public BombDefusing
|
||||
public BombPlanted
|
||||
public BombDefused
|
||||
public BombFailed
|
||||
public BombPickUp
|
||||
public BombDrop
|
||||
public BombCountVoice
|
||||
public BombCountDef
|
||||
public BombReached
|
||||
public ItalyBonusKill
|
||||
public EnemyRemaining
|
||||
public LastMan
|
||||
public KnifeKill
|
||||
public KnifeKillSound
|
||||
public GrenadeKill
|
||||
public GrenadeSuicide
|
||||
public HeadShotKill
|
||||
public HeadShotKillSound
|
||||
public RoundCounterSound
|
||||
public RoundCounter
|
||||
public KillingStreak
|
||||
public KillingStreakSound
|
||||
public DoubleKill
|
||||
public DoubleKillSound
|
||||
public PlayerName
|
||||
public FirstBloodSound
|
||||
|
||||
new g_streakKills[33][2]
|
||||
new g_multiKills[33][2]
|
||||
new g_C4Timer
|
||||
new g_Defusing
|
||||
new g_Planter
|
||||
new Float:g_LastOmg
|
||||
new g_LastAnnounce
|
||||
new g_roundCount
|
||||
new Float:g_doubleKill
|
||||
new g_doubleKillId
|
||||
new g_friend[33]
|
||||
new g_firstBlood
|
||||
|
||||
new g_MultiKillMsg[7][] = {
|
||||
"Multi-Kill! %s^n%L %d kills (%d hs)",
|
||||
"Ultra-Kill!!! %s^n%L %d kills (%d hs)",
|
||||
"%s IS ON A KILLING SPREE!!!^n%L %d kills (%d hs)",
|
||||
"RAMPAGE!!! %s^n%L %d kills (%d hs)" ,
|
||||
"%s IS UNSTOPPABLE!!!^n%L %d kills (%d hs)",
|
||||
"%s IS A MONSTER!^n%L %d kills (%d hs)",
|
||||
"%s IS GODLIKE!!!!^n%L %d kills (%d hs)"
|
||||
}
|
||||
new g_Sounds[7][] = {
|
||||
"multikill",
|
||||
"ultrakill",
|
||||
"killingspree",
|
||||
"rampage",
|
||||
"unstoppable",
|
||||
"monsterkill",
|
||||
"godlike"
|
||||
}
|
||||
new g_KillingMsg[7][] = {
|
||||
"%s: Multi-Kill!",
|
||||
"%s: Ultra-Kill!!!",
|
||||
"%s IS ON A KILLING SPREE!!!",
|
||||
"%s: RAMPAGE!!!",
|
||||
"%s IS UNSTOPPABLE!!!",
|
||||
"%s IS A MONSTER!",
|
||||
"%s IS GODLIKE!!!"
|
||||
}
|
||||
new g_KinfeMsg[4][] = {
|
||||
"KNIFE_MSG_1",
|
||||
"KNIFE_MSG_2",
|
||||
"KNIFE_MSG_3",
|
||||
"KNIFE_MSG_4"
|
||||
}
|
||||
new g_LastMessages[4][] = {
|
||||
"LAST_MSG_1",
|
||||
"LAST_MSG_2",
|
||||
"LAST_MSG_3",
|
||||
"LAST_MSG_4"
|
||||
}
|
||||
new g_HeMessages[4][] = {
|
||||
"HE_MSG_1",
|
||||
"HE_MSG_2",
|
||||
"HE_MSG_3",
|
||||
"HE_MSG_4"
|
||||
}
|
||||
new g_SHeMessages[4][] = {
|
||||
"SHE_MSG_1",
|
||||
"SHE_MSG_2",
|
||||
"SHE_MSG_3",
|
||||
"SHE_MSG_4"
|
||||
}
|
||||
new g_HeadShots[7][] = {
|
||||
"HS_MSG_1",
|
||||
"HS_MSG_2",
|
||||
"HS_MSG_3",
|
||||
"HS_MSG_4",
|
||||
"HS_MSG_5",
|
||||
"HS_MSG_6",
|
||||
"HS_MSG_7"
|
||||
}
|
||||
|
||||
new g_teamsNames[4][] = {
|
||||
"TERRORIST",
|
||||
"CT",
|
||||
"TERRORISTS",
|
||||
"CTS"
|
||||
}
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("CS Misc. Stats",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
register_dictionary("miscstats.txt")
|
||||
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("RoundTime", "eNewRound", "bc")
|
||||
register_event("StatusValue","setTeam","be","1=1")
|
||||
register_event("StatusValue","showStatus","be","1=2","2!0")
|
||||
register_event("StatusValue","hideStatus","be","1=1","2=0")
|
||||
new mapname[32]
|
||||
get_mapname(mapname,31)
|
||||
if (equali(mapname,"de_",3)||equali(mapname,"csde_",5)) {
|
||||
register_event("StatusIcon", "eGotBomb", "be", "1=1", "1=2", "2=c4")
|
||||
register_event("TextMsg", "eBombPickUp", "bc", "2&#Got_bomb")
|
||||
register_event("TextMsg", "eBombDrop", "bc", "2&#Game_bomb_d")
|
||||
}
|
||||
else if ( equali( mapname , "cs_italy" ) ) {
|
||||
register_event( "23" , "chickenKill", "a" , "1=108" , /*"12=106",*/ "15=4" )
|
||||
register_event( "23" , "radioKill", "a" , "1=108" , /*"12=294",*/ "15=2" )
|
||||
}
|
||||
}
|
||||
|
||||
public plugin_cfg() {
|
||||
new g_addStast[] = "amx_statscfg add ^"%s^" %s"
|
||||
server_cmd(g_addStast,"MultiKill","MultiKill")
|
||||
server_cmd(g_addStast,"MultiKillSound","MultiKillSound")
|
||||
server_cmd(g_addStast,"Bomb Planting","BombPlanting")
|
||||
server_cmd(g_addStast,"Bomb Defusing","BombDefusing")
|
||||
server_cmd(g_addStast,"Bomb Planted","BombPlanted")
|
||||
server_cmd(g_addStast,"Bomb Defuse Succ.","BombDefused")
|
||||
server_cmd(g_addStast,"Bomb Def. Failure","BombFailed")
|
||||
server_cmd(g_addStast,"Bomb PickUp","BombPickUp")
|
||||
server_cmd(g_addStast,"Bomb Drop","BombDrop")
|
||||
server_cmd(g_addStast,"Bomb Count Down","BombCountVoice")
|
||||
server_cmd(g_addStast,"Bomb Count Down (def)","BombCountDef")
|
||||
server_cmd(g_addStast,"Bomb Site Reached","BombReached")
|
||||
server_cmd(g_addStast,"Italy Bonus Kill","ItalyBonusKill")
|
||||
server_cmd(g_addStast,"Last Man","LastMan")
|
||||
server_cmd(g_addStast,"Knife Kill","KnifeKill")
|
||||
server_cmd(g_addStast,"Knife Kill Sound","KnifeKillSound")
|
||||
server_cmd(g_addStast,"Grenade Kill","GrenadeKill")
|
||||
server_cmd(g_addStast,"Grenade Suicide","GrenadeSuicide")
|
||||
server_cmd(g_addStast,"HeadShot Kill","HeadShotKill")
|
||||
server_cmd(g_addStast,"HeadShot Kill Sound","HeadShotKillSound")
|
||||
server_cmd(g_addStast,"Round Counter","RoundCounter")
|
||||
server_cmd(g_addStast,"Round Counter Sound","RoundCounterSound")
|
||||
server_cmd(g_addStast,"Killing Streak","KillingStreak")
|
||||
server_cmd(g_addStast,"Killing Streak Sound","KillingStreakSound")
|
||||
server_cmd(g_addStast,"Enemy Remaining","EnemyRemaining")
|
||||
server_cmd(g_addStast,"Double Kill","DoubleKill")
|
||||
server_cmd(g_addStast,"Double Kill Sound","DoubleKillSound")
|
||||
server_cmd(g_addStast,"Player Name","PlayerName")
|
||||
server_cmd(g_addStast,"First Blood Sound","FirstBloodSound")
|
||||
}
|
||||
|
||||
public client_putinserver(id)
|
||||
g_multiKills[id] = g_streakKills[ id ] = { 0 , 0 }
|
||||
|
||||
public client_death(killer,victim,wpnindex,hitplace,TK) {
|
||||
|
||||
new headshot = ( hitplace == HIT_HEAD ) ? 1:0
|
||||
|
||||
if ( g_firstBlood ) {
|
||||
g_firstBlood = 0
|
||||
if ( FirstBloodSound ) client_cmd(0,"spk misc/firstblood")
|
||||
}
|
||||
if ( (KillingStreak || KillingStreakSound) && !TK ) {
|
||||
g_streakKills[ killer ][ 0 ]++
|
||||
g_streakKills[ killer ][ 1 ] = 0
|
||||
g_streakKills[ victim ][ 1 ]++
|
||||
g_streakKills[ victim ][ 0 ] = 0
|
||||
new a = g_streakKills[ killer ][ 0 ] - 3
|
||||
if ( (a > -1) && !( a % 2 ) ) {
|
||||
new name[32]
|
||||
get_user_name( killer , name , 31 )
|
||||
if ( (a >>= 1) > 6 ) a = 6
|
||||
if ( KillingStreak ){
|
||||
set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, 3)
|
||||
show_hudmessage(0,g_KillingMsg[ a ], name )
|
||||
}
|
||||
if ( KillingStreakSound ) client_cmd( 0, "spk misc/%s", g_Sounds[ a ] )
|
||||
}
|
||||
}
|
||||
if ( MultiKill || MultiKillSound ) {
|
||||
if (killer && !TK ) {
|
||||
g_multiKills[killer][0]++
|
||||
g_multiKills[killer][1] += headshot
|
||||
new param[2]
|
||||
param[0] = killer
|
||||
param[1] = g_multiKills[killer][0]
|
||||
set_task( 4.0 + float( param[1] ) ,"checkKills",0,param,2)
|
||||
}
|
||||
}
|
||||
if ( EnemyRemaining ) {
|
||||
new ppl[32], pplnum
|
||||
new team = get_user_team( victim ) - 1
|
||||
get_players(ppl,pplnum,"e", g_teamsNames[1 - team] )
|
||||
if (pplnum) {
|
||||
new eppl[32], epplnum
|
||||
get_players(eppl,epplnum,"ae",g_teamsNames[team])
|
||||
if (epplnum) {
|
||||
new message[128],team_name[32]
|
||||
set_hudmessage(255,255,255,0.02,0.85,2, 0.05, 0.1, 0.02, 3.0, 3)
|
||||
for(new a=0; a<pplnum; ++a){
|
||||
format(team_name,31,"%L",ppl[a],(epplnum==1)?g_teamsNames[team]:g_teamsNames[team+2])
|
||||
format(message,127,"%L",ppl[a],"REMAINING",epplnum,team_name)
|
||||
show_hudmessage(ppl[a],message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( LastMan ) {
|
||||
new cts[32], ts[32], ctsnum, tsnum
|
||||
get_players(cts,ctsnum,"ae", g_teamsNames[1] )
|
||||
get_players(ts,tsnum,"ae", g_teamsNames[0] )
|
||||
if ( ctsnum == 1 && tsnum == 1 ) {
|
||||
new ctname[32], tname[32]
|
||||
get_user_name(cts[0],ctname,31)
|
||||
get_user_name(ts[0],tname,31)
|
||||
set_hudmessage(0, 255, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, 3)
|
||||
show_hudmessage(0,"%s vs. %s",ctname,tname)
|
||||
client_cmd(0,"spk misc/maytheforce")
|
||||
}
|
||||
else if ( !g_LastAnnounce ) {
|
||||
new oposite = 0, team = 0
|
||||
if ( ctsnum == 1 && tsnum > 1 ) {
|
||||
g_LastAnnounce = cts[0]
|
||||
oposite = tsnum
|
||||
team = 0
|
||||
}
|
||||
else if ( tsnum == 1 && ctsnum > 1 ) {
|
||||
g_LastAnnounce = ts[0]
|
||||
oposite = ctsnum
|
||||
team = 1
|
||||
}
|
||||
if (g_LastAnnounce) {
|
||||
new name[32]
|
||||
get_user_name(g_LastAnnounce,name,31)
|
||||
set_hudmessage(0, 255, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, 3)
|
||||
show_hudmessage(0,"%s (%d HP) vs. %d %s%s: %L",name,
|
||||
get_user_health(g_LastAnnounce),oposite,
|
||||
g_teamsNames[team],(oposite==1)?"":"S",LANG_PLAYER,g_LastMessages[ random_num(0,3) ] )
|
||||
client_cmd(g_LastAnnounce,"spk misc/oneandonly")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( wpnindex == 29 && ( KnifeKill || KnifeKillSound ) ) {
|
||||
if ( KnifeKill ) {
|
||||
new killer_name[32],victim_name[32]
|
||||
get_user_name(killer,killer_name,31)
|
||||
get_user_name(victim,victim_name,31)
|
||||
set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(0,"%L",LANG_PLAYER,g_KinfeMsg[ random_num(0,3) ],killer_name,victim_name)
|
||||
}
|
||||
if ( KnifeKillSound ) client_cmd(0,"spk misc/humiliation")
|
||||
}
|
||||
|
||||
if ( wpnindex == 4 && (GrenadeKill || GrenadeSuicide) ) {
|
||||
new killer_name[32],victim_name[32]
|
||||
get_user_name(killer,killer_name,32)
|
||||
get_user_name(victim,victim_name,32)
|
||||
set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
if ( killer != victim ) {
|
||||
if ( GrenadeKill ) show_hudmessage(0,"%L",LANG_PLAYER,g_HeMessages[ random_num(0,3)],killer_name,victim_name)
|
||||
}
|
||||
else if ( GrenadeSuicide ) show_hudmessage(0,"%L",LANG_PLAYER,g_SHeMessages[ random_num(0,3) ],victim_name)
|
||||
}
|
||||
if ( headshot && (HeadShotKill || HeadShotKillSound) ) {
|
||||
if ( HeadShotKill ) {
|
||||
new killer_name[32], victim_name[32], weapon_name[32], message[128], players[32], pnum
|
||||
get_weaponname(wpnindex,weapon_name,31)
|
||||
get_user_name(killer,killer_name,31)
|
||||
get_user_name(victim,victim_name,31)
|
||||
|
||||
get_players(players,pnum,"c")
|
||||
for (new i=0;i<pnum;i++) {
|
||||
format( message, 127, "%L",players[i],g_HeadShots[ random_num(0,6) ] )
|
||||
replace( message, 127 , "$vn", victim_name )
|
||||
replace( message, 127 , "$wn", weapon_name )
|
||||
replace( message, 127 , "$kn", killer_name )
|
||||
set_hudmessage(100, 100, 255, -1.0, 0.29, 0, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(players[i],message )
|
||||
}
|
||||
}
|
||||
if ( HeadShotKillSound ) {
|
||||
client_cmd(killer,"spk misc/headshot")
|
||||
client_cmd(victim,"spk misc/headshot")
|
||||
}
|
||||
}
|
||||
if ( DoubleKill || DoubleKillSound ) {
|
||||
new Float:nowtime = get_gametime()
|
||||
if ( g_doubleKill == nowtime && g_doubleKillId == killer ) {
|
||||
if ( DoubleKill ) {
|
||||
new name[32]
|
||||
get_user_name( killer , name , 31 )
|
||||
set_hudmessage(255, 0, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, 3)
|
||||
show_hudmessage(0,"%L",LANG_PLAYER,"DOUBLE_KILL",name )
|
||||
}
|
||||
if ( DoubleKillSound ) client_cmd(0,"spk misc/doublekill")
|
||||
}
|
||||
g_doubleKill = nowtime
|
||||
g_doubleKillId = killer
|
||||
}
|
||||
}
|
||||
|
||||
public hideStatus(id) {
|
||||
if ( PlayerName ) {
|
||||
set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4)
|
||||
show_hudmessage(id,"")
|
||||
}
|
||||
}
|
||||
|
||||
public setTeam(id)
|
||||
g_friend[id] = read_data(2)
|
||||
|
||||
public showStatus(id) {
|
||||
if ( PlayerName ) {
|
||||
new name[32],pid = read_data(2)
|
||||
get_user_name(pid,name,31)
|
||||
new color1 = 0,color2 = 0
|
||||
if ( get_user_team(pid)==1 )
|
||||
color1 = 255
|
||||
else
|
||||
color2 = 255
|
||||
if (g_friend[id]==1) { // friend
|
||||
new clip, ammo, wpnid = get_user_weapon(pid,clip,ammo)
|
||||
new wpnname[32]
|
||||
get_weaponname(wpnid,wpnname,31)
|
||||
set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
|
||||
show_hudmessage(id,"%s -- %d HP / %d AP / %s",name,
|
||||
get_user_health(pid),get_user_armor(pid),wpnname[7])
|
||||
}
|
||||
else {
|
||||
set_hudmessage(color1,50,color2,-1.0,0.60,1, 0.01, 3.0, 0.01, 0.01, 4)
|
||||
show_hudmessage(id,name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public eNewRound()
|
||||
if ( read_data(1) == floatround(get_cvar_float("mp_roundtime") * 60.0) ) {
|
||||
g_firstBlood = 1
|
||||
g_C4Timer = 0
|
||||
++g_roundCount
|
||||
if ( RoundCounter ) {
|
||||
set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(0, "%L", LANG_PLAYER, "PREPARE_FIGHT", g_roundCount )
|
||||
}
|
||||
if ( RoundCounterSound ) client_cmd( 0 , "spk misc/prepare" )
|
||||
if ( KillingStreak ) {
|
||||
new appl[32],ppl, i
|
||||
get_players(appl,ppl, "ac" )
|
||||
for (new a = 0; a < ppl; ++a) {
|
||||
i = appl[ a ]
|
||||
if ( g_streakKills[ i ][ 0 ] >= 2 )
|
||||
client_print( i , print_chat , "* %L", i, "KILLED_ROW", g_streakKills[ i ][ 0 ] )
|
||||
else if ( g_streakKills[ i ][ 1 ] >= 2 )
|
||||
client_print( i , print_chat , "* %L", i, "DIED_ROUNDS", g_streakKills[ i ][ 1 ] )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public eRestart() {
|
||||
eEndRound()
|
||||
g_roundCount = 0
|
||||
g_firstBlood = 1
|
||||
}
|
||||
|
||||
public eEndRound() {
|
||||
g_C4Timer = -2
|
||||
g_LastOmg = 0.0
|
||||
remove_task(8038)
|
||||
g_LastAnnounce = 0
|
||||
}
|
||||
|
||||
public checkKills(param[]) {
|
||||
new id = param[0]
|
||||
new a = param[1]
|
||||
if (a == g_multiKills[id][0]) {
|
||||
a -= 3
|
||||
if ( a > -1 ) {
|
||||
if ( MultiKill ) {
|
||||
new name[32]
|
||||
get_user_name(id,name,31)
|
||||
set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)
|
||||
if ( a > 6 ) a = 6
|
||||
show_hudmessage(0,g_MultiKillMsg[a],name,LANG_PLAYER,"WITH",g_multiKills[id][0],g_multiKills[id][1])
|
||||
}
|
||||
if ( MultiKillSound ) client_cmd(0,"spk misc/%s",g_Sounds[a])
|
||||
}
|
||||
g_multiKills[id] = { 0,0 }
|
||||
}
|
||||
}
|
||||
|
||||
public chickenKill()
|
||||
if ( ItalyBonusKill ) announceEvent( 0 , "KILLED_CHICKEN" )
|
||||
|
||||
public radioKill() {
|
||||
if ( ItalyBonusKill ) announceEvent( 0 , "BLEW_RADIO" )
|
||||
}
|
||||
|
||||
announceEvent( id, message[] ) {
|
||||
new name[32]
|
||||
get_user_name(id, name , 31)
|
||||
set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
|
||||
show_hudmessage(0,"%L",LANG_PLAYER,message,name)
|
||||
}
|
||||
|
||||
public eBombPickUp(id)
|
||||
if (BombPickUp) announceEvent(id , "PICKED_BOMB")
|
||||
|
||||
public eBombDrop()
|
||||
if (BombDrop) announceEvent(g_Planter , "DROPPED_BOMB")
|
||||
|
||||
public eGotBomb(id) {
|
||||
g_Planter = id
|
||||
if ( BombReached && read_data(1)==2 && g_LastOmg<get_gametime()) {
|
||||
g_LastOmg = get_gametime() + 15.0
|
||||
announceEvent(g_Planter, "REACHED_TARGET" )
|
||||
}
|
||||
}
|
||||
|
||||
public bombTimer() {
|
||||
if (--g_C4Timer > 0) {
|
||||
if (BombCountVoice) {
|
||||
if (g_C4Timer == 30 || g_C4Timer == 20) {
|
||||
new temp[48]
|
||||
num_to_word(g_C4Timer,temp,47)
|
||||
client_cmd(0,"spk ^"vox/%s seconds until explosion^"",temp)
|
||||
}
|
||||
else if (g_C4Timer < 11) {
|
||||
new temp[48]
|
||||
num_to_word(g_C4Timer,temp,47)
|
||||
client_cmd(0,"spk ^"vox/%s^"",temp)
|
||||
}
|
||||
}
|
||||
if (BombCountDef && g_Defusing) client_print(g_Defusing,print_center,"%d",g_C4Timer)
|
||||
}
|
||||
else remove_task(8038)
|
||||
}
|
||||
|
||||
public bomb_planted(planter){
|
||||
g_Defusing = 0
|
||||
if (BombPlanted) announceEvent(planter, "SET_UP_BOMB" )
|
||||
g_C4Timer = get_cvar_num("mp_c4timer")
|
||||
set_task(1.0,"bombTimer",8038,"",0,"b")
|
||||
|
||||
}
|
||||
|
||||
public bomb_planting(planter)
|
||||
if (BombPlanting) announceEvent(planter, "PLANT_BOMB" )
|
||||
|
||||
public bomb_defusing(defuser){
|
||||
if (BombDefusing) announceEvent(defuser, "DEFUSING_BOMB" )
|
||||
g_Defusing = defuser
|
||||
}
|
||||
|
||||
public bomb_defused(defuser)
|
||||
if (BombDefused) announceEvent(defuser, "DEFUSED_BOMB" )
|
||||
|
||||
public bomb_explode(planter,defuser)
|
||||
if (BombFailed && defuser) announceEvent(defuser , "FAILED_DEFU" )
|
||||
|
||||
public plugin_modules()
|
||||
{
|
||||
require_module("csx")
|
||||
}
|
44
dlls/csx/plugins/miscstats.txt
Executable file
44
dlls/csx/plugins/miscstats.txt
Executable file
@ -0,0 +1,44 @@
|
||||
[en]
|
||||
WITH = with
|
||||
KNIFE_MSG_1 = %s sliced and diced %s
|
||||
KNIFE_MSG_2 = %s pulled out knife and gutted %s
|
||||
KNIFE_MSG_3 = %s sneaks carefully behind and knifed %s
|
||||
KNIFE_MSG_4 = %s knived %s
|
||||
LAST_MSG_1 = Now all depend on you!
|
||||
LAST_MSG_2 = I hope you still have a healthpack.
|
||||
LAST_MSG_3 = All your teammates were killed. Good luck!
|
||||
LAST_MSG_4 = Now you are alone. Have fun!
|
||||
HE_MSG_1 = %s sends a little gift to %s
|
||||
HE_MSG_2 = %s throws a small present to %s
|
||||
HE_MSG_3 = %s made a precision throw to %s
|
||||
HE_MSG_4 = %s got a big explosion for %s
|
||||
SHE_MSG_1 = %s detonated himself with a grenade
|
||||
SHE_MSG_2 = %s trys the effect of an HE Grenade
|
||||
SHE_MSG_3 = %s swallows grenades whole!
|
||||
SHE_MSG_4 = %s explodes!
|
||||
HS_MSG_1 = $kn killed $vn with a well^nplaced shot to the head!
|
||||
HS_MSG_2 = $kn removed $vn's^nhead with the $wn
|
||||
HS_MSG_3 = $kn turned $vn's head^ninto pudding with the $wn
|
||||
HS_MSG_4 = $vn got pwned by $kn
|
||||
HS_MSG_5 = $vn's head has been^nturned into red jello
|
||||
HS_MSG_6 = $kn has superb aim with the $wn,^nas $vn well knows.
|
||||
HS_MSG_7 = $vn's head stayed in $kn's^ncrosshairs a bit too long...
|
||||
DOUBLE_KILL = Wow! %s made a double kill!!!
|
||||
PREPARE_FIGHT = Prepare to FIGHT!^nRound %d
|
||||
KILLED_ROW = You've killed %d in a row so far
|
||||
DIED_ROUNDS = Careful! You've died %d rounds in a row now...
|
||||
KILLED_CHICKEN = Somebody killed a chicken!!!
|
||||
BLEW_RADIO = Somebody blew up the radio!!!
|
||||
REACHED_TARGET = Omg! %s reached the target!
|
||||
PLANT_BOMB = %s is planting the bomb!
|
||||
DEFUSING_BOMB = %s is defusing the bomb...
|
||||
SET_UP_BOMB = %s set us up the bomb!!!
|
||||
DEFUSED_BOMB = %s defused the bomb!
|
||||
FAILED_DEFU = %s failed to defuse the bomb...
|
||||
PICKED_BOMB = %s picked up the bomb...
|
||||
DROPPED_BOMB = %s dropped the bomb!!!
|
||||
CT = CT
|
||||
CTS = CTS
|
||||
TERRORIST = TERRORIST
|
||||
TERRORISTS = TERRORISTS
|
||||
REMAINING = %d %s Remaining...
|
1561
dlls/csx/plugins/statsx.sma
Executable file
1561
dlls/csx/plugins/statsx.sma
Executable file
File diff suppressed because it is too large
Load Diff
177
dlls/csx/plugins/tp/amx_csx_gasnades.sma
Executable file
177
dlls/csx/plugins/tp/amx_csx_gasnades.sma
Executable file
@ -0,0 +1,177 @@
|
||||
/* Gasnades */
|
||||
|
||||
#include <amxmodx>
|
||||
#include <fun>
|
||||
#include <engine>
|
||||
#include <csx>
|
||||
|
||||
new g_Gas
|
||||
//----------------------------------------------------------------------------------------------
|
||||
public plugin_init()
|
||||
{
|
||||
register_plugin("Gasgrenades", "1.3 (CSX)", "RichoDemus/AssKicR/T(+)rget")
|
||||
|
||||
register_cvar("amx_gasnades", "1")
|
||||
register_cvar("amx_gasdmg", "10")
|
||||
register_cvar("amx_gascheck", "3")
|
||||
register_cvar("amx_gasradius", "200")
|
||||
register_cvar("amx_smokegasp", "1")
|
||||
register_cvar("amx_gasobeyFF", "1")
|
||||
|
||||
g_Gas = custom_weapon_add("gasnade",0,"gasnade")
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
public plugin_precache()
|
||||
{
|
||||
precache_sound("player/gasp1.wav")
|
||||
precache_sound("player/gasp2.wav")
|
||||
}
|
||||
|
||||
public gas(par[])
|
||||
{
|
||||
new grenadeid = par[1]
|
||||
new id = par[0]
|
||||
|
||||
if ( !is_valid_ent(grenadeid) )
|
||||
return
|
||||
|
||||
new player[3], inum, Float:temp_grenade[3], grenade[3], players[32]
|
||||
if(get_cvar_num("amx_gasobeyFF") != 1)
|
||||
get_players(players, inum) // Get number of players
|
||||
else{
|
||||
new FFOn = get_cvar_num("mp_friendlyfire")
|
||||
if(FFOn == 0){
|
||||
new team[33]
|
||||
get_user_team(id, team, 32)
|
||||
if(equali(team, "CT"))
|
||||
get_players(players, inum, "ae", "TERRORIST")
|
||||
else
|
||||
get_players(players, inum, "ae", "CT")
|
||||
}
|
||||
else
|
||||
get_players(players, inum) // Get number of players
|
||||
}
|
||||
entity_get_vector(grenadeid, EV_VEC_origin, temp_grenade) // Get the position of the grenade
|
||||
grenade[0] = floatround(temp_grenade[0])
|
||||
grenade[1] = floatround(temp_grenade[1])
|
||||
grenade[2] = floatround(temp_grenade[2])
|
||||
for(new i = 0; i < inum; ++i){ // Loop through all players
|
||||
get_user_origin(players[i],player,0)
|
||||
new distance = get_distance(grenade, player)
|
||||
|
||||
if((distance < get_cvar_num("amx_gasradius"))){ // Check who is standing close
|
||||
if(get_cvar_num("amx_smokegasp") != 0){
|
||||
if(get_cvar_num("amx_gascheck") >= 1){
|
||||
new number = random_num(1, 2)
|
||||
if(is_user_alive(players[i])){
|
||||
switch (number){
|
||||
case 1:emit_sound(players[i], CHAN_VOICE, "player/gasp1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
|
||||
case 2:emit_sound(players[i], CHAN_VOICE, "player/gasp2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
message_begin(MSG_ONE, get_user_msgid("Damage"), {0,0,0}, players[i])
|
||||
write_byte(30) // dmg_save
|
||||
write_byte(30) // dmg_take
|
||||
write_long((1 << 16)) // visibleDamageBits
|
||||
write_coord(grenade[0]) // damageOrigin.x
|
||||
write_coord(grenade[1]) // damageOrigin.y
|
||||
write_coord(grenade[2]) // damageOrigin.z
|
||||
message_end()
|
||||
if(is_user_alive(id))
|
||||
ExtraDamage(players[i], id, get_cvar_num("amx_gasdmg"), "gasgrenade")
|
||||
}
|
||||
}
|
||||
set_task(get_cvar_float("amx_gascheck"), "gas",grenadeid,par,2) // If the grenade still exists we do a new check in get_cvar_num("amx_gascheck") second
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
public grenade_throw(index,greindex,wId){
|
||||
if ( task_exists(greindex) )
|
||||
remove_task(greindex)
|
||||
if( get_cvar_num("amx_gasnades") !=1 || wId != CSW_SMOKEGRENADE )
|
||||
return PLUGIN_CONTINUE
|
||||
if (g_Gas) custom_weapon_shot(g_Gas,index)
|
||||
new par[2]
|
||||
par[0] = index
|
||||
par[1] = greindex
|
||||
set_task(1.5, "gas", greindex,par,2)
|
||||
return PLUGIN_CONTINUE
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
stock ExtraDamage(id, attacker, damage, weaponDescription[])
|
||||
{
|
||||
if(is_user_alive(id))
|
||||
{
|
||||
new userHealth = get_user_health(id)
|
||||
set_user_health(id, userHealth - damage)
|
||||
if (g_Gas)
|
||||
custom_weapon_dmg(g_Gas,attacker,id,damage)
|
||||
|
||||
if(userHealth - damage <= 0)
|
||||
{
|
||||
logKill(attacker, id, weaponDescription)
|
||||
if(get_user_team(id) != get_user_team(attacker))
|
||||
{
|
||||
// The person dying shouldn't get negative credit for this kill (so add it back)
|
||||
set_user_frags(id, get_user_frags(id) + 1)
|
||||
// The killing should get credit for the frag
|
||||
set_user_frags(attacker, get_user_frags(attacker) + 1)
|
||||
}
|
||||
else
|
||||
{
|
||||
// The person dying shouldn't get negative credit for this kill (so add it back)
|
||||
set_user_frags(id, get_user_frags(id) + 1)
|
||||
// The killer killed a teammember or self
|
||||
// Engine gives credit for the kill so let's take away that + 1
|
||||
set_user_frags(attacker, get_user_frags(attacker) - 2)
|
||||
}
|
||||
}else{
|
||||
if(get_cvar_num("mp_logdetail") == 3){
|
||||
logDmg(attacker, id, weaponDescription,"body",damage,userHealth-damage)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------
|
||||
/* Log a kill using standard HL-logging format */
|
||||
stock logKill(attacker, victim, weaponDescription[])
|
||||
{
|
||||
// Save Hummiliation
|
||||
new namea[24], namev[24], authida[20], authidv[20], teama[10], teamv[10]
|
||||
|
||||
// Info On Attacker
|
||||
get_user_name(attacker, namea, 23)
|
||||
get_user_team(attacker, teama, 9)
|
||||
get_user_authid(attacker, authida, 19)
|
||||
// Info On Victim
|
||||
get_user_name(victim, namev, 23)
|
||||
get_user_team(victim, teamv, 9)
|
||||
get_user_authid(victim, authidv, 19)
|
||||
// Log This Kill
|
||||
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",
|
||||
namea, get_user_userid(attacker), authida, teama, namev, get_user_userid(victim), authidv, teamv, weaponDescription)
|
||||
}
|
||||
|
||||
/* Log damage using standard HL-logging format */
|
||||
stock logDmg(attacker, victim, weaponDescription[],hit[],damage,health)
|
||||
{
|
||||
// Save Hummiliation
|
||||
new namea[24], namev[24], authida[20], authidv[20], teama[10], teamv[10]
|
||||
|
||||
// Info On Attacker
|
||||
get_user_name(attacker, namea, 23)
|
||||
get_user_team(attacker, teama, 9)
|
||||
get_user_authid(attacker, authida, 19)
|
||||
// Info On Victim
|
||||
get_user_name(victim, namev, 23)
|
||||
get_user_team(victim, teamv, 9)
|
||||
get_user_authid(victim, authidv, 19)
|
||||
// Log This Damage
|
||||
log_message("^"%s<%d><%s><%s>^" attacked ^"%s<%d><%s><%s>^" with ^"%s^" (hit ^"%s^") (damage ^"%d^") (health ^"%d^")",
|
||||
namea,get_user_userid(attacker),authida,teama,namev,get_user_userid(victim),authidv,teamv,weaponDescription,hit,damage,health)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
299
dlls/csx/source/CMisc.cpp
Executable file
299
dlls/csx/source/CMisc.cpp
Executable file
@ -0,0 +1,299 @@
|
||||
|
||||
|
||||
#include "CMisc.h"
|
||||
#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Grenades
|
||||
// *****************************************************
|
||||
void Grenades::put( edict_t* grenade, float time, int type, CPlayer* player )
|
||||
{
|
||||
Obj* a = new Obj;
|
||||
if ( a == 0 ) return;
|
||||
a->player = player;
|
||||
a->grenade = grenade;
|
||||
a->time = gpGlobals->time + time;
|
||||
a->type = type;
|
||||
a->prev = 0;
|
||||
a->next = head;
|
||||
if ( head ) head->prev = a;
|
||||
head = a;
|
||||
}
|
||||
|
||||
bool Grenades::find( edict_t* enemy, CPlayer** p, int* type )
|
||||
{
|
||||
bool found = false;
|
||||
Obj* a = head;
|
||||
while ( a ){
|
||||
if ( a->time > gpGlobals->time ) {
|
||||
if ( a->grenade == enemy ) {
|
||||
found = true;
|
||||
*p = a->player;
|
||||
*type = a->type;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Obj* next = a->next;
|
||||
if (a->prev) a->prev->next = next;
|
||||
else head = next;
|
||||
if (next) next->prev = a->prev;
|
||||
delete a;
|
||||
a = next;
|
||||
continue;
|
||||
}
|
||||
a = a->next;
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Grenades::clear()
|
||||
{
|
||||
while(head){
|
||||
Obj* a = head->next;
|
||||
delete head;
|
||||
head = a;
|
||||
}
|
||||
}
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
void CPlayer::Disconnect(){
|
||||
|
||||
if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
|
||||
return;
|
||||
|
||||
rank->updatePosition( &life );
|
||||
rank = 0;
|
||||
}
|
||||
|
||||
void CPlayer::PutInServer(){
|
||||
|
||||
if ( ignoreBots(pEdict) )
|
||||
return;
|
||||
|
||||
restartStats();
|
||||
const char* name = STRING(pEdict->v.netname);
|
||||
const char* unique = name;
|
||||
switch((int)csstats_rank->value) {
|
||||
case 1:
|
||||
if ( (unique = GETPLAYERAUTHID(pEdict)) == 0 )
|
||||
unique = name; // failed to get authid
|
||||
break;
|
||||
case 2:
|
||||
unique = ip;
|
||||
}
|
||||
rank = g_rank.findEntryInRank( unique , name );
|
||||
}
|
||||
|
||||
void CPlayer::Connect(const char* address ){
|
||||
bot = IsBot();
|
||||
strcpy(ip,address);
|
||||
rank = 0;
|
||||
clearStats = 0.0f;
|
||||
}
|
||||
|
||||
void CPlayer::restartStats(bool all)
|
||||
{
|
||||
if ( all ) memset(weapons,0,sizeof(weapons));
|
||||
memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
|
||||
memset(attackers,0,sizeof(attackers));
|
||||
memset(victims,0,sizeof(victims));
|
||||
memset(&life,0,sizeof(life));
|
||||
}
|
||||
|
||||
void CPlayer::Init( int pi, edict_t* pe )
|
||||
{
|
||||
pEdict = pe;
|
||||
index = pi;
|
||||
current = 0;
|
||||
clearStats = 0.0f;
|
||||
rank = 0;
|
||||
}
|
||||
|
||||
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
|
||||
|
||||
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||
return;
|
||||
|
||||
if ( pVictim->index == index ){ // killed self
|
||||
pVictim->weapons[0].deaths++;
|
||||
pVictim->life.deaths++;
|
||||
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||
return;
|
||||
}
|
||||
|
||||
pVictim->attackers[index].name = weaponData[wweapon].name;
|
||||
pVictim->attackers[index].kills++;
|
||||
pVictim->attackers[index].hs += hhs;
|
||||
pVictim->attackers[index].tks += ttk;
|
||||
pVictim->attackers[0].kills++;
|
||||
pVictim->attackers[0].hs += hhs;
|
||||
pVictim->attackers[0].tks += ttk;
|
||||
pVictim->weapons[pVictim->current].deaths++;
|
||||
pVictim->weapons[0].deaths++;
|
||||
pVictim->life.deaths++;
|
||||
|
||||
|
||||
pVictim->weaponsRnd[pVictim->current].deaths++; // DEC-Weapon (round) stats
|
||||
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||
|
||||
int vi = pVictim->index;
|
||||
victims[vi].name = weaponData[wweapon].name;
|
||||
victims[vi].deaths++;
|
||||
victims[vi].hs += hhs;
|
||||
victims[vi].tks += ttk;
|
||||
victims[0].deaths++;
|
||||
victims[0].hs += hhs;
|
||||
victims[0].tks += ttk;
|
||||
|
||||
weaponsRnd[wweapon].kills++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].hs += hhs; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].tks += ttk; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].kills++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].hs += hhs; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].tks += ttk; // DEC-Weapon (round) stats
|
||||
|
||||
weapons[wweapon].kills++;
|
||||
weapons[wweapon].hs += hhs;
|
||||
weapons[wweapon].tks += ttk;
|
||||
weapons[0].kills++;
|
||||
weapons[0].hs += hhs;
|
||||
weapons[0].tks += ttk;
|
||||
life.kills++;
|
||||
life.hs += hhs;
|
||||
life.tks += ttk;
|
||||
}
|
||||
|
||||
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
|
||||
|
||||
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||
return;
|
||||
|
||||
if ( index == pVictim->index ) return;
|
||||
|
||||
pVictim->attackers[index].hits++;
|
||||
pVictim->attackers[index].damage += ddamage;
|
||||
pVictim->attackers[index].bodyHits[bbody]++;
|
||||
pVictim->attackers[0].hits++;
|
||||
pVictim->attackers[0].damage += ddamage;
|
||||
pVictim->attackers[0].bodyHits[bbody]++;
|
||||
|
||||
|
||||
int vi = pVictim->index;
|
||||
victims[vi].hits++;
|
||||
victims[vi].damage += ddamage;
|
||||
victims[vi].bodyHits[bbody]++;
|
||||
victims[0].hits++;
|
||||
victims[0].damage += ddamage;
|
||||
victims[0].bodyHits[bbody]++;
|
||||
|
||||
weaponsRnd[wweapon].hits++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].damage += ddamage; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].hits++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].damage += ddamage; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||
|
||||
weapons[wweapon].hits++;
|
||||
weapons[wweapon].damage += ddamage;
|
||||
weapons[wweapon].bodyHits[bbody]++;
|
||||
weapons[0].hits++;
|
||||
weapons[0].damage += ddamage;
|
||||
weapons[0].bodyHits[bbody]++;
|
||||
|
||||
life.hits++;
|
||||
life.damage += ddamage;
|
||||
life.bodyHits[bbody]++;
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::saveShot(int weapon){
|
||||
|
||||
if ( ignoreBots(pEdict) )
|
||||
return;
|
||||
|
||||
victims[0].shots++;
|
||||
weapons[weapon].shots++;
|
||||
weapons[0].shots++;
|
||||
life.shots++;
|
||||
weaponsRnd[weapon].shots++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].shots++; // DEC-Weapon (round) stats
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::saveBPlant(){
|
||||
life.bPlants++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBExplode(){
|
||||
life.bExplosions++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBDefusing(){
|
||||
life.bDefusions++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBDefused(){
|
||||
life.bDefused++;
|
||||
}
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class Forward
|
||||
// *****************************************************
|
||||
|
||||
void Forward::put( AMX *a , int i ){
|
||||
head = new AmxCall( a, i , head );
|
||||
}
|
||||
|
||||
|
||||
void Forward::clear(){
|
||||
while ( head ) {
|
||||
AmxCall* a = head->next;
|
||||
delete head;
|
||||
head = a;
|
||||
}
|
||||
}
|
||||
|
||||
void Forward::exec(int p1,int p2,int p3,int p4,int p5,int p6){
|
||||
AmxCall* a = head;
|
||||
while ( a ){
|
||||
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 6,p1, p2, p3, p4, p5, p6);
|
||||
a = a->next;
|
||||
}
|
||||
}
|
||||
|
||||
void Forward::exec(int p1,int p2,int p3,int p4,int p5){
|
||||
AmxCall* a = head;
|
||||
while ( a ){
|
||||
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 5,p1, p2, p3, p4, p5);
|
||||
a = a->next;
|
||||
}
|
||||
}
|
||||
|
||||
void Forward::exec(int p1,int p2){
|
||||
AmxCall* a = head;
|
||||
while ( a ){
|
||||
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 2,p1, p2);
|
||||
a = a->next;
|
||||
}
|
||||
}
|
||||
|
||||
// *****************************************************
|
||||
|
||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther){
|
||||
if ( !rankBots && ( pEnt->v.flags & FL_FAKECLIENT || ( pOther && pOther->v.flags & FL_FAKECLIENT ) ) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isModuleActive(){
|
||||
if ( !(int)CVAR_GET_FLOAT("csstats_pause") )
|
||||
return true;
|
||||
return false;
|
||||
}
|
116
dlls/csx/source/CMisc.h
Executable file
116
dlls/csx/source/CMisc.h
Executable file
@ -0,0 +1,116 @@
|
||||
|
||||
|
||||
#ifndef CMISC_H
|
||||
#define CMISC_H
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
|
||||
#define MAX_CWEAPONS 6
|
||||
|
||||
#define CSW_HEGRENADE 4
|
||||
#define CSW_C4 6
|
||||
#define CSW_SMOKEGRENADE 9
|
||||
#define CSW_FLASHBANG 25
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
struct CPlayer {
|
||||
edict_t* pEdict;
|
||||
char ip[32];
|
||||
int index;
|
||||
int aiming;
|
||||
int current;
|
||||
bool bot;
|
||||
float clearStats;
|
||||
RankSystem::RankStats* rank;
|
||||
|
||||
struct PlayerWeapon : Stats {
|
||||
const char* name;
|
||||
int ammo;
|
||||
int clip;
|
||||
};
|
||||
|
||||
PlayerWeapon weapons[MAX_WEAPONS+MAX_CWEAPONS];
|
||||
PlayerWeapon attackers[33];
|
||||
PlayerWeapon victims[33];
|
||||
Stats weaponsRnd[MAX_WEAPONS+MAX_CWEAPONS]; // DEC-Weapon (Round) stats
|
||||
Stats life;
|
||||
|
||||
int teamId;
|
||||
|
||||
void Init( int pi, edict_t* pe );
|
||||
void Connect(const char* ip );
|
||||
void PutInServer();
|
||||
void Disconnect();
|
||||
void saveKill(CPlayer* pVictim, int weapon, int hs, int tk);
|
||||
void saveHit(CPlayer* pVictim, int weapon, int damage, int aiming);
|
||||
void saveShot(int weapon);
|
||||
|
||||
void saveBPlant();
|
||||
void saveBExplode();
|
||||
void saveBDefusing();
|
||||
void saveBDefused();
|
||||
|
||||
void restartStats(bool all = true);
|
||||
inline bool IsBot(){
|
||||
const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict);
|
||||
return ( auth && !strcmp( auth , "BOT" ) );
|
||||
}
|
||||
inline bool IsAlive(){
|
||||
return ((pEdict->v.deadflag==DEAD_NO)&&(pEdict->v.health>0));
|
||||
}
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class Grenades
|
||||
// *****************************************************
|
||||
|
||||
class Grenades
|
||||
{
|
||||
struct Obj
|
||||
{
|
||||
CPlayer* player;
|
||||
edict_t* grenade;
|
||||
float time;
|
||||
int type;
|
||||
Obj* next;
|
||||
Obj* prev;
|
||||
} *head;
|
||||
|
||||
public:
|
||||
Grenades() { head = 0; }
|
||||
~Grenades() { clear(); }
|
||||
void put( edict_t* grenade, float time, int type, CPlayer* player );
|
||||
bool find( edict_t* enemy, CPlayer** p, int* type );
|
||||
void clear();
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class Forward
|
||||
// *****************************************************
|
||||
|
||||
class Forward
|
||||
{
|
||||
struct AmxCall {
|
||||
AMX *amx;
|
||||
int iFunctionIdx;
|
||||
AmxCall* next;
|
||||
AmxCall( AMX *a , int i, AmxCall* n ): amx(a), iFunctionIdx(i), next(n) {}
|
||||
} *head;
|
||||
public:
|
||||
Forward() { head = 0; }
|
||||
~Forward() { clear(); }
|
||||
void clear();
|
||||
void put( AMX *a , int i );
|
||||
void exec(int p1,int p2,int p3,int p4,int p5,int p6);
|
||||
void exec(int p1,int p2,int p3,int p4,int p5);
|
||||
void exec(int p1,int p2);
|
||||
};
|
||||
|
||||
#endif // CMISC_H
|
||||
|
||||
|
||||
|
308
dlls/csx/source/CRank.cpp
Executable file
308
dlls/csx/source/CRank.cpp
Executable file
@ -0,0 +1,308 @@
|
||||
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
Stats::Stats(){
|
||||
hits = shots = damage = hs = tks = kills = deaths = bDefusions = bDefused = bPlants = bExplosions = 0;
|
||||
memset( bodyHits , 0 ,sizeof( bodyHits ) );
|
||||
}
|
||||
void Stats::commit(Stats* a){
|
||||
hits += a->hits;
|
||||
shots += a->shots;
|
||||
damage += a->damage;
|
||||
hs += a->hs;
|
||||
tks += a->tks;
|
||||
kills += a->kills;
|
||||
deaths += a->deaths;
|
||||
|
||||
bDefusions += a->bDefusions;
|
||||
bDefused += a->bDefused;
|
||||
bPlants += a->bPlants;
|
||||
bExplosions += a->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
bodyHits[i] += a->bodyHits[i];
|
||||
}
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
RankSystem::RankStats::RankStats( const char* uu, const char* nn, RankSystem* pp ) {
|
||||
name = 0;
|
||||
namelen = 0;
|
||||
unique = 0;
|
||||
uniquelen = 0;
|
||||
score = 0;
|
||||
parent = pp;
|
||||
id = ++parent->rankNum;
|
||||
next = prev = 0;
|
||||
setName( nn );
|
||||
setUnique( uu );
|
||||
}
|
||||
|
||||
RankSystem::RankStats::~RankStats() {
|
||||
delete[] name;
|
||||
delete[] unique;
|
||||
--parent->rankNum;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setName( const char* nn ) {
|
||||
delete[] name;
|
||||
namelen = strlen(nn) + 1;
|
||||
name = new char[namelen];
|
||||
if ( name )
|
||||
strcpy( name , nn );
|
||||
else
|
||||
namelen = 0;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setUnique( const char* nn ) {
|
||||
delete[] unique;
|
||||
uniquelen = strlen(nn) + 1;
|
||||
unique = new char[uniquelen];
|
||||
if ( unique )
|
||||
strcpy( unique , nn );
|
||||
else
|
||||
uniquelen = 0;
|
||||
}
|
||||
|
||||
RankSystem::RankSystem() {
|
||||
head = 0;
|
||||
tail = 0;
|
||||
rankNum = 0;
|
||||
calc.code = 0;
|
||||
}
|
||||
|
||||
RankSystem::~RankSystem() {
|
||||
clear();
|
||||
}
|
||||
|
||||
void RankSystem::put_before( RankStats* a, RankStats* ptr ){
|
||||
a->next = ptr;
|
||||
if ( ptr ){
|
||||
a->prev = ptr->prev;
|
||||
ptr->prev = a;
|
||||
}
|
||||
else{
|
||||
a->prev = head;
|
||||
head = a;
|
||||
}
|
||||
if ( a->prev ) a->prev->next = a;
|
||||
else tail = a;
|
||||
}
|
||||
|
||||
void RankSystem::put_after( RankStats* a, RankStats* ptr ) {
|
||||
a->prev = ptr;
|
||||
if ( ptr ){
|
||||
a->next = ptr->next;
|
||||
ptr->next = a;
|
||||
}
|
||||
else{
|
||||
a->next = tail;
|
||||
tail = a;
|
||||
}
|
||||
if ( a->next ) a->next->prev = a;
|
||||
else head = a;
|
||||
}
|
||||
|
||||
void RankSystem::unlink( RankStats* ptr ){
|
||||
if (ptr->prev) ptr->prev->next = ptr->next;
|
||||
else tail = ptr->next;
|
||||
if (ptr->next) ptr->next->prev = ptr->prev;
|
||||
else head = ptr->prev;
|
||||
}
|
||||
|
||||
void RankSystem::clear(){
|
||||
while( tail ){
|
||||
head = tail->next;
|
||||
delete tail;
|
||||
tail = head;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool RankSystem::loadCalc(const char* filename, char* error)
|
||||
{
|
||||
if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error,0)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr1, &calc.physAddr1)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr2, &calc.physAddr2)!=AMX_ERR_NONE)||
|
||||
(MF_AmxFindPublic(&calc.amx,"get_score",&calc.func)!=AMX_ERR_NONE)){
|
||||
LOG_CONSOLE( PLID, "Couldn't load plugin (file \"%s\")",filename);
|
||||
MF_UnloadAmxScript(&calc.amx, &calc.code);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RankSystem::unloadCalc()
|
||||
{
|
||||
MF_UnloadAmxScript(&calc.amx , &calc.code);
|
||||
}
|
||||
|
||||
RankSystem::RankStats* RankSystem::findEntryInRank(const char* unique, const char* name )
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( strcmp( a->getUnique() ,unique ) == 0 )
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
a = new RankStats( unique ,name,this );
|
||||
if ( a == 0 ) return 0;
|
||||
put_after( a , 0 );
|
||||
return a;
|
||||
}
|
||||
|
||||
void RankSystem::updatePos( RankStats* rr , Stats* s )
|
||||
{
|
||||
rr->addStats( s );
|
||||
if ( calc.code ) {
|
||||
calc.physAddr1[0] = rr->kills;
|
||||
calc.physAddr1[1] = rr->deaths;
|
||||
calc.physAddr1[2] = rr->hs;
|
||||
calc.physAddr1[3] = rr->tks;
|
||||
calc.physAddr1[4] = rr->shots;
|
||||
calc.physAddr1[5] = rr->hits;
|
||||
calc.physAddr1[6] = rr->damage;
|
||||
|
||||
calc.physAddr1[7] = rr->bDefusions;
|
||||
calc.physAddr1[8] = rr->bDefused;
|
||||
calc.physAddr1[9] = rr->bPlants;
|
||||
calc.physAddr1[10] = rr->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
calc.physAddr2[i] = rr->bodyHits[i];
|
||||
cell result = 0;
|
||||
int err;
|
||||
if ((err = MF_AmxExec(&calc.amx,&result, calc.func ,2,calc.amxAddr1,calc.amxAddr2 )) != AMX_ERR_NONE)
|
||||
LOG_CONSOLE( PLID, "Run time error %d on line %ld (plugin \"%s\")", err,calc.amx.curline,LOCALINFO("csstats_score"));
|
||||
rr->score = result;
|
||||
}
|
||||
else rr->score = rr->kills - rr->deaths;
|
||||
|
||||
|
||||
RankStats* aa = rr->next;
|
||||
while ( aa && (aa->score <= rr->score) ) { // try to nominate
|
||||
rr->goUp();
|
||||
aa->goDown();
|
||||
aa = aa->next; // go to next rank
|
||||
}
|
||||
if ( aa != rr->next )
|
||||
{
|
||||
unlink( rr );
|
||||
put_before( rr, aa );
|
||||
}
|
||||
else
|
||||
{
|
||||
aa = rr->prev;
|
||||
while ( aa && (aa->score > rr->score) ) { // go down
|
||||
rr->goDown();
|
||||
aa->goUp();
|
||||
aa = aa->prev; // go to prev rank
|
||||
}
|
||||
if ( aa != rr->prev ){
|
||||
unlink( rr );
|
||||
put_after( rr, aa );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RankSystem::loadRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen( filename , "rb" );
|
||||
|
||||
if ( !bfp ) return;
|
||||
|
||||
short int i = 0;
|
||||
fread(&i, 1 , sizeof(short int) , bfp);
|
||||
|
||||
if (i == RANK_VERSION)
|
||||
{
|
||||
Stats d;
|
||||
char unique[64], name[64];
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
while( i )
|
||||
{
|
||||
fread(name , i,sizeof(char) , bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
fread(unique , i,sizeof(char) , bfp);
|
||||
fread(&d.tks, 1,sizeof(int), bfp);
|
||||
fread(&d.damage, 1,sizeof(int), bfp);
|
||||
fread(&d.deaths, 1,sizeof(int), bfp);
|
||||
fread(&d.kills, 1,sizeof(int), bfp);
|
||||
fread(&d.shots, 1,sizeof(int), bfp);
|
||||
fread(&d.hits, 1,sizeof(int), bfp);
|
||||
fread(&d.hs, 1,sizeof(int), bfp);
|
||||
|
||||
fread(&d.bDefusions, 1,sizeof(int), bfp);
|
||||
fread(&d.bDefused, 1,sizeof(int), bfp);
|
||||
fread(&d.bPlants, 1,sizeof(int), bfp);
|
||||
fread(&d.bExplosions, 1,sizeof(int), bfp);
|
||||
|
||||
fread(d.bodyHits, 1,sizeof(d.bodyHits), bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
RankSystem::RankStats* a = findEntryInRank( unique , name );
|
||||
|
||||
if ( a ) a->updatePosition( &d );
|
||||
}
|
||||
}
|
||||
fclose(bfp);
|
||||
}
|
||||
|
||||
void RankSystem::saveRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen(filename, "wb");
|
||||
|
||||
if ( !bfp ) return;
|
||||
|
||||
short int i = RANK_VERSION;
|
||||
|
||||
fwrite(&i, 1, sizeof(short int) , bfp);
|
||||
|
||||
RankSystem::iterator a = front();
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||
{
|
||||
fwrite( &(*a).namelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).name , (*a).namelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).uniquelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).unique , (*a).uniquelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).tks, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).damage, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).deaths, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).kills, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).shots, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hits, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hs, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( &(*a).bDefusions, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bDefused, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bPlants, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bExplosions, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( (*a).bodyHits, 1, sizeof((*a).bodyHits), bfp);
|
||||
}
|
||||
|
||||
--a;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
fwrite( &i , 1, sizeof(short int), bfp); // null terminator
|
||||
|
||||
fclose(bfp);
|
||||
}
|
122
dlls/csx/source/CRank.h
Executable file
122
dlls/csx/source/CRank.h
Executable file
@ -0,0 +1,122 @@
|
||||
|
||||
|
||||
#ifndef CRANK_H
|
||||
#define CRANK_H
|
||||
|
||||
#define RANK_VERSION 11
|
||||
|
||||
#include "amxxmodule.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
|
||||
struct Stats {
|
||||
int hits;
|
||||
int shots;
|
||||
int damage;
|
||||
int hs;
|
||||
int tks;
|
||||
int kills;
|
||||
int deaths;
|
||||
int bodyHits[9]; ////////////////////
|
||||
|
||||
// SiDLuke start
|
||||
int bPlants;
|
||||
int bExplosions;
|
||||
int bDefusions;
|
||||
int bDefused;
|
||||
// SiDLuke end :D
|
||||
|
||||
Stats();
|
||||
void commit(Stats* a);
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
|
||||
class RankSystem
|
||||
{
|
||||
public:
|
||||
class RankStats;
|
||||
friend class RankStats;
|
||||
class iterator;
|
||||
|
||||
class RankStats : public Stats {
|
||||
friend class RankSystem;
|
||||
friend class iterator;
|
||||
RankSystem* parent;
|
||||
RankStats* next;
|
||||
RankStats* prev;
|
||||
char* unique;
|
||||
short int uniquelen;
|
||||
char* name;
|
||||
short int namelen;
|
||||
int score;
|
||||
int id;
|
||||
RankStats( const char* uu, const char* nn, RankSystem* pp );
|
||||
~RankStats();
|
||||
void setUnique( const char* nn );
|
||||
inline void goDown() {++id;}
|
||||
inline void goUp() {--id;}
|
||||
inline void addStats(Stats* a) { commit( a ); }
|
||||
public:
|
||||
void setName( const char* nn );
|
||||
inline const char* getName() const { return name ? name : ""; }
|
||||
inline const char* getUnique() const { return unique ? unique : ""; }
|
||||
inline int getPosition() const { return id; }
|
||||
inline void updatePosition( Stats* points ) {
|
||||
parent->updatePos( this , points );
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
RankStats* head;
|
||||
RankStats* tail;
|
||||
int rankNum;
|
||||
|
||||
struct scoreCalc{
|
||||
AMX amx;
|
||||
void* code;
|
||||
int func;
|
||||
cell amxAddr1;
|
||||
cell amxAddr2;
|
||||
cell *physAddr1;
|
||||
cell *physAddr2;
|
||||
} calc;
|
||||
|
||||
void put_before( RankStats* a, RankStats* ptr );
|
||||
void put_after( RankStats* a, RankStats* ptr );
|
||||
void unlink( RankStats* ptr );
|
||||
void updatePos( RankStats* r , Stats* s );
|
||||
|
||||
public:
|
||||
|
||||
RankSystem();
|
||||
~RankSystem();
|
||||
|
||||
void saveRank( const char* filename );
|
||||
void loadRank( const char* filename );
|
||||
RankStats* findEntryInRank(const char* unique, const char* name );
|
||||
bool loadCalc(const char* filename, char* error);
|
||||
inline int getRankNum( ) const { return rankNum; }
|
||||
void clear();
|
||||
void unloadCalc();
|
||||
|
||||
class iterator {
|
||||
RankStats* ptr;
|
||||
public:
|
||||
iterator(RankStats* a): ptr(a){}
|
||||
inline iterator& operator--() { ptr = ptr->prev; return *this;}
|
||||
inline iterator& operator++() { ptr = ptr->next; return *this; }
|
||||
inline RankStats& operator*() { return *ptr;}
|
||||
operator bool () { return (ptr != 0); }
|
||||
};
|
||||
|
||||
inline iterator front() { return iterator(head); }
|
||||
inline iterator begin() { return iterator(tail); }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
102
dlls/csx/source/Makefile
Executable file
102
dlls/csx/source/Makefile
Executable file
@ -0,0 +1,102 @@
|
||||
MODNAME = csx_amxx
|
||||
SRCFILES = amxxmodule.cpp CMisc.cpp CRank.cpp meta_api.cpp rank.cpp usermsg.cpp
|
||||
|
||||
EXTRA_LIBS_LINUX =
|
||||
EXTRA_LIBS_WIN32 =
|
||||
EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux
|
||||
EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32
|
||||
|
||||
EXTRA_INCLUDEDIRS = -Iextra/include -I../amx
|
||||
|
||||
EXTRA_FLAGS = -Dstrcmpi=strcasecmp
|
||||
|
||||
AMXDIR=../amx
|
||||
SDKSRC=../sdk
|
||||
METADIR=../metamod
|
||||
|
||||
OBJDIR_LINUX=obj.linux
|
||||
OBJDIR_WIN32=obj.win32
|
||||
SRCDIR=.
|
||||
|
||||
ifdef windir
|
||||
OS=WIN32
|
||||
else
|
||||
OS=LINUX
|
||||
endif
|
||||
|
||||
CC_LINUX=gcc
|
||||
ifeq "$(OS)" "WIN32"
|
||||
CC_WIN32=gcc
|
||||
LD_WINDLL=dllwrap
|
||||
DEFAULT=win32
|
||||
CLEAN=clean_win32
|
||||
else
|
||||
CC_WIN32=/usr/local/cross-tools/i386-mingw32msvc/bin/gcc
|
||||
LD_WINDLL=/usr/local/cross-tools/bin/i386-mingw32msvc-dllwrap
|
||||
DEFAULT=linux win32
|
||||
CLEAN=clean_both
|
||||
endif
|
||||
|
||||
|
||||
LIBFILE_LINUX = $(MODNAME)_i386.so
|
||||
LIBFILE_WIN32 = $(MODNAME).dll
|
||||
TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
|
||||
TARGET_WIN32 = $(OBJDIR_WIN32)/$(LIBFILE_WIN32)
|
||||
|
||||
FILES_ALL = *.cpp *.h [A-Z]* *.rc
|
||||
ifeq "$(OS)" "LINUX"
|
||||
ASRCFILES := $(shell ls -t $(SRCFILES))
|
||||
else
|
||||
ASRCFILES := $(shell dir /b)
|
||||
endif
|
||||
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
|
||||
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
|
||||
|
||||
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
|
||||
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
|
||||
-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)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
|
||||
CFLAGS=-Wall -Wno-unknown-pragmas
|
||||
ODEF = -DOPT_TYPE=\"optimized\"
|
||||
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
|
||||
|
||||
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
|
||||
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
|
||||
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
|
||||
LINK_WIN32=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
|
||||
|
||||
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
|
||||
$(DO_CC_LINUX)
|
||||
|
||||
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
|
||||
$(DO_CC_WIN32)
|
||||
|
||||
default: $(DEFAULT)
|
||||
|
||||
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
|
||||
$(LINK_LINUX)
|
||||
|
||||
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
|
||||
$(LINK_WIN32)
|
||||
|
||||
$(OBJDIR_LINUX):
|
||||
mkdir $@
|
||||
|
||||
$(OBJDIR_WIN32):
|
||||
mkdir $@
|
||||
|
||||
win32: $(TARGET_WIN32)
|
||||
|
||||
linux: $(TARGET_LINUX)
|
||||
|
||||
clean: $(CLEAN)
|
||||
|
||||
clean_both:
|
||||
-rm -f $(OBJDIR_LINUX)/*
|
||||
-rm -f $(OBJDIR_WIN32)/*
|
||||
|
||||
clean_win32:
|
||||
del /q $(OBJDIR_WIN32)
|
||||
|
||||
|
3004
dlls/csx/source/amxxmodule.cpp
Executable file
3004
dlls/csx/source/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2181
dlls/csx/source/amxxmodule.h
Executable file
2181
dlls/csx/source/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
6
dlls/csx/source/compile.bat
Executable file
6
dlls/csx/source/compile.bat
Executable file
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
PATH=D:\gcc\bin;%PATH%
|
||||
|
||||
make
|
||||
|
||||
pause
|
368
dlls/csx/source/meta_api.cpp
Executable file
368
dlls/csx/source/meta_api.cpp
Executable file
@ -0,0 +1,368 @@
|
||||
#include "amxxmodule.h"
|
||||
#include "rank.h"
|
||||
|
||||
funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||
funEventCall modMsgs[MAX_REG_MSGS];
|
||||
|
||||
void (*function)(void*);
|
||||
void (*endfunction)(void*);
|
||||
|
||||
CPlayer players[33];
|
||||
|
||||
CPlayer* mPlayer;
|
||||
|
||||
int mPlayerIndex;
|
||||
int mState;
|
||||
|
||||
RankSystem g_rank;
|
||||
|
||||
Grenades g_grenades;
|
||||
|
||||
int iFGrenade;
|
||||
int iFDeath;
|
||||
int iFDamage;
|
||||
|
||||
int iFBPlanted;
|
||||
int iFBDefused;
|
||||
int iFBPlanting;
|
||||
int iFBDefusing;
|
||||
int iFBExplode;
|
||||
|
||||
int g_bombAnnounce;
|
||||
int g_Planter;
|
||||
int g_Defuser;
|
||||
|
||||
bool rankBots;
|
||||
|
||||
int gmsgCurWeapon;
|
||||
int gmsgDeathMsg;
|
||||
int gmsgDamage;
|
||||
int gmsgDamageEnd;
|
||||
int gmsgWeaponList;
|
||||
int gmsgResetHUD;
|
||||
int gmsgAmmoX;
|
||||
int gmsgScoreInfo;
|
||||
int gmsgAmmoPickup;
|
||||
|
||||
int gmsgSendAudio;
|
||||
int gmsgTextMsg;
|
||||
int gmsgBarTime;
|
||||
|
||||
cvar_t init_csstats_maxsize ={"csstats_maxsize","3500", 0 , 3500.0 };
|
||||
cvar_t init_csstats_reset ={"csstats_reset","0"};
|
||||
cvar_t init_csstats_rank ={"csstats_rank","0"};
|
||||
cvar_t *csstats_maxsize;
|
||||
cvar_t *csstats_reset;
|
||||
cvar_t *csstats_rank;
|
||||
|
||||
cvar_t* csstats_rankbots;
|
||||
cvar_t* csstats_pause;
|
||||
cvar_t init_csstats_rankbots ={"csstats_rankbots","1"};
|
||||
cvar_t init_csstats_pause = {"csstats_pause","0"};
|
||||
|
||||
struct sUserMsg {
|
||||
const char* name;
|
||||
int* id;
|
||||
funEventCall func;
|
||||
bool endmsg;
|
||||
} g_user_msg[] = {
|
||||
{ "CurWeapon" , &gmsgCurWeapon , Client_CurWeapon, false },
|
||||
{ "Damage" , &gmsgDamage,Client_Damage, false },
|
||||
{ "Damage" , &gmsgDamageEnd, Client_Damage_End, true },
|
||||
{ "WeaponList" , &gmsgWeaponList, Client_WeaponList, false },
|
||||
{ "ResetHUD" , &gmsgResetHUD,Client_ResetHUD, true },
|
||||
{ "AmmoX" , &gmsgAmmoX, Client_AmmoX , false },
|
||||
{ "ScoreInfo" , &gmsgScoreInfo, Client_ScoreInfo, false },
|
||||
{ "AmmoPickup" , &gmsgAmmoPickup, Client_AmmoPickup , false },
|
||||
|
||||
{ "SendAudio" , &gmsgSendAudio , Client_SendAudio , false },
|
||||
{ "TextMsg" , &gmsgTextMsg , Client_TextMsg , false },
|
||||
{ "BarTime" , &gmsgBarTime , Client_BarTime , false },
|
||||
|
||||
{ 0 , 0,0,false }
|
||||
};
|
||||
|
||||
int RegUserMsg_Post(const char *pszName, int iSize)
|
||||
{
|
||||
for (int i = 0; g_user_msg[ i ].name; ++i )
|
||||
{
|
||||
if ( !*g_user_msg[i].id && strcmp( g_user_msg[ i ].name , pszName ) == 0 )
|
||||
{
|
||||
int id = META_RESULT_ORIG_RET( int );
|
||||
|
||||
*g_user_msg[ i ].id = id;
|
||||
|
||||
if ( g_user_msg[ i ].endmsg )
|
||||
modMsgsEnd[ id ] = g_user_msg[ i ].func;
|
||||
else
|
||||
modMsgs[ id ] = g_user_msg[ i ].func;
|
||||
//break;
|
||||
}
|
||||
}
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
}
|
||||
|
||||
const char* get_localinfo( const char* name , const char* def = 0 )
|
||||
{
|
||||
const char* b = LOCALINFO( (char*)name );
|
||||
if (((b==0)||(*b==0)) && def )
|
||||
SET_LOCALINFO((char*)name,(char*)(b = def) );
|
||||
return b;
|
||||
}
|
||||
|
||||
void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
|
||||
|
||||
rankBots = (int)csstats_rankbots->value ? true:false;
|
||||
|
||||
for( int i = 1; i <= gpGlobals->maxClients; ++i)
|
||||
GET_PLAYER_POINTER_I(i)->Init( i , pEdictList + i );
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void PlayerPreThink_Post( edict_t *pEntity ) {
|
||||
if ( !isModuleActive() )
|
||||
return;
|
||||
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time ){
|
||||
|
||||
if ( !ignoreBots(pEntity) ){
|
||||
pPlayer->clearStats = 0.0f;
|
||||
if (pPlayer->rank)
|
||||
pPlayer->rank->updatePosition( &pPlayer->life );
|
||||
pPlayer->restartStats(false);
|
||||
}
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ServerDeactivate() {
|
||||
int i;
|
||||
for( i = 1;i<=gpGlobals->maxClients; ++i){
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||
if (pPlayer->rank) pPlayer->Disconnect();
|
||||
}
|
||||
if ( (g_rank.getRankNum() >= (int)csstats_maxsize->value) || ((int)csstats_reset->value == 1 ) ) {
|
||||
CVAR_SET_FLOAT("csstats_reset",0.0);
|
||||
g_rank.clear(); // clear before save to file
|
||||
}
|
||||
g_rank.saveRank( MF_BuildPathname("%s",get_localinfo("csstats")) );
|
||||
|
||||
// clear custom weapons info
|
||||
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++)
|
||||
weaponData[i].ammoSlot = 0;
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ){
|
||||
GET_PLAYER_POINTER(pEntity)->Connect(pszAddress);
|
||||
RETURN_META_VALUE(MRES_IGNORED, TRUE);
|
||||
}
|
||||
|
||||
void ClientDisconnect( edict_t *pEntity ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if (pPlayer->rank) pPlayer->Disconnect();
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ClientPutInServer_Post( edict_t *pEntity ) {
|
||||
GET_PLAYER_POINTER(pEntity)->PutInServer();
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
const char* name = INFOKEY_VALUE(infobuffer,"name");
|
||||
const char* oldname = STRING(pEntity->v.netname);
|
||||
|
||||
if ( pPlayer->rank ){
|
||||
if ( strcmp(oldname,name) != 0 ) {
|
||||
if ((int)csstats_rank->value == 0)
|
||||
pPlayer->rank = g_rank.findEntryInRank( name, name );
|
||||
else
|
||||
pPlayer->rank->setName( name );
|
||||
}
|
||||
}
|
||||
else if ( pPlayer->IsBot() ) {
|
||||
pPlayer->Connect( "127.0.0.1" );
|
||||
pPlayer->PutInServer();
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
|
||||
if (ed){
|
||||
mPlayerIndex = ENTINDEX(ed);
|
||||
mPlayer = GET_PLAYER_POINTER_I(mPlayerIndex);
|
||||
} else {
|
||||
mPlayerIndex = 0;
|
||||
mPlayer = 0;
|
||||
}
|
||||
mState = 0;
|
||||
if ( msg_type < 0 || msg_type >= MAX_REG_MSGS )
|
||||
msg_type = 0;
|
||||
function=modMsgs[msg_type];
|
||||
endfunction=modMsgsEnd[msg_type];
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void MessageEnd_Post(void) {
|
||||
if (endfunction) (*endfunction)(NULL);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteByte_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteChar_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteShort_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteLong_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteAngle_Post(float flValue) {
|
||||
if (function) (*function)((void *)&flValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteCoord_Post(float flValue) {
|
||||
if (function) (*function)((void *)&flValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteString_Post(const char *sz) {
|
||||
if (function) (*function)((void *)sz);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void WriteEntity_Post(int iValue) {
|
||||
if (function) (*function)((void *)&iValue);
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void StartFrame_Post(){
|
||||
if (g_bombAnnounce){
|
||||
switch (g_bombAnnounce){
|
||||
case BOMB_PLANTING:
|
||||
MF_ExecuteForward( iFBPlanting,g_Planter );
|
||||
break;
|
||||
case BOMB_PLANTED:
|
||||
MF_ExecuteForward( iFBPlanted,g_Planter );
|
||||
break;
|
||||
case BOMB_EXPLODE:
|
||||
MF_ExecuteForward( iFBExplode,g_Planter,g_Defuser );
|
||||
break;
|
||||
case BOMB_DEFUSING:
|
||||
MF_ExecuteForward( iFBDefusing,g_Defuser );
|
||||
break;
|
||||
case BOMB_DEFUSED:
|
||||
MF_ExecuteForward( iFBDefused,g_Defuser );
|
||||
break;
|
||||
}
|
||||
g_bombAnnounce = 0;
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void SetModel_Post(edict_t *e, const char *m){
|
||||
|
||||
if ( !isModuleActive() )
|
||||
return;
|
||||
|
||||
if ( e->v.owner && m[7]=='w' && m[8]=='_' ){
|
||||
int w_id = 0;
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner);
|
||||
switch(m[9]){
|
||||
case 'h':
|
||||
w_id = CSW_HEGRENADE;
|
||||
g_grenades.put(e, 2.0, 4, pPlayer);
|
||||
pPlayer->saveShot(CSW_HEGRENADE);
|
||||
break;
|
||||
case 'f':
|
||||
if (m[10]=='l') w_id = CSW_FLASHBANG;
|
||||
break;
|
||||
case 's':
|
||||
if (m[10]=='m') w_id = CSW_SMOKEGRENADE;
|
||||
break;
|
||||
}
|
||||
if ( w_id )
|
||||
MF_ExecuteForward( iFGrenade, pPlayer->index, ENTINDEX(e) ,w_id );
|
||||
}
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) {
|
||||
if (sample[0]=='w'&&sample[1]=='e'&&sample[8]=='k'&&sample[9]=='n'&&sample[14]!='d'){
|
||||
CPlayer*pPlayer = GET_PLAYER_POINTER(entity);
|
||||
pPlayer->saveShot(pPlayer->current);
|
||||
}
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *e, TraceResult *ptr) {
|
||||
if (ptr->pHit&&(ptr->pHit->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&&
|
||||
e&&(e->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&&ptr->iHitgroup)
|
||||
GET_PLAYER_POINTER(e)->aiming = ptr->iHitgroup;
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void OnMetaAttach() {
|
||||
|
||||
CVAR_REGISTER (&init_csstats_maxsize);
|
||||
CVAR_REGISTER (&init_csstats_reset);
|
||||
CVAR_REGISTER (&init_csstats_rank);
|
||||
csstats_maxsize=CVAR_GET_POINTER(init_csstats_maxsize.name);
|
||||
csstats_reset=CVAR_GET_POINTER(init_csstats_reset.name);
|
||||
csstats_rank=CVAR_GET_POINTER(init_csstats_rank.name);
|
||||
|
||||
CVAR_REGISTER (&init_csstats_rankbots);
|
||||
CVAR_REGISTER (&init_csstats_pause);
|
||||
csstats_rankbots = CVAR_GET_POINTER(init_csstats_rankbots.name);
|
||||
csstats_pause = CVAR_GET_POINTER(init_csstats_pause.name);
|
||||
}
|
||||
|
||||
void OnAmxxAttach(){
|
||||
MF_AddNatives(stats_Natives);
|
||||
const char* path = get_localinfo("csstats_score");
|
||||
if ( path && *path )
|
||||
{
|
||||
char error[128];
|
||||
g_rank.loadCalc( MF_BuildPathname("%s",path) , error );
|
||||
}
|
||||
|
||||
if ( !g_rank.begin() )
|
||||
{
|
||||
g_rank.loadRank( MF_BuildPathname("%s",
|
||||
get_localinfo("csstats") ) );
|
||||
}
|
||||
}
|
||||
|
||||
void OnAmxxDetach() {
|
||||
g_grenades.clear();
|
||||
g_rank.clear();
|
||||
g_rank.unloadCalc();
|
||||
}
|
||||
|
||||
void OnPluginsLoaded(){
|
||||
iFDeath = MF_RegisterForward("client_death",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||
iFDamage = MF_RegisterForward("client_damage",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||
iFBPlanted = MF_RegisterForward("bomb_planted",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBDefused = MF_RegisterForward("bomb_defused",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBPlanting = MF_RegisterForward("bomb_planting",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBDefusing = MF_RegisterForward("bomb_defusing",ET_IGNORE,FP_CELL,FP_DONE);
|
||||
iFBExplode = MF_RegisterForward("bomb_explode",ET_IGNORE,FP_CELL,FP_CELL,FP_DONE);
|
||||
iFGrenade = MF_RegisterForward("grenade_throw",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||
}
|
462
dlls/csx/source/moduleconfig.h
Executable file
462
dlls/csx/source/moduleconfig.h
Executable file
@ -0,0 +1,462 @@
|
||||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CSX"
|
||||
#define MODULE_VERSION "0.20"
|
||||
#define MODULE_AUTHOR "AMXx Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "CSX"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX detach
|
||||
#define FN_AMXX_DETACH OnAmxxDetach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
#define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
#define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
#define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
#define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
#define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
#define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
#define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
#define FN_MessageBegin_Post MessageBegin_Post
|
||||
#define FN_MessageEnd_Post MessageEnd_Post
|
||||
#define FN_WriteByte_Post WriteByte_Post
|
||||
#define FN_WriteChar_Post WriteChar_Post
|
||||
#define FN_WriteShort_Post WriteShort_Post
|
||||
#define FN_WriteLong_Post WriteLong_Post
|
||||
#define FN_WriteAngle_Post WriteAngle_Post
|
||||
#define FN_WriteCoord_Post WriteCoord_Post
|
||||
#define FN_WriteString_Post WriteString_Post
|
||||
#define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
#define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
149
dlls/csx/source/msvc/csx.dsp
Executable file
149
dlls/csx/source/msvc/csx.dsp
Executable file
@ -0,0 +1,149 @@
|
||||
# Microsoft Developer Studio Project File - Name="csx" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=csx - 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 "csx.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 "csx.mak" CFG="csx - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "csx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "csx - 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)" == "csx - 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 "csx_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /Zp4 /MT /W3 /GX /O2 /I "..\..\metamod" /I "..\..\sdk\common" /I "..\..\sdk\engine" /I "..\..\sdk\dlls" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "csx_EXPORTS" /D "JIT" /FR /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 /out:"release/csx_amxx.dll"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "csx - 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 "csx_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\metamod" /I "..\..\sdk\common" /I "..\..\sdk\engine" /I "..\..\sdk\dlls" /I "..\..\hlsdk\sourcecode\pm_shared" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "csx_EXPORTS" /FR /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 /out:"debug/csx_amxx.dll" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "csx - Win32 Release"
|
||||
# Name "csx - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\amxxmodule.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\CMisc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\CRank.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\meta_api.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\rank.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\usermsg.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\amxxmodule.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\CMisc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\CRank.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\moduleconfig.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\rank.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
29
dlls/csx/source/msvc/csx.dsw
Executable file
29
dlls/csx/source/msvc/csx.dsw
Executable file
@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "csx"=.\csx.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
441
dlls/csx/source/rank.cpp
Executable file
441
dlls/csx/source/rank.cpp
Executable file
@ -0,0 +1,441 @@
|
||||
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "rank.h"
|
||||
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
int attacker = params[2];
|
||||
if (attacker<0||attacker>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->attackers[attacker].hits){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
CPlayer::PlayerWeapon* stats = &pPlayer->attackers[attacker];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
if (params[6] && attacker && stats->name )
|
||||
MF_SetAmxString(amx,params[5],stats->name,params[6]);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
int victim = params[2];
|
||||
if (victim<0||victim>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->victims[victim].hits){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
CPlayer::PlayerWeapon* stats = &pPlayer->victims[victim];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
if (params[6] && victim && stats->name)
|
||||
MF_SetAmxString(amx,params[5],stats->name,params[6]);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end)
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
int weapon = params[2];
|
||||
if (weapon<0||weapon>=MAX_WEAPONS){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->weaponsRnd[weapon].shots){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
Stats* stats = &pPlayer->weaponsRnd[weapon];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
int weapon = params[2];
|
||||
if (weapon<0||weapon>=MAX_WEAPONS){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->weapons[weapon].shots){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||
CPlayer::PlayerWeapon* stats = &pPlayer->weapons[weapon];
|
||||
cpStats[0] = stats->kills;
|
||||
cpStats[1] = stats->deaths;
|
||||
cpStats[2] = stats->hs;
|
||||
cpStats[3] = stats->tks;
|
||||
cpStats[4] = stats->shots;
|
||||
cpStats[5] = stats->hits;
|
||||
cpStats[6] = stats->damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = stats->bodyHits[i];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
GET_PLAYER_POINTER_I(index)->restartStats();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if (pPlayer->rank){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||
cpStats[0] = pPlayer->life.kills;
|
||||
cpStats[1] = pPlayer->life.deaths;
|
||||
cpStats[2] = pPlayer->life.hs;
|
||||
cpStats[3] = pPlayer->life.tks;
|
||||
cpStats[4] = pPlayer->life.shots;
|
||||
cpStats[5] = pPlayer->life.hits;
|
||||
cpStats[6] = pPlayer->life.damage;
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = pPlayer->life.bodyHits[i];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if ( pPlayer->rank ){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||
cpStats[0] = pPlayer->rank->kills;
|
||||
cpStats[1] = pPlayer->rank->deaths;
|
||||
cpStats[2] = pPlayer->rank->hs;
|
||||
cpStats[3] = pPlayer->rank->tks;
|
||||
cpStats[4] = pPlayer->rank->shots;
|
||||
cpStats[5] = pPlayer->rank->hits;
|
||||
cpStats[6] = pPlayer->rank->damage;
|
||||
|
||||
cpStats[7] = pPlayer->rank->getPosition();
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = pPlayer->rank->bodyHits[i];
|
||||
return pPlayer->rank->getPosition();
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int index = params[1];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
if ( pPlayer->rank ){
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
|
||||
cpStats[0] = pPlayer->rank->bDefusions;
|
||||
cpStats[1] = pPlayer->rank->bDefused;
|
||||
cpStats[2] = pPlayer->rank->bPlants;
|
||||
cpStats[3] = pPlayer->rank->bExplosions;
|
||||
|
||||
return pPlayer->rank->getPosition();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
|
||||
int index = params[1] + 1;
|
||||
|
||||
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||
if ((*a).getPosition() == index) {
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||
cpStats[0] = (*a).kills;
|
||||
cpStats[1] = (*a).deaths;
|
||||
cpStats[2] = (*a).hs;
|
||||
cpStats[3] = (*a).tks;
|
||||
cpStats[4] = (*a).shots;
|
||||
cpStats[5] = (*a).hits;
|
||||
cpStats[6] = (*a).damage;
|
||||
|
||||
cpStats[7] = (*a).getPosition();
|
||||
|
||||
MF_SetAmxString(amx,params[4],(*a).getName(),params[5]);
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = (*a).bodyHits[i];
|
||||
return --a ? index : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
|
||||
int index = params[1] + 1;
|
||||
|
||||
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||
if ((*a).getPosition() == index) {
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
|
||||
cpStats[0] = (*a).bDefusions;
|
||||
cpStats[1] = (*a).bDefused;
|
||||
cpStats[2] = (*a).bPlants;
|
||||
cpStats[3] = (*a).bExplosions;
|
||||
|
||||
return --a ? index : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_statsnum(AMX *amx, cell *params)
|
||||
{
|
||||
return g_rank.getRankNum();
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL register_cwpn(AMX *amx, cell *params){ // name,melee=0,logname
|
||||
int i,iLen;
|
||||
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++){
|
||||
if ( !weaponData[i].used ){
|
||||
|
||||
char* szName = MF_GetAmxString(amx, params[1], 0, &iLen);
|
||||
char *szLog = MF_GetAmxString(amx, params[3], 0, &iLen);
|
||||
|
||||
strcpy(weaponData[i].name,szName);
|
||||
strcpy(weaponData[i].logname,szLog);
|
||||
|
||||
weaponData[i].used = true;
|
||||
weaponData[i].melee = params[2] ? true:false;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
MF_PrintSrvConsole("No More Custom Weapon Slots!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
||||
int weapon = params[1];
|
||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){ // only for custom weapons
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int att = params[2];
|
||||
if (att<1||att>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vic = params[3];
|
||||
if (vic<1||vic>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dmg = params[4];
|
||||
if ( dmg<1 ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aim = params[5];
|
||||
if ( aim < 0 || aim > 7 ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer* pAtt = GET_PLAYER_POINTER_I(att);
|
||||
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
|
||||
|
||||
pVic->pEdict->v.dmg_inflictor = NULL;
|
||||
pAtt->saveHit( pVic , weapon , dmg, aim );
|
||||
|
||||
if ( !pAtt ) pAtt = pVic;
|
||||
int TA = 0;
|
||||
if ( (pVic->teamId == pAtt->teamId) && ( pVic != pAtt) )
|
||||
TA = 1;
|
||||
MF_ExecuteForward( iFDamage,pAtt->index, pVic->index, dmg, weapon, aim, TA );
|
||||
|
||||
if ( pVic->IsAlive() )
|
||||
return 1;
|
||||
|
||||
pAtt->saveKill(pVic,weapon,( aim == 1 ) ? 1:0 ,TA);
|
||||
MF_ExecuteForward( iFDeath,pAtt->index, pVic->index, weapon, aim, TA );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid
|
||||
int index = params[2];
|
||||
if (index<1||index>gpGlobals->maxClients){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int weapon = params[1];
|
||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||
pPlayer->saveShot(weapon);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_wpnname(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
return MF_SetAmxString(amx,params[2],weaponData[id].name,params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_wpnlogname(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
return MF_SetAmxString(amx,params[2],weaponData[id].logname,params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL is_melee(AMX *amx, cell *params){
|
||||
int id = params[1];
|
||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
||||
return 0;
|
||||
}
|
||||
if ( id == 29 )
|
||||
return 1;
|
||||
return weaponData[id].melee ? 1:0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_maxweapons(AMX *amx, cell *params){
|
||||
return MAX_WEAPONS+MAX_CWEAPONS;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats_size(AMX *amx, cell *params){
|
||||
return 8;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO stats_Natives[] = {
|
||||
{ "get_stats", get_stats},
|
||||
{ "get_stats2", get_stats2},
|
||||
{ "get_statsnum", get_statsnum},
|
||||
{ "get_user_astats", get_user_astats },
|
||||
{ "get_user_rstats", get_user_rstats },
|
||||
{ "get_user_lstats", get_user_rstats }, // for backward compatibility
|
||||
{ "get_user_stats", get_user_stats },
|
||||
{ "get_user_stats2", get_user_stats2 },
|
||||
{ "get_user_vstats", get_user_vstats },
|
||||
{ "get_user_wrstats", get_user_wrstats}, // DEC-Weapon(Round) Stats
|
||||
{ "get_user_wstats", get_user_wstats},
|
||||
{ "reset_user_wstats", reset_user_wstats },
|
||||
|
||||
// Custom Weapon Support
|
||||
{ "custom_weapon_add", register_cwpn },
|
||||
{ "custom_weapon_dmg", custom_wpn_dmg },
|
||||
{ "custom_weapon_shot", custom_wpn_shot },
|
||||
|
||||
{ "xmod_get_wpnname", get_wpnname },
|
||||
{ "xmod_get_wpnlogname", get_wpnlogname },
|
||||
{ "xmod_is_melee_wpn", is_melee },
|
||||
{ "xmod_get_maxweapons", get_maxweapons },
|
||||
{ "xmod_get_stats_size", get_stats_size },
|
||||
|
||||
//***************************************
|
||||
{ "get_weaponname", get_wpnname },
|
||||
|
||||
///*******************
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
105
dlls/csx/source/rank.h
Executable file
105
dlls/csx/source/rank.h
Executable file
@ -0,0 +1,105 @@
|
||||
|
||||
|
||||
|
||||
#ifndef RANK_H
|
||||
#define RANK_H
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CMisc.h"
|
||||
#include "CRank.h"
|
||||
|
||||
#define GET_PLAYER_POINTER(e) (&players[ENTINDEX(e)])
|
||||
#define GET_PLAYER_POINTER_I(i) (&players[i])
|
||||
|
||||
extern AMX_NATIVE_INFO stats_Natives[];
|
||||
|
||||
struct weaponsVault {
|
||||
char name[32];
|
||||
char logname[16];
|
||||
short int ammoSlot;
|
||||
bool used;
|
||||
bool melee;
|
||||
};
|
||||
|
||||
extern bool rankBots;
|
||||
extern cvar_t* csstats_rankbots;
|
||||
extern cvar_t* csstats_pause;
|
||||
|
||||
extern int iFGrenade;
|
||||
extern int iFDeath;
|
||||
extern int iFDamage;
|
||||
|
||||
extern int iFBPlanted;
|
||||
extern int iFBDefused;
|
||||
extern int iFBPlanting;
|
||||
extern int iFBDefusing;
|
||||
extern int iFBExplode;
|
||||
|
||||
extern int g_bombAnnounce;
|
||||
extern int g_Planter;
|
||||
extern int g_Defuser;
|
||||
|
||||
#define BOMB_PLANTING 1
|
||||
#define BOMB_PLANTED 2
|
||||
#define BOMB_EXPLODE 3
|
||||
#define BOMB_DEFUSING 4
|
||||
#define BOMB_DEFUSED 5
|
||||
|
||||
extern weaponsVault weaponData[MAX_WEAPONS+MAX_CWEAPONS];
|
||||
|
||||
typedef void (*funEventCall)(void*);
|
||||
extern funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||
extern funEventCall modMsgs[MAX_REG_MSGS];
|
||||
|
||||
extern void (*function)(void*);
|
||||
extern void (*endfunction)(void*);
|
||||
|
||||
extern cvar_t *csstats_maxsize;
|
||||
extern cvar_t* csstats_rank;
|
||||
extern cvar_t* csstats_reset;
|
||||
|
||||
extern Grenades g_grenades;
|
||||
|
||||
extern RankSystem g_rank;
|
||||
|
||||
extern CPlayer players[33];
|
||||
|
||||
extern CPlayer* mPlayer;
|
||||
|
||||
extern int mPlayerIndex;
|
||||
|
||||
extern int mState;
|
||||
|
||||
extern int gmsgCurWeapon;
|
||||
extern int gmsgDamageEnd;
|
||||
extern int gmsgDamage;
|
||||
extern int gmsgWeaponList;
|
||||
extern int gmsgResetHUD;
|
||||
extern int gmsgAmmoX;
|
||||
extern int gmsgScoreInfo;
|
||||
extern int gmsgAmmoPickup;
|
||||
|
||||
extern int gmsgSendAudio;
|
||||
extern int gmsgTextMsg;
|
||||
extern int gmsgBarTime;
|
||||
|
||||
void Client_AmmoX(void*);
|
||||
void Client_CurWeapon(void*);
|
||||
void Client_Damage(void*);
|
||||
void Client_WeaponList(void*);
|
||||
void Client_AmmoPickup(void*);
|
||||
void Client_Damage_End(void*);
|
||||
void Client_ScoreInfo(void*);
|
||||
void Client_ResetHUD(void*);
|
||||
|
||||
void Client_SendAudio(void*);
|
||||
void Client_TextMsg(void*);
|
||||
void Client_BarTime(void*);
|
||||
|
||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
||||
bool isModuleActive();
|
||||
|
||||
#endif // RANK_H
|
||||
|
||||
|
||||
|
205
dlls/csx/source/usermsg.cpp
Executable file
205
dlls/csx/source/usermsg.cpp
Executable file
@ -0,0 +1,205 @@
|
||||
#include "amxxmodule.h"
|
||||
#include "rank.h"
|
||||
|
||||
weaponsVault weaponData[MAX_WEAPONS+MAX_CWEAPONS];
|
||||
|
||||
int damage;
|
||||
int TA;
|
||||
int weapon;
|
||||
int aim;
|
||||
CPlayer *pAttacker;
|
||||
|
||||
void Client_ResetHUD(void* mValue){
|
||||
if ( mPlayer && mPlayer->IsAlive() )
|
||||
mPlayer->clearStats = gpGlobals->time + 0.25f;
|
||||
}
|
||||
|
||||
void Client_WeaponList(void* mValue){
|
||||
static int wpnList;
|
||||
static int iSlot;
|
||||
static const char* wpnName;
|
||||
|
||||
switch (mState++) {
|
||||
case 0:
|
||||
wpnName = (const char*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
iSlot = *(int*)mValue;
|
||||
break;
|
||||
case 7:
|
||||
int iId = *(int*)mValue;
|
||||
if ( (iId < 0 || iId >= MAX_WEAPONS ) || ( wpnList & (1<<iId) ) )
|
||||
break;
|
||||
|
||||
wpnList |= (1<<iId);
|
||||
weaponData[iId].ammoSlot = iSlot;
|
||||
|
||||
if ( strstr( wpnName,"weapon_") )
|
||||
{
|
||||
if ( strcmp(wpnName+7,"hegrenade") == 0 )
|
||||
strcpy(weaponData[iId].name,wpnName+9);
|
||||
else
|
||||
strcpy(weaponData[iId].name,wpnName+7);
|
||||
strcpy(weaponData[iId].logname,weaponData[iId].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client_Damage(void* mValue){
|
||||
static int bits;
|
||||
switch (mState++) {
|
||||
case 1:
|
||||
damage = *(int*)mValue;
|
||||
break;
|
||||
case 2:
|
||||
bits = *(int*)mValue;
|
||||
break;
|
||||
case 3:
|
||||
if (!mPlayer || !damage || !*(float*)mValue || bits) break;
|
||||
edict_t *enemy;
|
||||
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
||||
|
||||
if ( FNullEnt( enemy ) )
|
||||
break;
|
||||
aim = 0;
|
||||
weapon = 0;
|
||||
pAttacker = NULL;
|
||||
|
||||
if (enemy->v.flags & (FL_CLIENT | FL_FAKECLIENT) ) {
|
||||
pAttacker = GET_PLAYER_POINTER(enemy);
|
||||
aim = pAttacker->aiming;
|
||||
weapon = pAttacker->current;
|
||||
pAttacker->saveHit( mPlayer , weapon , damage, aim);
|
||||
break;
|
||||
}
|
||||
if( g_grenades.find(enemy , &pAttacker , &weapon ) )
|
||||
pAttacker->saveHit( mPlayer , weapon , damage, aim );
|
||||
else if ( strcmp("grenade",STRING(enemy->v.classname))==0 ) // ? more checks ?
|
||||
weapon = CSW_C4;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_Damage_End(void* mValue){
|
||||
if ( !mPlayer || !damage )
|
||||
return;
|
||||
|
||||
if ( !pAttacker ) pAttacker = mPlayer;
|
||||
TA = 0;
|
||||
if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) )
|
||||
TA = 1;
|
||||
|
||||
MF_ExecuteForward( iFDamage,pAttacker->index , mPlayer->index , damage, weapon, aim, TA );
|
||||
|
||||
if ( !mPlayer->IsAlive() ){
|
||||
if ( weapon != CSW_C4 )
|
||||
pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TA);
|
||||
MF_ExecuteForward( iFDeath,pAttacker->index, mPlayer->index, weapon, aim, TA );
|
||||
}
|
||||
}
|
||||
|
||||
void Client_CurWeapon(void* mValue){
|
||||
static int iState;
|
||||
static int iId;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
iState = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
if (!iState) break;
|
||||
iId = *(int*)mValue;
|
||||
break;
|
||||
case 2:
|
||||
if (!mPlayer || !iState ) break;
|
||||
int iClip = *(int*)mValue;
|
||||
if ((iClip > -1) && (iClip < mPlayer->weapons[iId].clip))
|
||||
mPlayer->saveShot(iId);
|
||||
mPlayer->weapons[iId].clip = iClip;
|
||||
mPlayer->current = iId;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_AmmoX(void* mValue){
|
||||
static int iAmmo;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
iAmmo = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
if (!mPlayer ) break;
|
||||
for(int i = 1; i < MAX_WEAPONS ; ++i)
|
||||
if (iAmmo == weaponData[i].ammoSlot)
|
||||
mPlayer->weapons[i].ammo = *(int*)mValue;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_AmmoPickup(void* mValue){
|
||||
static int iSlot;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
iSlot = *(int*)mValue;
|
||||
break;
|
||||
case 1:
|
||||
if (!mPlayer ) break;
|
||||
for(int i = 1; i < MAX_WEAPONS ; ++i)
|
||||
if (weaponData[i].ammoSlot == iSlot)
|
||||
mPlayer->weapons[i].ammo += *(int*)mValue;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_ScoreInfo(void* mValue){
|
||||
static int index;
|
||||
switch (mState++){
|
||||
case 0:
|
||||
index = *(int*)mValue;
|
||||
break;
|
||||
case 4:
|
||||
if ( index > 0 && index <= gpGlobals->maxClients )
|
||||
GET_PLAYER_POINTER_I( index )->teamId = *(int*)mValue;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_SendAudio(void* mValue){
|
||||
static const char* szText;
|
||||
if ( mState == 1 ){
|
||||
szText = (const char*)mValue;
|
||||
if ( !mPlayer && szText[7]=='B' ) {
|
||||
if ( szText[11]=='P' && g_Planter ){
|
||||
GET_PLAYER_POINTER_I(g_Planter)->saveBPlant();
|
||||
g_bombAnnounce = BOMB_PLANTED;
|
||||
}
|
||||
else if ( szText[11]=='D' && g_Defuser ){
|
||||
GET_PLAYER_POINTER_I(g_Defuser)->saveBDefused();
|
||||
g_bombAnnounce = BOMB_DEFUSED;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
mState++;
|
||||
}
|
||||
|
||||
void Client_TextMsg(void* mValue){
|
||||
static const char* szText;
|
||||
if ( !mPlayer && mState==1 ){
|
||||
szText = (const char*)mValue;
|
||||
if ( szText[1]=='T' && szText[8]=='B' && g_Planter ){
|
||||
GET_PLAYER_POINTER_I(g_Planter)->saveBExplode();
|
||||
g_bombAnnounce = BOMB_EXPLODE;
|
||||
}
|
||||
}
|
||||
mState++;
|
||||
}
|
||||
|
||||
void Client_BarTime(void* mValue){
|
||||
int iTime = *(int*)mValue;
|
||||
if ( !iTime || !mPlayer->IsAlive() ) return;
|
||||
if ( iTime == 3 ){
|
||||
g_Planter = mPlayerIndex;
|
||||
g_bombAnnounce = BOMB_PLANTING;
|
||||
g_Defuser = 0;
|
||||
}
|
||||
else {
|
||||
mPlayer->saveBDefusing();
|
||||
g_Defuser = mPlayerIndex;
|
||||
g_bombAnnounce = BOMB_DEFUSING;
|
||||
}
|
||||
}
|
@ -151,11 +151,11 @@ void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
|
||||
|
||||
void PlayerPreThink_Post( edict_t *pEntity ) {
|
||||
if ( !isModuleActive() )
|
||||
return;
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if ( !pPlayer->ingame )
|
||||
return;
|
||||
RETURN_META(MRES_IGNORED);
|
||||
|
||||
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time){
|
||||
if ( !ignoreBots(pEntity) ){
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
|
||||
void append(const char *t)
|
||||
{
|
||||
Grow(cSize + strlen(t));
|
||||
Grow(cSize + strlen(t) + 1);
|
||||
strcat(v, t);
|
||||
cSize = strlen(v);
|
||||
}
|
||||
@ -187,7 +187,7 @@ public:
|
||||
{
|
||||
if (c == '\f' || c == '\n' ||
|
||||
c == '\t' || c == '\r' ||
|
||||
c == 'v' || c == ' ')
|
||||
c == '\v' || c == ' ')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -8,6 +8,10 @@ int g_CameraCount;
|
||||
|
||||
TraceResult g_tr;
|
||||
|
||||
#define BUFFERSIZE 1023
|
||||
char g_buffer[BUFFERSIZE + 1];
|
||||
|
||||
|
||||
void UTIL_SetSize(edict_t *pev, const Vector &vecMin, const Vector &vecMax)
|
||||
{
|
||||
SET_SIZE(ENT(pev), vecMin, vecMax);
|
||||
@ -365,7 +369,7 @@ static cell AMX_NATIVE_CALL get_info_keybuffer(AMX *amx, cell *params)
|
||||
{
|
||||
int iEnt = params[1];
|
||||
|
||||
if (!is_ent_valid(iEnt)) {
|
||||
if (FNullEnt(iEnt) || iEnt < 1 || iEnt > gpGlobals->maxClients) {
|
||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
||||
return 0;
|
||||
}
|
||||
@ -898,6 +902,13 @@ static cell AMX_NATIVE_CALL traceresult(AMX *amx, cell *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// (jghg)
|
||||
static cell AMX_NATIVE_CALL get_string(AMX *amx, cell *params) // (string, returnstring[], length)
|
||||
{
|
||||
snprintf(g_buffer, BUFFERSIZE, "%s", STRING(params[1]));
|
||||
return MF_SetAmxString(amx, params[2], g_buffer, params[3]);
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO engine_Natives[] = {
|
||||
{"halflife_time", halflife_time},
|
||||
|
||||
@ -938,6 +949,8 @@ AMX_NATIVE_INFO engine_Natives[] = {
|
||||
{"register_think", register_think},
|
||||
{"register_touch", register_touch},
|
||||
|
||||
{"get_string", get_string},
|
||||
|
||||
{NULL, NULL},
|
||||
///////////////////
|
||||
};
|
||||
|
@ -17,7 +17,7 @@ $sdk = "../../hlsdk/SourceCode";
|
||||
$mm = "../../metamod/metamod";
|
||||
$gccf = "gcc";
|
||||
|
||||
@CPP_SOURCE_FILES = ("dllfunc.cpp", "fakemeta_amxx.cpp", "forward.cpp", "pdata.cpp", "pev.cpp", "engfunc.cpp", "sdk/amxxmodule.cpp");
|
||||
@CPP_SOURCE_FILES = ("dllfunc.cpp", "fakemeta_amxx.cpp", "forward.cpp", "pdata.cpp", "pev.cpp", "engfunc.cpp", "sdk/amxxmodule.cpp", "fm_tr.cpp");
|
||||
|
||||
@C_SOURCE_FILES = ();
|
||||
my %OPTIONS, %OPT;
|
||||
|
@ -123,6 +123,12 @@
|
||||
<File
|
||||
RelativePath=".\fakemeta_amxx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\fm_tr.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\fm_tr.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\pdata.cpp">
|
||||
</File>
|
||||
|
@ -9,6 +9,7 @@ void OnAmxxAttach()
|
||||
MF_AddNatives(pev_natives);
|
||||
MF_AddNatives(forward_natives);
|
||||
MF_AddNatives(pdata_natives);
|
||||
MF_AddNatives(tr_Natives);
|
||||
}
|
||||
int GetHullBounds(int hullnumber, float *mins, float *maxs);
|
||||
// sawce: Do not null out the forward for ServerActivate. It's required for the INDEXENT() fix. (I don't think ServerActivate is planned on being forwarded anyway)
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "dllfunc.h"
|
||||
#include "pev.h"
|
||||
#include "forward.h"
|
||||
#include "fm_tr.h"
|
||||
|
||||
extern edict_t *g_player_edicts[33];
|
||||
|
||||
@ -25,6 +26,7 @@ extern AMX_NATIVE_INFO dllfunc_natives[];
|
||||
extern AMX_NATIVE_INFO pev_natives[];
|
||||
extern AMX_NATIVE_INFO forward_natives[];
|
||||
extern AMX_NATIVE_INFO pdata_natives[];
|
||||
extern AMX_NATIVE_INFO tr_Natives[];
|
||||
extern TraceResult g_tr;
|
||||
|
||||
/* Wouldnt modifying the table AFTER it's memcpy'd be ... pointless?
|
||||
|
178
dlls/fakemeta/fm_tr.cpp
Executable file
178
dlls/fakemeta/fm_tr.cpp
Executable file
@ -0,0 +1,178 @@
|
||||
#include "fakemeta_amxx.h"
|
||||
|
||||
TraceResult *gfm_tr;
|
||||
|
||||
/*enum
|
||||
{
|
||||
TR_AllSolid,
|
||||
TR_StartSolid,
|
||||
TR_InOpen,
|
||||
TR_InWater,
|
||||
TR_flFraction,
|
||||
TR_vecEndPos,
|
||||
TR_flPlaneDist,
|
||||
TR_vecPlaneNormal,
|
||||
TR_pHit,
|
||||
TR_iHitgroup,
|
||||
};*/
|
||||
|
||||
static cell AMX_NATIVE_CALL set_tr(AMX *amx, cell *params)
|
||||
{
|
||||
int type = params[1];
|
||||
//TraceResult *tr = (TraceResult*)((void *)cPtr);
|
||||
|
||||
if (*params / sizeof(cell) < 2)
|
||||
return 0; //TODO: Error
|
||||
|
||||
cell *ptr = MF_GetAmxAddr(amx, params[2]);
|
||||
edict_t *e = 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TR_AllSolid:
|
||||
{
|
||||
gfm_tr->fAllSolid = *ptr;
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_StartSolid:
|
||||
{
|
||||
return gfm_tr->fStartSolid;
|
||||
break;
|
||||
}
|
||||
case TR_InWater:
|
||||
{
|
||||
gfm_tr->fInWater = *ptr;
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_flFraction:
|
||||
{
|
||||
gfm_tr->flFraction = amx_ctof(*ptr);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_vecEndPos:
|
||||
{
|
||||
gfm_tr->vecEndPos.x = amx_ctof(ptr[0]);
|
||||
gfm_tr->vecEndPos.y = amx_ctof(ptr[1]);
|
||||
gfm_tr->vecEndPos.z = amx_ctof(ptr[2]);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_flPlaneDist:
|
||||
{
|
||||
gfm_tr->flPlaneDist = amx_ctof(*ptr);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_vecPlaneNormal:
|
||||
{
|
||||
gfm_tr->vecPlaneNormal.x = amx_ctof(ptr[0]);
|
||||
gfm_tr->vecPlaneNormal.y = amx_ctof(ptr[1]);
|
||||
gfm_tr->vecPlaneNormal.z = amx_ctof(ptr[2]);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_pHit:
|
||||
{
|
||||
e = INDEXENT(*ptr);
|
||||
if (!e || FNullEnt(e))
|
||||
return 0; //TODO: return error
|
||||
gfm_tr->pHit = e;
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_iHitgroup:
|
||||
{
|
||||
gfm_tr->iHitgroup = *ptr;
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
//TODO: error
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_tr(AMX *amx, cell *params)
|
||||
{
|
||||
int type = params[1];
|
||||
cell *ptr = 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TR_AllSolid:
|
||||
{
|
||||
return gfm_tr->fAllSolid;
|
||||
break;
|
||||
}
|
||||
case TR_StartSolid:
|
||||
{
|
||||
return gfm_tr->fStartSolid;
|
||||
break;
|
||||
}
|
||||
case TR_InWater:
|
||||
{
|
||||
return gfm_tr->fInWater;
|
||||
break;
|
||||
}
|
||||
case TR_flFraction:
|
||||
{
|
||||
ptr = MF_GetAmxAddr(amx, params[2]);
|
||||
*ptr = amx_ftoc(gfm_tr->flFraction);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_vecEndPos:
|
||||
{
|
||||
ptr = MF_GetAmxAddr(amx, params[2]);
|
||||
ptr[0] = amx_ftoc(gfm_tr->vecEndPos.x);
|
||||
ptr[1] = amx_ftoc(gfm_tr->vecEndPos.y);
|
||||
ptr[2] = amx_ftoc(gfm_tr->vecEndPos.z);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_flPlaneDist:
|
||||
{
|
||||
ptr = MF_GetAmxAddr(amx, params[2]);
|
||||
*ptr = amx_ftoc(gfm_tr->flPlaneDist);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_vecPlaneNormal:
|
||||
{
|
||||
ptr = MF_GetAmxAddr(amx, params[2]);
|
||||
ptr[0] = amx_ftoc(gfm_tr->vecPlaneNormal.x);
|
||||
ptr[1] = amx_ftoc(gfm_tr->vecPlaneNormal.y);
|
||||
ptr[2] = amx_ftoc(gfm_tr->vecPlaneNormal.z);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
case TR_pHit:
|
||||
{
|
||||
if (gfm_tr->pHit == NULL || FNullEnt(gfm_tr->pHit))
|
||||
return -1;
|
||||
return ENTINDEX(gfm_tr->pHit);
|
||||
break;
|
||||
}
|
||||
case TR_iHitgroup:
|
||||
{
|
||||
return gfm_tr->iHitgroup;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
//TODO: error
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO tr_Natives[] = {
|
||||
{"get_tr", get_tr},
|
||||
{"set_tr", set_tr},
|
||||
{NULL, NULL},
|
||||
};
|
22
dlls/fakemeta/fm_tr.h
Executable file
22
dlls/fakemeta/fm_tr.h
Executable file
@ -0,0 +1,22 @@
|
||||
#ifndef _INCLUDE_TR_H
|
||||
#define _INCLUDE_TR_H
|
||||
|
||||
extern TraceResult *gfm_tr;
|
||||
|
||||
enum
|
||||
{
|
||||
TR_AllSolid,
|
||||
TR_StartSolid,
|
||||
TR_InOpen,
|
||||
TR_InWater,
|
||||
TR_flFraction,
|
||||
TR_vecEndPos,
|
||||
TR_flPlaneDist,
|
||||
TR_vecPlaneNormal,
|
||||
TR_pHit,
|
||||
TR_iHitgroup,
|
||||
};
|
||||
|
||||
extern AMX_NATIVE_INFO tr_Natives[];
|
||||
|
||||
#endif //_INCLUDE_TR_H
|
@ -90,6 +90,27 @@ void SetModel_post(edict_t *e, const char *m)
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr)
|
||||
{
|
||||
/*
|
||||
TRACE_LINE(v1, v2, fNoMonsters, pentToSkip, ptr); //from fun module - prevents crash? - t(+)rget/freecode // well i guess that's what you get for listening, isnt it? =/
|
||||
*/
|
||||
gfm_tr=ptr;
|
||||
PREPARE_VECTOR(v1);
|
||||
PREPARE_VECTOR(v2);
|
||||
FM_ENG_HANDLE(FM_TraceLine, (Engine[FM_TraceLine].at(i), p_v1, p_v2, fNoMonsters, ENTINDEX(pentToSkip) /*, (cell)ptr*/));
|
||||
RETURN_META(mswi(lastFmRes));
|
||||
}
|
||||
|
||||
void TraceLine_post(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr)
|
||||
{
|
||||
gfm_tr=ptr;
|
||||
PREPARE_VECTOR(v1);
|
||||
PREPARE_VECTOR(v2);
|
||||
FM_ENG_HANDLE_POST(FM_TraceLine, (EnginePost[FM_TraceLine].at(i), p_v1, p_v2, fNoMonsters, ENTINDEX(pentToSkip)/*, (cell)ptr*/));
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
// pfnModelIndex
|
||||
SIMPLE_INT_HOOK_CONSTSTRING(ModelIndex);
|
||||
|
||||
@ -570,7 +591,7 @@ static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params)
|
||||
break;
|
||||
case FM_TraceLine:
|
||||
fId = MF_RegisterSPForwardByName(amx, funcname, FP_ARRAY, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE);
|
||||
// ENGHOOK(TraceLine);
|
||||
ENGHOOK(TraceLine);
|
||||
break;
|
||||
case FM_TraceToss:
|
||||
fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_CELL, FP_DONE);
|
||||
|
@ -241,7 +241,6 @@
|
||||
#define SIMPLE_USHORT_HOOK_INT_CONSTSTRING(call) \
|
||||
unsigned short call (int v, const char *s) \
|
||||
{ \
|
||||
printf("Addr: %d\n",s); \
|
||||
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), v, s)); \
|
||||
RETURN_META_VALUE(mswi(lastFmRes),(unsigned short)mlCellResult); \
|
||||
} \
|
||||
@ -279,10 +278,8 @@
|
||||
void call (float v) \
|
||||
{ \
|
||||
PREPARE_FLOAT(v); \
|
||||
printf("[before] v is now: %f\n",v); \
|
||||
FM_ENG_HANDLE(FM_##call, (Engine[FM_##call].at(i), c_v)); \
|
||||
BYREF_FLOAT(v); \
|
||||
printf("[after] v is now: %f\n",v); \
|
||||
RETURN_META(mswi(lastFmRes)); \
|
||||
} \
|
||||
void call##_post (float v) \
|
||||
|
@ -2681,7 +2681,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||
MF_AmxFindPublic(0, 0, 0);
|
||||
MF_AmxAllot(0, 0, 0, 0);
|
||||
MF_LoadAmxScript(0, 0, 0, 0);
|
||||
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||
MF_UnloadAmxScript(0, 0);
|
||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||
|
@ -239,6 +239,11 @@ static cell AMX_NATIVE_CALL give_item(AMX *amx, cell *params) // native give_ite
|
||||
// Create the entity, returns to pointer
|
||||
pItemEntity = CREATE_NAMED_ENTITY(item);
|
||||
|
||||
if(FNullEnt(pItemEntity)) {
|
||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I
|
||||
//I'm not sure, normally I use macros too =P
|
||||
pItemEntity->v.origin = pPlayer->v.origin;
|
||||
|
@ -39,6 +39,12 @@ void OnAmxxAttach()
|
||||
MF_AddNatives(geoip_natives);
|
||||
}
|
||||
|
||||
void OnAmxxDetach()
|
||||
{
|
||||
GeoIP_delete(gi);
|
||||
gi = NULL;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO geoip_natives[] = {
|
||||
{"geoip_code2", amx_geoip_code2},
|
||||
{"geoip_code3", amx_geoip_code3},
|
||||
|
@ -10,7 +10,7 @@
|
||||
#define MODULE_URL "http://www.bailopan.com/"
|
||||
#define MODULE_LOGTAG "GEOIP"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
//#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
@ -29,7 +29,7 @@
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX dettach
|
||||
//#define FN_AMXX_DETTACH OnAmxxDettach
|
||||
#define FN_AMXX_DETTACH OnAmxxDettach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
@ -27,7 +27,7 @@
|
||||
#define OFFSET_WIN_EXP 6352
|
||||
#define OFFSET_LIN_EXP 6240
|
||||
|
||||
#define OFFSET_WIN_POINTS 6416
|
||||
#define OFFSET_WIN_POINTS 6360
|
||||
#define OFFSET_LIN_POINTS 6248
|
||||
|
||||
#define OFFSET_WIN_AMMO_LMG 912
|
||||
|
@ -1,26 +1,99 @@
|
||||
/* 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 _INCLUDE_CSTRING_H
|
||||
#define _INCLUDE_CSTRING_H
|
||||
|
||||
//by David "BAILOPAN" Anderson
|
||||
class CString
|
||||
class String
|
||||
{
|
||||
public:
|
||||
CString() { v = NULL; mSize = 0; }
|
||||
~CString() { if (v) delete [] v; }
|
||||
String()
|
||||
{
|
||||
v = NULL;
|
||||
mSize = 0;
|
||||
cSize = 0;
|
||||
Grow(2);
|
||||
assign("");
|
||||
}
|
||||
|
||||
~String()
|
||||
{
|
||||
if (v)
|
||||
delete [] v;
|
||||
}
|
||||
|
||||
String(const char *src)
|
||||
{
|
||||
v = NULL;
|
||||
mSize = 0;
|
||||
cSize = 0; assign(src);
|
||||
}
|
||||
|
||||
String(String &src)
|
||||
{
|
||||
v = NULL;
|
||||
mSize = 0;
|
||||
cSize = 0;
|
||||
assign(src.c_str());
|
||||
}
|
||||
|
||||
const char *c_str() { return v?v:""; }
|
||||
const char *c_str() const { return v?v:""; }
|
||||
|
||||
void append(const char *t)
|
||||
{
|
||||
Grow(strlen(v) + strlen(t));
|
||||
Grow(cSize + strlen(t) + 1);
|
||||
strcat(v, t);
|
||||
cSize = strlen(v);
|
||||
}
|
||||
|
||||
void append(CString &d)
|
||||
void append(const char c)
|
||||
{
|
||||
Grow(cSize + 2);
|
||||
v[cSize] = c;
|
||||
v[++cSize] = 0;
|
||||
}
|
||||
|
||||
void append(String &d)
|
||||
{
|
||||
const char *t = d.c_str();
|
||||
Grow(strlen(v) + strlen(t));
|
||||
Grow(cSize + strlen(t));
|
||||
strcat(v, t);
|
||||
cSize = strlen(v);
|
||||
}
|
||||
|
||||
void assign(const String &src)
|
||||
{
|
||||
assign(src.c_str());
|
||||
}
|
||||
|
||||
void assign(const char *d)
|
||||
@ -28,20 +101,27 @@ public:
|
||||
if (!d)
|
||||
{
|
||||
Grow(1);
|
||||
cSize = 0;
|
||||
strcpy(v, "");
|
||||
return;
|
||||
}
|
||||
Grow(strlen(d));
|
||||
if (v)
|
||||
{
|
||||
strcpy(v, d);
|
||||
cSize = strlen(v);
|
||||
} else {
|
||||
cSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
if (v)
|
||||
delete [] v;
|
||||
v = NULL;
|
||||
mSize = 0;
|
||||
{
|
||||
v[0] = 0;
|
||||
cSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int compare (const char *d)
|
||||
@ -61,24 +141,252 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
//Added this for amxx inclusion
|
||||
bool empty()
|
||||
{
|
||||
if (!v || !cSize)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int size()
|
||||
{
|
||||
if (!v)
|
||||
return 0;
|
||||
return strlen(v);
|
||||
return cSize;
|
||||
}
|
||||
|
||||
const char * _fread(FILE *fp)
|
||||
{
|
||||
Grow(512);
|
||||
char * ret = fgets(v, 511, fp);
|
||||
cSize = strlen(v);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int find(const char c, int index = 0)
|
||||
{
|
||||
if (!v)
|
||||
return npos;
|
||||
if (index >= (int)cSize || index < 0)
|
||||
return npos;
|
||||
unsigned int i = 0;
|
||||
for (i=index; i<cSize; i++)
|
||||
{
|
||||
if (v[i] == c)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return npos;
|
||||
}
|
||||
|
||||
bool is_space(int c)
|
||||
{
|
||||
if (c == '\f' || c == '\n' ||
|
||||
c == '\t' || c == '\r' ||
|
||||
c == '\v' || c == ' ')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void trim()
|
||||
{
|
||||
if (!v)
|
||||
return;
|
||||
unsigned int i = 0;
|
||||
unsigned int j = 0;
|
||||
|
||||
if (cSize == 1)
|
||||
{
|
||||
if (is_space(v[i]))
|
||||
{
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char c0 = v[0];
|
||||
|
||||
if (is_space(c0))
|
||||
{
|
||||
for (i=0; i<cSize; i++)
|
||||
{
|
||||
if (!is_space(v[i]) || (is_space(v[i]) && ((unsigned char)i==cSize-1)))
|
||||
{
|
||||
erase(0, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cSize = strlen(v);
|
||||
|
||||
if (cSize < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_space(v[cSize-1]))
|
||||
{
|
||||
for (i=cSize-1; i>=0; i--)
|
||||
{
|
||||
if (!is_space(v[i])
|
||||
|| (is_space(v[i]) && i==0))
|
||||
{
|
||||
erase(i+1, j);
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if (cSize == 1)
|
||||
{
|
||||
if (is_space(v[0]))
|
||||
{
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String & erase(unsigned int start, int num = npos)
|
||||
{
|
||||
if (!v)
|
||||
return (*this);
|
||||
unsigned int i = 0;
|
||||
//check for bounds
|
||||
if (num == npos || start+num > cSize-num+1)
|
||||
num = cSize - start;
|
||||
//do the erasing
|
||||
bool copyflag = false;
|
||||
for (i=0; i<cSize; i++)
|
||||
{
|
||||
if (i>=start && i<start+num)
|
||||
{
|
||||
if (i+num < cSize)
|
||||
{
|
||||
v[i] = v[i+num];
|
||||
} else {
|
||||
v[i] = 0;
|
||||
}
|
||||
copyflag = true;
|
||||
} else if (copyflag) {
|
||||
if (i+num < cSize)
|
||||
{
|
||||
v[i] = v[i+num];
|
||||
} else {
|
||||
v[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
cSize -= num;
|
||||
v[cSize] = 0;
|
||||
|
||||
return (*this);
|
||||
}
|
||||
|
||||
String substr(unsigned int index, int num = npos)
|
||||
{
|
||||
String ns;
|
||||
|
||||
if (index >= cSize || !v)
|
||||
return ns;
|
||||
|
||||
if (num == npos)
|
||||
{
|
||||
num = cSize - index;
|
||||
} else if (index+num >= cSize) {
|
||||
num = cSize - index;
|
||||
}
|
||||
|
||||
unsigned int i = 0, j=0;
|
||||
char *s = new char[cSize+1];
|
||||
|
||||
for (i=index; i<index+num; i++)
|
||||
{
|
||||
s[j++] = v[i];
|
||||
}
|
||||
s[j] = 0;
|
||||
|
||||
ns.assign(s);
|
||||
|
||||
delete [] s;
|
||||
|
||||
return ns;
|
||||
}
|
||||
|
||||
void toLower()
|
||||
{
|
||||
if (!v)
|
||||
return;
|
||||
unsigned int i = 0;
|
||||
for (i=0; i<cSize; i++)
|
||||
{
|
||||
if (v[i] >= 65 && v[i] <= 90)
|
||||
v[i] |= 32;
|
||||
}
|
||||
}
|
||||
|
||||
String & operator = (const String &src)
|
||||
{
|
||||
assign(src);
|
||||
return *this;
|
||||
}
|
||||
|
||||
String & operator = (const char *src)
|
||||
{
|
||||
assign(src);
|
||||
return *this;
|
||||
|
||||
}
|
||||
|
||||
char operator [] (unsigned int index)
|
||||
{
|
||||
if (index > cSize)
|
||||
{
|
||||
return -1;
|
||||
} else {
|
||||
return v[index];
|
||||
}
|
||||
}
|
||||
|
||||
int at(int a)
|
||||
{
|
||||
if (a < 0 || a >= (int)cSize)
|
||||
return -1;
|
||||
|
||||
return v[a];
|
||||
}
|
||||
|
||||
bool at(int at, char c)
|
||||
{
|
||||
if (at < 0 || at >= (int)cSize)
|
||||
return false;
|
||||
|
||||
v[at] = c;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
void Grow(int d)
|
||||
void Grow(unsigned int d)
|
||||
{
|
||||
if (d<1)
|
||||
return;
|
||||
if (d > mSize)
|
||||
{
|
||||
mSize = d + 16; // allocate a buffer
|
||||
char *t = new char[d+1];
|
||||
if (v) {
|
||||
strcpy(t, v);
|
||||
t[strlen(v)] = 0;
|
||||
t[cSize] = 0;
|
||||
delete [] v;
|
||||
}
|
||||
v = t;
|
||||
@ -87,7 +395,10 @@ private:
|
||||
}
|
||||
|
||||
char *v;
|
||||
int mSize;
|
||||
unsigned int mSize;
|
||||
unsigned int cSize;
|
||||
public:
|
||||
static const int npos = -1;
|
||||
};
|
||||
|
||||
#endif //_INCLUDE_CSTRING_H
|
Binary file not shown.
@ -18,14 +18,14 @@ public:
|
||||
|
||||
PGconn *cn;
|
||||
|
||||
CString ErrorStr;
|
||||
String ErrorStr;
|
||||
int ErrorCode;
|
||||
|
||||
CString Host;
|
||||
CString Password;
|
||||
CString Username;
|
||||
CString Database;
|
||||
CString cstr;
|
||||
String Host;
|
||||
String Password;
|
||||
String Username;
|
||||
String Database;
|
||||
String cstr;
|
||||
|
||||
bool isFree;
|
||||
};
|
||||
|
@ -43,7 +43,7 @@
|
||||
OutputFile=".\Release/pgsql_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreDefaultLibraryNames="LIBCMT, LIBC"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\Release/pgsql.pdb"
|
||||
ImportLibrary=".\Release/pgsql.lib"
|
||||
|
@ -214,6 +214,8 @@ public cmdReload(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,1))
|
||||
return PLUGIN_HANDLED
|
||||
|
||||
//strip original flags (patch submitted by mrhunt)
|
||||
remove_user_flags(0,read_flags("z"))
|
||||
#if !defined USING_SQL
|
||||
new filename[128]
|
||||
get_configsdir(filename,127)
|
||||
|
@ -48,7 +48,8 @@ public plugin_init() {
|
||||
register_dictionary("admincmd.txt")
|
||||
register_dictionary("common.txt")
|
||||
register_concmd("amx_kick","cmdKick",ADMIN_KICK,"<name or #userid> [reason]")
|
||||
register_concmd("amx_ban","cmdBan",ADMIN_BAN,"<name or #userid> <id/ip> <minutes> [reason]")
|
||||
register_concmd("amx_ban","cmdBan",ADMIN_BAN,"<name or #userid> <minutes> [reason]")
|
||||
register_concmd("amx_banip","cmdBanIP",ADMIN_BAN,"<name or #userid> <minutes> [reason]")
|
||||
register_concmd("amx_addban","cmdAddBan",ADMIN_BAN,"<authid or ip> <minutes> [reason]")
|
||||
register_concmd("amx_unban","cmdUnban",ADMIN_BAN,"<authid or ip>")
|
||||
register_concmd("amx_slay","cmdSlay",ADMIN_SLAY,"<name or #userid>")
|
||||
@ -163,20 +164,12 @@ public cmdAddBan(id,level,cid) {
|
||||
}
|
||||
|
||||
public cmdBan(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,4))
|
||||
if (!cmd_access(id,level,cid,3))
|
||||
return PLUGIN_HANDLED
|
||||
new target[32],mode[3],minutes[8],reason[32]
|
||||
new target[32],minutes[8],reason[64]
|
||||
read_argv(1,target,31)
|
||||
read_argv(2,mode,2)
|
||||
strtolower(mode)
|
||||
read_argv(3,minutes,7)
|
||||
read_argv(4,reason,31)
|
||||
if ( (!equal(mode,"id")) && (!equal(mode,"ip")) ) {
|
||||
new hcmd[32],hinfo[128],hflag
|
||||
get_concmd(cid,hcmd,31,hflag,hinfo,127,level)
|
||||
console_print(id,"Usage: %s %s",hcmd,hinfo)
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
read_argv(2,minutes,7)
|
||||
read_argv(3,reason,63)
|
||||
new player = cmd_target(id,target,9)
|
||||
if (!player) return PLUGIN_HANDLED
|
||||
new authid[32],name2[32],authid2[32],name[32]
|
||||
@ -186,8 +179,8 @@ public cmdBan(id,level,cid) {
|
||||
get_user_name(player,name2,31)
|
||||
get_user_name(id,name,31)
|
||||
userid2 = get_user_userid(player)
|
||||
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (mode ^"%s^") (minutes ^"%s^") (reason ^"%s^")",
|
||||
name,get_user_userid(id),authid, name2,userid2,authid2,mode,minutes,reason)
|
||||
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")",
|
||||
name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason)
|
||||
|
||||
new temp[64],banned[16],nNum = str_to_num(minutes)
|
||||
if (nNum)
|
||||
@ -197,23 +190,71 @@ public cmdBan(id,level,cid) {
|
||||
|
||||
format(banned,15,"%L",player,"BANNED")
|
||||
|
||||
if ( equal(mode,"ip") ){
|
||||
new address[32]
|
||||
get_user_ip(player,address,31,1)
|
||||
|
||||
if (reason[0])
|
||||
server_cmd("kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,banned,temp,minutes,address)
|
||||
else
|
||||
server_cmd("kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,banned,temp,minutes,address)
|
||||
}
|
||||
if (reason[0])
|
||||
server_cmd("kick #%d ^"%s (%s %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,banned,temp,minutes,authid2)
|
||||
else
|
||||
{
|
||||
if (reason[0])
|
||||
server_cmd("kick #%d ^"%s (%s %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,banned,temp,minutes,authid2)
|
||||
else
|
||||
server_cmd("kick #%d ^"%s %s^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,banned,temp,minutes,authid2)
|
||||
server_cmd("kick #%d ^"%s %s^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,banned,temp,minutes,authid2)
|
||||
|
||||
new activity = get_cvar_num("amx_show_activity")
|
||||
if (activity!=0) {
|
||||
new players[32],pnum,msg[256],len
|
||||
get_players(players,pnum,"c")
|
||||
for (new i=0;i<pnum;i++) {
|
||||
len = format(msg,255,"%L",players[i],"ADMIN")
|
||||
if (activity==1)
|
||||
len += copy(msg[len],255-len,":")
|
||||
else
|
||||
len += format(msg[len],255-len," %s:",name)
|
||||
len += format(msg[len],255-len," %L",players[i],"BAN")
|
||||
len += format(msg[len],255-len," %s ",name2)
|
||||
if (nNum)
|
||||
format(msg[len],255-len,"%L",players[i],"FOR_MIN",minutes)
|
||||
else
|
||||
format(msg[len],255-len,"%L",players[i],"PERM")
|
||||
client_print(players[i],print_chat,msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
console_print(id,"[AMXX] %L",id,"CLIENT_BANNED",name2)
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
public cmdBanIP(id,level,cid) {
|
||||
if (!cmd_access(id,level,cid,3))
|
||||
return PLUGIN_HANDLED
|
||||
new target[32],minutes[8],reason[64]
|
||||
read_argv(1,target,31)
|
||||
read_argv(2,minutes,7)
|
||||
read_argv(3,reason,63)
|
||||
new player = cmd_target(id,target,9)
|
||||
if (!player) return PLUGIN_HANDLED
|
||||
new authid[32],name2[32],authid2[32],name[32]
|
||||
new userid2 = get_user_userid(player)
|
||||
get_user_authid(player,authid2,31)
|
||||
get_user_authid(id,authid,31)
|
||||
get_user_name(player,name2,31)
|
||||
get_user_name(id,name,31)
|
||||
userid2 = get_user_userid(player)
|
||||
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")",
|
||||
name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason)
|
||||
|
||||
new temp[64],banned[16],nNum = str_to_num(minutes)
|
||||
if (nNum)
|
||||
format(temp,63,"%L",player,"FOR_MIN",minutes)
|
||||
else
|
||||
format(temp,63,"%L",player,"PERM")
|
||||
|
||||
format(banned,15,"%L",player,"BANNED")
|
||||
|
||||
new address[32]
|
||||
get_user_ip(player,address,31,1)
|
||||
|
||||
if (reason[0])
|
||||
server_cmd("kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,banned,temp,minutes,address)
|
||||
else
|
||||
server_cmd("kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,banned,temp,minutes,address)
|
||||
|
||||
new activity = get_cvar_num("amx_show_activity")
|
||||
if (activity!=0) {
|
||||
new players[32],pnum,msg[256],len
|
||||
@ -400,26 +441,6 @@ public cmdPlugins(id,level,cid) {
|
||||
format(lFile,31,"%L",id,"FILE")
|
||||
format(lStatus,31,"%L",id,"STATUS")
|
||||
|
||||
/*
|
||||
new motd_body[MOTD_LEN],state[4]
|
||||
new num = get_pluginsnum()
|
||||
new running = 0
|
||||
new pos = copy(motd_body,MOTD_LEN,"<html><head><body><style type=^"text/css^">")
|
||||
pos += copy(motd_body[pos],MOTD_LEN-pos,"body{font-family:Arial,sans-serif;font-size:12px;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}.header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}")
|
||||
pos += copy(motd_body[pos],MOTD_LEN-pos,"</style></head><body><table><tr class=^"header^"><td>Name</td><td>Version</td><td>Author</td><td>Filename</td><td>status</td></tr>")
|
||||
|
||||
for (new i=0;i<num;i++)
|
||||
{
|
||||
if (equal(state,"one")) copy(state,3,"two")
|
||||
else copy(state,3,"one")
|
||||
get_plugin(i,filename,31,name,31,version,31,author,31,status,31)
|
||||
pos += format(motd_body[pos],MOTD_LEN-pos,"<tr class=^"%s^"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",state,name,version,author,filename,status)
|
||||
if (equal(status,"running"))
|
||||
running++
|
||||
}
|
||||
format(motd_body[pos],MOTD_LEN-pos,"</table>%d plugins, %d running</body></html>",num,running)
|
||||
show_motd(id,motd_body,"Currently loaded plugins:")
|
||||
*/
|
||||
new num = get_pluginsnum()
|
||||
new running = 0
|
||||
console_print(id,"%L:",id,"LOADED_PLUGINS")
|
||||
@ -447,23 +468,6 @@ public cmdModules(id,level,cid) {
|
||||
format(lVersion,31,"%L",id,"VERSION")
|
||||
format(lAuthor,31,"%L",id,"AUTHOR")
|
||||
|
||||
/*
|
||||
new motd_body[MOTD_LEN],state[4]
|
||||
new num = get_modulesnum()
|
||||
new pos = copy(motd_body,MOTD_LEN,"<html><head><body><style type=^"text/css^">")
|
||||
pos += copy(motd_body[pos],MOTD_LEN-pos,"body{font-family:Arial,sans-serif;font-size:12px;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}.header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}")
|
||||
pos += copy(motd_body[pos],MOTD_LEN-pos,"</style></head><body><table><tr class=^"header^"><td>Name</td><td>Version</td><td>Author</td></tr>")
|
||||
|
||||
for (new i=0;i<num;i++)
|
||||
{
|
||||
if (equal(state,"one")) copy(state,3,"two")
|
||||
else copy(state,3,"one")
|
||||
get_module(i,name,31,author,31,version,31)
|
||||
pos += format(motd_body[pos],MOTD_LEN-pos,"<tr class=^"%s^"><td>%s</td><td>%s</td><td>%s</td></tr>",state,name,version,author)
|
||||
}
|
||||
format(motd_body[pos],MOTD_LEN-pos,"</table>%d modules</body></html>",num)
|
||||
show_motd(id,motd_body,"Currently loaded modules:")
|
||||
*/
|
||||
new num = get_modulesnum()
|
||||
console_print(id,"%L:",id,"LOADED_MODULES")
|
||||
console_print(id,"%-23.22s %-8.7s %-20.19s",lName,lVersion,lAuthor)
|
||||
@ -581,14 +585,14 @@ public cmdWho(id,level,cid) {
|
||||
format(lNo,15,"%L",id,"NO")
|
||||
get_players(players,inum)
|
||||
format(cl_on_server,63,"%L",id,"CLIENTS_ON_SERVER")
|
||||
console_print(id,"^n%s:^n # %-16.15s %-12s %-8s %-4.3s %-4.3s %s",
|
||||
console_print(id,"^n%s:^n # %-16.15s %-20s %-8s %-4.3s %-4.3s %s",
|
||||
cl_on_server,"nick","authid","userid",lImm,lRes,lAccess)
|
||||
for (new a = 0; a < inum; ++a) {
|
||||
get_user_authid(players[a],authid,31)
|
||||
get_user_name(players[a],name,31)
|
||||
flags = get_user_flags(players[a])
|
||||
get_flags(flags,sflags,31)
|
||||
console_print(id,"%2d %-16.15s %-12s %-8d %-4.3s %-4.3s %s", players[a],name,authid,
|
||||
console_print(id,"%2d %-16.15s %-20s %-8d %-4.3s %-4.3s %s", players[a],name,authid,
|
||||
get_user_userid(players[a]),(flags&ADMIN_IMMUNITY)?lYes:lNo,
|
||||
(flags&ADMIN_RESERVATION)?lYes:lNo,sflags)
|
||||
}
|
||||
|
@ -50,6 +50,10 @@ public plugin_init() {
|
||||
random_num('A','Z') , random_num('A','Z') ,random_num('A','Z'),random_num('A','Z') )
|
||||
|
||||
register_clcmd( g_cmdLoopback, "ackSignal" )
|
||||
new maxplayers = get_maxplayers()
|
||||
new players = get_playersnum(1)
|
||||
new limit = maxplayers - get_cvar_num("amx_reservation")
|
||||
setVisibleSlots(players, maxplayers, limit)
|
||||
}
|
||||
|
||||
public ackSignal(id) {
|
||||
|
BIN
plugins/amxxsc
BIN
plugins/amxxsc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -7,8 +7,18 @@
|
||||
#
|
||||
# This file is part of AMX Mod X.
|
||||
|
||||
# new code contributed by \malex\
|
||||
|
||||
test -e compiled || mkdir compiled
|
||||
ls *.sma | xargs -i ./amxxsc \{\} -ocompiled/\{\} > temp.txt
|
||||
ls compiled/*.sma | xargs -i basename \{\} .sma | xargs -i mv compiled/\{\}.sma compiled/\{\}.amxx
|
||||
more temp.txt
|
||||
rm test.txt
|
||||
|
||||
for sourcefile in *.sma
|
||||
do
|
||||
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/.amxx/'`"
|
||||
echo -n "Compiling $sourcefile ..."
|
||||
./amxxsc $sourcefile -ocompiled/$amxxfile >> temp.txt
|
||||
echo "done"
|
||||
done
|
||||
|
||||
less temp.txt
|
||||
rm temp.txt
|
@ -313,14 +313,14 @@ setWeapon( a , action ) {
|
||||
|
||||
findMenuId( name[] ) {
|
||||
for(new i = 0; i < 7 ; ++i)
|
||||
if( equal( name , g_menusNames[i] ) )
|
||||
if( equali( name , g_menusNames[i] ) )
|
||||
return i
|
||||
return -1
|
||||
}
|
||||
|
||||
findAliasId( name[] ) {
|
||||
for(new i = 0; i < MAXMENUPOS ; ++i)
|
||||
if( equal( name , g_Aliases[i] ) )
|
||||
if( equali( name , g_Aliases[i] ) )
|
||||
return i
|
||||
return -1
|
||||
}
|
||||
@ -486,8 +486,8 @@ public client_command( id ) {
|
||||
new a = 0
|
||||
|
||||
do {
|
||||
if ( equal( g_Aliases[g_AliasBlock[ a ]] , arg ) ||
|
||||
equal( g_Aliases2[g_AliasBlock[ a ]] , arg ) )
|
||||
if ( equali( g_Aliases[g_AliasBlock[ a ]] , arg ) ||
|
||||
equali( g_Aliases2[g_AliasBlock[ a ]] , arg ) )
|
||||
{
|
||||
client_print(id,print_center,g_Restricted )
|
||||
return PLUGIN_HANDLED
|
||||
@ -509,6 +509,9 @@ public cmdMenu(id,level,cid){
|
||||
}
|
||||
|
||||
checkRest(id,menu,key){
|
||||
new team = get_user_team(id)
|
||||
if (team != 1 && team != 2)
|
||||
return PLUGIN_HANDLED
|
||||
if ( g_blockPos[ (menu * 8 + key) + (get_user_team(id) - 1) * 56 ] ){
|
||||
engclient_cmd(id,"menuselect","10")
|
||||
client_print(id,print_center, g_Restricted )
|
||||
|
@ -261,6 +261,7 @@ public plugin_cfg() {
|
||||
server_cmd( addStast, "Show Total Stats", "ShowTotalStats" )
|
||||
server_cmd( addStast, "Show Best Score", "ShowBestScore" )
|
||||
server_cmd( addStast, "Show Most Disruptive", "ShowMostDisruptive" )
|
||||
server_cmd( addStast, "Show HUD Stats", "ShowFullStats" )
|
||||
|
||||
server_cmd( addStast, "HUD-stats default", "ShowStats" )
|
||||
server_cmd( addStast, "Dist&HS in HUD lists", "ShowDistHS" )
|
||||
|
BIN
plugins/dlsym64
Executable file
BIN
plugins/dlsym64
Executable file
Binary file not shown.
@ -1,201 +0,0 @@
|
||||
/* AMX Mod X
|
||||
* Menus Front-End Plugin
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
* This file is part of AMX Mod X.
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
#include <amxmisc>
|
||||
|
||||
new g_menuPosition[33]
|
||||
|
||||
#define MENUS_NUMBER 16
|
||||
|
||||
new g_menuBody[MENUS_NUMBER][] = {
|
||||
"KICK_PLAYER",
|
||||
"BAN_PLAYER",
|
||||
"SLAP_SLAY",
|
||||
"TEAM_PLAYER",
|
||||
|
||||
"CHANGEL",
|
||||
"VOTE_MAPS",
|
||||
|
||||
"SPECH_STUFF",
|
||||
"CLIENT_COM",
|
||||
|
||||
// Next Page
|
||||
|
||||
"SERVER_COM",
|
||||
"CVARS_SET",
|
||||
"CONFIG",
|
||||
"LANG_SET",
|
||||
"STATS_SET",
|
||||
|
||||
"PAUSE_PLUG",
|
||||
"RES_WEAP",
|
||||
|
||||
"TELE_PLAYER" /* Last is Teleport menu - if you want to move it
|
||||
change also code in displayMenu (look for fun module check) */
|
||||
}
|
||||
|
||||
new g_menuCmd[MENUS_NUMBER][] = {
|
||||
"amx_kickmenu",
|
||||
"amx_banmenu",
|
||||
"amx_slapmenu",
|
||||
"amx_teammenu",
|
||||
|
||||
"amx_mapmenu",
|
||||
"amx_votemapmenu",
|
||||
|
||||
"amx_speechmenu",
|
||||
"amx_clcmdmenu",
|
||||
|
||||
// Next Page
|
||||
|
||||
"amx_cmdmenu",
|
||||
"amx_cvarmenu",
|
||||
"amx_cfgmenu",
|
||||
"amx_setlangmenu",
|
||||
"amx_statscfgmenu",
|
||||
|
||||
"amx_pausecfgmenu",
|
||||
"amx_restmenu",
|
||||
|
||||
"amx_teleportmenu"
|
||||
}
|
||||
|
||||
// Second value sets if menu is only for CS...
|
||||
new g_menuAccess[MENUS_NUMBER][2] = {
|
||||
{ADMIN_KICK,0},
|
||||
{ADMIN_BAN,0},
|
||||
{ADMIN_SLAY,0},
|
||||
{ADMIN_LEVEL_A,0},
|
||||
|
||||
{ADMIN_MAP,0},
|
||||
{ADMIN_MAP,0},
|
||||
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_LEVEL_A,0},
|
||||
|
||||
// Next Page
|
||||
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_CVAR,0},
|
||||
{ADMIN_MENU,0},
|
||||
{ADMIN_CFG,0},
|
||||
{ADMIN_CFG,0},
|
||||
|
||||
{ADMIN_CFG,0},
|
||||
{ADMIN_CFG,1},
|
||||
|
||||
{ADMIN_LEVEL_A,0}
|
||||
}
|
||||
|
||||
new g_coloredMenus
|
||||
new g_cstrikeRunning
|
||||
new g_funModule
|
||||
|
||||
public plugin_init() {
|
||||
register_plugin("Menus Front-End",AMXX_VERSION_STR,"AMXX Dev Team")
|
||||
|
||||
register_dictionary("menufront.txt")
|
||||
register_dictionary("common.txt")
|
||||
|
||||
register_menucmd(register_menuid("AMX Mod X Menu"),1023,"actionMenu")
|
||||
register_clcmd("amxmodmenu","cmdMenu",ADMIN_MENU,"- displays menus")
|
||||
|
||||
g_coloredMenus = colored_menus()
|
||||
g_cstrikeRunning = cstrike_running()
|
||||
g_funModule = is_module_loaded("Fun")
|
||||
}
|
||||
|
||||
public actionMenu(id,key) {
|
||||
switch (key) {
|
||||
case 8: displayMenu(id,++g_menuPosition[id])
|
||||
case 9: displayMenu(id,--g_menuPosition[id])
|
||||
default: client_cmd(id, g_menuCmd[ g_menuPosition[id] * 8 + key ] )
|
||||
}
|
||||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
displayMenu(id,pos) {
|
||||
if (pos < 0) return
|
||||
|
||||
new menuBody[512]
|
||||
new b = 0
|
||||
new start = pos * 8
|
||||
|
||||
if ( start >= MENUS_NUMBER )
|
||||
start = pos = g_menuPosition[id] = 0
|
||||
|
||||
new len = format(menuBody,511,
|
||||
g_coloredMenus ? "\yAMX Mod X Menu\R%d/%d^n\w^n" : "AMX Mod X Menu %d/%d^n^n" , pos+1, 2 )
|
||||
|
||||
new end = start + 8
|
||||
new keys = MENU_KEY_0
|
||||
|
||||
if (end > MENUS_NUMBER )
|
||||
end = MENUS_NUMBER
|
||||
|
||||
new flags = get_user_flags(id)
|
||||
|
||||
for (new a = start; a < end; ++a) {
|
||||
if ( a == MENUS_NUMBER - 1 && !g_funModule )
|
||||
continue // checks if there is fun module for teleport menu
|
||||
|
||||
if ( (flags & g_menuAccess[a][0]) && ( g_menuAccess[a][1] ? g_cstrikeRunning : 1 ) ) {
|
||||
keys |= (1<<b)
|
||||
len += format(menuBody[len],511-len,"%d. %L^n",++b, id, g_menuBody[ a ] )
|
||||
}
|
||||
else {
|
||||
++b
|
||||
if ( g_coloredMenus )
|
||||
len += format(menuBody[len],511-len, "\d%d. %L^n\w",b, id, g_menuBody[ a ] )
|
||||
else
|
||||
len += format(menuBody[len],511-len, "#. %L^n", id, g_menuBody[ a ] )
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (end != MENUS_NUMBER ) {
|
||||
format(menuBody[len],511-len,"^n9. %L...^n0. %s", id, "MORE", id, pos ? "BACK" : "EXIT")
|
||||
keys |= MENU_KEY_9
|
||||
}
|
||||
else format(menuBody[len],511-len,"^n0. %s", id, pos ? "BACK" : "EXIT")
|
||||
|
||||
show_menu(id,keys,menuBody)
|
||||
}
|
||||
|
||||
public cmdMenu(id,level,cid) {
|
||||
if (cmd_access(id,level,cid,1))
|
||||
displayMenu(id,g_menuPosition[id] = 0)
|
||||
return PLUGIN_HANDLED
|
||||
}
|
@ -37,7 +37,7 @@ forward plugin_cfg();
|
||||
forward plugin_end();
|
||||
|
||||
/* Function called to handle changelevel */
|
||||
forward server_changelevel();
|
||||
forward server_changelevel(map[]);
|
||||
|
||||
/* Called on log message. */
|
||||
forward plugin_log();
|
||||
|
@ -15,7 +15,7 @@
|
||||
/* Function is called after grenade throw */
|
||||
forward grenade_throw(index,greindex,wId);
|
||||
|
||||
/* Example: for full stamina use set_player_stamina(1,STAMINA_SET,100,100) */
|
||||
/* Example: for full stamina use dod_player_stamina(1,STAMINA_SET,100,100) */
|
||||
/* value is from 0 - 100 */
|
||||
native dod_set_stamina(index,set=STAMINA_SET,minvalue=0,maxvalue=100);
|
||||
|
||||
@ -53,7 +53,10 @@ native dod_get_pl_teamname(index,szName[],len);
|
||||
/* Returns 1 is player weapon is deployed (bar,mg..) */
|
||||
native dod_is_deployed(index);
|
||||
|
||||
/*Sets the ammo of the specified weapon entity id */
|
||||
native dod_set_user_ammo(index,wid,value);
|
||||
|
||||
/*Gets the ammo of the specified weapon entity id */
|
||||
native dod_get_user_ammo(index,wid);
|
||||
|
||||
|
||||
|
@ -183,7 +183,7 @@ native trace_normal(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]
|
||||
/* Changes a Vector to an Angle vector. */
|
||||
native vector_to_angle(Float:fVector[3], Float:vReturn[3]);
|
||||
|
||||
native anglevector(Float:vector[3],FRU,Float:ret[3])
|
||||
native angle_vector(Float:vector[3],FRU,Float:ret[3])
|
||||
|
||||
/* Gets the length of a vector (float[3]). */
|
||||
native Float:vector_length(Float:vVector[3]);
|
||||
@ -222,6 +222,10 @@ native get_usercmd(type,{Float,Sql,Result,_}:...);
|
||||
Note that your changes will be seen by any other plugin doing get_usercmd() */
|
||||
native set_usercmd(type,{Float,Sql,Result,_}:...);
|
||||
|
||||
/* Converts a string offset into a real string. Some of the forwards in fakemeta
|
||||
uses string offsets. (FM_CreateNamedEntity) */
|
||||
native get_string(_string, _returnString[], _len);
|
||||
|
||||
/* FORWARDS
|
||||
**********/
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user