Compare commits
294 Commits
amxmodx-0.
...
amxmodx-1.
Author | SHA1 | Date | |
---|---|---|---|
6c6f7f499c | |||
d3a49d1d41 | |||
8736214678 | |||
b2aa069cd4 | |||
01bacc3275 | |||
53b7516449 | |||
916325d3db | |||
054f046807 | |||
a4e57797f5 | |||
afef83ae66 | |||
730857a23b | |||
7fd9fff987 | |||
3074ca0756 | |||
7b8165fe6f | |||
3774575160 | |||
57eec2b88e | |||
b2eb9df894 | |||
00e9f2bbea | |||
adf12ab745 | |||
9d4e5b18ee | |||
8a40ed8cd6 | |||
c79909eb80 | |||
26e8b0dbb6 | |||
a2c2dc88fc | |||
99f47224ee | |||
a085cef0d6 | |||
2980fb1d82 | |||
3ed92695be | |||
9d797f8664 | |||
d7dbf60c8f | |||
06923d0f6d | |||
948be015a7 | |||
1a339b2f77 | |||
39479f2403 | |||
e4beb3828a | |||
84caa10733 | |||
a8ff2abab5 | |||
b4d2f83d6f | |||
be28d95b8d | |||
2401d1833e | |||
a189c0bda7 | |||
cc462c9ccb | |||
3d7987e8d8 | |||
1c544f55ca | |||
5c231919b6 | |||
4b48be3e93 | |||
ca07e53293 | |||
3f2a8ccfc5 | |||
e097932ac9 | |||
27e4174be6 | |||
7f47d2de56 | |||
6200ee6977 | |||
e98fb7d6e4 | |||
4e6233b898 | |||
544b74f839 | |||
4a823a0894 | |||
53188ab941 | |||
5f7dabf9b6 | |||
e343d224ce | |||
188023b5ac | |||
f18adbf9d6 | |||
9959ef52b3 | |||
8e58484fc5 | |||
a58ab24b0c | |||
a67085217f | |||
f08f16c20d | |||
ec9d4a52fe | |||
01b955d2d4 | |||
a384a78544 | |||
b4ad89e6ef | |||
2b4ed9cc27 | |||
e986848faf | |||
21ceae3c9e | |||
51b9fae4bc | |||
4e7d24f64b | |||
40640c92d4 | |||
c5b3919122 | |||
29a22bb5fd | |||
2baf9c4c20 | |||
c4727c1dc3 | |||
4901dee86d | |||
c1f2a499f8 | |||
7aa31c764d | |||
08fea0eea1 | |||
add716276b | |||
e688addd98 | |||
199131b2b8 | |||
fb29cbff16 | |||
11fa330f10 | |||
ca720c8c83 | |||
456d7b69a2 | |||
a86cb11fd7 | |||
96c65dcfc4 | |||
86451da9a9 | |||
57607f1a28 | |||
eb4fdf53fa | |||
6251521102 | |||
c940a0b621 | |||
719af5c72c | |||
128d19c69e | |||
46861ff5b4 | |||
ee464539de | |||
f69ff642df | |||
db77c245e6 | |||
d5caf3e2ac | |||
148b365e43 | |||
8c215e5d6f | |||
0513dae63e | |||
f73a8356f6 | |||
77c5198009 | |||
820fedca22 | |||
28a1182cd2 | |||
16444a713a | |||
6457fc45c7 | |||
cb94cccf22 | |||
c0ee97b437 | |||
f950d384b6 | |||
426a71e7f2 | |||
d49b2453bb | |||
74a1db4417 | |||
dc7e1e2494 | |||
5dfbcf2a23 | |||
09c1471c3a | |||
50a882cf4c | |||
850557df5a | |||
4c43eccbb5 | |||
380db7c884 | |||
1994917044 | |||
449f31d78c | |||
bc2386fe47 | |||
ec02883f6e | |||
abd372447a | |||
fef70c0386 | |||
719b32d71f | |||
4e385fec50 | |||
c9b2f2f060 | |||
d038e926fd | |||
712859eb20 | |||
826893d8d2 | |||
47d1881c29 | |||
741666b742 | |||
ee8e30417c | |||
cc4bbadfa2 | |||
8761791473 | |||
6697b7b1d3 | |||
3c9a47aae3 | |||
d1675c82b5 | |||
b40643950d | |||
ff5b1dd7cc | |||
3587483fa6 | |||
c9c26b869c | |||
8f18856e91 | |||
ddfba00791 | |||
c6eaa97391 | |||
5eb095b514 | |||
4e0bfe161e | |||
0e681d9bd4 | |||
3d1162ecd9 | |||
3414cd7ce7 | |||
66386cca59 | |||
75396c753c | |||
4edd77faee | |||
91db6c7398 | |||
46390b83ac | |||
89eda75b1f | |||
f14808e009 | |||
b569ea3c3f | |||
f595be47dc | |||
ee3404fea0 | |||
61fc7da654 | |||
14c3930b3d | |||
3efa25a5fb | |||
c29a7d34e5 | |||
daa873d8ed | |||
c09de969eb | |||
b0dd18580c | |||
32deaa261f | |||
3a8e103faf | |||
f4b1c9f78a | |||
618759f390 | |||
ced5d6ff57 | |||
db4041114f | |||
b52d77e8bf | |||
940b0be4b9 | |||
75f49e78b0 | |||
f06359e38f | |||
2733adbb49 | |||
fc4d8f183b | |||
ea70c77dd8 | |||
301a69aacb | |||
92eda7c214 | |||
4800ab292c | |||
34cfce33a1 | |||
fec17424fb | |||
264dd7a10d | |||
6cef4eab4f | |||
f4ada32ec2 | |||
bff8c3cdcf | |||
3b670333de | |||
eb36757ef1 | |||
054b1f8868 | |||
23234fad0b | |||
74dca8b6ef | |||
2a187988f6 | |||
d1ee9ee9ba | |||
380f560fa4 | |||
d9b6fa1f93 | |||
8a57648b87 | |||
80b8591295 | |||
f94aa52974 | |||
ef8ad4a894 | |||
41b6f6bd4a | |||
9e8f380121 | |||
39070081d1 | |||
00d8ffe503 | |||
4ef8530bba | |||
77aa0f4f8e | |||
766246648d | |||
7963eb1cde | |||
02d8b2c523 | |||
227fb0411e | |||
027ae6dc7e | |||
334905e16e | |||
e3fad723b8 | |||
5e52c45968 | |||
e3a2a2bc17 | |||
18b75cb07c | |||
4e1c5a3e02 | |||
5db290890f | |||
b9c83aa4a2 | |||
bb12f71137 | |||
0a3911231b | |||
846ef95c58 | |||
601bb30b7e | |||
9728b79c33 | |||
90baf98057 | |||
8ad6437dd8 | |||
02bf904467 | |||
62e4bbcfe9 | |||
fc15ac1f41 | |||
01770f0e5b | |||
87ff81a499 | |||
981f41aee0 | |||
605ca152c2 | |||
0fc8f0b489 | |||
c511d80da7 | |||
8304fc143c | |||
f3cfd31668 | |||
ef90960121 | |||
3700b8b39f | |||
b83f2f5257 | |||
06f61cf92a | |||
5a5ff6d8ea | |||
bbe2626fd1 | |||
d5646ae238 | |||
df43d897df | |||
687a0f23da | |||
aa0dc4dbaf | |||
de399c54c6 | |||
58d522e4c3 | |||
3b90cca5bd | |||
b7c9cfeea4 | |||
4fcad51d25 | |||
c2a2fc7dbe | |||
3f0d3c257a | |||
ecc07d4b45 | |||
8da965552b | |||
cfe36dea52 | |||
c16eab09ec | |||
d07cc0424d | |||
c669efd609 | |||
c3151b312a | |||
3fc3ece5b0 | |||
6887dfef16 | |||
867e7615ae | |||
5157be6e3d | |||
82ca25b231 | |||
a555f9b3f0 | |||
c1a6ce2565 | |||
8874666109 | |||
5233be593f | |||
0f38a24555 | |||
8d06f80eeb | |||
0983698d2e | |||
dde43b6e0d | |||
4382158b88 | |||
ba69d73785 | |||
be3d078d5a | |||
b8ca4586ad | |||
25750d2f05 | |||
423a467a70 | |||
d6e18a3e97 | |||
a6d5d89209 | |||
16b35006bd |
@ -244,7 +244,11 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
|||||||
|
|
||||||
// exec
|
// exec
|
||||||
cell retVal;
|
cell retVal;
|
||||||
amx_Execv(m_Amx, &retVal, m_Func, m_NumParams, realParams);
|
int err = amx_Execv(m_Amx, &retVal, m_Func, m_NumParams, realParams);
|
||||||
|
|
||||||
|
// log runtime error, if any
|
||||||
|
if (err != AMX_ERR_NONE)
|
||||||
|
LogError(m_Amx, err, "");
|
||||||
|
|
||||||
// cleanup strings & arrays
|
// cleanup strings & arrays
|
||||||
for (i = 0; i < m_NumParams; ++i)
|
for (i = 0; i < m_NumParams; ++i)
|
||||||
@ -494,6 +498,7 @@ cell executeForwards(int id, ...)
|
|||||||
REAL tmp = (REAL)va_arg(argptr, double); // floats get converted to doubles
|
REAL tmp = (REAL)va_arg(argptr, double); // floats get converted to doubles
|
||||||
params[i] = *(cell*)&tmp;
|
params[i] = *(cell*)&tmp;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
params[i] = (cell)va_arg(argptr, cell);
|
params[i] = (cell)va_arg(argptr, cell);
|
||||||
}
|
}
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
@ -502,10 +507,20 @@ cell executeForwards(int id, ...)
|
|||||||
|
|
||||||
cell CForwardMngr::prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type, bool copyBack)
|
cell CForwardMngr::prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type, bool copyBack)
|
||||||
{
|
{
|
||||||
|
if (m_TmpArraysNum >= FORWARD_MAX_PARAMS)
|
||||||
|
{
|
||||||
|
#ifdef MEMORY_TEST
|
||||||
|
m_validateAllAllocUnits();
|
||||||
|
#endif // MEMORY_TEST
|
||||||
|
AMXXLOG_Log("[AMXX] Forwards with more than 32 parameters are not supported (tried to prepare array # %d).", m_TmpArraysNum + 1);
|
||||||
|
m_TmpArraysNum = 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
m_TmpArrays[m_TmpArraysNum].ptr = ptr;
|
m_TmpArrays[m_TmpArraysNum].ptr = ptr;
|
||||||
m_TmpArrays[m_TmpArraysNum].size = size;
|
m_TmpArrays[m_TmpArraysNum].size = size;
|
||||||
m_TmpArrays[m_TmpArraysNum].type = type;
|
m_TmpArrays[m_TmpArraysNum].type = type;
|
||||||
m_TmpArrays[m_TmpArraysNum].copyBack = copyBack;
|
m_TmpArrays[m_TmpArraysNum].copyBack = copyBack;
|
||||||
|
|
||||||
return m_TmpArraysNum++;
|
return m_TmpArraysNum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#ifndef FORWARD_H
|
#ifndef FORWARD_H
|
||||||
#define FORWARD_H
|
#define FORWARD_H
|
||||||
|
|
||||||
const int FORWARD_MAX_PARAMS = 16;
|
const int FORWARD_MAX_PARAMS = 32;
|
||||||
|
|
||||||
enum ForwardExecType
|
enum ForwardExecType
|
||||||
{
|
{
|
||||||
|
@ -498,7 +498,7 @@ int CLangMngr::GetKeyEntry(String &key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_PTR(ptr, start, bufsize) if ((ptr) - (start) >= (bufsize)) { \
|
#define CHECK_PTR(ptr, start, bufsize) if ((ptr) - (start) >= (bufsize)) { \
|
||||||
AMXXLOG_Log("[AMXX] Buffer overflow in formatting (line %d, \"%s\")", amx->curline, g_plugins.findPluginFast(amx)->getName()); \
|
LogError(amx, AMX_ERR_STACKERR, "Buffer overflow in string formatting"); \
|
||||||
outbuf[0] = 0; \
|
outbuf[0] = 0; \
|
||||||
len = 0; \
|
len = 0; \
|
||||||
return outbuf; }
|
return outbuf; }
|
||||||
@ -509,7 +509,7 @@ int CLangMngr::GetKeyEntry(String &key)
|
|||||||
{ \
|
{ \
|
||||||
strcpy(outbuf, ""); \
|
strcpy(outbuf, ""); \
|
||||||
len = 0; \
|
len = 0; \
|
||||||
AMXXLOG_Log("[AMXX] Plugin did not format a string correctly (parameter %d (total %d), line %d, \"%s\")", parm, paramCount, amx->curline, g_plugins.findPluginFast(amx)->getName()); \
|
LogError(amx, AMX_ERR_PARAMS, "String formatted incorrectly - parameter %d (total %d)", parm, paramCount); \
|
||||||
return outbuf; \
|
return outbuf; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -536,7 +536,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
// Handle player ids (1-32) and server language
|
// Handle player ids (1-32) and server language
|
||||||
if (*pAmxLangName == LANG_PLAYER) // LANG_PLAYER
|
if (*pAmxLangName == LANG_PLAYER) // LANG_PLAYER
|
||||||
{
|
{
|
||||||
if ((int)CVAR_GET_FLOAT("amx_client_languages"))
|
if ((int)CVAR_GET_FLOAT("amx_client_languages") == 0)
|
||||||
{
|
{
|
||||||
cpLangName = g_vault.get("server_language");
|
cpLangName = g_vault.get("server_language");
|
||||||
} else {
|
} else {
|
||||||
@ -545,7 +545,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
} else if (*pAmxLangName == LANG_SERVER) { // LANG_SERVER
|
} else if (*pAmxLangName == LANG_SERVER) { // LANG_SERVER
|
||||||
cpLangName = g_vault.get("server_language");
|
cpLangName = g_vault.get("server_language");
|
||||||
} else if (*pAmxLangName >= 1 && *pAmxLangName <= 32) { // Direct Client Id
|
} else if (*pAmxLangName >= 1 && *pAmxLangName <= 32) { // Direct Client Id
|
||||||
if ((int)CVAR_GET_FLOAT("amx_client_languages"))
|
if ((int)CVAR_GET_FLOAT("amx_client_languages") == 0)
|
||||||
{
|
{
|
||||||
cpLangName = g_vault.get("server_language");
|
cpLangName = g_vault.get("server_language");
|
||||||
} else {
|
} else {
|
||||||
@ -584,9 +584,17 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
if (*def == '%')
|
if (*def == '%')
|
||||||
{
|
{
|
||||||
++def;
|
++def;
|
||||||
|
if (*def == '%' || *def == 0)
|
||||||
|
{
|
||||||
|
*outptr++ = '%';
|
||||||
|
++def;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
static char format[32];
|
static char format[32];
|
||||||
format[0] = '%';
|
format[0] = '%';
|
||||||
char *ptr = format+1;
|
char *ptr = format+1;
|
||||||
|
|
||||||
while (ptr-format<sizeof(format) && !isalpha(*ptr++ = *def++))
|
while (ptr-format<sizeof(format) && !isalpha(*ptr++ = *def++))
|
||||||
/*nothing*/;
|
/*nothing*/;
|
||||||
ZEROTERM(format);
|
ZEROTERM(format);
|
||||||
@ -634,6 +642,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
}
|
}
|
||||||
outptr += strlen(outptr);
|
outptr += strlen(outptr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (*def == '^')
|
else if (*def == '^')
|
||||||
{
|
{
|
||||||
++def;
|
++def;
|
||||||
@ -957,7 +966,7 @@ int CLangMngr::MergeDefinitionFile(const char *file)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
MD5 md5;
|
MD5 md5;
|
||||||
md5.update(fp);
|
md5.update(fp); // closes for us
|
||||||
md5.finalize();
|
md5.finalize();
|
||||||
char md5buffer[33];
|
char md5buffer[33];
|
||||||
md5.hex_digest(md5buffer);
|
md5.hex_digest(md5buffer);
|
||||||
|
@ -153,9 +153,11 @@ void LogEventsMngr::executeLogEvents()
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
bool valid;
|
bool valid;
|
||||||
for(CLogEvent* a = logevents[ logArgc ]; a ; a = a->next){
|
for(CLogEvent* a = logevents[ logArgc ]; a ; a = a->next)
|
||||||
|
{
|
||||||
valid = true;
|
valid = true;
|
||||||
for( CLogEvent::LogCond* b = a->filters; b ; b = b->next){
|
for( CLogEvent::LogCond* b = a->filters; b ; b = b->next)
|
||||||
|
{
|
||||||
valid = false;
|
valid = false;
|
||||||
for( CLogEvent::LogCondEle* c = b->list; c ; c = c->next) {
|
for( CLogEvent::LogCondEle* c = b->list; c ; c = c->next) {
|
||||||
if ( c->cmp->compareCondition( logArgs[b->argnum] ) == 0 ){
|
if ( c->cmp->compareCondition( logArgs[b->argnum] ) == 0 ){
|
||||||
@ -163,27 +165,15 @@ void LogEventsMngr::executeLogEvents()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!valid) break;
|
if (!valid)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLEEXEPTIONS
|
if (valid)
|
||||||
try
|
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
if (valid){
|
|
||||||
if ((err = amx_Exec(a->plugin->getAMX(), NULL , a->func , 0)) != AMX_ERR_NONE)
|
if ((err = amx_Exec(a->plugin->getAMX(), NULL , a->func , 0)) != AMX_ERR_NONE)
|
||||||
LogError(a->plugin->getAMX(), err, "");
|
LogError(a->plugin->getAMX(), err, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLEEXEPTIONS
|
|
||||||
}
|
|
||||||
catch( ... )
|
|
||||||
{
|
|
||||||
AMXXLOG_Log( "[AMXX] fatal error at log forward function execution");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
@ -428,6 +428,7 @@ int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, cell *params)
|
|||||||
AMX_HEADER *hdr;
|
AMX_HEADER *hdr;
|
||||||
AMX_FUNCSTUB *func;
|
AMX_FUNCSTUB *func;
|
||||||
AMX_NATIVE f;
|
AMX_NATIVE f;
|
||||||
|
int i =0;
|
||||||
|
|
||||||
assert(amx!=NULL);
|
assert(amx!=NULL);
|
||||||
hdr=(AMX_HEADER *)amx->base;
|
hdr=(AMX_HEADER *)amx->base;
|
||||||
@ -437,6 +438,7 @@ int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, cell *params)
|
|||||||
assert(index>=0 && index<(cell)NUMENTRIES(hdr,natives,libraries));
|
assert(index>=0 && index<(cell)NUMENTRIES(hdr,natives,libraries));
|
||||||
func=GETENTRY(hdr,natives,index);
|
func=GETENTRY(hdr,natives,index);
|
||||||
f=(AMX_NATIVE)func->address;
|
f=(AMX_NATIVE)func->address;
|
||||||
|
amx->userdata[2] = (char *)GETENTRYNAME(hdr, func);
|
||||||
assert(f!=NULL);
|
assert(f!=NULL);
|
||||||
|
|
||||||
/* now that we have found the function, patch the program so that any
|
/* now that we have found the function, patch the program so that any
|
||||||
@ -606,6 +608,7 @@ static int amx_BrowseRelocate(AMX *amx)
|
|||||||
} else {
|
} else {
|
||||||
amx->userdata[0] = 0;
|
amx->userdata[0] = 0;
|
||||||
amx->userdata[1] = 0;
|
amx->userdata[1] = 0;
|
||||||
|
amx->userdata[2] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined __GNUC__ || defined ASM32 || defined JIT && !defined __64BIT__
|
#if defined __GNUC__ || defined ASM32 || defined JIT && !defined __64BIT__
|
||||||
@ -1111,12 +1114,18 @@ int AMXAPI amx_Init(AMX *amx,void *program)
|
|||||||
#if defined __BORLANDC__ || defined __WATCOMC__
|
#if defined __BORLANDC__ || defined __WATCOMC__
|
||||||
#pragma argsused
|
#pragma argsused
|
||||||
#endif
|
#endif
|
||||||
int memoryFullAccess( void* addr, int len ) { return 1; }
|
int memoryFullAccess( void* addr, int len )
|
||||||
|
{
|
||||||
|
return mprotect(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined __BORLANDC__ || defined __WATCOMC__
|
#if defined __BORLANDC__ || defined __WATCOMC__
|
||||||
#pragma argsused
|
#pragma argsused
|
||||||
#endif
|
#endif
|
||||||
int memorySetAccess( void* addr, int len, int access ) { return 1; }
|
int memorySetAccess( void* addr, int len, int access )
|
||||||
|
{
|
||||||
|
return mprotect(addr, len, PROT_READ|PROT_EXEC);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* #if defined __WIN32 __ */
|
#endif /* #if defined __WIN32 __ */
|
||||||
|
|
||||||
@ -1125,8 +1134,13 @@ int AMXAPI amx_InitJIT(AMX *amx, void *reloc_table, void *native_code)
|
|||||||
int mac, res;
|
int mac, res;
|
||||||
AMX_HEADER *hdr;
|
AMX_HEADER *hdr;
|
||||||
|
|
||||||
mac = memoryFullAccess( (void*)asm_runJIT, 20000 );
|
#ifdef __linux__
|
||||||
if ( ! mac )
|
mac = memoryFullAccess( (void *)((int)((void*)asm_runJIT)-(int)((void*)asm_runJIT)%sysconf(_SC_PAGESIZE)), 20000 );
|
||||||
|
if ( mac )
|
||||||
|
#else
|
||||||
|
mac = memoryFullAccess((void *)asm_runJIT, 20000);
|
||||||
|
if ( !mac )
|
||||||
|
#endif
|
||||||
return AMX_ERR_INIT_JIT;
|
return AMX_ERR_INIT_JIT;
|
||||||
|
|
||||||
/* copy the prefix */
|
/* copy the prefix */
|
||||||
@ -3405,7 +3419,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
if (alt==0)
|
if (alt==0)
|
||||||
ABORT(amx,AMX_ERR_DIVIDE);
|
ABORT(amx,AMX_ERR_DIVIDE);
|
||||||
/* divide must always round down; this is a bit
|
/* divide must always round down; this is a bit
|
||||||
* involved to do in a machine-independent way.
|
|
||||||
*/
|
*/
|
||||||
offs=(pri % alt + alt) % alt; /* true modulus */
|
offs=(pri % alt + alt) % alt; /* true modulus */
|
||||||
pri=(pri - offs) / alt; /* division result */
|
pri=(pri - offs) / alt; /* division result */
|
||||||
|
@ -46,14 +46,15 @@
|
|||||||
typedef long int int32_t;
|
typedef long int int32_t;
|
||||||
typedef unsigned long int uint32_t;
|
typedef unsigned long int uint32_t;
|
||||||
#endif
|
#endif
|
||||||
#if defined __WIN32__ || defined _WIN32 || defined WIN32
|
// evilspy's fix for mingw
|
||||||
typedef __int64 int64_t;
|
#if defined __GNUC__
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
#define HAVE_I64
|
|
||||||
#elif defined __GNUC__
|
|
||||||
typedef long long int64_t;
|
typedef long long int64_t;
|
||||||
typedef unsigned long long uint64_t;
|
typedef unsigned long long uint64_t;
|
||||||
#define HAVE_I64
|
#define HAVE_I64
|
||||||
|
#elif defined __WIN32__ || defined _WIN32 || defined WIN32
|
||||||
|
typedef __int64 int64_t;
|
||||||
|
typedef unsigned __int64 uint64_t;
|
||||||
|
#define HAVE_I64
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
; /usr/local/cross-tools/bin/i386-mingw32msvc-dlltool --base-file /tmp/cc4kB6s0.base --output-exp amx_mm.exp --dllname amx_mm.dll --output-def amx_mm.def --add-stdcall-alias --exclude-symbol=DllMainCRTStartup@12 --def /tmp/ccyI7I7K.def
|
|
||||||
EXPORTS
|
|
||||||
GetEngineFunctions @ 1 ;
|
|
||||||
GetEngineFunctions_Post @ 2 ;
|
|
||||||
GetEntityAPI2 @ 3 ;
|
|
||||||
GetEntityAPI2_Post @ 4 ;
|
|
||||||
GiveFnptrsToDll = GiveFnptrsToDll@8 @ 5 ;
|
|
||||||
GiveFnptrsToDll@8 @ 6 ;
|
|
||||||
Meta_Attach @ 7 ;
|
|
||||||
Meta_Detach @ 8 ;
|
|
||||||
Meta_Query @ 9 ;
|
|
@ -351,6 +351,15 @@ static cell AMX_NATIVE_CALL is_linux_server(AMX *amx, cell *params)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL is_amd64_server(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
#if SMALL_CELL_SIZE==64
|
||||||
|
return 1;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL is_jit_enabled(AMX *amx, cell *params) // PM: Useless ;P
|
static cell AMX_NATIVE_CALL is_jit_enabled(AMX *amx, cell *params) // PM: Useless ;P
|
||||||
{
|
{
|
||||||
#ifdef JIT
|
#ifdef JIT
|
||||||
@ -1196,6 +1205,14 @@ static cell AMX_NATIVE_CALL message_begin(AMX *amx, cell *params) /* 4 param */
|
|||||||
int numparam = *params/sizeof(cell);
|
int numparam = *params/sizeof(cell);
|
||||||
float vecOrigin[3];
|
float vecOrigin[3];
|
||||||
cell *cpOrigin;
|
cell *cpOrigin;
|
||||||
|
|
||||||
|
if (params[2] < 1 || ((params[2] > 63) // maximal number of engine messages
|
||||||
|
&& !GET_USER_MSG_NAME(PLID, params[2], NULL)))
|
||||||
|
{
|
||||||
|
AMXXLOG_Log("[AMXX] Plugin called message_begin with an invalid message id (%d).", params[2]);
|
||||||
|
amx_RaiseError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
switch (params[1]){
|
switch (params[1]){
|
||||||
case MSG_BROADCAST:
|
case MSG_BROADCAST:
|
||||||
case MSG_ALL:
|
case MSG_ALL:
|
||||||
@ -1203,6 +1220,7 @@ static cell AMX_NATIVE_CALL message_begin(AMX *amx, cell *params) /* 4 param */
|
|||||||
MESSAGE_BEGIN( params[1], params[2],NULL );
|
MESSAGE_BEGIN( params[1], params[2],NULL );
|
||||||
break;
|
break;
|
||||||
case MSG_PVS: case MSG_PAS:
|
case MSG_PVS: case MSG_PAS:
|
||||||
|
case MSG_PVS_R: case MSG_PAS_R:
|
||||||
if (numparam < 3) {
|
if (numparam < 3) {
|
||||||
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1213,12 +1231,13 @@ static cell AMX_NATIVE_CALL message_begin(AMX *amx, cell *params) /* 4 param */
|
|||||||
vecOrigin[2] = *(cpOrigin+2);
|
vecOrigin[2] = *(cpOrigin+2);
|
||||||
MESSAGE_BEGIN( params[1], params[2] , vecOrigin );
|
MESSAGE_BEGIN( params[1], params[2] , vecOrigin );
|
||||||
break;
|
break;
|
||||||
|
case MSG_ONE_UNRELIABLE:
|
||||||
case MSG_ONE:
|
case MSG_ONE:
|
||||||
if (numparam < 4) {
|
if (numparam < 4) {
|
||||||
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
MESSAGE_BEGIN( MSG_ONE, params[2], NULL, INDEXENT(params[4]) );
|
MESSAGE_BEGIN( params[1], params[2], NULL, INDEXENT(params[4]) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1434,10 +1453,10 @@ static cell AMX_NATIVE_CALL read_data(AMX *amx, cell *params) /* 3 param */
|
|||||||
case 3:
|
case 3:
|
||||||
return set_amxstring(amx,params[2], g_events.getArgString( params[1] ),*get_amxaddr(amx,params[3]));
|
return set_amxstring(amx,params[2], g_events.getArgString( params[1] ),*get_amxaddr(amx,params[3]));
|
||||||
default:
|
default:
|
||||||
cell *fCell = get_amxaddr(amx,params[2]);
|
cell *fCell = get_amxaddr(amx, params[2]);
|
||||||
REAL pFloat = amx_ctof(fCell);
|
float fparam = g_events.getArgFloat(params[1]);
|
||||||
pFloat = g_events.getArgFloat( params[1] );
|
fCell[0] = amx_ftoc(fparam);
|
||||||
return (int)(pFloat);
|
return (int)fparam;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1667,6 +1686,16 @@ static cell AMX_NATIVE_CALL get_user_msgid(AMX *amx, cell *params) /* 1 param */
|
|||||||
return GET_USER_MSG_ID(PLID, sptemp , NULL );
|
return GET_USER_MSG_ID(PLID, sptemp , NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_msgname(AMX *amx, cell *params) /* get_user_msgname(msg, str[], len) = 3 params */
|
||||||
|
{
|
||||||
|
const char* STRING = GET_USER_MSG_NAME(PLID, params[1], NULL);
|
||||||
|
if (STRING)
|
||||||
|
return set_amxstring(amx, params[2], STRING, params[3]);
|
||||||
|
|
||||||
|
// Comes here if GET_USER_MSG_NAME failed (ie, invalid msg id)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_task(AMX *amx, cell *params) /* 2 param */
|
static cell AMX_NATIVE_CALL set_task(AMX *amx, cell *params) /* 2 param */
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -1740,7 +1769,11 @@ static cell AMX_NATIVE_CALL register_cvar(AMX *amx, cell *params) /* 3 param */
|
|||||||
g_cvars.put( cvar );
|
g_cvars.put( cvar );
|
||||||
|
|
||||||
if ( CVAR_GET_POINTER(temp) == 0 )
|
if ( CVAR_GET_POINTER(temp) == 0 )
|
||||||
CVAR_REGISTER( cvar->getCvar() );
|
{
|
||||||
|
static cvar_t cvar_reg_helper;
|
||||||
|
cvar_reg_helper = *(cvar->getCvar());
|
||||||
|
CVAR_REGISTER( &cvar_reg_helper );
|
||||||
|
}
|
||||||
|
|
||||||
CVAR_SET_STRING( temp ,get_amxstring(amx,params[2],1,i));
|
CVAR_SET_STRING( temp ,get_amxstring(amx,params[2],1,i));
|
||||||
return 1;
|
return 1;
|
||||||
@ -2408,6 +2441,49 @@ static cell AMX_NATIVE_CALL callfunc_begin(AMX *amx, cell *params)
|
|||||||
return 1; // success: 1
|
return 1; // success: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// native callfunc_begin_i(funcId, pluginId = -1)
|
||||||
|
static cell AMX_NATIVE_CALL callfunc_begin_i(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
CPluginMngr::CPlugin *plugin;
|
||||||
|
if (params[2] < 0)
|
||||||
|
plugin = g_plugins.findPluginFast(amx);
|
||||||
|
else
|
||||||
|
plugin = g_plugins.findPlugin(params[2]);
|
||||||
|
|
||||||
|
if (!plugin)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (!plugin->isExecutable(params[1]))
|
||||||
|
return -2;
|
||||||
|
|
||||||
|
g_CallFunc_Plugin = plugin;
|
||||||
|
g_CallFunc_Func = params[1];
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// native get_func_id(funcName[], pluginId = -1)
|
||||||
|
static cell AMX_NATIVE_CALL get_func_id(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
CPluginMngr::CPlugin *plugin;
|
||||||
|
if (params[2] < 0)
|
||||||
|
plugin = g_plugins.findPluginFast(amx);
|
||||||
|
else
|
||||||
|
plugin = g_plugins.findPlugin(params[2]);
|
||||||
|
|
||||||
|
if (!plugin)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
int len;
|
||||||
|
const char *funcName = get_amxstring(amx, params[1], 0, len);
|
||||||
|
|
||||||
|
int index;
|
||||||
|
if (amx_FindPublic(plugin->getAMX(), funcName, &index) != AMX_ERR_NONE)
|
||||||
|
index = -1;
|
||||||
|
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
// native callfunc_end();
|
// native callfunc_end();
|
||||||
static cell AMX_NATIVE_CALL callfunc_end(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL callfunc_end(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
@ -2666,6 +2742,47 @@ cell AMX_NATIVE_CALL require_module(AMX *amx, cell *params)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL lang_phrase(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int len = 0;
|
||||||
|
int iLang = params[1];
|
||||||
|
|
||||||
|
const char *cpLangName=NULL;
|
||||||
|
// Handle player ids (1-32) and server language
|
||||||
|
if (iLang == LANG_SERVER) { // LANG_SERVER
|
||||||
|
cpLangName = g_vault.get("server_language");
|
||||||
|
} else if (iLang >= 1 && iLang <= 32) { // Direct Client Id
|
||||||
|
if ((int)CVAR_GET_FLOAT("amx_client_languages") == 0)
|
||||||
|
{
|
||||||
|
cpLangName = g_vault.get("server_language");
|
||||||
|
} else {
|
||||||
|
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(iLang)->pEdict, "lang");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!cpLangName || strlen(cpLangName) < 1)
|
||||||
|
cpLangName = "en";
|
||||||
|
|
||||||
|
const char *str = get_amxstring(amx, params[2], 0, len);
|
||||||
|
|
||||||
|
const char *dat = g_langMngr.GetDef(cpLangName, str);
|
||||||
|
|
||||||
|
set_amxstring(amx, params[3], dat?dat:"ML_LNOTFOUND", params[4]);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL amx_mkdir(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int len = 0;
|
||||||
|
char *path = get_amxstring(amx, params[1], 0, len);
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
return mkdir(path, 0700);
|
||||||
|
#else
|
||||||
|
return mkdir(path);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
AMX_NATIVE_INFO amxmod_Natives[] = {
|
AMX_NATIVE_INFO amxmod_Natives[] = {
|
||||||
{ "client_cmd", client_cmd },
|
{ "client_cmd", client_cmd },
|
||||||
{ "client_print", client_print },
|
{ "client_print", client_print },
|
||||||
@ -2716,6 +2833,7 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
|
|||||||
{ "get_user_ip", get_user_ip },
|
{ "get_user_ip", get_user_ip },
|
||||||
{ "get_user_menu", get_user_menu},
|
{ "get_user_menu", get_user_menu},
|
||||||
{ "get_user_msgid", get_user_msgid},
|
{ "get_user_msgid", get_user_msgid},
|
||||||
|
{ "get_user_msgname", get_user_msgname},
|
||||||
{ "get_user_name", get_user_name },
|
{ "get_user_name", get_user_name },
|
||||||
{ "get_user_origin", get_user_origin},
|
{ "get_user_origin", get_user_origin},
|
||||||
{ "get_user_ping", get_user_ping },
|
{ "get_user_ping", get_user_ping },
|
||||||
@ -2731,6 +2849,7 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
|
|||||||
{ "get_xvar_num", get_xvar_num },
|
{ "get_xvar_num", get_xvar_num },
|
||||||
{ "is_dedicated_server",is_dedicated_server },
|
{ "is_dedicated_server",is_dedicated_server },
|
||||||
{ "is_linux_server", is_linux_server },
|
{ "is_linux_server", is_linux_server },
|
||||||
|
{ "is_amd64_server", is_amd64_server },
|
||||||
{ "is_jit_enabled", is_jit_enabled },
|
{ "is_jit_enabled", is_jit_enabled },
|
||||||
{ "is_user_authorized", is_user_authorized },
|
{ "is_user_authorized", is_user_authorized },
|
||||||
{ "is_map_valid", is_map_valid },
|
{ "is_map_valid", is_map_valid },
|
||||||
@ -2800,7 +2919,9 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
|
|||||||
{ "get_modulesnum", get_modulesnum },
|
{ "get_modulesnum", get_modulesnum },
|
||||||
{ "get_module", get_module },
|
{ "get_module", get_module },
|
||||||
{ "log_amx", log_amx },
|
{ "log_amx", log_amx },
|
||||||
|
{ "get_func_id", get_func_id },
|
||||||
{ "callfunc_begin", callfunc_begin },
|
{ "callfunc_begin", callfunc_begin },
|
||||||
|
{ "callfunc_begin_i", callfunc_begin_i },
|
||||||
{ "callfunc_end", callfunc_end },
|
{ "callfunc_end", callfunc_end },
|
||||||
{ "callfunc_push_int", callfunc_push_byval },
|
{ "callfunc_push_int", callfunc_push_byval },
|
||||||
{ "callfunc_push_str", callfunc_push_str },
|
{ "callfunc_push_str", callfunc_push_str },
|
||||||
@ -2824,5 +2945,7 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
|
|||||||
{ "md5", amx_md5 },
|
{ "md5", amx_md5 },
|
||||||
{ "md5_file", amx_md5_file },
|
{ "md5_file", amx_md5_file },
|
||||||
{ "plugin_flags", plugin_flags},
|
{ "plugin_flags", plugin_flags},
|
||||||
|
{ "lang_phrase", lang_phrase},
|
||||||
|
{ "mkdir", amx_mkdir},
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
@ -33,9 +33,15 @@
|
|||||||
#define AMXMODX_H
|
#define AMXMODX_H
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
#include <ctype.h> //tolower, etc
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include <extdll.h>
|
#include <extdll.h>
|
||||||
#include <meta_api.h>
|
#include <meta_api.h>
|
||||||
|
#include "mm_pextensions.h" // metamod-p extensions
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
#ifdef MEMORY_TEST
|
||||||
#include "mmgr/mmgr.h"
|
#include "mmgr/mmgr.h"
|
||||||
@ -62,7 +68,7 @@
|
|||||||
#include "amxxlog.h"
|
#include "amxxlog.h"
|
||||||
|
|
||||||
#define AMXXLOG_Log g_log.Log
|
#define AMXXLOG_Log g_log.Log
|
||||||
#define AMX_VERSION "0.2"
|
#define AMX_VERSION "1.01"
|
||||||
|
|
||||||
extern AMX_NATIVE_INFO core_Natives[];
|
extern AMX_NATIVE_INFO core_Natives[];
|
||||||
extern AMX_NATIVE_INFO time_Natives[];
|
extern AMX_NATIVE_INFO time_Natives[];
|
||||||
@ -130,6 +136,7 @@ struct fakecmd_t {
|
|||||||
bool fake;
|
bool fake;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern pextension_funcs_t *gpMetaPExtFuncs;
|
||||||
extern CLog g_log;
|
extern CLog g_log;
|
||||||
extern CPluginMngr g_plugins;
|
extern CPluginMngr g_plugins;
|
||||||
extern CTaskMngr g_tasksMngr;
|
extern CTaskMngr g_tasksMngr;
|
||||||
|
@ -64,7 +64,7 @@ void CLog::CloseFile()
|
|||||||
if (fp)
|
if (fp)
|
||||||
{
|
{
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
fopen(m_LogFile.c_str(), "a+");
|
fp = fopen(m_LogFile.c_str(), "a+");
|
||||||
|
|
||||||
// get time
|
// get time
|
||||||
time_t td;
|
time_t td;
|
||||||
@ -106,8 +106,11 @@ void CLog::CreateNewFile()
|
|||||||
ALERT(at_logged, "[AMXX] Unexpected fatal logging error. AMXX Logging disabled.\n");
|
ALERT(at_logged, "[AMXX] Unexpected fatal logging error. AMXX Logging disabled.\n");
|
||||||
SET_LOCALINFO("amxx_logging", "0");
|
SET_LOCALINFO("amxx_logging", "0");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
fprintf(fp, "AMX Mod X log file started (file \"%s/L%02d%02d%03d.log\") (version \"%s\")\n", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday, i, AMX_VERSION);
|
fprintf(fp, "AMX Mod X log file started (file \"%s/L%02d%02d%03d.log\") (version \"%s\")\n", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday, i, AMX_VERSION);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLog::UseFile(const String &fileName)
|
void CLog::UseFile(const String &fileName)
|
||||||
|
@ -2344,8 +2344,24 @@ CFakeMeta::CFakeMetaPlugin::~CFakeMetaPlugin()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ghost_of_evilspy's "could not find memloc for cvar" fix
|
||||||
|
void FakeMeta_New_CVarRegister(cvar_t *pCVar)
|
||||||
|
{
|
||||||
|
static cvar_t tmpvar;
|
||||||
|
tmpvar = *pCVar;
|
||||||
|
CVAR_REGISTER(&tmpvar);
|
||||||
|
}
|
||||||
|
|
||||||
int CFakeMeta::CFakeMetaPlugin::Query(mutil_funcs_t *pMetaUtilFuncs)
|
int CFakeMeta::CFakeMetaPlugin::Query(mutil_funcs_t *pMetaUtilFuncs)
|
||||||
{
|
{
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs)
|
||||||
|
{
|
||||||
|
//load plugins in meta_attach
|
||||||
|
m_Status = PL_OPENED;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Load the library
|
// Load the library
|
||||||
// We don't have to DLCLOSE here.
|
// We don't have to DLCLOSE here.
|
||||||
m_Handle = DLOPEN(build_pathname("%s", m_Path.c_str()));
|
m_Handle = DLOPEN(build_pathname("%s", m_Path.c_str()));
|
||||||
@ -2390,7 +2406,13 @@ int CFakeMeta::CFakeMetaPlugin::Query(mutil_funcs_t *pMetaUtilFuncs)
|
|||||||
m_Status = PL_BADFILE;
|
m_Status = PL_BADFILE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
giveEngFuncsFn(&g_engfuncs, gpGlobals);
|
|
||||||
|
// ghost_of_evilspy's "Could not find memloc for cvar" fix
|
||||||
|
static enginefuncs_t fakemeta_engfuncs;
|
||||||
|
memcpy(&fakemeta_engfuncs, &g_engfuncs, sizeof(enginefuncs_t));
|
||||||
|
// Override cvar register to our own function
|
||||||
|
fakemeta_engfuncs.pfnCVarRegister = FakeMeta_New_CVarRegister;
|
||||||
|
giveEngFuncsFn(&fakemeta_engfuncs, gpGlobals);
|
||||||
|
|
||||||
if (queryFn(META_INTERFACE_VERSION, &m_Info, pMetaUtilFuncs) != 1)
|
if (queryFn(META_INTERFACE_VERSION, &m_Info, pMetaUtilFuncs) != 1)
|
||||||
{
|
{
|
||||||
@ -2405,6 +2427,18 @@ int CFakeMeta::CFakeMetaPlugin::Query(mutil_funcs_t *pMetaUtilFuncs)
|
|||||||
|
|
||||||
int CFakeMeta::CFakeMetaPlugin::Attach(PLUG_LOADTIME now, meta_globals_t *pMGlobals, gamedll_funcs_t *pGameDllFuncs)
|
int CFakeMeta::CFakeMetaPlugin::Attach(PLUG_LOADTIME now, meta_globals_t *pMGlobals, gamedll_funcs_t *pGameDllFuncs)
|
||||||
{
|
{
|
||||||
|
// evilspy's patch:
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs) {
|
||||||
|
if(PEXT_LOAD_PLUGIN_BY_NAME(PLID, m_Path.c_str(), now, (void**)&m_Handle) || !m_Handle) {
|
||||||
|
m_Status = PL_FAILED;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_Status = PL_RUNNING;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_Handle)
|
if (!m_Handle)
|
||||||
return 0;
|
return 0;
|
||||||
META_ATTACH_FN attachFn = (META_ATTACH_FN)DLSYM(m_Handle, "Meta_Attach");
|
META_ATTACH_FN attachFn = (META_ATTACH_FN)DLSYM(m_Handle, "Meta_Attach");
|
||||||
@ -2429,6 +2463,19 @@ int CFakeMeta::CFakeMetaPlugin::Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reaso
|
|||||||
{
|
{
|
||||||
if (!m_Handle)
|
if (!m_Handle)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
// evilspy's patch:
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if (gpMetaPExtFuncs) {
|
||||||
|
if(PEXT_UNLOAD_PLUGIN_BY_HANDLE(PLID, (void*)m_Handle, now, reason)) {
|
||||||
|
m_Status = PL_FAILED;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
m_Status = PL_OPENED;
|
||||||
|
m_Handle = NULL;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
META_DETACH_FN detachFn = (META_DETACH_FN)DLSYM(m_Handle, "Meta_Detach");
|
META_DETACH_FN detachFn = (META_DETACH_FN)DLSYM(m_Handle, "Meta_Detach");
|
||||||
if (!detachFn)
|
if (!detachFn)
|
||||||
{
|
{
|
||||||
@ -2519,6 +2566,11 @@ void CFakeMeta::ReleasePlugins()
|
|||||||
|
|
||||||
bool CFakeMeta::AddCorePlugin()
|
bool CFakeMeta::AddCorePlugin()
|
||||||
{
|
{
|
||||||
|
// evilspy:
|
||||||
|
// not needed when using metamod p-extensions
|
||||||
|
if(gpMetaPExtFuncs)
|
||||||
|
return true;
|
||||||
|
|
||||||
// Check whether there already is a core plugin
|
// Check whether there already is a core plugin
|
||||||
if (m_Plugins.begin() && strcmp((*m_Plugins.begin()).GetPath(), "[AMXX Core]") == 0)
|
if (m_Plugins.begin() && strcmp((*m_Plugins.begin()).GetPath(), "[AMXX Core]") == 0)
|
||||||
return true;
|
return true;
|
||||||
@ -2582,6 +2634,14 @@ int CFakeMeta::GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable /*from metamod*/, int
|
|||||||
*interfaceVersion = INTERFACE_VERSION;
|
*interfaceVersion = INTERFACE_VERSION;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// evilspy:
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs) {
|
||||||
|
memcpy( pFunctionTable, pAMXXFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy( pFunctionTable, &g_DllFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
memcpy( pFunctionTable, &g_DllFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
@ -2611,6 +2671,14 @@ int CFakeMeta::GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable /*from metamod*/
|
|||||||
*interfaceVersion = INTERFACE_VERSION;
|
*interfaceVersion = INTERFACE_VERSION;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// evilspy
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs) {
|
||||||
|
memcpy( pFunctionTable, pAMXXFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy( pFunctionTable, &g_DllFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
|
memcpy( pFunctionTable, &g_DllFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
@ -2640,6 +2708,14 @@ int CFakeMeta::GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inter
|
|||||||
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// evilspy:
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs) {
|
||||||
|
memcpy( pengfuncsFromEngine, pAMXXFunctionTable, sizeof( enginefuncs_t ) );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy( pengfuncsFromEngine, &g_EngineFunctionTable, sizeof( enginefuncs_t ) );
|
memcpy( pengfuncsFromEngine, &g_EngineFunctionTable, sizeof( enginefuncs_t ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
@ -2668,6 +2744,14 @@ int CFakeMeta::GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *
|
|||||||
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// evilspy:
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs) {
|
||||||
|
memcpy( pengfuncsFromEngine, pAMXXFunctionTable, sizeof( enginefuncs_t ) );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy( pengfuncsFromEngine, &g_EngineFunctionTable_Post, sizeof( enginefuncs_t ) );
|
memcpy( pengfuncsFromEngine, &g_EngineFunctionTable_Post, sizeof( enginefuncs_t ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
@ -2703,6 +2787,14 @@ int CFakeMeta::GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *int
|
|||||||
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// evilspy:
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs) {
|
||||||
|
memcpy( pNewFunctionTable, pAMXXFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy( pNewFunctionTable, &g_NewDllFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
memcpy( pNewFunctionTable, &g_NewDllFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
@ -2738,6 +2830,14 @@ int CFakeMeta::GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable, int
|
|||||||
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// evilspy:
|
||||||
|
//using metamod p-extensions?
|
||||||
|
if(gpMetaPExtFuncs) {
|
||||||
|
memcpy( pNewFunctionTable, pAMXXFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy( pNewFunctionTable, &g_NewDllFunctionTable_Post, sizeof( NEW_DLL_FUNCTIONS ) );
|
memcpy( pNewFunctionTable, &g_NewDllFunctionTable_Post, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
|
@ -57,6 +57,23 @@
|
|||||||
|
|
||||||
CVector<FILE *> FileList;
|
CVector<FILE *> FileList;
|
||||||
|
|
||||||
|
class AutoFilePtr
|
||||||
|
{
|
||||||
|
FILE *m_FP;
|
||||||
|
public:
|
||||||
|
AutoFilePtr(FILE *fp) : m_FP(fp)
|
||||||
|
{ }
|
||||||
|
~AutoFilePtr()
|
||||||
|
{
|
||||||
|
if (m_FP)
|
||||||
|
fclose(m_FP);
|
||||||
|
}
|
||||||
|
operator FILE* ()
|
||||||
|
{
|
||||||
|
return m_FP;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL read_dir(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL read_dir(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
@ -168,7 +185,7 @@ static cell AMX_NATIVE_CALL write_file(AMX *amx, cell *params) /* 3 param */
|
|||||||
|
|
||||||
// adding a new line in a middle of already existing file
|
// adding a new line in a middle of already existing file
|
||||||
FILE* pTemp;
|
FILE* pTemp;
|
||||||
char buffor[1024];
|
char buffor[2048];
|
||||||
|
|
||||||
if ( (pTemp = tmpfile()) == NULL ){
|
if ( (pTemp = tmpfile()) == NULL ){
|
||||||
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
||||||
@ -177,11 +194,11 @@ static cell AMX_NATIVE_CALL write_file(AMX *amx, cell *params) /* 3 param */
|
|||||||
|
|
||||||
for(i=0;;++i){
|
for(i=0;;++i){
|
||||||
if ( i == iLine ){
|
if ( i == iLine ){
|
||||||
fgets(buffor,1023,pFile);
|
fgets(buffor,2047,pFile);
|
||||||
fputs( sText , pTemp );
|
fputs( sText , pTemp );
|
||||||
fputc( '\n', pTemp );
|
fputc( '\n', pTemp );
|
||||||
}
|
}
|
||||||
else if ( fgets(buffor,1023,pFile) ){
|
else if ( fgets(buffor,2047,pFile) ){
|
||||||
fputs(buffor , pTemp );
|
fputs(buffor , pTemp );
|
||||||
}
|
}
|
||||||
else if ( i < iLine ) {
|
else if ( i < iLine ) {
|
||||||
@ -199,7 +216,7 @@ static cell AMX_NATIVE_CALL write_file(AMX *amx, cell *params) /* 3 param */
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(fgets(buffor,1023,pTemp))
|
while(fgets(buffor,2047,pTemp))
|
||||||
fputs(buffor,pFile );
|
fputs(buffor,pFile );
|
||||||
|
|
||||||
fclose(pTemp);
|
fclose(pTemp);
|
||||||
@ -230,17 +247,20 @@ static cell AMX_NATIVE_CALL file_size(AMX *amx, cell *params) /* 1 param */
|
|||||||
{
|
{
|
||||||
int iLen;
|
int iLen;
|
||||||
char* sFile = get_amxstring(amx,params[1],0,iLen);
|
char* sFile = get_amxstring(amx,params[1],0,iLen);
|
||||||
FILE* fp = fopen(build_pathname("%s",sFile),"r");
|
AutoFilePtr fp(fopen(build_pathname("%s",sFile),"r"));
|
||||||
if ( fp != NULL) {
|
if ( fp != NULL)
|
||||||
if ( params[0] < 2 || params[2] == 0 ){
|
{
|
||||||
|
if ( params[0] < 2 || params[2] == 0 )
|
||||||
|
{
|
||||||
fseek(fp,0,SEEK_END);
|
fseek(fp,0,SEEK_END);
|
||||||
int size = ftell(fp);
|
int size = ftell(fp);
|
||||||
fclose(fp);
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
else if ( params[2] == 1 ){
|
else if ( params[2] == 1 )
|
||||||
|
{
|
||||||
int a = 0,lines = 0;
|
int a = 0,lines = 0;
|
||||||
while( a != EOF ){
|
while( a != EOF )
|
||||||
|
{
|
||||||
++lines;
|
++lines;
|
||||||
while ( (a = fgetc(fp)) != '\n' && a != EOF )
|
while ( (a = fgetc(fp)) != '\n' && a != EOF )
|
||||||
;
|
;
|
||||||
@ -454,7 +474,7 @@ static cell AMX_NATIVE_CALL amx_filesize(AMX *amx, cell *params)
|
|||||||
int len;
|
int len;
|
||||||
char *file = build_pathname("%s", format_amxstring(amx, params, 1, len));
|
char *file = build_pathname("%s", format_amxstring(amx, params, 1, len));
|
||||||
long size;
|
long size;
|
||||||
FILE *fp = fopen(file, "rb");
|
AutoFilePtr fp(fopen(file, "rb"));
|
||||||
if (fp) {
|
if (fp) {
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
size = ftell(fp);
|
size = ftell(fp);
|
||||||
|
@ -50,6 +50,7 @@ gamedll_funcs_t *gpGamedllFuncs;
|
|||||||
mutil_funcs_t *gpMetaUtilFuncs;
|
mutil_funcs_t *gpMetaUtilFuncs;
|
||||||
enginefuncs_t g_engfuncs;
|
enginefuncs_t g_engfuncs;
|
||||||
globalvars_t *gpGlobals;
|
globalvars_t *gpGlobals;
|
||||||
|
pextension_funcs_t *gpMetaPExtFuncs;
|
||||||
|
|
||||||
funEventCall modMsgsEnd[MAX_REG_MSGS];
|
funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||||
funEventCall modMsgs[MAX_REG_MSGS];
|
funEventCall modMsgs[MAX_REG_MSGS];
|
||||||
@ -281,7 +282,7 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
FF_ClientPutInServer = registerForward("client_putinserver", ET_IGNORE, FP_CELL, FP_DONE);
|
FF_ClientPutInServer = registerForward("client_putinserver", ET_IGNORE, FP_CELL, FP_DONE);
|
||||||
FF_PluginCfg = registerForward("plugin_cfg", ET_IGNORE, FP_DONE);
|
FF_PluginCfg = registerForward("plugin_cfg", ET_IGNORE, FP_DONE);
|
||||||
FF_PluginPrecache = registerForward("plugin_precache", ET_IGNORE, FP_DONE);
|
FF_PluginPrecache = registerForward("plugin_precache", ET_IGNORE, FP_DONE);
|
||||||
FF_PluginLog = registerForward("plugin_log", ET_IGNORE, FP_DONE);
|
FF_PluginLog = registerForward("plugin_log", ET_STOP, FP_DONE);
|
||||||
FF_PluginEnd = registerForward("plugin_end", ET_IGNORE, FP_DONE);
|
FF_PluginEnd = registerForward("plugin_end", ET_IGNORE, FP_DONE);
|
||||||
FF_InconsistentFile = registerForward("inconsistent_file", ET_STOP, FP_CELL, FP_STRING, FP_STRINGEX, FP_DONE);
|
FF_InconsistentFile = registerForward("inconsistent_file", ET_STOP, FP_CELL, FP_STRING, FP_STRINGEX, FP_DONE);
|
||||||
FF_ClientAuthorized = registerForward("client_authorized", ET_IGNORE, FP_CELL, FP_DONE);
|
FF_ClientAuthorized = registerForward("client_authorized", ET_IGNORE, FP_CELL, FP_DONE);
|
||||||
@ -300,7 +301,6 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
(*a).getMin(),(*a).getMax(),(*a).getFilename());
|
(*a).getMin(),(*a).getMax(),(*a).getFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,10 +423,11 @@ void C_ServerDeactivate() {
|
|||||||
|
|
||||||
for(int i = 1; i <= gpGlobals->maxClients; ++i){
|
for(int i = 1; i <= gpGlobals->maxClients; ++i){
|
||||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->initialized)
|
||||||
|
|
||||||
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
||||||
|
|
||||||
|
if (pPlayer->ingame){
|
||||||
|
|
||||||
pPlayer->Disconnect();
|
pPlayer->Disconnect();
|
||||||
--g_players_num;
|
--g_players_num;
|
||||||
}
|
}
|
||||||
@ -547,8 +548,10 @@ BOOL C_ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *ps
|
|||||||
|
|
||||||
void C_ClientDisconnect( edict_t *pEntity ) {
|
void C_ClientDisconnect( edict_t *pEntity ) {
|
||||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||||
if (pPlayer->ingame) {
|
if (pPlayer->initialized)
|
||||||
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
||||||
|
|
||||||
|
if (pPlayer->ingame) {
|
||||||
--g_players_num;
|
--g_players_num;
|
||||||
}
|
}
|
||||||
pPlayer->Disconnect();
|
pPlayer->Disconnect();
|
||||||
@ -603,6 +606,35 @@ void C_ClientCommand( edict_t *pEntity ) {
|
|||||||
META_RES result = MRES_IGNORED;
|
META_RES result = MRES_IGNORED;
|
||||||
cell ret = 0;
|
cell ret = 0;
|
||||||
int err;
|
int err;
|
||||||
|
const char* cmd = CMD_ARGV(0);
|
||||||
|
const char* arg = CMD_ARGV(1);
|
||||||
|
|
||||||
|
// Handle "amxx" if not on listenserver
|
||||||
|
if (IS_DEDICATED_SERVER())
|
||||||
|
{
|
||||||
|
if (cmd && stricmp(cmd, "amxx")==0)
|
||||||
|
{
|
||||||
|
// Print version
|
||||||
|
static char buf[1024];
|
||||||
|
sprintf(buf, "%s %s\n", Plugin_info.name, Plugin_info.version);
|
||||||
|
CLIENT_PRINT(pEntity, print_console, buf);
|
||||||
|
sprintf(buf, "Authors: %s (%s)\n", "Felix \"SniperBeamer\" Geyer, David \"BAILOPAN\" Anderson, Pavol \"PM OnoTo\" Marko, Jonny \"Got His Gun\" Bergstrom, and Lukasz \"SidLuke\" Wlasinski.", Plugin_info.url);
|
||||||
|
CLIENT_PRINT(pEntity, print_console, buf);
|
||||||
|
sprintf(buf, "Compiled: %s\n", __DATE__ ", " __TIME__);
|
||||||
|
CLIENT_PRINT(pEntity, print_console, buf);
|
||||||
|
#ifdef JIT
|
||||||
|
sprintf(buf, "Core mode: JIT\n");
|
||||||
|
#else
|
||||||
|
#ifdef ASM32
|
||||||
|
sprintf(buf, "Core mode: ASM\n");
|
||||||
|
#else
|
||||||
|
sprintf(buf, "Core mode: Normal\n");
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
CLIENT_PRINT(pEntity, print_console, buf);
|
||||||
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENABLEEXEPTIONS
|
#ifdef ENABLEEXEPTIONS
|
||||||
try
|
try
|
||||||
@ -619,10 +651,7 @@ void C_ClientCommand( edict_t *pEntity ) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* check for command and if needed also for first argument and call proper function */
|
/* check for command and if needed also for first argument and call proper function */
|
||||||
const char* cmd = CMD_ARGV(0);
|
|
||||||
const char* arg = CMD_ARGV(1);
|
|
||||||
|
|
||||||
#ifdef ENABLEEXEPTIONS
|
#ifdef ENABLEEXEPTIONS
|
||||||
try{
|
try{
|
||||||
@ -985,7 +1014,9 @@ void C_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...)
|
|||||||
g_logevents.parseLogString( );
|
g_logevents.parseLogString( );
|
||||||
if (g_logevents.logEventsExist())
|
if (g_logevents.logEventsExist())
|
||||||
g_logevents.executeLogEvents( );
|
g_logevents.executeLogEvents( );
|
||||||
executeForwards(FF_PluginLog);
|
cell retVal = executeForwards(FF_PluginLog);
|
||||||
|
if (retVal)
|
||||||
|
RETURN_META(MRES_HANDLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
@ -1012,10 +1043,24 @@ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_
|
|||||||
else
|
else
|
||||||
LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor);
|
LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We can set this to null here because Meta_PExtGiveFnptrs is called after this
|
||||||
|
gpMetaPExtFuncs = NULL;
|
||||||
|
|
||||||
// :NOTE: Don't call modules query here (g_FakeMeta.Meta_Query), because we don't know modules yet. Do it in Meta_Attach
|
// :NOTE: Don't call modules query here (g_FakeMeta.Meta_Query), because we don't know modules yet. Do it in Meta_Attach
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// evilspy's patch for mm-p ext support
|
||||||
|
// this is called right after Meta_Query
|
||||||
|
C_DLLEXPORT int Meta_PExtGiveFnptrs(int interfaceVersion, pextension_funcs_t *pMetaPExtFuncs) {
|
||||||
|
if(interfaceVersion<META_PEXT_VERSION) {
|
||||||
|
return(META_PEXT_VERSION);
|
||||||
|
}
|
||||||
|
gpMetaPExtFuncs = pMetaPExtFuncs;
|
||||||
|
return(META_PEXT_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
static META_FUNCTIONS gMetaFunctionTable;
|
static META_FUNCTIONS gMetaFunctionTable;
|
||||||
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) {
|
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) {
|
||||||
if(now > Plugin_info.loadable) {
|
if(now > Plugin_info.loadable) {
|
||||||
@ -1048,7 +1093,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
|
|||||||
g_mod_name.assign(a);
|
g_mod_name.assign(a);
|
||||||
|
|
||||||
// ###### Print short GPL
|
// ###### Print short GPL
|
||||||
print_srvconsole( "\n AMX Mod X version %s Copyright (c) 2004 AMX Mod X Development Team \n"
|
print_srvconsole( "\n AMX Mod X version %s Copyright (c) 2004-2005 AMX Mod X Development Team \n"
|
||||||
" AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'.\n", AMX_VERSION);
|
" 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"
|
print_srvconsole( " This is free software and you are welcome to redistribute it under \n"
|
||||||
" certain conditions; type 'amxx gpl' for details.\n \n");
|
" certain conditions; type 'amxx gpl' for details.\n \n");
|
||||||
|
116
amxmodx/mm_pextensions.h
Executable file
116
amxmodx/mm_pextensions.h
Executable file
@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2004 Jussi Kivilinna
|
||||||
|
*
|
||||||
|
* This file is part of "Metamod All-Mod-Support"-patch for Metamod.
|
||||||
|
*
|
||||||
|
* Metamod 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.
|
||||||
|
*
|
||||||
|
* Metamod 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 Metamod; 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 MM_PEXTENSIONS_H
|
||||||
|
#define MM_PEXTENSIONS_H
|
||||||
|
|
||||||
|
#include "plinfo.h" // plid_t
|
||||||
|
#include "meta_api.h" // PLUG_LOADTIME
|
||||||
|
/*
|
||||||
|
|
||||||
|
How to use:
|
||||||
|
1. Add new export function 'Meta_PExtGiveFnptrs' to your plugin file.
|
||||||
|
'Meta_PExtGiveFnptrs' will be called right after 'Meta_Query' call.
|
||||||
|
2. Meta_PExtGiveFnptrs is called with interface version 'META_PEXT_VERSION'
|
||||||
|
and pointer to extension function table.
|
||||||
|
3. Meta_PExtGiveFnptrs should return plugin's interface version.
|
||||||
|
4. !NOTE! Metamod will not stop loading plugin even if plugin returns
|
||||||
|
interface version greater than current. Plugin should disable itself in
|
||||||
|
this kind of situation.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
#include "mm_pextensions.h"
|
||||||
|
|
||||||
|
pextension_funcs_t *gpMetaPExtFuncs;
|
||||||
|
|
||||||
|
int Meta_PExtGiveFnptrs(int interfaceVersion, pextension_funcs_t *pMetaPExtFuncs) {
|
||||||
|
if(interfaceVersion < META_PEXT_VERSION) {
|
||||||
|
LOG_DEVELOPER(PLID, "Error! Metamod is too old, please update!");
|
||||||
|
gpMetaPExtFuncs = NULL;
|
||||||
|
|
||||||
|
return(META_PEXT_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
gpMetaPExtFuncs = pMetaPExtFuncs;
|
||||||
|
|
||||||
|
return(META_PEXT_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
Callback functions:
|
||||||
|
- int PEXT_LOAD_PLUGIN_BY_NAME(PLID, const char *cmdline, PLUG_LOADTIME now, void **plugin_handle);
|
||||||
|
Parses 'cmdline' as metamod would parse 'meta load <cmdline>' and loads found
|
||||||
|
plugin. If 'plugin_handle' is set, metamod writes module handle of loaded
|
||||||
|
plugin at it.
|
||||||
|
Returns zero on success.
|
||||||
|
For error codes see 'META_ERRNO' in 'types_meta.h'.
|
||||||
|
|
||||||
|
- int PEXT_UNLOAD_PLUGIN_BY_NAME(PLID, const char *cmdline, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||||
|
Parses 'cmdline' as metamod would parse 'meta unload <cmdline>' and
|
||||||
|
unloads found plugin.
|
||||||
|
Returns zero on success.
|
||||||
|
For error codes see 'META_ERRNO' in 'types_meta.h'.
|
||||||
|
|
||||||
|
- int PEXT_UNLOAD_PLUGIN_BY_HANDLE(PLID, void *plugin_handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||||
|
Unloads plugin with 'plugin_handle'.
|
||||||
|
Returns zero on success.
|
||||||
|
For error codes see 'META_ERRNO' in 'types_meta.h'.
|
||||||
|
|
||||||
|
!NOTE! Plugin cannot unload itself!
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Interface version
|
||||||
|
// 1: first version. Used in p13
|
||||||
|
// 2: Complete remake (p14):
|
||||||
|
// pfnLoadMetaPluginByName
|
||||||
|
// pfnUnloadMetaPluginByName
|
||||||
|
// pfnUnloadMetaPluginByHandle
|
||||||
|
// v2 is locked now. Don't modify old functions. If you add new functions, increase META_PEXT_VERSION.
|
||||||
|
#define META_PEXT_VERSION 2
|
||||||
|
|
||||||
|
// Meta PExtension Function table type.
|
||||||
|
typedef struct pextension_funcs_s {
|
||||||
|
int (*pfnLoadMetaPluginByName)(plid_t plid, const char *cmdline, PLUG_LOADTIME now, void **plugin_handle);
|
||||||
|
int (*pfnUnloadMetaPluginByName)(plid_t plid, const char *cmdline, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||||
|
int (*pfnUnloadMetaPluginByHandle)(plid_t plid, void *plugin_handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||||
|
} pextension_funcs_t;
|
||||||
|
|
||||||
|
// Convenience macros for MetaPExtension functions.
|
||||||
|
#define PEXT_LOAD_PLUGIN_BY_NAME (*gpMetaPExtFuncs->pfnLoadMetaPluginByName)
|
||||||
|
#define PEXT_UNLOAD_PLUGIN_BY_NAME (*gpMetaPExtFuncs->pfnUnloadMetaPluginByName)
|
||||||
|
#define PEXT_UNLOAD_PLUGIN_BY_HANDLE (*gpMetaPExtFuncs->pfnUnloadMetaPluginByHandle)
|
||||||
|
|
||||||
|
// Give plugin extension function table.
|
||||||
|
C_DLLEXPORT int Meta_PExtGiveFnptrs(int interfaceVersion,
|
||||||
|
pextension_funcs_t *pMetaPExtFuncs);
|
||||||
|
typedef int (*META_GIVE_PEXT_FUNCTIONS_FN) (int interfaceVersion,
|
||||||
|
pextension_funcs_t *pMetaPExtFuncs);
|
||||||
|
|
||||||
|
#endif /* MM_PEXTENSIONS_H */
|
@ -29,6 +29,11 @@
|
|||||||
* version.
|
* version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#endif
|
||||||
#include "amxmodx.h"
|
#include "amxmodx.h"
|
||||||
#include "osdep.h" // sleep, etc
|
#include "osdep.h" // sleep, etc
|
||||||
#include "CFile.h"
|
#include "CFile.h"
|
||||||
@ -174,10 +179,16 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
|||||||
return (amx->error = AMX_ERR_INIT);
|
return (amx->error = AMX_ERR_INIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amx_InitJIT(amx, rt, np) == AMX_ERR_NONE)
|
if ( (err = amx_InitJIT(amx, rt, np)) == AMX_ERR_NONE )
|
||||||
{
|
{
|
||||||
//amx->base = (unsigned char FAR *)realloc( np, amx->code_size );
|
//amx->base = (unsigned char FAR *)realloc( np, amx->code_size );
|
||||||
|
#ifndef __linux__
|
||||||
amx->base = new unsigned char[ amx->code_size ];
|
amx->base = new unsigned char[ amx->code_size ];
|
||||||
|
#else
|
||||||
|
//posix_memalign((void **)&(amx->base), sysconf(_SC_PAGESIZE), amx->code_size);
|
||||||
|
amx->base = (unsigned char *)memalign(sysconf(_SC_PAGESIZE), amx->code_size);
|
||||||
|
mprotect((void *)amx->base, amx->code_size, PROT_READ|PROT_WRITE|PROT_EXEC);
|
||||||
|
#endif
|
||||||
if ( amx->base )
|
if ( amx->base )
|
||||||
memcpy( amx->base , np , amx->code_size );
|
memcpy( amx->base , np , amx->code_size );
|
||||||
delete[] np;
|
delete[] np;
|
||||||
@ -193,7 +204,7 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
|||||||
{
|
{
|
||||||
delete[] np;
|
delete[] np;
|
||||||
delete[] rt;
|
delete[] rt;
|
||||||
strcpy(error,"Failed to initialize plugin");
|
sprintf(error, "Failed to initialize plugin (%d)", err);
|
||||||
return (amx->error = AMX_ERR_INIT_JIT);
|
return (amx->error = AMX_ERR_INIT_JIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,7 +627,11 @@ int loadModules(const char* filename)
|
|||||||
|
|
||||||
CModule* cc = new CModule( path.c_str() );
|
CModule* cc = new CModule( path.c_str() );
|
||||||
|
|
||||||
if ( cc == 0 ) return loaded;
|
if ( cc == 0 )
|
||||||
|
{
|
||||||
|
fclose(fp);
|
||||||
|
return loaded;
|
||||||
|
}
|
||||||
|
|
||||||
cc->queryModule();
|
cc->queryModule();
|
||||||
|
|
||||||
@ -1161,10 +1176,16 @@ void GenericError(AMX *amx, int err, int line, char buf[], const char *file)
|
|||||||
if (geterr == NULL)
|
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()));
|
sprintf(buf, "Run time error %d on line %d (%s \"%s\").", err, line, (file?"file":"plugin"), (file?file:g_plugins.findPluginFast(amx)->getName()));
|
||||||
|
} else {
|
||||||
|
if (err == AMX_ERR_NATIVE && amx->userdata[2])
|
||||||
|
{
|
||||||
|
geterr = (char *)(amx->userdata[2]);
|
||||||
|
sprintf(buf, "Native error in \"%s\" on line %d (%s \"%s\").", geterr, line, (file?"file":"plugin"), (file?file:g_plugins.findPluginFast(amx)->getName()));
|
||||||
} else {
|
} 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()));
|
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
|
//by BAILOPAN
|
||||||
@ -1185,8 +1206,21 @@ void LogError(AMX *amx, int err, const char *fmt, ...)
|
|||||||
|
|
||||||
if (!dbg || !(dbg->tail))
|
if (!dbg || !(dbg->tail))
|
||||||
{
|
{
|
||||||
|
if (dbg && amx->curfile < dbg->numFiles && amx->curfile >= 0)
|
||||||
|
{
|
||||||
|
GenericError(amx, err, amx->curline, buf, dbg->files[amx->curfile]);
|
||||||
|
} else {
|
||||||
GenericError(amx, err, amx->curline, buf, NULL);
|
GenericError(amx, err, amx->curline, buf, NULL);
|
||||||
AMXXLOG_Log("[AMXX] %s %s", buf, vbuf);
|
}
|
||||||
|
AMXXLOG_Log("[AMXX] %s", buf);
|
||||||
|
if (*vbuf)
|
||||||
|
{
|
||||||
|
AMXXLOG_Log("%s", vbuf);
|
||||||
|
}
|
||||||
|
if (!dbg)
|
||||||
|
{
|
||||||
|
AMXXLOG_Log("[AMXX] To enable debug mode, add \" debug\" after the plugin name in plugins.ini (without quotes).");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
AMX_TRACE *t = dbg->tail;
|
AMX_TRACE *t = dbg->tail;
|
||||||
AMX_DEBUGCALL tracer = (AMX_DEBUGCALL)(amx->userdata[1]);
|
AMX_DEBUGCALL tracer = (AMX_DEBUGCALL)(amx->userdata[1]);
|
||||||
@ -1194,19 +1228,20 @@ void LogError(AMX *amx, int err, const char *fmt, ...)
|
|||||||
cell line = amx->curline;
|
cell line = amx->curline;
|
||||||
cell file = amx->curfile;
|
cell file = amx->curfile;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (file >= dbg->numFiles || file < 0)
|
|
||||||
{
|
|
||||||
GenericError(amx, err, line, buf, NULL);
|
GenericError(amx, err, line, buf, NULL);
|
||||||
} else {
|
|
||||||
GenericError(amx, err, line, buf, dbg->files[file]);
|
|
||||||
}
|
|
||||||
AMXXLOG_Log("[AMXX] %s", buf);
|
AMXXLOG_Log("[AMXX] %s", buf);
|
||||||
if (*vbuf)
|
if (*vbuf)
|
||||||
{
|
{
|
||||||
AMXXLOG_Log("[AMXX] %s", vbuf);
|
AMXXLOG_Log("%s", vbuf);
|
||||||
}
|
}
|
||||||
AMXXLOG_Log("[AMXX] Debug Trace =>");
|
AMXXLOG_Log("[AMXX] Debug Trace =>");
|
||||||
//log the error right away
|
//log the error right away
|
||||||
|
if (file >= dbg->numFiles || file < 0)
|
||||||
|
{
|
||||||
|
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]);
|
||||||
|
}
|
||||||
while (t != NULL)
|
while (t != NULL)
|
||||||
{
|
{
|
||||||
line = t->line;
|
line = t->line;
|
||||||
|
@ -316,7 +316,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="..\jit\jits.obj ..\zlib\zlib.lib"
|
||||||
OutputFile="jitdebug/amxmodx_mm.dll"
|
OutputFile="jitdebug/amxmodx_mm.dll"
|
||||||
Version="0.1"
|
Version="0.1"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
@ -780,6 +780,9 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath="..\modules.h">
|
RelativePath="..\modules.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\resource.h">
|
||||||
|
</File>
|
||||||
<Filter
|
<Filter
|
||||||
Name="mmgr"
|
Name="mmgr"
|
||||||
Filter="">
|
Filter="">
|
||||||
|
@ -45,6 +45,16 @@
|
|||||||
enginefuncs_t g_engfuncs;
|
enginefuncs_t g_engfuncs;
|
||||||
globalvars_t *gpGlobals;
|
globalvars_t *gpGlobals;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable;
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
|
enginefuncs_t *g_pengfuncsTable;
|
||||||
|
enginefuncs_t *g_pengfuncsTable_Post;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post;
|
||||||
|
|
||||||
|
|
||||||
// GetEntityAPI2 functions
|
// GetEntityAPI2 functions
|
||||||
static DLL_FUNCTIONS g_EntityAPI_Table =
|
static DLL_FUNCTIONS g_EntityAPI_Table =
|
||||||
{
|
{
|
||||||
@ -2114,6 +2124,7 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
||||||
|
g_pFunctionTable=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2131,7 +2142,7 @@ C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interface
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
g_pFunctionTable_Post=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2154,6 +2165,7 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2171,6 +2183,7 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable_Post=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2195,6 +2208,7 @@ C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable,
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2212,6 +2226,7 @@ C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, i
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable_Post=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2439,7 +2454,7 @@ PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
|||||||
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
PFN_LOG g_fn_Log;
|
PFN_LOG g_fn_Log;
|
||||||
PFN_LOG_ERROR g_fn_LogError;
|
PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
@ -2529,7 +2544,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("LogError", g_fn_LogError, PFN_LOG_ERROR);
|
REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
@ -2633,7 +2648,19 @@ void MF_Log(const char *fmt, ...)
|
|||||||
vsprintf(msg, fmt, arglst);
|
vsprintf(msg, fmt, arglst);
|
||||||
va_end(arglst);
|
va_end(arglst);
|
||||||
|
|
||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
// :TODO: Overflow possible here
|
||||||
|
char msg[3072];
|
||||||
|
va_list arglst;
|
||||||
|
va_start(arglst, fmt);
|
||||||
|
vsprintf(msg, fmt, arglst);
|
||||||
|
va_end(arglst);
|
||||||
|
|
||||||
|
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ struct amxx_module_info_s
|
|||||||
// The next section is copied from the amx.h file
|
// The next section is copied from the amx.h file
|
||||||
// Copyright (c) ITB CompuPhase, 1997-2004
|
// Copyright (c) ITB CompuPhase, 1997-2004
|
||||||
|
|
||||||
#if defined __LCC__ || defined __DMC__ || defined __linux__
|
#if defined __LCC__ || defined __DMC__ || defined __linux__ || defined __GNUC__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||||
@ -929,7 +929,7 @@ void FN_EngineFprintf(FILE *pfile, char *szFmt, ...);
|
|||||||
#endif // FN_EngineFprintf
|
#endif // FN_EngineFprintf
|
||||||
|
|
||||||
#ifdef FN_PvAllocEntPrivateData
|
#ifdef FN_PvAllocEntPrivateData
|
||||||
void *FN_PvAllocEntPrivateData(edict_t *pEdict, long cb);
|
void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb);
|
||||||
#endif // FN_PvAllocEntPrivateData
|
#endif // FN_PvAllocEntPrivateData
|
||||||
|
|
||||||
#ifdef FN_PvEntPrivateData
|
#ifdef FN_PvEntPrivateData
|
||||||
@ -1990,7 +1990,7 @@ extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
|||||||
extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
extern PFN_LOG g_fn_Log;
|
extern PFN_LOG g_fn_Log;
|
||||||
extern PFN_LOG_ERROR g_fn_LogError;
|
extern PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
@ -2106,7 +2106,7 @@ const char * MF_Format (const char *fmt, ...) { }
|
|||||||
#define MF_GetAmxStringLen g_fn_GetAmxStringLen
|
#define MF_GetAmxStringLen g_fn_GetAmxStringLen
|
||||||
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
||||||
void MF_Log(const char *fmt, ...);
|
void MF_Log(const char *fmt, ...);
|
||||||
#define MF_LogError g_fn_LogError
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||||
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
||||||
#define MF_RegisterForward g_fn_RegisterForward
|
#define MF_RegisterForward g_fn_RegisterForward
|
||||||
#define MF_ExecuteForward g_fn_ExecuteForward
|
#define MF_ExecuteForward g_fn_ExecuteForward
|
||||||
|
@ -148,8 +148,8 @@ void amx_command(){
|
|||||||
{
|
{
|
||||||
|
|
||||||
print_srvconsole( "%s %s\n", Plugin_info.name, Plugin_info.version);
|
print_srvconsole( "%s %s\n", Plugin_info.name, Plugin_info.version);
|
||||||
print_srvconsole( "author: %s (%s)\n", Plugin_info.author, Plugin_info.url);
|
print_srvconsole( "Authors: %s (%s)\n", "Felix \"SniperBeamer\" Geyer, David \"BAILOPAN\" Anderson, Pavol \"PM OnoTo\" Marko, Jonny \"Got His Gun\" Bergstrom, and Lukasz \"SidLuke\" Wlasinski.", Plugin_info.url);
|
||||||
print_srvconsole( "compiled: %s\n", __DATE__ ", " __TIME__);
|
print_srvconsole( "Compiled: %s\n", __DATE__ ", " __TIME__);
|
||||||
#ifdef JIT
|
#ifdef JIT
|
||||||
print_srvconsole( "Core mode: JIT\n");
|
print_srvconsole( "Core mode: JIT\n");
|
||||||
#else
|
#else
|
||||||
|
@ -527,7 +527,7 @@ static cell AMX_NATIVE_CALL strbreak(AMX *amx, cell *params) /* 5 param */
|
|||||||
} else if (string[i] == '"' && quote_flag) {
|
} else if (string[i] == '"' && quote_flag) {
|
||||||
quote_flag = false;
|
quote_flag = false;
|
||||||
}
|
}
|
||||||
if ((string[i] == ' ') && !quote_flag && !done_flag) {
|
if (isspace(string[i]) && !quote_flag && !done_flag) {
|
||||||
done_flag = true;
|
done_flag = true;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,34 @@
|
|||||||
|
// Microsoft Visual C++ generated resource script.
|
||||||
|
//
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
#include "winres.h"
|
#include "winres.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// English (U.S.) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Version
|
||||||
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 0,2,0,0
|
FILEVERSION 1,0,1,0
|
||||||
PRODUCTVERSION 0,2,0,0
|
PRODUCTVERSION 1,0,1,0
|
||||||
FILEFLAGSMASK 0x17L
|
FILEFLAGSMASK 0x17L
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@ -17,14 +43,14 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "000004b0"
|
BLOCK "000004b0"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "Comments", "AMX Mod X\0"
|
VALUE "Comments", "AMX Mod X"
|
||||||
VALUE "FileDescription", "AMX Mod X\0"
|
VALUE "FileDescription", "AMX Mod X"
|
||||||
VALUE "FileVersion", "0.20\0"
|
VALUE "FileVersion", "1.01"
|
||||||
VALUE "InternalName", "amxmodx\0"
|
VALUE "InternalName", "amxmodx"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004, AMX Mod X Dev Team\0"
|
VALUE "LegalCopyright", "Copyright (c) 2004-2005, AMX Mod X Dev Team"
|
||||||
VALUE "OriginalFilename", "amxx_mm.dll\0"
|
VALUE "OriginalFilename", "amxmodx_mm.dll"
|
||||||
VALUE "ProductName", "AMX Mod X\0"
|
VALUE "ProductName", "AMX Mod X"
|
||||||
VALUE "ProductVersion", "0.20\0"
|
VALUE "ProductVersion", "1.01"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
@ -32,3 +58,45 @@ BEGIN
|
|||||||
VALUE "Translation", 0x0, 1200
|
VALUE "Translation", 0x0, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"#include ""winres.h""\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
#endif // English (U.S.) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/clcmds.ini
|
; Default File location: $moddir/addons/amxmodx/configs/clcmds.ini
|
||||||
; To use with Players Menu plugin
|
; To use with Players Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
@ -14,4 +14,4 @@
|
|||||||
"Kick player" "amx_kick #%userid%" "b" "u"
|
"Kick player" "amx_kick #%userid%" "b" "u"
|
||||||
"Slay player" "amx_slay #%userid%" "bd" "u"
|
"Slay player" "amx_slay #%userid%" "bd" "u"
|
||||||
"Slap with 1 dmg." "amx_slap #%userid% 1" "bd" "u"
|
"Slap with 1 dmg." "amx_slap #%userid% 1" "bd" "u"
|
||||||
"Ban for 5 minutes" "amx_ban #%userid% id 5" "b" "u"
|
"Ban for 5 minutes" "amx_ban #%userid% 5" "b" "u"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cmds.ini
|
; File location: $moddir/addons/amxmodx/configs/cmds.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/configs.ini
|
; File location: $moddir/addons/amxmodx/configs/configs.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cmds.ini
|
; File location: $moddir/addons/amxmodx/configs/cmds.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; Cvars Menu:
|
; Cvars Menu:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Maps configuration file
|
; Maps configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||||
; To use with Maps Menu plugin
|
; To use with Maps Menu plugin
|
||||||
|
|
||||||
; Add in your mod's maps here
|
; Add in your mod's maps here
|
||||||
|
@ -7,18 +7,21 @@
|
|||||||
; ------------------------------
|
; ------------------------------
|
||||||
fun_amxx_i386.so
|
fun_amxx_i386.so
|
||||||
fun_amxx.dll
|
fun_amxx.dll
|
||||||
|
fun_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
; Engine - provides engine functions core to Half-Life
|
; Engine - provides engine functions core to Half-Life
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
;engine_amxx_i386.so
|
;engine_amxx_i386.so
|
||||||
;engine_amxx.dll
|
;engine_amxx.dll
|
||||||
|
;engine_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
; Fakemeta - provides a massive interface into the HL engine
|
; Fakemeta - provides a massive interface into the HL engine
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
;fakemeta_amxx_i386.so
|
;fakemeta_amxx_i386.so
|
||||||
;fakemeta_amxx.dll
|
;fakemeta_amxx.dll
|
||||||
|
;fakemeta_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------
|
; -------------------------------------------
|
||||||
; Database Access - only enable one of these
|
; Database Access - only enable one of these
|
||||||
@ -26,38 +29,55 @@ fun_amxx.dll
|
|||||||
; MySQL
|
; MySQL
|
||||||
;mysql_amxx_i386.so
|
;mysql_amxx_i386.so
|
||||||
;mysql_amxx.dll
|
;mysql_amxx.dll
|
||||||
|
;mysql_amxx_amd64.so
|
||||||
; PostgreSQL
|
; PostgreSQL
|
||||||
;pgsql_amxx_i386.so
|
;pgsql_amxx_i386.so
|
||||||
;pgsql_amxx.dll
|
;pgsql_amxx.dll
|
||||||
; Microsoft SQL
|
; Microsoft SQL
|
||||||
;mssql_amxx.dll
|
;mssql_amxx.dll
|
||||||
|
; SQLite
|
||||||
|
;sqlite_amxx.dll
|
||||||
|
;sqlite_amxx_i386.so
|
||||||
|
;sqlite_amxx_amd64.so
|
||||||
|
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
; GeoIP - determines the country of ip adresses
|
; GeoIP - determines the country of ip adresses
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;geoip_amxx_i386.so
|
;geoip_amxx_i386.so
|
||||||
;geoip_amxx.dll
|
;geoip_amxx.dll
|
||||||
|
;geoip_amxx_amd64.so
|
||||||
|
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
; Array - advanced arrays in scripting
|
; Array - advanced arrays in scripting
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
;array_amxx_i386.so
|
;array_amxx_i386.so
|
||||||
;array_amxx.dll
|
;array_amxx.dll
|
||||||
|
;array_amxx_amd64.so
|
||||||
|
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
; Sockets - network socket support
|
; Sockets - network socket support
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
;sockets_amxx_i386.so
|
;sockets_amxx_i386.so
|
||||||
;sockets_amxx.dll
|
;sockets_amxx.dll
|
||||||
|
;sockets_amxx_amd64.so
|
||||||
|
|
||||||
|
; --------------------------
|
||||||
|
; Regular Expression support
|
||||||
|
; --------------------------
|
||||||
|
;regex_amxx_i386.so
|
||||||
|
;regex_amxx.dll
|
||||||
|
;regex_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
; Counter-Strike - adds functions specific to Counter-Strike
|
; Counter-Strike - adds functions specific to Counter-Strike
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
;cstrike_amxx_i386.so
|
cstrike_amxx_i386.so
|
||||||
;cstrike_amxx.dll
|
cstrike_amxx.dll
|
||||||
|
cstrike_amxx_amd64.so
|
||||||
|
|
||||||
; ------------------------------------------------
|
; -----------------------------------------------------
|
||||||
; CS Stats - adds functionality for CS statistical
|
; CSX - adds functionality for CS statistics and events
|
||||||
; ------------------------------------------------
|
; -----------------------------------------------------
|
||||||
;csstats_amxx_i386.so
|
csx_amxx_i386.so
|
||||||
;csstats_amxx.dll
|
csx_amxx.dll
|
||||||
|
csx_amxx_amd64.so
|
||||||
|
@ -35,9 +35,9 @@ statscfg.amxx ; allows to manage stats plugins via menu and commands
|
|||||||
|
|
||||||
; Counter-Strike
|
; Counter-Strike
|
||||||
;restmenu.amxx ; restrict weapons menu
|
;restmenu.amxx ; restrict weapons menu
|
||||||
;statsx.amxx ; stats on death or round end (CSStats Module required!)
|
;statsx.amxx ; stats on death or round end (CSX Module required!)
|
||||||
;miscstats.amxx ; bunch of events announcement for Counter-Strike
|
;miscstats.amxx ; bunch of events announcement for Counter-Strike
|
||||||
;stats_logging.amxx ; weapons stats logging (CSStats Module required!)
|
;stats_logging.amxx ; weapons stats logging (CSX Module required!)
|
||||||
|
|
||||||
|
|
||||||
; Custom - Add 3rd party plugins here
|
; Custom - Add 3rd party plugins here
|
||||||
|
19
configs/custommenuitems.cfg
Executable file
19
configs/custommenuitems.cfg
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
// Here you can add menu items from any plugin to Menus Front-End plugin, aka "amxmodmenu".
|
||||||
|
// You can also add menu items to the normal non-admin client menu "amx_menu".
|
||||||
|
//
|
||||||
|
// Adding to "amxmodmenu":
|
||||||
|
// Usage: "amx_addmenuitem <menu text> <menu command> <access flags> <plugin name>"
|
||||||
|
//
|
||||||
|
// Adding to "amx_menu":
|
||||||
|
// Usage: "amx_addclientmenuitem <menu text> <menu command> <access flags> <plugin name>"
|
||||||
|
//
|
||||||
|
// <menu text>: This is the text displayed in the menu itself for this item.
|
||||||
|
// <menu command>: This is the client command used to access the menu.
|
||||||
|
// <access flags>: Specify what access flags admins must have to use this menu item. (Check users.ini for access flags.)
|
||||||
|
// <plugin name>: This must be the _exact_ (though case insensitive) name of the plugin which holds the menu command. (Use "amxx plugins" in server console, plugin names are listed in Name column.)
|
||||||
|
//
|
||||||
|
// Example: (be sure to use quotes around parameters with spaces!)
|
||||||
|
//
|
||||||
|
// amx_addmenuitem "Weapon Arena" "weaponarena_menu" "hu" "Weapon Arena"
|
||||||
|
// amx_addclientmenuitem "Warcraft 3" "war3menu" "" "Warcraft 3 XP"
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; Cvars Menu:
|
; Cvars Menu:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; Cvars Menu:
|
; Cvars Menu:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Maps configuration file
|
; Maps configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||||
; To use with Maps Menu plugin
|
; To use with Maps Menu plugin
|
||||||
|
|
||||||
; Add in your mod's maps here
|
; Add in your mod's maps here
|
||||||
|
@ -7,18 +7,21 @@
|
|||||||
; ------------------------------
|
; ------------------------------
|
||||||
fun_amxx_i386.so
|
fun_amxx_i386.so
|
||||||
fun_amxx.dll
|
fun_amxx.dll
|
||||||
|
fun_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
; Engine - provides engine functions core to Half-Life
|
; Engine - provides engine functions core to Half-Life
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
;engine_amxx_i386.so
|
;engine_amxx_i386.so
|
||||||
;engine_amxx.dll
|
;engine_amxx.dll
|
||||||
|
;engine_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
; Fakemeta - provides a massive interface into the HL engine
|
; Fakemeta - provides a massive interface into the HL engine
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
;fakemeta_amxx_i386.so
|
;fakemeta_amxx_i386.so
|
||||||
;fakemeta_amxx.dll
|
;fakemeta_amxx.dll
|
||||||
|
;fakemeta_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------
|
; -------------------------------------------
|
||||||
; Database Access - only enable one of these
|
; Database Access - only enable one of these
|
||||||
@ -26,38 +29,55 @@ fun_amxx.dll
|
|||||||
; MySQL
|
; MySQL
|
||||||
;mysql_amxx_i386.so
|
;mysql_amxx_i386.so
|
||||||
;mysql_amxx.dll
|
;mysql_amxx.dll
|
||||||
|
;mysql_amxx_amd64.so
|
||||||
; PostgreSQL
|
; PostgreSQL
|
||||||
;pgsql_amxx_i386.so
|
;pgsql_amxx_i386.so
|
||||||
;pgsql_amxx.dll
|
;pgsql_amxx.dll
|
||||||
; Microsoft SQL
|
; Microsoft SQL
|
||||||
;mssql_amxx.dll
|
;mssql_amxx.dll
|
||||||
|
; SQLite
|
||||||
|
;sqlite_amxx.dll
|
||||||
|
;sqlite_amxx_i386.so
|
||||||
|
;sqlite_amxx_amd64.so
|
||||||
|
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
; GeoIP - determines the country of ip adresses
|
; GeoIP - determines the country of ip adresses
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;geoip_amxx_i386.so
|
;geoip_amxx_i386.so
|
||||||
;geoip_amxx.dll
|
;geoip_amxx.dll
|
||||||
|
;geoip_amxx_amd64.so
|
||||||
|
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
; Array - advanced arrays in scripting
|
; Array - advanced arrays in scripting
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
;array_amxx_i386.so
|
;array_amxx_i386.so
|
||||||
;array_amxx.dll
|
;array_amxx.dll
|
||||||
|
;array_amxx_amd64.so
|
||||||
|
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
; Sockets - network socket support
|
; Sockets - network socket support
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
;sockets_amxx_i386.so
|
;sockets_amxx_i386.so
|
||||||
;sockets_amxx.dll
|
;sockets_amxx.dll
|
||||||
|
;sockets_amxx_amd64.so
|
||||||
|
|
||||||
|
; --------------------------
|
||||||
|
; Regular Expression support
|
||||||
|
; --------------------------
|
||||||
|
;regex_amxx_i386.so
|
||||||
|
;regex_amxx.dll
|
||||||
|
;regex_amxx_amd64.so
|
||||||
|
|
||||||
; --------------------------------------------------
|
; --------------------------------------------------
|
||||||
; Day of Defeat Fun - adds functions specific to DoD
|
; Day of Defeat Fun - adds functions specific to DoD
|
||||||
; --------------------------------------------------
|
; --------------------------------------------------
|
||||||
;dodfun_amxx_i386.so
|
dodfun_amxx_i386.so
|
||||||
;dodfun_amxx.dll
|
dodfun_amxx.dll
|
||||||
|
dodfun_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------------------
|
; -------------------------------------------------------
|
||||||
; Day of Defeat X - adds stats and addition DoD functions
|
; Day of Defeat X - adds stats and addition DoD functions
|
||||||
; -------------------------------------------------------
|
; -------------------------------------------------------
|
||||||
;dodx_amxx_i386.so
|
dodx_amxx_i386.so
|
||||||
;dodx_amxx.dll
|
dodx_amxx.dll
|
||||||
|
dodx_amxx_amd64.so
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Maps configuration file
|
; Maps configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||||
; To use with Maps Menu plugin
|
; To use with Maps Menu plugin
|
||||||
|
|
||||||
; Add in your mod's maps here
|
; Add in your mod's maps here
|
||||||
|
@ -7,18 +7,21 @@
|
|||||||
; ------------------------------
|
; ------------------------------
|
||||||
fun_amxx_i386.so
|
fun_amxx_i386.so
|
||||||
fun_amxx.dll
|
fun_amxx.dll
|
||||||
|
fun_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
; Engine - provides engine functions core to Half-Life
|
; Engine - provides engine functions core to Half-Life
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
;engine_amxx_i386.so
|
;engine_amxx_i386.so
|
||||||
;engine_amxx.dll
|
;engine_amxx.dll
|
||||||
|
;engine_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
; Fakemeta - provides a massive interface into the HL engine
|
; Fakemeta - provides a massive interface into the HL engine
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
;fakemeta_amxx_i386.so
|
;fakemeta_amxx_i386.so
|
||||||
;fakemeta_amxx.dll
|
;fakemeta_amxx.dll
|
||||||
|
;fakemeta_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------
|
; -------------------------------------------
|
||||||
; Database Access - only enable one of these
|
; Database Access - only enable one of these
|
||||||
@ -26,26 +29,41 @@ fun_amxx.dll
|
|||||||
; MySQL
|
; MySQL
|
||||||
;mysql_amxx_i386.so
|
;mysql_amxx_i386.so
|
||||||
;mysql_amxx.dll
|
;mysql_amxx.dll
|
||||||
|
;mysql_amxx_amd64.so
|
||||||
; PostgreSQL
|
; PostgreSQL
|
||||||
;pgsql_amxx_i386.so
|
;pgsql_amxx_i386.so
|
||||||
;pgsql_amxx.dll
|
;pgsql_amxx.dll
|
||||||
; Microsoft SQL
|
; Microsoft SQL
|
||||||
;mssql_amxx.dll
|
;mssql_amxx.dll
|
||||||
|
; SQLite
|
||||||
|
;sqlite_amxx.dll
|
||||||
|
;sqlite_amxx_i386.so
|
||||||
|
;sqlite_amxx_amd64.so
|
||||||
|
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
; GeoIP - determines the country of ip adresses
|
; GeoIP - determines the country of ip adresses
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;geoip_amxx_i386.so
|
;geoip_amxx_i386.so
|
||||||
;geoip_amxx.dll
|
;geoip_amxx.dll
|
||||||
|
;geoip_amxx_amd64.so
|
||||||
|
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
; Array - advanced arrays in scripting
|
; Array - advanced arrays in scripting
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
;array_amxx_i386.so
|
;array_amxx_i386.so
|
||||||
;array_amxx.dll
|
;array_amxx.dll
|
||||||
|
;array_amxx_amd64.so
|
||||||
|
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
; Sockets - network socket support
|
; Sockets - network socket support
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
;sockets_amxx_i386.so
|
;sockets_amxx_i386.so
|
||||||
;sockets_amxx.dll
|
;sockets_amxx.dll
|
||||||
|
;sockets_amxx_amd64.so
|
||||||
|
|
||||||
|
; --------------------------
|
||||||
|
; Regular Expression support
|
||||||
|
; --------------------------
|
||||||
|
;regex_amxx_i386.so
|
||||||
|
;regex_amxx.dll
|
||||||
|
;regex_amxx_amd64.so
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/clcmds.ini
|
; File location: $moddir/addons/amxmodx/configs/clcmds.ini
|
||||||
; To use with Players Menu plugin
|
; To use with Players Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cmds.ini
|
; File location: $moddir/addons/amxmodx/configs/cmds.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; Cvars Menu:
|
; Cvars Menu:
|
||||||
|
@ -1,26 +1,29 @@
|
|||||||
; Maps configuration file
|
; Maps configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||||
; To use with Maps Menu plugin
|
; To use with Maps Menu plugin
|
||||||
|
|
||||||
; Add in your mod's maps here
|
; Add in your mod's maps here
|
||||||
|
|
||||||
co_angst
|
|
||||||
ns_caged
|
|
||||||
ns_hera
|
|
||||||
ns_metal
|
ns_metal
|
||||||
|
ns_caged
|
||||||
|
co_sava
|
||||||
|
co_angst
|
||||||
|
ns_hera
|
||||||
ns_lost
|
ns_lost
|
||||||
ns_nothing
|
ns_nothing
|
||||||
|
co_niveus
|
||||||
co_faceoff
|
co_faceoff
|
||||||
ns_mineshaft
|
|
||||||
co_daimos
|
co_daimos
|
||||||
|
ns_bast
|
||||||
ns_origin
|
ns_origin
|
||||||
co_kestrel
|
co_kestrel
|
||||||
ns_tanith
|
ns_tanith
|
||||||
ns_nancy
|
ns_nancy
|
||||||
ns_veil
|
ns_veil
|
||||||
co_core
|
co_core
|
||||||
|
co_ulysses
|
||||||
ns_eclipse
|
ns_eclipse
|
||||||
co_pulse
|
co_pulse
|
||||||
ns_ayumi
|
ns_ayumi
|
||||||
ns_agora
|
ns_altair
|
||||||
co_ulysses
|
ns_eon
|
||||||
|
@ -5,20 +5,23 @@
|
|||||||
; ------------------------------
|
; ------------------------------
|
||||||
; Fun - provides extra functions
|
; Fun - provides extra functions
|
||||||
; ------------------------------
|
; ------------------------------
|
||||||
;fun_amxx_i386.so
|
fun_amxx_i386.so
|
||||||
;fun_amxx.dll
|
fun_amxx.dll
|
||||||
|
fun_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
; Engine - provides engine functions core to Half-Life
|
; Engine - provides engine functions core to Half-Life
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
;engine_amxx_i386.so
|
;engine_amxx_i386.so
|
||||||
;engine_amxx.dll
|
;engine_amxx.dll
|
||||||
|
;engine_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
; Fakemeta - provides a massive interface into the HL engine
|
; Fakemeta - provides a massive interface into the HL engine
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
;fakemeta_amxx_i386.so
|
;fakemeta_amxx_i386.so
|
||||||
;fakemeta_amxx.dll
|
;fakemeta_amxx.dll
|
||||||
|
;fakemeta_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------
|
; -------------------------------------------
|
||||||
; Database Access - only enable one of these
|
; Database Access - only enable one of these
|
||||||
@ -26,32 +29,47 @@
|
|||||||
; MySQL
|
; MySQL
|
||||||
;mysql_amxx_i386.so
|
;mysql_amxx_i386.so
|
||||||
;mysql_amxx.dll
|
;mysql_amxx.dll
|
||||||
|
;mysql_amxx_amd64.so
|
||||||
; PostgreSQL
|
; PostgreSQL
|
||||||
;pgsql_amxx_i386.so
|
;pgsql_amxx_i386.so
|
||||||
;pgsql_amxx.dll
|
;pgsql_amxx.dll
|
||||||
; Microsoft SQL
|
; Microsoft SQL
|
||||||
;mssql_amxx.dll
|
;mssql_amxx.dll
|
||||||
|
; SQLite
|
||||||
|
;sqlite_amxx.dll
|
||||||
|
;sqlite_amxx_i386.so
|
||||||
|
;sqlite_amxx_amd64.so
|
||||||
|
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
; GeoIP - determines the country of ip adresses
|
; GeoIP - determines the country of ip adresses
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;geoip_amxx_i386.so
|
;geoip_amxx_i386.so
|
||||||
;geoip_amxx.dll
|
;geoip_amxx.dll
|
||||||
|
;geoip_amxx_amd64.so
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
; Array - advanced arrays in scripting
|
; Array - advanced arrays in scripting
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
;array_amxx_i386.so
|
;array_amxx_i386.so
|
||||||
;array_amxx.dll
|
;array_amxx.dll
|
||||||
|
;array_amxx_amd64.so
|
||||||
|
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
; Sockets - network socket support
|
; Sockets - network socket support
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
;sockets_amxx_i386.so
|
;sockets_amxx_i386.so
|
||||||
;sockets_amxx.dll
|
;sockets_amxx.dll
|
||||||
|
;sockets_amxx_amd64.so
|
||||||
|
|
||||||
|
; --------------------------
|
||||||
|
; Regular Expression support
|
||||||
|
; --------------------------
|
||||||
|
;regex_amxx_i386.so
|
||||||
|
;regex_amxx.dll
|
||||||
|
;regex_amxx_amd64.so
|
||||||
|
|
||||||
; -----------------
|
; -----------------
|
||||||
; Natural Selection
|
; Natural Selection
|
||||||
; -----------------
|
; -----------------
|
||||||
ns_amxx_i386.so
|
ns_amxx_i386.so
|
||||||
ns_amxx.dll
|
ns_amxx.dll
|
||||||
|
ns_amxx_amd64.so
|
||||||
|
@ -35,6 +35,6 @@ pausecfg.amxx ; allows to pause and unpause some plugins
|
|||||||
; NS Specific plugins
|
; NS Specific plugins
|
||||||
idlekicker.amxx ; kicks idle players
|
idlekicker.amxx ; kicks idle players
|
||||||
nscommands.amxx ; extra commands for Natural-Selection
|
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)
|
;unstuck.amxx ; Free stuck players (engine & ns modules required!)
|
||||||
|
|
||||||
; Custom - Add 3rd party plugins here
|
; Custom - Add 3rd party plugins here
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/speech.ini
|
; File location: $moddir/addons/amxmodx/configs/speech.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Users configuration file
|
; Users configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/users.ini
|
; File location: $moddir/addons/amxmodx/configs/users.ini
|
||||||
|
|
||||||
; Line starting with ; is a comment
|
; Line starting with ; is a comment
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/speech.ini
|
; File location: $moddir/addons/amxmodx/configs/speech.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; NOTE: By default in all settings the access level is set to "u".
|
; NOTE: By default in all settings the access level is set to "u".
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// SQL configuration file
|
// SQL configuration file
|
||||||
// File location: $moddir/addons/amxx/configs/sql.cfg
|
// File location: $moddir/addons/amxmodx/configs/sql.cfg
|
||||||
|
|
||||||
// *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
|
// *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
|
||||||
// We recommend using your server IP address instead of its name
|
// We recommend using your server IP address instead of its name
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Menu configuration file
|
; Menu configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||||
; To use with Commands Menu plugin
|
; To use with Commands Menu plugin
|
||||||
|
|
||||||
; Cvars Menu:
|
; Cvars Menu:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Maps configuration file
|
; Maps configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||||
; To use with Maps Menu plugin
|
; To use with Maps Menu plugin
|
||||||
|
|
||||||
; Add in your mod's maps here
|
; Add in your mod's maps here
|
||||||
|
@ -7,18 +7,21 @@
|
|||||||
; ------------------------------
|
; ------------------------------
|
||||||
fun_amxx_i386.so
|
fun_amxx_i386.so
|
||||||
fun_amxx.dll
|
fun_amxx.dll
|
||||||
|
fun_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
; Engine - provides engine functions core to Half-Life
|
; Engine - provides engine functions core to Half-Life
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
;engine_amxx_i386.so
|
;engine_amxx_i386.so
|
||||||
;engine_amxx.dll
|
;engine_amxx.dll
|
||||||
|
;engine_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
; Fakemeta - provides a massive interface into the HL engine
|
; Fakemeta - provides a massive interface into the HL engine
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
;fakemeta_amxx_i386.so
|
;fakemeta_amxx_i386.so
|
||||||
;fakemeta_amxx.dll
|
;fakemeta_amxx.dll
|
||||||
|
;fakemeta_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------
|
; -------------------------------------------
|
||||||
; Database Access - only enable one of these
|
; Database Access - only enable one of these
|
||||||
@ -26,32 +29,48 @@ fun_amxx.dll
|
|||||||
; MySQL
|
; MySQL
|
||||||
;mysql_amxx_i386.so
|
;mysql_amxx_i386.so
|
||||||
;mysql_amxx.dll
|
;mysql_amxx.dll
|
||||||
|
;mysql_amxx_amd64.so
|
||||||
; PostgreSQL
|
; PostgreSQL
|
||||||
;pgsql_amxx_i386.so
|
;pgsql_amxx_i386.so
|
||||||
;pgsql_amxx.dll
|
;pgsql_amxx.dll
|
||||||
; Microsoft SQL
|
; Microsoft SQL
|
||||||
;mssql_amxx.dll
|
;mssql_amxx.dll
|
||||||
|
; SQLite
|
||||||
|
;sqlite_amxx.dll
|
||||||
|
;sqlite_amxx_i386.so
|
||||||
|
;sqlite_amxx_amd64.so
|
||||||
|
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
; GeoIP - determines the country of ip adresses
|
; GeoIP - determines the country of ip adresses
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;geoip_amxx_i386.so
|
;geoip_amxx_i386.so
|
||||||
;geoip_amxx.dll
|
;geoip_amxx.dll
|
||||||
|
;geoip_amxx_amd64.so
|
||||||
|
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
; Array - advanced arrays in scripting
|
; Array - advanced arrays in scripting
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
;array_amxx_i386.so
|
;array_amxx_i386.so
|
||||||
;array_amxx.dll
|
;array_amxx.dll
|
||||||
|
;array_amxx_amd64.so
|
||||||
|
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
; Sockets - network socket support
|
; Sockets - network socket support
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
;sockets_amxx_i386.so
|
;sockets_amxx_i386.so
|
||||||
;sockets_amxx.dll
|
;sockets_amxx.dll
|
||||||
|
;sockets_amxx_amd64.so
|
||||||
|
|
||||||
|
; --------------------------
|
||||||
|
; Regular Expression support
|
||||||
|
; --------------------------
|
||||||
|
;regex_amxx_i386.so
|
||||||
|
;regex_amxx.dll
|
||||||
|
;regex_amxx_amd64.so
|
||||||
|
|
||||||
; ------------------------------------------------------------------
|
; ------------------------------------------------------------------
|
||||||
; Team Fortress Classic X - adds functions and stats specific to TFC
|
; Team Fortress Classic X - adds functions and stats specific to TFC
|
||||||
; ------------------------------------------------------------------
|
; ------------------------------------------------------------------
|
||||||
;tfcx_amxx_i386.so
|
tfcx_amxx_i386.so
|
||||||
;tfcx_amxx.dll
|
tfcx_amxx.dll
|
||||||
|
tfx_amxx_amd64.so
|
@ -3,7 +3,7 @@ amxx_logdir addons/amxmodx/logs
|
|||||||
amxx_configsdir addons/amxmodx/configs
|
amxx_configsdir addons/amxmodx/configs
|
||||||
amxx_datadir addons/amxmodx/data
|
amxx_datadir addons/amxmodx/data
|
||||||
amxx_modules addons/amxmodx/configs/modules.ini
|
amxx_modules addons/amxmodx/configs/modules.ini
|
||||||
mxx_plugins addons/amxmodx/configs/plugins.ini
|
amxx_plugins addons/amxmodx/configs/plugins.ini
|
||||||
amxx_pluginsdir addons/amxmodx/plugins
|
amxx_pluginsdir addons/amxmodx/plugins
|
||||||
amxx_modulesdir addons/amxmodx/modules
|
amxx_modulesdir addons/amxmodx/modules
|
||||||
amxx_vault addons/amxmodx/data/vault.ini
|
amxx_vault addons/amxmodx/data/vault.ini
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; Maps configuration file
|
; Maps configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||||
; To use with Maps Menu plugin
|
; To use with Maps Menu plugin
|
||||||
|
|
||||||
; Add in your mod's maps here
|
; Add in your mod's maps here
|
||||||
|
@ -7,18 +7,21 @@
|
|||||||
; ------------------------------
|
; ------------------------------
|
||||||
fun_amxx_i386.so
|
fun_amxx_i386.so
|
||||||
fun_amxx.dll
|
fun_amxx.dll
|
||||||
|
fun_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
; Engine - provides engine functions core to Half-Life
|
; Engine - provides engine functions core to Half-Life
|
||||||
; ----------------------------------------------------
|
; ----------------------------------------------------
|
||||||
;engine_amxx_i386.so
|
;engine_amxx_i386.so
|
||||||
;engine_amxx.dll
|
;engine_amxx.dll
|
||||||
|
;engine_amxx_amd64.so
|
||||||
|
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
; Fakemeta - provides a massive interface into the HL engine
|
; Fakemeta - provides a massive interface into the HL engine
|
||||||
; ----------------------------------------------------------
|
; ----------------------------------------------------------
|
||||||
;fakemeta_amxx_i386.so
|
;fakemeta_amxx_i386.so
|
||||||
;fakemeta_amxx.dll
|
;fakemeta_amxx.dll
|
||||||
|
;fakemeta_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------
|
; -------------------------------------------
|
||||||
; Database Access - only enable one of these
|
; Database Access - only enable one of these
|
||||||
@ -26,32 +29,48 @@ fun_amxx.dll
|
|||||||
; MySQL
|
; MySQL
|
||||||
;mysql_amxx_i386.so
|
;mysql_amxx_i386.so
|
||||||
;mysql_amxx.dll
|
;mysql_amxx.dll
|
||||||
|
;mysql_amxx_amd64.so
|
||||||
; PostgreSQL
|
; PostgreSQL
|
||||||
;pgsql_amxx_i386.so
|
;pgsql_amxx_i386.so
|
||||||
;pgsql_amxx.dll
|
;pgsql_amxx.dll
|
||||||
; Microsoft SQL
|
; Microsoft SQL
|
||||||
;mssql_amxx.dll
|
;mssql_amxx.dll
|
||||||
|
; SQLite
|
||||||
|
;sqlite_amxx.dll
|
||||||
|
;sqlite_amxx_i386.so
|
||||||
|
;sqlite_amxx_amd64.so
|
||||||
|
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
; GeoIP - determines the country of ip adresses
|
; GeoIP - determines the country of ip adresses
|
||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;geoip_amxx_i386.so
|
;geoip_amxx_i386.so
|
||||||
;geoip_amxx.dll
|
;geoip_amxx.dll
|
||||||
|
;geoip_amxx_amd64.so
|
||||||
|
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
; Array - advanced arrays in scripting
|
; Array - advanced arrays in scripting
|
||||||
; ------------------------------------
|
; ------------------------------------
|
||||||
;array_amxx_i386.so
|
;array_amxx_i386.so
|
||||||
;array_amxx.dll
|
;array_amxx.dll
|
||||||
|
;array_amxx_amd64.so
|
||||||
|
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
; Sockets - network socket support
|
; Sockets - network socket support
|
||||||
; --------------------------------
|
; --------------------------------
|
||||||
;sockets_amxx_i386.so
|
;sockets_amxx_i386.so
|
||||||
;sockets_amxx.dll
|
;sockets_amxx.dll
|
||||||
|
;sockets_amxx_amd64.so
|
||||||
|
|
||||||
|
; --------------------------
|
||||||
|
; Regular Expression support
|
||||||
|
; --------------------------
|
||||||
|
;regex_amxx_i386.so
|
||||||
|
;regex_amxx.dll
|
||||||
|
;regex_amxx_amd64.so
|
||||||
|
|
||||||
; -----------------------------------------------------------
|
; -----------------------------------------------------------
|
||||||
; The Specialists X - adds functions and stats specific to TS
|
; The Specialists X - adds functions and stats specific to TS
|
||||||
; -----------------------------------------------------------
|
; -----------------------------------------------------------
|
||||||
;tsx_amxx_i386.so
|
tsx_amxx_i386.so
|
||||||
;tsx_amxx.dll
|
tsx_amxx.dll
|
||||||
|
tsx_amxx_amd64.so
|
@ -1,5 +1,5 @@
|
|||||||
; Users configuration file
|
; Users configuration file
|
||||||
; File location: $moddir/addons/amxx/configs/users.ini
|
; File location: $moddir/addons/amxmodx/configs/users.ini
|
||||||
|
|
||||||
; Line starting with ; is a comment
|
; Line starting with ; is a comment
|
||||||
|
|
||||||
|
@ -45,6 +45,16 @@
|
|||||||
enginefuncs_t g_engfuncs;
|
enginefuncs_t g_engfuncs;
|
||||||
globalvars_t *gpGlobals;
|
globalvars_t *gpGlobals;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable;
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
|
enginefuncs_t *g_pengfuncsTable;
|
||||||
|
enginefuncs_t *g_pengfuncsTable_Post;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post;
|
||||||
|
|
||||||
|
|
||||||
// GetEntityAPI2 functions
|
// GetEntityAPI2 functions
|
||||||
static DLL_FUNCTIONS g_EntityAPI_Table =
|
static DLL_FUNCTIONS g_EntityAPI_Table =
|
||||||
{
|
{
|
||||||
@ -2114,6 +2124,7 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
||||||
|
g_pFunctionTable=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2131,7 +2142,7 @@ C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interface
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
g_pFunctionTable_Post=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2154,6 +2165,7 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2171,6 +2183,7 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable_Post=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2195,6 +2208,7 @@ C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable,
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2212,6 +2226,7 @@ C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, i
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable_Post=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2439,11 +2454,14 @@ PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
|||||||
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
PFN_LOG g_fn_Log;
|
PFN_LOG g_fn_Log;
|
||||||
|
PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||||
PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
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_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||||
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||||
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
||||||
@ -2453,6 +2471,7 @@ PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized;
|
|||||||
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
||||||
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
||||||
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
||||||
|
PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||||
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
||||||
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
||||||
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
||||||
@ -2525,6 +2544,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
|
REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
@ -2560,7 +2580,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
||||||
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
||||||
REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY);
|
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
|
// Player
|
||||||
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
||||||
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
||||||
@ -2572,6 +2593,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
||||||
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
||||||
REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID);
|
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("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS);
|
||||||
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
||||||
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
||||||
@ -2626,7 +2648,19 @@ void MF_Log(const char *fmt, ...)
|
|||||||
vsprintf(msg, fmt, arglst);
|
vsprintf(msg, fmt, arglst);
|
||||||
va_end(arglst);
|
va_end(arglst);
|
||||||
|
|
||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
// :TODO: Overflow possible here
|
||||||
|
char msg[3072];
|
||||||
|
va_list arglst;
|
||||||
|
va_start(arglst, fmt);
|
||||||
|
vsprintf(msg, fmt, arglst);
|
||||||
|
va_end(arglst);
|
||||||
|
|
||||||
|
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2649,11 +2683,14 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_GetAmxStringLen(NULL);
|
MF_GetAmxStringLen(NULL);
|
||||||
MF_CopyAmxMemory(NULL, NULL, 0);
|
MF_CopyAmxMemory(NULL, NULL, 0);
|
||||||
MF_Log("str", "str", 0);
|
MF_Log("str", "str", 0);
|
||||||
|
MF_LogError(NULL, 0, NULL);
|
||||||
MF_RaiseAmxError(NULL, 0);
|
MF_RaiseAmxError(NULL, 0);
|
||||||
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
||||||
MF_ExecuteForward(0, 0, 0);
|
MF_ExecuteForward(0, 0, 0);
|
||||||
MF_PrepareCellArray(NULL, 0);
|
MF_PrepareCellArray(NULL, 0);
|
||||||
MF_PrepareCharArray(NULL, 0);
|
MF_PrepareCharArray(NULL, 0);
|
||||||
|
MF_PrepareCellArrayA(NULL, 0, true);
|
||||||
|
MF_PrepareCharArrayA(NULL, 0, true);
|
||||||
MF_IsPlayerValid(0);
|
MF_IsPlayerValid(0);
|
||||||
MF_GetPlayerName(0);
|
MF_GetPlayerName(0);
|
||||||
MF_GetPlayerIP(0);
|
MF_GetPlayerIP(0);
|
||||||
@ -2664,6 +2701,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_GetPlayerPlayTime(0);
|
MF_GetPlayerPlayTime(0);
|
||||||
MF_GetPlayerCurweapon(0);
|
MF_GetPlayerCurweapon(0);
|
||||||
MF_GetPlayerTeamID(0);
|
MF_GetPlayerTeamID(0);
|
||||||
|
MF_GetPlayerTeam(0);
|
||||||
MF_GetPlayerDeaths(0);
|
MF_GetPlayerDeaths(0);
|
||||||
MF_GetPlayerMenu(0);
|
MF_GetPlayerMenu(0);
|
||||||
MF_GetPlayerKeys(0);
|
MF_GetPlayerKeys(0);
|
||||||
|
@ -55,7 +55,7 @@ struct amxx_module_info_s
|
|||||||
// The next section is copied from the amx.h file
|
// The next section is copied from the amx.h file
|
||||||
// Copyright (c) ITB CompuPhase, 1997-2004
|
// Copyright (c) ITB CompuPhase, 1997-2004
|
||||||
|
|
||||||
#if defined __LCC__ || defined __DMC__ || defined __linux__
|
#if defined __LCC__ || defined __DMC__ || defined __linux__ || defined __GNUC__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||||
@ -929,7 +929,7 @@ void FN_EngineFprintf(FILE *pfile, char *szFmt, ...);
|
|||||||
#endif // FN_EngineFprintf
|
#endif // FN_EngineFprintf
|
||||||
|
|
||||||
#ifdef FN_PvAllocEntPrivateData
|
#ifdef FN_PvAllocEntPrivateData
|
||||||
void *FN_PvAllocEntPrivateData(edict_t *pEdict, long cb);
|
void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb);
|
||||||
#endif // FN_PvAllocEntPrivateData
|
#endif // FN_PvAllocEntPrivateData
|
||||||
|
|
||||||
#ifdef FN_PvEntPrivateData
|
#ifdef FN_PvEntPrivateData
|
||||||
@ -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 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_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/);
|
||||||
typedef void (*PFN_LOG) (const char * /*fmt*/, ...);
|
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_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/);
|
||||||
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
||||||
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
||||||
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
||||||
typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*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 int (*PFN_IS_PLAYER_VALID) (int /*id*/);
|
||||||
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
||||||
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
||||||
@ -1934,6 +1937,7 @@ typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/);
|
|||||||
typedef float (*PFN_GET_PLAYER_PLAYTIME) (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 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_TEAMID) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_MENU) (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_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
extern PFN_LOG g_fn_Log;
|
extern PFN_LOG g_fn_Log;
|
||||||
|
extern PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||||
extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
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_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||||
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||||
extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
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_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
extern PFN_FORMAT g_fn_Format;
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// 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) { }
|
char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { }
|
||||||
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
||||||
void MF_Log (const char * fmt, ...) { }
|
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_RaiseAmxError (AMX * amx, int error) { }
|
||||||
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
||||||
int MF_ExecuteForward (int id, ...) { }
|
int MF_ExecuteForward (int id, ...) { }
|
||||||
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
||||||
cell MF_PrepareCharArray (char * 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) { }
|
int MF_IsPlayerValid (int id) { }
|
||||||
const char * MF_GetPlayerName (int id) { }
|
const char * MF_GetPlayerName (int id) { }
|
||||||
const char * MF_GetPlayerIP (int id) { }
|
const char * MF_GetPlayerIP (int id) { }
|
||||||
@ -2059,6 +2070,7 @@ int MF_IsPlayerAuthorized (int id) { }
|
|||||||
float MF_GetPlayerTime (int id) { }
|
float MF_GetPlayerTime (int id) { }
|
||||||
float MF_GetPlayerPlayTime (int id) { }
|
float MF_GetPlayerPlayTime (int id) { }
|
||||||
int MF_GetPlayerCurweapon (int id) { }
|
int MF_GetPlayerCurweapon (int id) { }
|
||||||
|
const char * MF_GetPlayerTeam (int id) { }
|
||||||
int MF_GetPlayerTeamID (int id) { }
|
int MF_GetPlayerTeamID (int id) { }
|
||||||
int MF_GetPlayerDeaths (int id) { }
|
int MF_GetPlayerDeaths (int id) { }
|
||||||
int MF_GetPlayerMenu (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_GetAmxStringLen g_fn_GetAmxStringLen
|
||||||
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
||||||
void MF_Log(const char *fmt, ...);
|
void MF_Log(const char *fmt, ...);
|
||||||
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||||
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
||||||
#define MF_RegisterForward g_fn_RegisterForward
|
#define MF_RegisterForward g_fn_RegisterForward
|
||||||
#define MF_ExecuteForward g_fn_ExecuteForward
|
#define MF_ExecuteForward g_fn_ExecuteForward
|
||||||
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
||||||
#define MF_PrepareCharArray g_fn_PrepareCharArray
|
#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_IsPlayerValid g_fn_IsPlayerValid
|
||||||
#define MF_GetPlayerName g_fn_GetPlayerName
|
#define MF_GetPlayerName g_fn_GetPlayerName
|
||||||
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
||||||
@ -2108,6 +2123,7 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
||||||
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
||||||
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
||||||
|
#define MF_GetPlayerTeam g_fn_GetPlayerTeam
|
||||||
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
||||||
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
||||||
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
||||||
@ -2133,7 +2149,7 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#define MF_Format g_fn_Format;
|
#define MF_Format g_fn_Format
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
|
@ -13,7 +13,6 @@ CCstrikePlayer::CCstrikePlayer()
|
|||||||
{
|
{
|
||||||
modelled = false;
|
modelled = false;
|
||||||
inspectModel = false;
|
inspectModel = false;
|
||||||
online = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCstrikePlayer::GetModelled()
|
bool CCstrikePlayer::GetModelled()
|
||||||
@ -48,20 +47,3 @@ void CCstrikePlayer::SetInspectModel(bool inspectModelIn)
|
|||||||
{
|
{
|
||||||
inspectModel = inspectModelIn;
|
inspectModel = inspectModelIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCstrikePlayer::GetOnline()
|
|
||||||
{
|
|
||||||
return online;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CCstrikePlayer::SetOnline(bool onlineIn)
|
|
||||||
{
|
|
||||||
online = onlineIn;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CCstrikePlayer::Initialize()
|
|
||||||
{
|
|
||||||
SetModelled(false);
|
|
||||||
SetInspectModel(false);
|
|
||||||
SetOnline(false);
|
|
||||||
}
|
|
@ -10,8 +10,6 @@ class CCstrikePlayer
|
|||||||
public:
|
public:
|
||||||
CCstrikePlayer();
|
CCstrikePlayer();
|
||||||
|
|
||||||
void Initialize();
|
|
||||||
|
|
||||||
bool GetModelled();
|
bool GetModelled();
|
||||||
bool SetModelled(bool modelledIn);
|
bool SetModelled(bool modelledIn);
|
||||||
const char* GetModel();
|
const char* GetModel();
|
||||||
@ -20,13 +18,10 @@ public:
|
|||||||
bool GetInspectModel();
|
bool GetInspectModel();
|
||||||
void SetInspectModel(bool inspectModelIn);
|
void SetInspectModel(bool inspectModelIn);
|
||||||
|
|
||||||
bool GetOnline();
|
|
||||||
void SetOnline(bool onlineIn);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool inspectModel;
|
bool inspectModel;
|
||||||
bool modelled;
|
bool modelled;
|
||||||
bool online;
|
|
||||||
char model[32];
|
char model[32];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,6 +45,16 @@
|
|||||||
enginefuncs_t g_engfuncs;
|
enginefuncs_t g_engfuncs;
|
||||||
globalvars_t *gpGlobals;
|
globalvars_t *gpGlobals;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable;
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
|
enginefuncs_t *g_pengfuncsTable;
|
||||||
|
enginefuncs_t *g_pengfuncsTable_Post;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post;
|
||||||
|
|
||||||
|
|
||||||
// GetEntityAPI2 functions
|
// GetEntityAPI2 functions
|
||||||
static DLL_FUNCTIONS g_EntityAPI_Table =
|
static DLL_FUNCTIONS g_EntityAPI_Table =
|
||||||
{
|
{
|
||||||
@ -2114,6 +2124,7 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
||||||
|
g_pFunctionTable=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2131,7 +2142,7 @@ C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interface
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
g_pFunctionTable_Post=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2154,6 +2165,7 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2171,6 +2183,7 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable_Post=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2195,6 +2208,7 @@ C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable,
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2212,6 +2226,7 @@ C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, i
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable_Post=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2439,11 +2454,14 @@ PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
|||||||
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
PFN_LOG g_fn_Log;
|
PFN_LOG g_fn_Log;
|
||||||
|
PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||||
PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
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_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||||
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||||
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
||||||
@ -2453,6 +2471,7 @@ PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized;
|
|||||||
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
||||||
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
||||||
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
||||||
|
PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||||
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
||||||
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
||||||
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
||||||
@ -2525,6 +2544,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
|
REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
@ -2560,7 +2580,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
||||||
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
||||||
REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY);
|
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
|
// Player
|
||||||
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
||||||
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
||||||
@ -2572,6 +2593,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
||||||
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
||||||
REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID);
|
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("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS);
|
||||||
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
||||||
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
||||||
@ -2626,7 +2648,19 @@ void MF_Log(const char *fmt, ...)
|
|||||||
vsprintf(msg, fmt, arglst);
|
vsprintf(msg, fmt, arglst);
|
||||||
va_end(arglst);
|
va_end(arglst);
|
||||||
|
|
||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
// :TODO: Overflow possible here
|
||||||
|
char msg[3072];
|
||||||
|
va_list arglst;
|
||||||
|
va_start(arglst, fmt);
|
||||||
|
vsprintf(msg, fmt, arglst);
|
||||||
|
va_end(arglst);
|
||||||
|
|
||||||
|
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2649,11 +2683,14 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_GetAmxStringLen(NULL);
|
MF_GetAmxStringLen(NULL);
|
||||||
MF_CopyAmxMemory(NULL, NULL, 0);
|
MF_CopyAmxMemory(NULL, NULL, 0);
|
||||||
MF_Log("str", "str", 0);
|
MF_Log("str", "str", 0);
|
||||||
|
MF_LogError(NULL, 0, NULL);
|
||||||
MF_RaiseAmxError(NULL, 0);
|
MF_RaiseAmxError(NULL, 0);
|
||||||
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
||||||
MF_ExecuteForward(0, 0, 0);
|
MF_ExecuteForward(0, 0, 0);
|
||||||
MF_PrepareCellArray(NULL, 0);
|
MF_PrepareCellArray(NULL, 0);
|
||||||
MF_PrepareCharArray(NULL, 0);
|
MF_PrepareCharArray(NULL, 0);
|
||||||
|
MF_PrepareCellArrayA(NULL, 0, true);
|
||||||
|
MF_PrepareCharArrayA(NULL, 0, true);
|
||||||
MF_IsPlayerValid(0);
|
MF_IsPlayerValid(0);
|
||||||
MF_GetPlayerName(0);
|
MF_GetPlayerName(0);
|
||||||
MF_GetPlayerIP(0);
|
MF_GetPlayerIP(0);
|
||||||
@ -2664,6 +2701,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_GetPlayerPlayTime(0);
|
MF_GetPlayerPlayTime(0);
|
||||||
MF_GetPlayerCurweapon(0);
|
MF_GetPlayerCurweapon(0);
|
||||||
MF_GetPlayerTeamID(0);
|
MF_GetPlayerTeamID(0);
|
||||||
|
MF_GetPlayerTeam(0);
|
||||||
MF_GetPlayerDeaths(0);
|
MF_GetPlayerDeaths(0);
|
||||||
MF_GetPlayerMenu(0);
|
MF_GetPlayerMenu(0);
|
||||||
MF_GetPlayerKeys(0);
|
MF_GetPlayerKeys(0);
|
||||||
|
@ -55,7 +55,7 @@ struct amxx_module_info_s
|
|||||||
// The next section is copied from the amx.h file
|
// The next section is copied from the amx.h file
|
||||||
// Copyright (c) ITB CompuPhase, 1997-2004
|
// Copyright (c) ITB CompuPhase, 1997-2004
|
||||||
|
|
||||||
#if defined __LCC__ || defined __DMC__ || defined __linux__
|
#if defined __LCC__ || defined __DMC__ || defined __linux__ || defined __GNUC__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||||
@ -929,7 +929,7 @@ void FN_EngineFprintf(FILE *pfile, char *szFmt, ...);
|
|||||||
#endif // FN_EngineFprintf
|
#endif // FN_EngineFprintf
|
||||||
|
|
||||||
#ifdef FN_PvAllocEntPrivateData
|
#ifdef FN_PvAllocEntPrivateData
|
||||||
void *FN_PvAllocEntPrivateData(edict_t *pEdict, long cb);
|
void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb);
|
||||||
#endif // FN_PvAllocEntPrivateData
|
#endif // FN_PvAllocEntPrivateData
|
||||||
|
|
||||||
#ifdef FN_PvEntPrivateData
|
#ifdef FN_PvEntPrivateData
|
||||||
@ -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 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_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/);
|
||||||
typedef void (*PFN_LOG) (const char * /*fmt*/, ...);
|
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_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/);
|
||||||
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
||||||
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
||||||
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
||||||
typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*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 int (*PFN_IS_PLAYER_VALID) (int /*id*/);
|
||||||
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
||||||
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
||||||
@ -1934,6 +1937,7 @@ typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/);
|
|||||||
typedef float (*PFN_GET_PLAYER_PLAYTIME) (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 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_TEAMID) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_MENU) (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_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
extern PFN_LOG g_fn_Log;
|
extern PFN_LOG g_fn_Log;
|
||||||
|
extern PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||||
extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
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_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||||
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||||
extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
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_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
extern PFN_FORMAT g_fn_Format;
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// 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) { }
|
char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { }
|
||||||
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
||||||
void MF_Log (const char * fmt, ...) { }
|
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_RaiseAmxError (AMX * amx, int error) { }
|
||||||
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
||||||
int MF_ExecuteForward (int id, ...) { }
|
int MF_ExecuteForward (int id, ...) { }
|
||||||
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
||||||
cell MF_PrepareCharArray (char * 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) { }
|
int MF_IsPlayerValid (int id) { }
|
||||||
const char * MF_GetPlayerName (int id) { }
|
const char * MF_GetPlayerName (int id) { }
|
||||||
const char * MF_GetPlayerIP (int id) { }
|
const char * MF_GetPlayerIP (int id) { }
|
||||||
@ -2059,6 +2070,7 @@ int MF_IsPlayerAuthorized (int id) { }
|
|||||||
float MF_GetPlayerTime (int id) { }
|
float MF_GetPlayerTime (int id) { }
|
||||||
float MF_GetPlayerPlayTime (int id) { }
|
float MF_GetPlayerPlayTime (int id) { }
|
||||||
int MF_GetPlayerCurweapon (int id) { }
|
int MF_GetPlayerCurweapon (int id) { }
|
||||||
|
const char * MF_GetPlayerTeam (int id) { }
|
||||||
int MF_GetPlayerTeamID (int id) { }
|
int MF_GetPlayerTeamID (int id) { }
|
||||||
int MF_GetPlayerDeaths (int id) { }
|
int MF_GetPlayerDeaths (int id) { }
|
||||||
int MF_GetPlayerMenu (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_GetAmxStringLen g_fn_GetAmxStringLen
|
||||||
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
||||||
void MF_Log(const char *fmt, ...);
|
void MF_Log(const char *fmt, ...);
|
||||||
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||||
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
||||||
#define MF_RegisterForward g_fn_RegisterForward
|
#define MF_RegisterForward g_fn_RegisterForward
|
||||||
#define MF_ExecuteForward g_fn_ExecuteForward
|
#define MF_ExecuteForward g_fn_ExecuteForward
|
||||||
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
||||||
#define MF_PrepareCharArray g_fn_PrepareCharArray
|
#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_IsPlayerValid g_fn_IsPlayerValid
|
||||||
#define MF_GetPlayerName g_fn_GetPlayerName
|
#define MF_GetPlayerName g_fn_GetPlayerName
|
||||||
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
||||||
@ -2108,6 +2123,7 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
||||||
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
||||||
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
||||||
|
#define MF_GetPlayerTeam g_fn_GetPlayerTeam
|
||||||
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
||||||
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
||||||
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
||||||
@ -2133,7 +2149,7 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#define MF_Format g_fn_Format;
|
#define MF_Format g_fn_Format
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
|
@ -37,11 +37,7 @@
|
|||||||
|
|
||||||
bool UTIL_IsPlayer(AMX* amx, edict_t* pPlayer) {
|
bool UTIL_IsPlayer(AMX* amx, edict_t* pPlayer) {
|
||||||
bool player = false;
|
bool player = false;
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (strcmp(STRING(pPlayer->v.classname), "player") == 0)
|
if (strcmp(STRING(pPlayer->v.classname), "player") == 0)
|
||||||
player = true;
|
player = true;
|
||||||
|
|
||||||
@ -74,20 +70,10 @@ static cell AMX_NATIVE_CALL cs_set_user_money(AMX *amx, cell *params) // cs_set_
|
|||||||
// params[3] = flash money?
|
// params[3] = flash money?
|
||||||
|
|
||||||
// Check index
|
// Check index
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch player pointer
|
// Fetch player pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Give money
|
// Give money
|
||||||
*((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY) = params[2];
|
*((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY) = params[2];
|
||||||
@ -107,20 +93,10 @@ static cell AMX_NATIVE_CALL cs_get_user_money(AMX *amx, cell *params) // cs_get_
|
|||||||
// params[1] = user
|
// params[1] = user
|
||||||
|
|
||||||
// Check index
|
// Check index
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch player pointer
|
// Fetch player pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return money
|
// Return money
|
||||||
return *((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY);
|
return *((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY);
|
||||||
@ -132,20 +108,10 @@ static cell AMX_NATIVE_CALL cs_get_user_deaths(AMX *amx, cell *params) // cs_get
|
|||||||
// params[1] = user
|
// params[1] = user
|
||||||
|
|
||||||
// Check index
|
// Check index
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch player pointer
|
// Fetch player pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS);
|
return *((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS);
|
||||||
}
|
}
|
||||||
@ -157,20 +123,10 @@ static cell AMX_NATIVE_CALL cs_set_user_deaths(AMX *amx, cell *params) // cs_set
|
|||||||
// params[2] = new deaths
|
// params[2] = new deaths
|
||||||
|
|
||||||
// Check index
|
// Check index
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch player pointer
|
// Fetch player pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set deaths
|
// Set deaths
|
||||||
*((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS) = params[2];
|
*((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS) = params[2];
|
||||||
@ -193,24 +149,14 @@ static cell AMX_NATIVE_CALL cs_get_hostage_id(AMX *amx, cell *params) // cs_get_
|
|||||||
// params[1] = hostage entity index
|
// params[1] = hostage entity index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_ENTITY(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into class pointer
|
// Make into class pointer
|
||||||
edict_t *pEdict = INDEXENT(params[1]);
|
edict_t *pEdict = GETEDICT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pEdict)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure this is a hostage.
|
// Make sure this is a hostage.
|
||||||
if (strcmp(STRING(pEdict->v.classname), "hostage_entity") != 0) {
|
if (strcmp(STRING(pEdict->v.classname), "hostage_entity") != 0) {
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pEdict->v.classname));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,21 +170,11 @@ static cell AMX_NATIVE_CALL cs_get_weapon_silenced(AMX *amx, cell *params) // cs
|
|||||||
// params[1] = weapon index
|
// params[1] = weapon index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pWeapon = INDEXENT(params[1]);
|
edict_t *pWeapon = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pWeapon)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
||||||
int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
||||||
switch (weapontype) {
|
switch (weapontype) {
|
||||||
@ -254,6 +190,20 @@ static cell AMX_NATIVE_CALL cs_get_weapon_silenced(AMX *amx, cell *params) // cs
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL cs_get_weapon_id(AMX *amx, cell *params) // cs_get_weapon_id(index); = 1 param
|
||||||
|
{
|
||||||
|
// Get weapon type. Corresponds to CSW_*
|
||||||
|
// params[1] = weapon index
|
||||||
|
|
||||||
|
// Valid entity should be within range
|
||||||
|
CHECK_NONPLAYER(params[1]);
|
||||||
|
|
||||||
|
// Make into edict pointer
|
||||||
|
edict_t *pWeapon = INDEXENT(params[1]);
|
||||||
|
|
||||||
|
return *((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
||||||
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs_set_weapon_silenced(index, silence = 1); = 2 params
|
static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs_set_weapon_silenced(index, silence = 1); = 2 params
|
||||||
{
|
{
|
||||||
// Silence/unsilence gun. Does only work on M4A1 and USP.
|
// Silence/unsilence gun. Does only work on M4A1 and USP.
|
||||||
@ -261,21 +211,11 @@ static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs
|
|||||||
// params[2] = 1, and we silence the gun, 0 and we unsilence gun.
|
// params[2] = 1, and we silence the gun, 0 and we unsilence gun.
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pWeapon = INDEXENT(params[1]);
|
edict_t *pWeapon = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pWeapon)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
||||||
int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
||||||
|
|
||||||
@ -325,21 +265,11 @@ static cell AMX_NATIVE_CALL cs_get_weapon_burstmode(AMX *amx, cell *params) // c
|
|||||||
// params[1] = weapon index
|
// params[1] = weapon index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pWeapon = INDEXENT(params[1]);
|
edict_t *pWeapon = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pWeapon)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
||||||
int* firemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
int* firemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
||||||
switch (weapontype) {
|
switch (weapontype) {
|
||||||
@ -362,21 +292,11 @@ static cell AMX_NATIVE_CALL cs_set_weapon_burstmode(AMX *amx, cell *params) // c
|
|||||||
// params[2] = 1, and we set burstmode, 0 and we unset it.
|
// params[2] = 1, and we set burstmode, 0 and we unset it.
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pWeapon = INDEXENT(params[1]);
|
edict_t *pWeapon = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pWeapon)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE);
|
||||||
|
|
||||||
int* firemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
int* firemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
|
||||||
@ -426,26 +346,61 @@ static cell AMX_NATIVE_CALL cs_set_weapon_burstmode(AMX *amx, cell *params) // c
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL cs_get_user_armor(AMX *amx, cell *params) // cs_get_user_armor(index, CsArmorType:&armortype); = 2 params
|
||||||
|
{
|
||||||
|
// Return how much armor and set reference of what type...
|
||||||
|
// params[1] = user index
|
||||||
|
// params[2] = byref, set armor type here (no armor/vest/vest+helmet)
|
||||||
|
|
||||||
|
CHECK_PLAYER(params[1]);
|
||||||
|
|
||||||
|
// Make into edict pointer
|
||||||
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
|
cell *armorTypeByRef = MF_GetAmxAddr(amx, params[2]);
|
||||||
|
*armorTypeByRef = *((int *)pPlayer->pvPrivateData + OFFSET_ARMORTYPE);
|
||||||
|
|
||||||
|
return pPlayer->v.armorvalue;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL cs_set_user_armor(AMX *amx, cell *params) // cs_set_user_armor(index, armorvalue, CsArmorType:armortype); = 3 params
|
||||||
|
{
|
||||||
|
// Set armor and set what type and send a message to client...
|
||||||
|
// params[1] = user index
|
||||||
|
// params[2] = armor value
|
||||||
|
// params[3] = armor type (no armor/vest/vest+helmet)
|
||||||
|
|
||||||
|
CHECK_PLAYER(params[1]);
|
||||||
|
|
||||||
|
// Make into edict pointer
|
||||||
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
|
// Set armor value
|
||||||
|
pPlayer->v.armorvalue = params[2];
|
||||||
|
|
||||||
|
// Set armor type
|
||||||
|
*((int *)pPlayer->pvPrivateData + OFFSET_ARMORTYPE) = params[3];
|
||||||
|
|
||||||
|
if (params[3] == CS_ARMOR_KEVLAR || params[3] == CS_ARMOR_ASSAULTSUIT) {
|
||||||
|
// And send appropriate message
|
||||||
|
MESSAGE_BEGIN(params[1], GET_USER_MSG_ID(PLID, "ItemPickup", NULL), NULL, pPlayer);
|
||||||
|
WRITE_STRING(params[3] == CS_ARMOR_KEVLAR ? "item_kevlar" : "item_assaultsuit");
|
||||||
|
MESSAGE_END();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_user_vip(index); = 1 param
|
static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_user_vip(index); = 1 param
|
||||||
{
|
{
|
||||||
// Is user vip?
|
// Is user vip?
|
||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( *((int *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP )
|
if ( *((int *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP )
|
||||||
return 1;
|
return 1;
|
||||||
@ -460,20 +415,10 @@ static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_us
|
|||||||
// params[2] = if 1, activate vip, else deactivate vip.
|
// params[2] = if 1, activate vip, else deactivate vip.
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params[2] == 1) {
|
if (params[2] == 1) {
|
||||||
// Set to "be" vip.
|
// Set to "be" vip.
|
||||||
@ -522,20 +467,10 @@ static cell AMX_NATIVE_CALL cs_get_user_team(AMX *amx, cell *params) // cs_get_u
|
|||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *((int *)pPlayer->pvPrivateData + OFFSET_TEAM);
|
return *((int *)pPlayer->pvPrivateData + OFFSET_TEAM);
|
||||||
}
|
}
|
||||||
@ -548,20 +483,10 @@ static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_u
|
|||||||
// params[3] = model = 0
|
// params[3] = model = 0
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int model = params[3];
|
int model = params[3];
|
||||||
|
|
||||||
@ -589,7 +514,8 @@ static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_u
|
|||||||
strcpy(teaminfo, "SPECTATOR");
|
strcpy(teaminfo, "SPECTATOR");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sprintf(teaminfo, "TEAM_%d", params[2]);
|
int team_nr = (int)params[2];
|
||||||
|
sprintf(teaminfo, "TEAM_%i", team_nr);
|
||||||
}
|
}
|
||||||
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "TeamInfo", NULL));
|
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "TeamInfo", NULL));
|
||||||
WRITE_BYTE(params[1]);
|
WRITE_BYTE(params[1]);
|
||||||
@ -605,20 +531,10 @@ static cell AMX_NATIVE_CALL cs_get_user_inside_buyzone(AMX *amx, cell *params) /
|
|||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (int)*((int *)pPlayer->pvPrivateData + OFFSET_BUYZONE); // This offset is 0 when outside, 1 when inside.
|
return (int)*((int *)pPlayer->pvPrivateData + OFFSET_BUYZONE); // This offset is 0 when outside, 1 when inside.
|
||||||
}
|
}
|
||||||
@ -629,20 +545,10 @@ static cell AMX_NATIVE_CALL cs_get_user_plant(AMX *amx, cell *params) // cs_get_
|
|||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT) & CAN_PLANT_BOMB)
|
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT) & CAN_PLANT_BOMB)
|
||||||
return 1;
|
return 1;
|
||||||
@ -658,20 +564,10 @@ static cell AMX_NATIVE_CALL cs_set_user_plant(AMX *amx, cell *params) // cs_set_
|
|||||||
// params[3] = show bomb icon?
|
// params[3] = show bomb icon?
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int* plantskill = ((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT);
|
int* plantskill = ((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT);
|
||||||
|
|
||||||
@ -714,20 +610,10 @@ static cell AMX_NATIVE_CALL cs_get_user_defusekit(AMX *amx, cell *params) // cs_
|
|||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT) & HAS_DEFUSE_KIT)
|
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT) & HAS_DEFUSE_KIT)
|
||||||
return 1;
|
return 1;
|
||||||
@ -747,20 +633,10 @@ static cell AMX_NATIVE_CALL cs_set_user_defusekit(AMX *amx, cell *params) // cs_
|
|||||||
// params[7] = flash = 0
|
// params[7] = flash = 0
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int* defusekit = ((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT);
|
int* defusekit = ((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT);
|
||||||
|
|
||||||
@ -822,20 +698,10 @@ static cell AMX_NATIVE_CALL cs_get_user_backpackammo(AMX *amx, cell *params) //
|
|||||||
// params[2] = weapon, as in CSW_*
|
// params[2] = weapon, as in CSW_*
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
@ -897,7 +763,7 @@ static cell AMX_NATIVE_CALL cs_get_user_backpackammo(AMX *amx, cell *params) //
|
|||||||
offset = OFFSET_C4_AMMO;
|
offset = OFFSET_C4_AMMO;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", params[2]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -914,20 +780,10 @@ static cell AMX_NATIVE_CALL cs_set_user_backpackammo(AMX *amx, cell *params) //
|
|||||||
// params[3] = new amount
|
// params[3] = new amount
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
@ -989,7 +845,7 @@ static cell AMX_NATIVE_CALL cs_set_user_backpackammo(AMX *amx, cell *params) //
|
|||||||
offset = OFFSET_C4_AMMO;
|
offset = OFFSET_C4_AMMO;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", params[2]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1004,20 +860,10 @@ static cell AMX_NATIVE_CALL cs_get_user_nvg(AMX *amx, cell *params) // cs_get_us
|
|||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_NVGOGGLES) & HAS_NVGOGGLES)
|
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_NVGOGGLES) & HAS_NVGOGGLES)
|
||||||
return 1;
|
return 1;
|
||||||
@ -1032,20 +878,10 @@ static cell AMX_NATIVE_CALL cs_set_user_nvg(AMX *amx, cell *params) // cs_set_us
|
|||||||
// params[2] = 1 = give, 0 = remove
|
// params[2] = 1 = give, 0 = remove
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int* defusekit = ((int *)pPlayer->pvPrivateData + OFFSET_NVGOGGLES);
|
int* defusekit = ((int *)pPlayer->pvPrivateData + OFFSET_NVGOGGLES);
|
||||||
|
|
||||||
@ -1073,20 +909,9 @@ static cell AMX_NATIVE_CALL cs_get_user_model(AMX *amx, cell *params) // cs_get_
|
|||||||
// params[3] = max length to set
|
// params[3] = max length to set
|
||||||
|
|
||||||
// Valid player index should be within range
|
// Valid player index should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return MF_SetAmxString(amx, params[2], GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model"), params[3]);
|
return MF_SetAmxString(amx, params[2], GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model"), params[3]);
|
||||||
}
|
}
|
||||||
@ -1098,23 +923,13 @@ static cell AMX_NATIVE_CALL cs_set_user_model(AMX *amx, cell *params) // cs_set_
|
|||||||
// params[2] = model
|
// params[2] = model
|
||||||
|
|
||||||
// Valid player index should be within range
|
// Valid player index should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t* pPlayer = INDEXENT(params[1]);
|
edict_t* pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params[2] == -1) {
|
if (params[2] == -1) {
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid model %d", params[2]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1137,20 +952,10 @@ static cell AMX_NATIVE_CALL cs_reset_user_model(AMX *amx, cell *params) // cs_re
|
|||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Valid player index should be within range
|
// Valid player index should be within range
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t* pPlayer = INDEXENT(params[1]);
|
edict_t* pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pPlayer)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_players[params[1]].SetModelled(false);
|
g_players[params[1]].SetModelled(false);
|
||||||
|
|
||||||
@ -1165,24 +970,14 @@ static cell AMX_NATIVE_CALL cs_get_hostage_follow(AMX *amx, cell *params) // cs_
|
|||||||
// params[1] = hostage index
|
// params[1] = hostage index
|
||||||
|
|
||||||
// Valid index should be within range
|
// Valid index should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t* pHostage = INDEXENT(params[1]);
|
edict_t* pHostage = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pHostage)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure this is a hostage.
|
// Make sure this is a hostage.
|
||||||
if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) {
|
if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) {
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1198,7 +993,7 @@ static cell AMX_NATIVE_CALL cs_get_hostage_follow(AMX *amx, cell *params) // cs_
|
|||||||
edict_t* pEntity = (edict_t*)following;
|
edict_t* pEntity = (edict_t*)following;
|
||||||
|
|
||||||
if (FNullEnt(pEntity)) {
|
if (FNullEnt(pEntity)) {
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Unknown error finding hostage parameter");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1212,24 +1007,14 @@ static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_
|
|||||||
// params[2] = index to follow, if -1 then set hostage to not follow anything
|
// params[2] = index to follow, if -1 then set hostage to not follow anything
|
||||||
|
|
||||||
// Valid index should be within range
|
// Valid index should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t* pHostage = INDEXENT(params[1]);
|
edict_t* pHostage = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pHostage)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure this is a hostage.
|
// Make sure this is a hostage.
|
||||||
if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) {
|
if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) {
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1245,20 +1030,10 @@ static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Valid index should be within range
|
// Valid index should be within range
|
||||||
if (params[2] < 1 || params[2] > gpGlobals->maxEntities)
|
CHECK_ENTITY(params[2]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t* pEntity = INDEXENT(params[2]);
|
edict_t* pEntity = GETEDICT(params[2]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pEntity)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined __amd64__
|
#if !defined __amd64__
|
||||||
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (int)pEntity;
|
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (int)pEntity;
|
||||||
@ -1274,21 +1049,11 @@ static cell AMX_NATIVE_CALL cs_get_weapon_ammo(AMX *amx, cell *params) // cs_get
|
|||||||
// params[1] = weapon index
|
// params[1] = weapon index
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pWeapon = INDEXENT(params[1]);
|
edict_t *pWeapon = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pWeapon)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO);
|
return *((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1299,21 +1064,11 @@ static cell AMX_NATIVE_CALL cs_set_weapon_ammo(AMX *amx, cell *params) // cs_set
|
|||||||
// params[2] = newammo
|
// params[2] = newammo
|
||||||
|
|
||||||
// Valid entity should be within range
|
// Valid entity should be within range
|
||||||
if (params[1] <= gpGlobals->maxClients || params[1] > gpGlobals->maxEntities)
|
CHECK_NONPLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pWeapon = INDEXENT(params[1]);
|
edict_t *pWeapon = INDEXENT(params[1]);
|
||||||
|
|
||||||
// Check entity validity
|
|
||||||
if (FNullEnt(pWeapon)) {
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
*((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO) = params[2];
|
*((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO) = params[2];
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -1325,14 +1080,10 @@ static cell AMX_NATIVE_CALL cs_get_user_hasprimary(AMX *amx, cell *params) // cs
|
|||||||
// params[1] = user index
|
// params[1] = user index
|
||||||
|
|
||||||
// Check player
|
// Check player
|
||||||
if (!MF_IsPlayerIngame(params[1]))
|
CHECK_PLAYER(params[1]);
|
||||||
{
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make into edict pointer
|
// Make into edict pointer
|
||||||
edict_t *pPlayer = INDEXENT(params[1]);
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
return *((int *)pPlayer->pvPrivateData + OFFSET_PRIMARYWEAPON);
|
return *((int *)pPlayer->pvPrivateData + OFFSET_PRIMARYWEAPON);
|
||||||
}
|
}
|
||||||
@ -1351,6 +1102,104 @@ static cell AMX_NATIVE_CALL cs_set_no_knives(AMX *amx, cell *params) // cs_set_n
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Damaged Soul
|
||||||
|
static cell AMX_NATIVE_CALL cs_get_user_tked(AMX *amx, cell *params) // cs_get_user_tked(index); = 1 param
|
||||||
|
{
|
||||||
|
// Return 1 if user has committed a team killing)
|
||||||
|
// params[1] = user index
|
||||||
|
|
||||||
|
// Check player
|
||||||
|
CHECK_PLAYER(params[1]);
|
||||||
|
|
||||||
|
// Make into edict pointer
|
||||||
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
|
return *((int *)pPlayer->pvPrivateData + OFFSET_TK);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Damaged Soul
|
||||||
|
static cell AMX_NATIVE_CALL cs_set_user_tked(AMX *amx, cell *params) // cs_set_user_tked(index, tk = 1, subtract = 1); = 2 arguments
|
||||||
|
{
|
||||||
|
// Sets whether or not player has committed a TK.
|
||||||
|
// params[1] = user
|
||||||
|
// params[2] = 1: player has TKed, 0: player hasn't TKed
|
||||||
|
// params[3] = number of frags to subtract
|
||||||
|
|
||||||
|
// Check index
|
||||||
|
CHECK_PLAYER(params[1]);
|
||||||
|
|
||||||
|
// Fetch player pointer
|
||||||
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
|
if (params[2]) {
|
||||||
|
*((int *)pPlayer->pvPrivateData + OFFSET_TK) = 1;
|
||||||
|
} else {
|
||||||
|
*((int *)pPlayer->pvPrivateData + OFFSET_TK) = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params[3]) {
|
||||||
|
pPlayer->v.frags = pPlayer->v.frags - params[3];
|
||||||
|
|
||||||
|
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL));
|
||||||
|
WRITE_BYTE(params[1]); // user index
|
||||||
|
WRITE_SHORT((int)pPlayer->v.frags); // frags
|
||||||
|
WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS)); // deaths
|
||||||
|
WRITE_SHORT(0); // ?
|
||||||
|
WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_TEAM)); // team
|
||||||
|
MESSAGE_END();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL cs_get_user_driving(AMX *amx, cell *params) // cs_get_user_driving(index); = 1 param
|
||||||
|
{
|
||||||
|
// Returns different values depending on if user is driving a value - and if so at what speed.
|
||||||
|
// 0: no driving
|
||||||
|
// 1: driving, but standing still
|
||||||
|
// 2-4: different positive speeds
|
||||||
|
// 5: negative speed (backing)
|
||||||
|
// params[1] = user index
|
||||||
|
|
||||||
|
// Check player
|
||||||
|
CHECK_PLAYER(params[1]);
|
||||||
|
|
||||||
|
// Make into edict pointer
|
||||||
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
|
// If player driving, return 1, if not, return 0
|
||||||
|
return *((int *)pPlayer->pvPrivateData + OFFSET_ISDRIVING);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL cs_get_user_stationary(AMX *amx, cell *params) // cs_get_user_stationary(index); = 1 param
|
||||||
|
{
|
||||||
|
// Returns 1 if client is using a stationary guns (maybe also other stuff)
|
||||||
|
|
||||||
|
// Check player
|
||||||
|
CHECK_PLAYER(params[1]);
|
||||||
|
|
||||||
|
// Make into edict pointer
|
||||||
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
|
// If player driving, return 1, if not, return 0
|
||||||
|
#if !defined __amd64__
|
||||||
|
return *((int *)pPlayer->pvPrivateData + OFFSET_STATIONARY);
|
||||||
|
#else
|
||||||
|
// The 32 bit server return 0 and 1 by itself from this offset, but the amd64 server has 2 and 3 respectively
|
||||||
|
// Doing a simple checking of these defined constants here, and mapping to 0 and 1, to keep our plugin authors sane.
|
||||||
|
// If an unexpected value is encountered, this will be logged.
|
||||||
|
if (AMD64_STATIONARY_NO == *((int *)pPlayer->pvPrivateData + OFFSET_STATIONARY))
|
||||||
|
return 0;
|
||||||
|
else if (AMD64_STATIONARY_YES == *((int *)pPlayer->pvPrivateData + OFFSET_STATIONARY))
|
||||||
|
return 1;
|
||||||
|
else {
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Unexpected value at offset. Please report this to development team @ www.amxmodx.org!");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
AMX_NATIVE_INFO cstrike_Exports[] = {
|
AMX_NATIVE_INFO cstrike_Exports[] = {
|
||||||
{"cs_set_user_money", cs_set_user_money},
|
{"cs_set_user_money", cs_set_user_money},
|
||||||
{"cs_get_user_money", cs_get_user_money},
|
{"cs_get_user_money", cs_get_user_money},
|
||||||
@ -1384,6 +1233,13 @@ AMX_NATIVE_INFO cstrike_Exports[] = {
|
|||||||
{"cs_get_user_hasprim", cs_get_user_hasprimary},
|
{"cs_get_user_hasprim", cs_get_user_hasprimary},
|
||||||
{"cs_get_no_knives", cs_get_no_knives},
|
{"cs_get_no_knives", cs_get_no_knives},
|
||||||
{"cs_set_no_knives", cs_set_no_knives},
|
{"cs_set_no_knives", cs_set_no_knives},
|
||||||
|
{"cs_get_weapon_id", cs_get_weapon_id},
|
||||||
|
{"cs_get_user_tked", cs_get_user_tked},
|
||||||
|
{"cs_set_user_tked", cs_set_user_tked},
|
||||||
|
{"cs_get_user_driving", cs_get_user_driving},
|
||||||
|
{"cs_get_user_stationary", cs_get_user_stationary},
|
||||||
|
{"cs_get_user_armor", cs_get_user_armor},
|
||||||
|
{"cs_set_user_armor", cs_set_user_armor},
|
||||||
//------------------- <-- max 19 characters!
|
//------------------- <-- max 19 characters!
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
@ -1452,6 +1308,23 @@ void PlayerPostThink(edict_t* pPlayer) {
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL cs_user_has_shield(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
//Return 1 if user has a shield.
|
||||||
|
//params[1] = user id
|
||||||
|
|
||||||
|
//Check player
|
||||||
|
CHECK_PLAYER(params[1]);
|
||||||
|
|
||||||
|
// Make into edict pointer
|
||||||
|
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||||
|
|
||||||
|
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_SHIELD) & HAS_SHIELD)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void OnAmxxAttach()
|
void OnAmxxAttach()
|
||||||
{
|
{
|
||||||
MF_AddNatives(cstrike_Exports);
|
MF_AddNatives(cstrike_Exports);
|
||||||
|
@ -46,45 +46,65 @@
|
|||||||
|
|
||||||
#if defined __linux__
|
#if defined __linux__
|
||||||
#define EXTRAOFFSET 5 // offsets 5 higher in Linux builds
|
#define EXTRAOFFSET 5 // offsets 5 higher in Linux builds
|
||||||
|
#define EXTRAOFFSET_WEAPONS 4 // weapon offsets are obviously only 4 steps higher on Linux!
|
||||||
#else
|
#else
|
||||||
#define EXTRAOFFSET 0 // no change in Windows builds
|
#define EXTRAOFFSET 0 // no change in Windows builds
|
||||||
|
#define EXTRAOFFSET_WEAPONS 0
|
||||||
#endif // defined __linux__
|
#endif // defined __linux__
|
||||||
|
/*
|
||||||
|
Offset history:
|
||||||
|
041029:
|
||||||
|
Confirmed (pretty much) ALL offsets for 32 bit Windows, 32 bit Linux and amd64 (yes that's all of them).
|
||||||
|
Found out that weapon offsets are only +4 higher on Linux.
|
||||||
|
Also backpack ammo offsets were all obviously 5 steps too high since unknown time...
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define HAS_SHIELD (1<<24) //16777216
|
||||||
|
|
||||||
// "player" entities
|
// "player" entities
|
||||||
#if !defined __amd64__
|
#if !defined __amd64__
|
||||||
|
// 32 bit offsets here
|
||||||
|
#define OFFSET_ARMORTYPE 112 + EXTRAOFFSET
|
||||||
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
||||||
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
||||||
#define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET
|
#define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET
|
||||||
#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET
|
#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET
|
||||||
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET
|
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET
|
||||||
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
||||||
#define OFFSET_VIP 215 + EXTRAOFFSET
|
#define OFFSET_VIP 209 + EXTRAOFFSET
|
||||||
#define OFFSET_BUYZONE 241 + EXTRAOFFSET
|
#define OFFSET_TK 216 + EXTRAOFFSET // 040926
|
||||||
|
#define OFFSET_BUYZONE 235 + EXTRAOFFSET
|
||||||
|
#define OFFSET_ISDRIVING 350 + EXTRAOFFSET // 040926
|
||||||
|
#define OFFSET_STATIONARY 362 + EXTRAOFFSET // 040927 (363 works also!)
|
||||||
|
|
||||||
#define OFFSET_AWM_AMMO 382 + EXTRAOFFSET
|
#define OFFSET_AWM_AMMO 377 + EXTRAOFFSET // 041029: All of these *_AMMO:s were changed -5
|
||||||
#define OFFSET_SCOUT_AMMO 383 + EXTRAOFFSET
|
#define OFFSET_SCOUT_AMMO 378 + EXTRAOFFSET
|
||||||
#define OFFSET_PARA_AMMO 384 + EXTRAOFFSET
|
#define OFFSET_PARA_AMMO 379 + EXTRAOFFSET
|
||||||
#define OFFSET_FAMAS_AMMO 385 + EXTRAOFFSET
|
#define OFFSET_FAMAS_AMMO 380 + EXTRAOFFSET
|
||||||
#define OFFSET_M3_AMMO 386 + EXTRAOFFSET
|
#define OFFSET_M3_AMMO 381 + EXTRAOFFSET
|
||||||
#define OFFSET_USP_AMMO 387 + EXTRAOFFSET
|
#define OFFSET_USP_AMMO 382 + EXTRAOFFSET
|
||||||
#define OFFSET_FIVESEVEN_AMMO 388 + EXTRAOFFSET
|
#define OFFSET_FIVESEVEN_AMMO 383 + EXTRAOFFSET
|
||||||
#define OFFSET_DEAGLE_AMMO 389 + EXTRAOFFSET
|
#define OFFSET_DEAGLE_AMMO 384 + EXTRAOFFSET
|
||||||
#define OFFSET_P228_AMMO 390 + EXTRAOFFSET
|
#define OFFSET_P228_AMMO 385 + EXTRAOFFSET
|
||||||
#define OFFSET_GLOCK_AMMO 391 + EXTRAOFFSET
|
#define OFFSET_GLOCK_AMMO 386 + EXTRAOFFSET
|
||||||
#define OFFSET_FLASH_AMMO 392 + EXTRAOFFSET
|
#define OFFSET_FLASH_AMMO 387 + EXTRAOFFSET
|
||||||
#define OFFSET_HE_AMMO 393 + EXTRAOFFSET
|
#define OFFSET_HE_AMMO 388 + EXTRAOFFSET
|
||||||
#define OFFSET_SMOKE_AMMO 394 + EXTRAOFFSET
|
#define OFFSET_SMOKE_AMMO 389 + EXTRAOFFSET
|
||||||
#define OFFSET_C4_AMMO 395 + EXTRAOFFSET
|
#define OFFSET_C4_AMMO 390 + EXTRAOFFSET
|
||||||
|
|
||||||
#define OFFSET_CSDEATHS 449 + EXTRAOFFSET
|
#define OFFSET_CSDEATHS 444 + EXTRAOFFSET // 040926
|
||||||
|
#define OFFSET_SHIELD 510 + EXTRAOFFSET
|
||||||
// "weapon_*" entities
|
// "weapon_*" entities
|
||||||
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET
|
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET_WEAPONS
|
||||||
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET
|
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET_WEAPONS
|
||||||
#define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET
|
#define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET_WEAPONS
|
||||||
// "hostage_entity" entities
|
// "hostage_entity" entities
|
||||||
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET
|
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET
|
||||||
#define OFFSET_HOSTAGEID 487 + EXTRAOFFSET
|
#define OFFSET_HOSTAGEID 487 + EXTRAOFFSET
|
||||||
#else
|
#else
|
||||||
|
// Amd64 offsets here
|
||||||
|
#define OFFSET_ARMORTYPE 137 + EXTRAOFFSET
|
||||||
#define OFFSET_TEAM 139 + EXTRAOFFSET // +25
|
#define OFFSET_TEAM 139 + EXTRAOFFSET // +25
|
||||||
#define OFFSET_CSMONEY 140 + EXTRAOFFSET // +25
|
#define OFFSET_CSMONEY 140 + EXTRAOFFSET // +25
|
||||||
#define OFFSET_PRIMARYWEAPON 141 + EXTRAOFFSET // +25
|
#define OFFSET_PRIMARYWEAPON 141 + EXTRAOFFSET // +25
|
||||||
@ -92,7 +112,10 @@
|
|||||||
#define OFFSET_NVGOGGLES 155 + EXTRAOFFSET // +26
|
#define OFFSET_NVGOGGLES 155 + EXTRAOFFSET // +26
|
||||||
#define OFFSET_DEFUSE_PLANT 219 + EXTRAOFFSET // +26
|
#define OFFSET_DEFUSE_PLANT 219 + EXTRAOFFSET // +26
|
||||||
#define OFFSET_VIP 242 + EXTRAOFFSET // +27
|
#define OFFSET_VIP 242 + EXTRAOFFSET // +27
|
||||||
|
#define OFFSET_TK 249 + EXTRAOFFSET // +33 040927
|
||||||
#define OFFSET_BUYZONE 268 + EXTRAOFFSET // +27
|
#define OFFSET_BUYZONE 268 + EXTRAOFFSET // +27
|
||||||
|
#define OFFSET_ISDRIVING 386 + EXTRAOFFSET // 040927
|
||||||
|
#define OFFSET_STATIONARY 400 + EXTRAOFFSET // 040927 (401 works also)
|
||||||
|
|
||||||
#define OFFSET_AWM_AMMO 426 + EXTRAOFFSET // +44
|
#define OFFSET_AWM_AMMO 426 + EXTRAOFFSET // +44
|
||||||
#define OFFSET_SCOUT_AMMO 427 + EXTRAOFFSET // +44
|
#define OFFSET_SCOUT_AMMO 427 + EXTRAOFFSET // +44
|
||||||
@ -109,13 +132,14 @@
|
|||||||
#define OFFSET_SMOKE_AMMO 438 + EXTRAOFFSET // +44
|
#define OFFSET_SMOKE_AMMO 438 + EXTRAOFFSET // +44
|
||||||
#define OFFSET_C4_AMMO 439 + EXTRAOFFSET // +44
|
#define OFFSET_C4_AMMO 439 + EXTRAOFFSET // +44
|
||||||
|
|
||||||
#define OFFSET_CSDEATHS 493 + EXTRAOFFSET // +44
|
#define OFFSET_CSDEATHS 493 + EXTRAOFFSET // +49
|
||||||
|
#define OFFSET_SHIELD 559 + EXTRAOFFSET
|
||||||
// "weapon_*" entities
|
// "weapon_*" entities
|
||||||
#define OFFSET_WEAPONTYPE 57 + EXTRAOFFSET // +14
|
#define OFFSET_WEAPONTYPE 57 + EXTRAOFFSET // +14
|
||||||
#define OFFSET_CLIPAMMO 65 + EXTRAOFFSET // +14
|
#define OFFSET_CLIPAMMO 65 + EXTRAOFFSET // +14
|
||||||
#define OFFSET_SILENCER_FIREMODE 88 + EXTRAOFFSET // +14
|
#define OFFSET_SILENCER_FIREMODE 88 + EXTRAOFFSET // +14
|
||||||
// "hostage_entity" entities
|
// "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_HOSTAGEFOLLOW 51 + EXTRAOFFSET // +21, long=51, int=107! (must use the long* offset because pointers on amd64 are stored the size of longs, 8 bytes, instead of the usual int 4 bytes.)
|
||||||
#define OFFSET_HOSTAGEID 516 + EXTRAOFFSET // +29
|
#define OFFSET_HOSTAGEID 516 + EXTRAOFFSET // +29
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -184,6 +208,13 @@
|
|||||||
#define SCOREATTRIB_BOMB 2 // t only
|
#define SCOREATTRIB_BOMB 2 // t only
|
||||||
#define SCOREATTRIB_VIP 4 // ct only
|
#define SCOREATTRIB_VIP 4 // ct only
|
||||||
|
|
||||||
|
#define AMD64_STATIONARY_NO 2
|
||||||
|
#define AMD64_STATIONARY_YES 3
|
||||||
|
|
||||||
|
#define CS_ARMOR_NONE 0
|
||||||
|
#define CS_ARMOR_KEVLAR 1
|
||||||
|
#define CS_ARMOR_ASSAULTSUIT 2
|
||||||
|
|
||||||
enum CS_Internal_Models {
|
enum CS_Internal_Models {
|
||||||
CS_DONTCHANGE = 0,
|
CS_DONTCHANGE = 0,
|
||||||
CS_CT_URBAN = 1,
|
CS_CT_URBAN = 1,
|
||||||
@ -202,3 +233,46 @@ CCstrikePlayer g_players[33];
|
|||||||
bool g_precachedknife = false;
|
bool g_precachedknife = false;
|
||||||
bool g_noknives = false;
|
bool g_noknives = false;
|
||||||
// Globals above
|
// Globals above
|
||||||
|
|
||||||
|
#define CHECK_ENTITY(x) \
|
||||||
|
if (x < 0 || x > gpGlobals->maxEntities) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
|
||||||
|
return 0; \
|
||||||
|
} else { \
|
||||||
|
if (x <= gpGlobals->maxClients) { \
|
||||||
|
if (!MF_IsPlayerIngame(x)) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
} else { \
|
||||||
|
if (x != 0 && FNullEnt(INDEXENT(x))) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CHECK_PLAYER(x) \
|
||||||
|
if (x < 1 || x > gpGlobals->maxClients) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", x); \
|
||||||
|
return 0; \
|
||||||
|
} else { \
|
||||||
|
if (!MF_IsPlayerIngame(x) || FNullEnt(MF_GetPlayerEdict(x))) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CHECK_NONPLAYER(x) \
|
||||||
|
if (x < 1 || x <= gpGlobals->maxClients || x > gpGlobals->maxEntities) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Non-player entity %d out of range", x); \
|
||||||
|
return 0; \
|
||||||
|
} else { \
|
||||||
|
if (FNullEnt(INDEXENT(x))) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid non-player entity %d", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define GETEDICT(n) \
|
||||||
|
((n >= 1 && n <= gpGlobals->maxClients) ? MF_GetPlayerEdict(n) : INDEXENT(n))
|
@ -118,6 +118,8 @@
|
|||||||
TargetEnvironment="1"
|
TargetEnvironment="1"
|
||||||
TypeLibraryName=".\Release/cstrike.tlb"
|
TypeLibraryName=".\Release/cstrike.tlb"
|
||||||
HeaderFileName=""/>
|
HeaderFileName=""/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCPreBuildEventTool"/>
|
Name="VCPreBuildEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -212,6 +214,9 @@
|
|||||||
RelativePath=".\moduleconfig.h">
|
RelativePath=".\moduleconfig.h">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath="..\plugins\include\cstrike.inc">
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
#define __MODULECONFIG_H__
|
#define __MODULECONFIG_H__
|
||||||
|
|
||||||
// Module info
|
// Module info
|
||||||
#define MODULE_NAME "Counter-Strike"
|
#define MODULE_NAME "CStrike"
|
||||||
#define MODULE_VERSION "0.20"
|
#define MODULE_VERSION "1.01"
|
||||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||||
#define MODULE_URL "http://www.amxmodx.org"
|
#define MODULE_URL "http://www.amxmodx.org"
|
||||||
#define MODULE_LOGTAG "CSTRIKE"
|
#define MODULE_LOGTAG "CSTRIKE"
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
|
|
||||||
#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]);
|
|
@ -1,515 +0,0 @@
|
|||||||
/* 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")
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
[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...
|
|
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@ bool Grenades::find( edict_t* enemy, CPlayer** p, int* type )
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
Obj* a = head;
|
Obj* a = head;
|
||||||
while ( a ){
|
while ( a ){
|
||||||
if ( a->time > gpGlobals->time ) {
|
if ( a->time > gpGlobals->time && !found ) {
|
||||||
if ( a->grenade == enemy ) {
|
if ( a->grenade == enemy ) {
|
||||||
found = true;
|
found = true;
|
||||||
*p = a->player;
|
*p = a->player;
|
||||||
@ -297,3 +297,4 @@ bool isModuleActive(){
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
178
dlls/csx/source/Makefile.pl
Executable file
178
dlls/csx/source/Makefile.pl
Executable file
@ -0,0 +1,178 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
#(C)2004 AMX Mod X Development Team
|
||||||
|
# by David "BAILOPAN" Anderson
|
||||||
|
|
||||||
|
# output will occur in bin.x.proc
|
||||||
|
# where x is debug or opt and proc is ix86 or amd64
|
||||||
|
# You must use this script from the project src dir
|
||||||
|
|
||||||
|
#options =
|
||||||
|
# debug - enable gdb debugging
|
||||||
|
# amd64 - compile for AMD64
|
||||||
|
# proc=ix86 - assumed not amd64
|
||||||
|
# clean - clean the specifications above
|
||||||
|
|
||||||
|
$PROJECT = "csx_amxx";
|
||||||
|
$sdk = "../../../hlsdk/SourceCode";
|
||||||
|
$mm = "../../../metamod/metamod";
|
||||||
|
$gccf = "gcc";
|
||||||
|
|
||||||
|
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CMisc.cpp", "usermsg.cpp", "meta_api.cpp", "rank.cpp", "CRank.cpp");
|
||||||
|
|
||||||
|
@C_SOURCE_FILES = ();
|
||||||
|
my %OPTIONS, %OPT;
|
||||||
|
|
||||||
|
$OPT{"debug"} = "-g -ggdb";
|
||||||
|
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\" -fno-exceptions -fno-rtti";
|
||||||
|
|
||||||
|
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
|
||||||
|
|
||||||
|
while ($cmd = shift)
|
||||||
|
{
|
||||||
|
if ($cmd =~ /amd64/) {
|
||||||
|
$OPTIONS{"amd64"} = 1;
|
||||||
|
} elsif ($cmd =~ /debug/) {
|
||||||
|
$OPTIONS{"debug"} = 1;
|
||||||
|
} elsif ($cmd =~ /proc=i(\d)86/) {
|
||||||
|
$proc = $1;
|
||||||
|
if ($OPTIONS{"amd64"})
|
||||||
|
{
|
||||||
|
die "You cannot compile for i".$proc."86 and AMD64.\n";
|
||||||
|
} else {
|
||||||
|
$OPTIONS{"proc"} = "i".$proc."86";
|
||||||
|
}
|
||||||
|
} elsif ($cmd =~ /clean/) {
|
||||||
|
$OPTIONS{"clean"} = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$gcc = `$gccf --version`;
|
||||||
|
if ($gcc =~ /2\.9/)
|
||||||
|
{
|
||||||
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
|
} else {
|
||||||
|
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($OPTIONS{"debug"})
|
||||||
|
{
|
||||||
|
$cflags = $OPT{"debug"};
|
||||||
|
} else {
|
||||||
|
if (!$OPTIONS{"amd64"})
|
||||||
|
{
|
||||||
|
$proc = $OPTIONS{"proc"};
|
||||||
|
if (!$proc)
|
||||||
|
{
|
||||||
|
$proc = 3;
|
||||||
|
}
|
||||||
|
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
|
||||||
|
} else {
|
||||||
|
$cflags = $OPT{"opt"};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($OPTIONS{"amd64"})
|
||||||
|
{
|
||||||
|
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($OPTIONS{"debug"})
|
||||||
|
{
|
||||||
|
$outdir = "bin.debug";
|
||||||
|
} else {
|
||||||
|
$outdir = "bin.opt";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($OPTIONS{"amd64"})
|
||||||
|
{
|
||||||
|
$outdir .= ".amd64";
|
||||||
|
$bin = $PROJECT."_amd64.so";
|
||||||
|
} else {
|
||||||
|
$proc = $OPTIONS{"proc"};
|
||||||
|
if ($proc)
|
||||||
|
{
|
||||||
|
$outdir .= ".i".$proc."86";
|
||||||
|
$bin = $PROJECT."_i".$proc."86.so";
|
||||||
|
} else {
|
||||||
|
$outdir .= ".i386";
|
||||||
|
$bin = $PROJECT."_i386.so";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unlink("$outdir/$bin");
|
||||||
|
if ($OPTIONS{"clean"})
|
||||||
|
{
|
||||||
|
`rm $outdir/*.o`;
|
||||||
|
die("Project cleaned.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
#create the dirs
|
||||||
|
#build link list
|
||||||
|
my @LINK;
|
||||||
|
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
||||||
|
{
|
||||||
|
$file = $CPP_SOURCE_FILES[$i];
|
||||||
|
$file =~ s/\.cpp/\.o/;
|
||||||
|
push(@LINK, $outdir."/".$file);
|
||||||
|
}
|
||||||
|
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
|
||||||
|
{
|
||||||
|
$file = $C_SOURCE_FILES[$i];
|
||||||
|
$file =~ s/\.c/\.o/;
|
||||||
|
push(@LINK, $outdir."/".$file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(-d $outdir))
|
||||||
|
{
|
||||||
|
mkdir($outdir);
|
||||||
|
}
|
||||||
|
|
||||||
|
$inc = $OPTIONS{"include"};
|
||||||
|
|
||||||
|
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
||||||
|
{
|
||||||
|
$file = $CPP_SOURCE_FILES[$i];
|
||||||
|
$ofile = $file;
|
||||||
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
|
$ofile = "$outdir/$ofile";
|
||||||
|
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
|
if (-e $ofile)
|
||||||
|
{
|
||||||
|
$file_time = (stat($file))[9];
|
||||||
|
$ofile_time = (stat($ofile))[9];
|
||||||
|
if ($file_time > $ofile_time)
|
||||||
|
{
|
||||||
|
print "$gcc\n";
|
||||||
|
`$gcc`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print "$gcc\n";
|
||||||
|
`$gcc`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
||||||
|
{
|
||||||
|
$file = $C_SOURCE_FILES[$i];
|
||||||
|
$ofile = $file;
|
||||||
|
$ofile =~ s/\.c/\.o/;
|
||||||
|
$ofile = "$outdir/$ofile";
|
||||||
|
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
|
if (-e $ofile)
|
||||||
|
{
|
||||||
|
$file_time = (stat($file))[9];
|
||||||
|
$ofile_time = (stat($ofile))[9];
|
||||||
|
if ($file_time > $ofile_time)
|
||||||
|
{
|
||||||
|
print "$gcc\n";
|
||||||
|
`$gcc`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print "$gcc\n";
|
||||||
|
`$gcc`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
|
print "$gcc\n";
|
||||||
|
`$gcc`;
|
345
dlls/csx/source/WinCSX/CRank.cpp
Executable file
345
dlls/csx/source/WinCSX/CRank.cpp
Executable file
@ -0,0 +1,345 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
//#include "amxxmodule.h"
|
||||||
|
#include "CRank.h"
|
||||||
|
#include <stdio.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
RankSystem::RankStats* RankSystem::findEntryInRankByUnique(const char* unique)
|
||||||
|
{
|
||||||
|
RankStats* a = head;
|
||||||
|
|
||||||
|
while ( a )
|
||||||
|
{
|
||||||
|
if ( strcmp( a->getUnique(), unique ) == 0 )
|
||||||
|
return a;
|
||||||
|
|
||||||
|
a = a->prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL; // none found
|
||||||
|
}
|
||||||
|
RankSystem::RankStats* RankSystem::findEntryInRankByPos(int position)
|
||||||
|
{
|
||||||
|
RankStats* a = head;
|
||||||
|
|
||||||
|
while ( a )
|
||||||
|
{
|
||||||
|
if (a->getPosition() == position)
|
||||||
|
return a;
|
||||||
|
|
||||||
|
a = a->prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int RankSystem::updatePos( RankStats* rr , Stats* s )
|
||||||
|
{
|
||||||
|
RankStats* rrFirst = rr;
|
||||||
|
if (s != NULL)
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rrFirst->getPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RankSystem::loadRank( const char* filename )
|
||||||
|
{
|
||||||
|
FILE *bfp = fopen( filename , "rb" );
|
||||||
|
|
||||||
|
if ( !bfp ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
128
dlls/csx/source/WinCSX/CRank.h
Executable file
128
dlls/csx/source/WinCSX/CRank.h
Executable file
@ -0,0 +1,128 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef CRANK_H
|
||||||
|
#define CRANK_H
|
||||||
|
|
||||||
|
#define RANK_VERSION 11
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#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 int updatePosition( Stats* points ) {
|
||||||
|
return parent->updatePos( this , points );
|
||||||
|
}
|
||||||
|
inline void MarkToDelete() {
|
||||||
|
this->score = (1<<31);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
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 );
|
||||||
|
int updatePos( RankStats* r , Stats* s );
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
RankSystem();
|
||||||
|
~RankSystem();
|
||||||
|
|
||||||
|
void saveRank( const char* filename );
|
||||||
|
bool loadRank( const char* filename );
|
||||||
|
RankStats* findEntryInRank(const char* unique, const char* name );
|
||||||
|
RankStats* findEntryInRankByUnique(const char* unique);
|
||||||
|
RankStats* findEntryInRankByPos(int position);
|
||||||
|
//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
|
53
dlls/csx/source/WinCSX/ReadMe.txt
Executable file
53
dlls/csx/source/WinCSX/ReadMe.txt
Executable file
@ -0,0 +1,53 @@
|
|||||||
|
========================================================================
|
||||||
|
WIN32 APPLICATION : WinCSX Project Overview
|
||||||
|
========================================================================
|
||||||
|
|
||||||
|
AppWizard has created this WinCSX application for you.
|
||||||
|
This file contains a summary of what you will find in each of the files that
|
||||||
|
make up your WinCSX application.
|
||||||
|
|
||||||
|
|
||||||
|
WinCSX.vcproj
|
||||||
|
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||||
|
It contains information about the version of Visual C++ that generated the file, and
|
||||||
|
information about the platforms, configurations, and project features selected with the
|
||||||
|
Application Wizard.
|
||||||
|
|
||||||
|
WinCSX.cpp
|
||||||
|
This is the main application source file.
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
AppWizard has created the following resources:
|
||||||
|
|
||||||
|
WinCSX.rc
|
||||||
|
This is a listing of all of the Microsoft Windows resources that the
|
||||||
|
program uses. It includes the icons, bitmaps, and cursors that are stored
|
||||||
|
in the RES subdirectory. This file can be directly edited in Microsoft
|
||||||
|
Visual C++.
|
||||||
|
|
||||||
|
Resource.h
|
||||||
|
This is the standard header file, which defines new resource IDs.
|
||||||
|
Microsoft Visual C++ reads and updates this file.
|
||||||
|
WinCSX.ico
|
||||||
|
This is an icon file, which is used as the application's icon (32x32).
|
||||||
|
This icon is included by the main resource file WinCSX.rc.
|
||||||
|
|
||||||
|
small.ico
|
||||||
|
This is an icon file, which contains a smaller version (16x16)
|
||||||
|
of the application's icon. This icon is included by the main resource
|
||||||
|
file WinCSX.rc.
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
Other standard files:
|
||||||
|
|
||||||
|
StdAfx.h, StdAfx.cpp
|
||||||
|
These files are used to build a precompiled header (PCH) file
|
||||||
|
named WinCSX.pch and a precompiled types file named StdAfx.obj.
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
Other notes:
|
||||||
|
|
||||||
|
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||||
|
should add to or customize.
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
52
dlls/csx/source/WinCSX/Resource.h
Executable file
52
dlls/csx/source/WinCSX/Resource.h
Executable file
@ -0,0 +1,52 @@
|
|||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Visual C++ generated include file.
|
||||||
|
// Used by WinCSX.rc
|
||||||
|
//
|
||||||
|
#define IDC_MYICON 2
|
||||||
|
#define IDD_WINCSX_DIALOG 102
|
||||||
|
#define IDS_APP_TITLE 103
|
||||||
|
#define IDD_WINCSXBOX 103
|
||||||
|
#define IDM_ABOUT 104
|
||||||
|
#define IDM_EXIT 105
|
||||||
|
#define IDI_WINCSX 107
|
||||||
|
#define IDI_SMALL 108
|
||||||
|
#define IDC_WINCSX 109
|
||||||
|
#define IDR_MAINFRAME 128
|
||||||
|
#define IDD_ABOUTBOX 129
|
||||||
|
#define IDC_LIST 1010
|
||||||
|
#define IDC_BUTTON_ABOUT 1029
|
||||||
|
#define IDC_ABOUT 1029
|
||||||
|
#define IDC_BUTTON_SAVECHANGES 1030
|
||||||
|
#define IDC_BUTTON_CLEARSTATS 1031
|
||||||
|
#define IDC_BUTTON_DELETE 1032
|
||||||
|
#define IDC_EDIT_NAME 1100
|
||||||
|
#define IDC_EDIT_POSITION 1101
|
||||||
|
#define IDC_EDIT_AUTHID 1102
|
||||||
|
#define IDC_EDIT_DAMAGE 1103
|
||||||
|
#define IDC_EDIT_FRAGS 1104
|
||||||
|
#define IDC_EDIT_DEATHS 1105
|
||||||
|
#define IDC_EDIT_TKS 1106
|
||||||
|
#define IDC_EDIT_SHOTS 1107
|
||||||
|
#define IDC_EDIT_HITS 1108
|
||||||
|
#define IDC_EDIT_HS 1109
|
||||||
|
#define IDC_EDIT_PLANTS 1110
|
||||||
|
#define IDC_EDIT_EXPLOSIONS 1111
|
||||||
|
#define IDC_EDIT_DEFUSIONS 1112
|
||||||
|
#define IDC_EDIT_DEFUSED 1113
|
||||||
|
#define IDC_AUTHOR 1114
|
||||||
|
#define ID_HELP_DIALOG 32771
|
||||||
|
#define IDM_FILE_DIALOG 32773
|
||||||
|
#define IDM_WINCSX 32774
|
||||||
|
#define IDC_STATIC -1
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NO_MFC 1
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 32775
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1033
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 110
|
||||||
|
#endif
|
||||||
|
#endif
|
460
dlls/csx/source/WinCSX/WinCSX.cpp
Executable file
460
dlls/csx/source/WinCSX/WinCSX.cpp
Executable file
@ -0,0 +1,460 @@
|
|||||||
|
// WinCSX.cpp : Defines the entry point for the application.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "WinCSX.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||||
|
HINSTANCE hPrevInstance,
|
||||||
|
LPTSTR lpCmdLine,
|
||||||
|
int nCmdShow)
|
||||||
|
{
|
||||||
|
// TODO: Place code here.
|
||||||
|
MSG msg;
|
||||||
|
HACCEL hAccelTable;
|
||||||
|
|
||||||
|
// Initialize global strings
|
||||||
|
LoadString(hInstance, IDS_APP_TITLE, g_szTitle, MAX_LOADSTRING);
|
||||||
|
|
||||||
|
LoadString(hInstance, IDC_WINCSX, g_szWindowClass, MAX_LOADSTRING);
|
||||||
|
MyRegisterClass(hInstance);
|
||||||
|
|
||||||
|
// Perform application initialization:
|
||||||
|
if (!InitInstance (hInstance, nCmdShow))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINCSX);
|
||||||
|
|
||||||
|
// Show the dialog box now.
|
||||||
|
DialogBox(hInst, (LPCTSTR)IDD_WINCSXBOX, g_hWnd, (DLGPROC)WinCSXBox);
|
||||||
|
|
||||||
|
// Main message loop:
|
||||||
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
|
{
|
||||||
|
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||||
|
{
|
||||||
|
TranslateMessage(&msg);
|
||||||
|
DispatchMessage(&msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (int) msg.wParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// FUNCTION: MyRegisterClass()
|
||||||
|
//
|
||||||
|
// PURPOSE: Registers the window class.
|
||||||
|
//
|
||||||
|
// COMMENTS:
|
||||||
|
//
|
||||||
|
// This function and its usage are only necessary if you want this code
|
||||||
|
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
|
||||||
|
// function that was added to Windows 95. It is important to call this function
|
||||||
|
// so that the application will get 'well formed' small icons associated
|
||||||
|
// with it.
|
||||||
|
//
|
||||||
|
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||||
|
{
|
||||||
|
WNDCLASSEX wcex;
|
||||||
|
|
||||||
|
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||||
|
|
||||||
|
wcex.style = 0; // CS_HREDRAW | CS_VREDRAW;
|
||||||
|
wcex.lpfnWndProc = (WNDPROC)WndProc;
|
||||||
|
wcex.cbClsExtra = 0;
|
||||||
|
wcex.cbWndExtra = 0;
|
||||||
|
wcex.hInstance = hInstance;
|
||||||
|
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_WINCSX);
|
||||||
|
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
|
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||||
|
wcex.lpszMenuName = (LPCTSTR)IDC_WINCSX;
|
||||||
|
wcex.lpszClassName = g_szWindowClass;
|
||||||
|
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
|
||||||
|
|
||||||
|
return RegisterClassEx(&wcex);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FUNCTION: InitInstance(HANDLE, int)
|
||||||
|
//
|
||||||
|
// PURPOSE: Saves instance handle and creates main window
|
||||||
|
//
|
||||||
|
// COMMENTS:
|
||||||
|
//
|
||||||
|
// In this function, we save the instance handle in a global variable and
|
||||||
|
// create and display the main program window.
|
||||||
|
//
|
||||||
|
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||||
|
{
|
||||||
|
hInst = hInstance; // Store instance handle in our global variable
|
||||||
|
|
||||||
|
g_hWnd = CreateWindow(g_szWindowClass, g_szTitle, WS_DLGFRAME, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, hInstance, NULL); // WS_OVERLAPPED WS_MINIMIZE
|
||||||
|
|
||||||
|
if (!g_hWnd)
|
||||||
|
{
|
||||||
|
MessageBox(g_hWnd, "Failed to create main window!", "A caption", MB_OK);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowWindow(g_hWnd, SW_SHOWMINNOACTIVE); // nCmdShow SW_SHOWNORMAL were rubbish. SW_SHOWMINNOACTIVE looks ok.
|
||||||
|
UpdateWindow(g_hWnd);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LoadRankFromFile(HWND hDlg) {
|
||||||
|
if ( !g_rank.begin() )
|
||||||
|
{
|
||||||
|
if (!g_rank.loadRank(STATS_FILENAME)) {
|
||||||
|
MessageBox(hDlg, "File load failed! Make sure you have csstats.dat in the same directory as this executable. Exiting...", "Where IS that file of yours?", MB_OK);
|
||||||
|
PostQuitMessage(0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
|
||||||
|
//
|
||||||
|
// PURPOSE: Processes messages for the main window.
|
||||||
|
//
|
||||||
|
// WM_COMMAND - process the application menu
|
||||||
|
// WM_PAINT - Paint the main window
|
||||||
|
// WM_DESTROY - post a quit message and return
|
||||||
|
//
|
||||||
|
//
|
||||||
|
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
//int wmId, wmEvent;
|
||||||
|
PAINTSTRUCT ps;
|
||||||
|
HDC hdc;
|
||||||
|
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_PAINT:
|
||||||
|
hdc = BeginPaint(hWnd, &ps);
|
||||||
|
// TODO: Add any drawing code here...
|
||||||
|
EndPaint(hWnd, &ps);
|
||||||
|
break;
|
||||||
|
case WM_DESTROY:
|
||||||
|
PostQuitMessage(0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateListBox(HWND hDlg) {
|
||||||
|
HWND listbox = GetDlgItem(hDlg, IDC_LIST);
|
||||||
|
|
||||||
|
// Clear first if there's anything in here already
|
||||||
|
SendMessage(listbox, LB_RESETCONTENT, NULL, NULL);
|
||||||
|
|
||||||
|
if (g_rank.front() == NULL) {
|
||||||
|
MessageBox(hDlg, "The stats file is empty", "Emptiness...", MB_OK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// This part copies the occurring authids into the lefthand listbox.
|
||||||
|
int index = 10, len = 0;
|
||||||
|
char tempbuffer[1024];
|
||||||
|
|
||||||
|
for (RankSystem::iterator b = g_rank.front(); b; --b) {
|
||||||
|
//if ((*b).getPosition() < 1) // umm... naaah!
|
||||||
|
//continue;
|
||||||
|
|
||||||
|
_snprintf(tempbuffer, 1023, "%s", (*b).getName());
|
||||||
|
|
||||||
|
SendMessage( // returns LRESULT in lResult
|
||||||
|
listbox, // handle to destination control
|
||||||
|
LB_ADDSTRING, // message ID
|
||||||
|
0, // = (WPARAM) () wParam;
|
||||||
|
(LPARAM) tempbuffer // = (LPARAM) () lParam;
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT InitWinCSXBox(HWND hDlg) {
|
||||||
|
// Load the stats
|
||||||
|
if (!LoadRankFromFile(hDlg))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
UpdateListBox(hDlg);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClearStatsfields(HWND hDlg) {
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_POSITION, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_NAME, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_AUTHID, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_FRAGS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_DEATHS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_HS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_TKS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_SHOTS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_HITS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_DAMAGE, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_PLANTS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_EXPLOSIONS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_DEFUSIONS, "");
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_DEFUSED, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListboxItemSelected(HWND hDlg) {
|
||||||
|
HWND hwndList = GetDlgItem(hDlg, IDC_LIST); // Get the handle of the listbox
|
||||||
|
LRESULT nItem = SendMessage(hwndList, LB_GETCURSEL, 0, 0); // Get the item # that's selected. First item is prolly 0...
|
||||||
|
if (nItem == LB_ERR) {
|
||||||
|
// Error, reset the form items...
|
||||||
|
//MessageBox(hDlg, "Error: Couldn't find the selected record in the listbox!", "Oh fiddlesticks!", MB_OK);
|
||||||
|
ClearStatsfields(hDlg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Retrieve complete stats record of this position. Position in listbox should be same as rank in our records!
|
||||||
|
RankSystem::RankStats* stats = g_rank.findEntryInRankByPos((int)nItem + 1);
|
||||||
|
if (stats == NULL) {
|
||||||
|
char msg[] = "Error: Couldn't find the record by position! (nItem = %d)";
|
||||||
|
sprintf(msg, msg, nItem);
|
||||||
|
MessageBox(hDlg, msg, "Oh fiddlesticks!", MB_OK);
|
||||||
|
ClearStatsfields(hDlg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Copy data into form
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_POSITION, stats->getPosition(), 0);
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_NAME, stats->getName());
|
||||||
|
SetDlgItemText(hDlg, IDC_EDIT_AUTHID, stats->getUnique());
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_FRAGS, stats->kills, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_DEATHS, stats->deaths, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_HS, stats->hs, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_TKS, stats->tks, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_SHOTS, stats->shots, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_HITS, stats->hits, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_DAMAGE, stats->damage, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_PLANTS, stats->bPlants, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_EXPLOSIONS, stats->bExplosions, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_DEFUSIONS, stats->bDefusions, 0);
|
||||||
|
SetDlgItemInt(hDlg, IDC_EDIT_DEFUSED, stats->bDefused, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SaveChanges(HWND hDlg) {
|
||||||
|
BOOL success;
|
||||||
|
int position = GetDlgItemInt(hDlg, IDC_EDIT_POSITION, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
|
||||||
|
char authid[32]; // "primary key"
|
||||||
|
GetDlgItemText(hDlg, IDC_EDIT_AUTHID, authid, sizeof(authid));
|
||||||
|
RankSystem::RankStats* entry = g_rank.findEntryInRankByUnique(authid);
|
||||||
|
if (!entry) {
|
||||||
|
char buffer[256];
|
||||||
|
sprintf(buffer, "Authid %s not found!", authid);
|
||||||
|
MessageBox(hDlg, buffer, "Update failed", MB_OK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
char name[32];
|
||||||
|
GetDlgItemText(hDlg, IDC_EDIT_NAME, name, sizeof(name));
|
||||||
|
int frags = GetDlgItemInt(hDlg, IDC_EDIT_FRAGS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int deaths = GetDlgItemInt(hDlg, IDC_EDIT_DEATHS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int hs = GetDlgItemInt(hDlg, IDC_EDIT_HS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int tks = GetDlgItemInt(hDlg, IDC_EDIT_TKS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int shots = GetDlgItemInt(hDlg, IDC_EDIT_SHOTS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int hits = GetDlgItemInt(hDlg, IDC_EDIT_HITS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int damage = GetDlgItemInt(hDlg, IDC_EDIT_DAMAGE, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int plants = GetDlgItemInt(hDlg, IDC_EDIT_PLANTS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int explosions = GetDlgItemInt(hDlg, IDC_EDIT_EXPLOSIONS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int defusions = GetDlgItemInt(hDlg, IDC_EDIT_DEFUSIONS, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
int defused = GetDlgItemInt(hDlg, IDC_EDIT_DEFUSED, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
|
||||||
|
// Update stats in memory
|
||||||
|
entry->setName(name);
|
||||||
|
entry->kills = frags;
|
||||||
|
entry->deaths = deaths;
|
||||||
|
entry->hs = hs;
|
||||||
|
entry->tks = tks;
|
||||||
|
entry->shots = shots;
|
||||||
|
entry->hits = hits;
|
||||||
|
entry->damage = damage;
|
||||||
|
entry->bPlants = plants;
|
||||||
|
entry->bExplosions = explosions;
|
||||||
|
entry->bDefusions = defusions;
|
||||||
|
entry->bDefused = defused;
|
||||||
|
|
||||||
|
int newPosition = entry->updatePosition(NULL); // Updates rank (prolly just calculates "frags - deaths" and moves up/down in rank)
|
||||||
|
|
||||||
|
g_rank.saveRank(STATS_FILENAME); // Save changes to file
|
||||||
|
|
||||||
|
// Now update our listbox
|
||||||
|
UpdateListBox(hDlg);
|
||||||
|
|
||||||
|
char buffer[256];
|
||||||
|
_snprintf(buffer, 255, "New rank of %s: %d", name, newPosition);
|
||||||
|
MessageBox(hDlg, buffer, "Update succeeded", MB_OK);
|
||||||
|
|
||||||
|
// In the listbox, we need to reselect the item we just updated. Use the new name.
|
||||||
|
HWND listbox = GetDlgItem(hDlg, IDC_LIST);
|
||||||
|
if (SendMessage(listbox, LB_SELECTSTRING, newPosition - 1, (LPARAM)name) == LB_ERR)
|
||||||
|
MessageBox(hDlg, "Error selecting item!", "Oh fiddlesticks!", MB_OK);
|
||||||
|
else {
|
||||||
|
// Update
|
||||||
|
ListboxItemSelected(hDlg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
BadEnd:
|
||||||
|
MessageBox(hDlg, "Update failed", "Oh fiddlesticks!", MB_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClearStats(HWND hDlg) {
|
||||||
|
if (MessageBox(hDlg, "Are you sure? If you continue the whole csstats.dat will be wiped out!", "Omg!", MB_OKCANCEL | MB_DEFBUTTON2 | MB_ICONWARNING) != IDOK)
|
||||||
|
return;
|
||||||
|
g_rank.clear();
|
||||||
|
g_rank.saveRank(STATS_FILENAME);
|
||||||
|
|
||||||
|
// Now update our listbox
|
||||||
|
UpdateListBox(hDlg);
|
||||||
|
|
||||||
|
// Update
|
||||||
|
ListboxItemSelected(hDlg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeleteRecord(HWND hDlg) {
|
||||||
|
if (MessageBox(hDlg, "Are you sure?", "Omg!", MB_OKCANCEL | MB_DEFBUTTON2 | MB_ICONWARNING) != IDOK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BOOL success;
|
||||||
|
int position = GetDlgItemInt(hDlg, IDC_EDIT_POSITION, &success, false);
|
||||||
|
if (!success)
|
||||||
|
goto BadEnd;
|
||||||
|
|
||||||
|
char authid[32]; // "primary key"
|
||||||
|
GetDlgItemText(hDlg, IDC_EDIT_AUTHID, authid, sizeof(authid));
|
||||||
|
RankSystem::RankStats* entry = g_rank.findEntryInRankByUnique(authid);
|
||||||
|
if (!entry) {
|
||||||
|
char buffer[256];
|
||||||
|
sprintf(buffer, "Authid %s not found!", authid);
|
||||||
|
MessageBox(hDlg, buffer, "Update failed", MB_OK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mark this record to delete it.
|
||||||
|
entry->MarkToDelete();
|
||||||
|
|
||||||
|
// Save ranks from memory to disk.
|
||||||
|
g_rank.saveRank(STATS_FILENAME); // Save changes to file
|
||||||
|
|
||||||
|
// Clear memory.
|
||||||
|
g_rank.clear();
|
||||||
|
|
||||||
|
// Reload from disk into memory.
|
||||||
|
LoadRankFromFile(hDlg);
|
||||||
|
|
||||||
|
// Update list box.
|
||||||
|
UpdateListBox(hDlg);
|
||||||
|
|
||||||
|
MessageBox(hDlg, "Deleted record", "Delete succeeded", MB_OK);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
BadEnd:
|
||||||
|
MessageBox(hDlg, "Delete failed", "Oh fiddlesticks!", MB_OK);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Message handler for WinCSXBox.
|
||||||
|
LRESULT CALLBACK WinCSXBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
return InitWinCSXBox(hDlg); // load all data from file and fill the listbox with the shit
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
|
case IDOK:
|
||||||
|
case IDCANCEL:
|
||||||
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
|
PostQuitMessage(0);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
case IDC_LIST:
|
||||||
|
switch (HIWORD(wParam))
|
||||||
|
{
|
||||||
|
case LBN_SELCHANGE:
|
||||||
|
// Omg omg, a line in linebox was selected.
|
||||||
|
ListboxItemSelected(hDlg);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case IDC_ABOUT:
|
||||||
|
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hDlg, (DLGPROC)AboutBox);
|
||||||
|
break;
|
||||||
|
case IDC_BUTTON_SAVECHANGES:
|
||||||
|
SaveChanges(hDlg);
|
||||||
|
break;
|
||||||
|
case IDC_BUTTON_CLEARSTATS:
|
||||||
|
ClearStats(hDlg);
|
||||||
|
break;
|
||||||
|
case IDC_BUTTON_DELETE:
|
||||||
|
DeleteRecord(hDlg);
|
||||||
|
//DialogBox(hInst, (LPCTSTR)IDD_DELETEBOX, hDlg, (DLGPROC)DeleteBox);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Message handler for AboutBox.
|
||||||
|
LRESULT CALLBACK AboutBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case WM_COMMAND:
|
||||||
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
|
case IDOK:
|
||||||
|
case IDCANCEL:
|
||||||
|
EndDialog(hDlg, LOWORD(wParam));
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
25
dlls/csx/source/WinCSX/WinCSX.h
Executable file
25
dlls/csx/source/WinCSX/WinCSX.h
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "resource.h"
|
||||||
|
#include "CRank.h"
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
#define MAX_LOADSTRING 100
|
||||||
|
#define VERSION "0.2"
|
||||||
|
#define STATS_FILENAME "csstats.dat"
|
||||||
|
|
||||||
|
// Global Variables:
|
||||||
|
HINSTANCE hInst; // current instance
|
||||||
|
TCHAR g_szTitle[MAX_LOADSTRING]; // The title bar text
|
||||||
|
TCHAR g_szWindowClass[MAX_LOADSTRING]; // the main window class name
|
||||||
|
RankSystem g_rank;
|
||||||
|
HWND g_hWnd;
|
||||||
|
|
||||||
|
// Forward declarations of functions included in this code module:
|
||||||
|
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||||
|
BOOL InitInstance(HINSTANCE, int);
|
||||||
|
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
LRESULT CALLBACK WinCSXBox(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
LRESULT CALLBACK AboutBox(HWND, UINT, WPARAM, LPARAM);
|
||||||
|
bool LoadRankFromFile(HWND hDlg);
|
||||||
|
|
BIN
dlls/csx/source/WinCSX/WinCSX.ico
Executable file
BIN
dlls/csx/source/WinCSX/WinCSX.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
216
dlls/csx/source/WinCSX/WinCSX.rc
Executable file
216
dlls/csx/source/WinCSX/WinCSX.rc
Executable file
@ -0,0 +1,216 @@
|
|||||||
|
// Microsoft Visual C++ generated resource script.
|
||||||
|
//
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||||
|
#include "windows.h"
|
||||||
|
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Swedish resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Icon
|
||||||
|
//
|
||||||
|
|
||||||
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
|
// remains consistent on all systems.
|
||||||
|
IDI_WINCSX ICON "WinCSX.ico"
|
||||||
|
IDI_SMALL ICON "small.ico"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Menu
|
||||||
|
//
|
||||||
|
|
||||||
|
IDC_WINCSX MENU
|
||||||
|
BEGIN
|
||||||
|
POPUP "&File"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "WinCSX", IDM_WINCSX
|
||||||
|
MENUITEM "E&xit", IDM_EXIT
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Accelerator
|
||||||
|
//
|
||||||
|
|
||||||
|
IDC_WINCSX ACCELERATORS
|
||||||
|
BEGIN
|
||||||
|
"?", IDM_ABOUT, ASCII, ALT
|
||||||
|
"/", IDM_ABOUT, ASCII, ALT
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Dialog
|
||||||
|
//
|
||||||
|
|
||||||
|
IDD_WINCSXBOX DIALOGEX 22, 17, 253, 204
|
||||||
|
STYLE DS_ABSALIGN | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION |
|
||||||
|
WS_SYSMENU
|
||||||
|
CAPTION "WinCSX"
|
||||||
|
FONT 8, "System", 0, 0, 0x0
|
||||||
|
BEGIN
|
||||||
|
DEFPUSHBUTTON "Close",IDOK,206,168,39,27,WS_GROUP
|
||||||
|
LISTBOX IDC_LIST,4,5,94,190,LBS_HASSTRINGS |
|
||||||
|
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||||
|
EDITTEXT IDC_EDIT_NAME,109,18,87,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_POSITION,206,18,39,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_AUTHID,109,48,87,12,ES_AUTOHSCROLL |
|
||||||
|
ES_READONLY
|
||||||
|
EDITTEXT IDC_EDIT_DAMAGE,206,48,39,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_FRAGS,109,78,40,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_DEATHS,157,78,40,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_TKS,206,78,39,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_SHOTS,109,108,40,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_HITS,157,108,40,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_HS,206,108,39,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_PLANTS,109,138,40,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_EXPLOSIONS,157,137,40,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_DEFUSIONS,206,137,39,12,ES_AUTOHSCROLL
|
||||||
|
EDITTEXT IDC_EDIT_DEFUSED,109,168,40,12,ES_AUTOHSCROLL
|
||||||
|
LTEXT "Name (last used)",IDC_STATIC,109,5,56,8
|
||||||
|
LTEXT "Damage",IDC_STATIC,206,35,28,8
|
||||||
|
LTEXT "Frags",IDC_STATIC,109,65,20,8
|
||||||
|
LTEXT "Headshots",IDC_STATIC,206,95,36,8
|
||||||
|
LTEXT "Team kills",IDC_STATIC,206,65,35,8
|
||||||
|
LTEXT "Hits",IDC_STATIC,157,95,14,8
|
||||||
|
LTEXT "Shots",IDC_STATIC,109,95,20,8
|
||||||
|
LTEXT "Deaths",IDC_STATIC,157,65,24,8
|
||||||
|
LTEXT "Authid",IDC_STATIC,109,35,21,8
|
||||||
|
LTEXT "Position",IDC_STATIC,206,5,28,8
|
||||||
|
LTEXT "Plants",IDC_STATIC,109,125,22,8
|
||||||
|
LTEXT "Explosions",IDC_STATIC,157,125,38,8
|
||||||
|
LTEXT "Defused",IDC_STATIC,109,155,28,8
|
||||||
|
LTEXT "Defusions",IDC_STATIC,206,125,34,8
|
||||||
|
PUSHBUTTON "About",IDC_ABOUT,109,185,40,10
|
||||||
|
PUSHBUTTON "Save",IDC_BUTTON_SAVECHANGES,157,155,39,8
|
||||||
|
PUSHBUTTON "Clear stats",IDC_BUTTON_CLEARSTATS,157,168,39,27
|
||||||
|
PUSHBUTTON "Delete",IDC_BUTTON_DELETE,206,155,39,8
|
||||||
|
END
|
||||||
|
|
||||||
|
IDD_ABOUTBOX DIALOGEX 0, 0, 186, 95
|
||||||
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
|
||||||
|
WS_SYSMENU
|
||||||
|
CAPTION "About"
|
||||||
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
|
BEGIN
|
||||||
|
DEFPUSHBUTTON "OK",IDOK,109,68,50,14
|
||||||
|
LTEXT "WinCSX 0.3",IDC_STATIC,18,20,66,8
|
||||||
|
LTEXT "By JGHG",IDC_STATIC,18,28,66,8
|
||||||
|
LTEXT "2005",IDC_STATIC,18,36,66,8
|
||||||
|
LTEXT "http://www.amxmodx.org/",IDC_STATIC,18,44,88,8
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||||
|
"#include ""windows.h""\r\n"
|
||||||
|
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// DESIGNINFO
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO
|
||||||
|
BEGIN
|
||||||
|
IDD_WINCSXBOX, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 4
|
||||||
|
RIGHTMARGIN, 248
|
||||||
|
VERTGUIDE, 98
|
||||||
|
VERTGUIDE, 109
|
||||||
|
VERTGUIDE, 157
|
||||||
|
VERTGUIDE, 196
|
||||||
|
VERTGUIDE, 206
|
||||||
|
VERTGUIDE, 245
|
||||||
|
TOPMARGIN, 5
|
||||||
|
BOTTOMMARGIN, 195
|
||||||
|
HORZGUIDE, 18
|
||||||
|
HORZGUIDE, 35
|
||||||
|
HORZGUIDE, 48
|
||||||
|
HORZGUIDE, 65
|
||||||
|
HORZGUIDE, 78
|
||||||
|
HORZGUIDE, 95
|
||||||
|
HORZGUIDE, 108
|
||||||
|
HORZGUIDE, 125
|
||||||
|
HORZGUIDE, 137
|
||||||
|
HORZGUIDE, 155
|
||||||
|
HORZGUIDE, 163
|
||||||
|
HORZGUIDE, 168
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// String Table
|
||||||
|
//
|
||||||
|
|
||||||
|
STRINGTABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_APP_TITLE "WinCSX"
|
||||||
|
IDC_WINCSX "WINCSX"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // Swedish resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
187
dlls/csx/source/WinCSX/WinCSX.vcproj
Executable file
187
dlls/csx/source/WinCSX/WinCSX.vcproj
Executable file
@ -0,0 +1,187 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="7.10"
|
||||||
|
Name="WinCSX"
|
||||||
|
ProjectGUID="{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||||
|
Keyword="Win32Proj">
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"/>
|
||||||
|
</Platforms>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="Debug"
|
||||||
|
IntermediateDirectory="Debug"
|
||||||
|
ConfigurationType="1"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||||
|
MinimalRebuild="TRUE"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="5"
|
||||||
|
UsePrecompiledHeader="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
|
DebugInformationFormat="4"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="$(OutDir)/WinCSX.exe"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile="$(OutDir)/WinCSX.pdb"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"/>
|
||||||
|
<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="1"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||||
|
RuntimeLibrary="4"
|
||||||
|
UsePrecompiledHeader="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
|
DebugInformationFormat="3"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="$(OutDir)/WinCSX.exe"
|
||||||
|
LinkIncremental="1"
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
SubSystem="2"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"/>
|
||||||
|
<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;def;odl;idl;hpj;bat;asm;asmx"
|
||||||
|
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||||
|
<File
|
||||||
|
RelativePath=".\stdafx.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
UsePrecompiledHeader="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
UsePrecompiledHeader="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\WinCSX.cpp">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||||
|
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||||
|
<File
|
||||||
|
RelativePath=".\Resource.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\stdafx.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\WinCSX.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||||
|
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||||
|
<File
|
||||||
|
RelativePath=".\small.ico">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\WinCSX.ico">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\WinCSX.rc">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Dependencies"
|
||||||
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath=".\amxxmodule.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\amxxmodule.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\CRank.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\CRank.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\moduleconfig.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ReadMe.txt">
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
3049
dlls/csx/source/WinCSX/amxxmodule.cpp
Executable file
3049
dlls/csx/source/WinCSX/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2197
dlls/csx/source/WinCSX/amxxmodule.h
Executable file
2197
dlls/csx/source/WinCSX/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
462
dlls/csx/source/WinCSX/moduleconfig.h
Executable file
462
dlls/csx/source/WinCSX/moduleconfig.h
Executable file
@ -0,0 +1,462 @@
|
|||||||
|
// Configuration
|
||||||
|
|
||||||
|
#ifndef __MODULECONFIG_H__
|
||||||
|
#define __MODULECONFIG_H__
|
||||||
|
|
||||||
|
// Module info
|
||||||
|
#define MODULE_NAME "CSX"
|
||||||
|
#define MODULE_VERSION "1.00"
|
||||||
|
#define MODULE_AUTHOR "AMX Mod X 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__
|
BIN
dlls/csx/source/WinCSX/small.ico
Executable file
BIN
dlls/csx/source/WinCSX/small.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
8
dlls/csx/source/WinCSX/stdafx.cpp
Executable file
8
dlls/csx/source/WinCSX/stdafx.cpp
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
// stdafx.cpp : source file that includes just the standard includes
|
||||||
|
// WinCSX.pch will be the pre-compiled header
|
||||||
|
// stdafx.obj will contain the pre-compiled type information
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
// TODO: reference any additional headers you need in STDAFX.H
|
||||||
|
// and not in this file
|
20
dlls/csx/source/WinCSX/stdafx.h
Executable file
20
dlls/csx/source/WinCSX/stdafx.h
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
// stdafx.h : include file for standard system include files,
|
||||||
|
// or project specific include files that are used frequently, but
|
||||||
|
// are changed infrequently
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||||
|
// Windows Header Files:
|
||||||
|
#include <windows.h>
|
||||||
|
// C RunTime Header Files
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <memory.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
|
||||||
|
// TODO: reference additional headers your program requires here
|
||||||
|
//#include "CRank.h"
|
||||||
|
//#include "amx.h"
|
@ -45,6 +45,16 @@
|
|||||||
enginefuncs_t g_engfuncs;
|
enginefuncs_t g_engfuncs;
|
||||||
globalvars_t *gpGlobals;
|
globalvars_t *gpGlobals;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable;
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
|
enginefuncs_t *g_pengfuncsTable;
|
||||||
|
enginefuncs_t *g_pengfuncsTable_Post;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable;
|
||||||
|
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post;
|
||||||
|
|
||||||
|
|
||||||
// GetEntityAPI2 functions
|
// GetEntityAPI2 functions
|
||||||
static DLL_FUNCTIONS g_EntityAPI_Table =
|
static DLL_FUNCTIONS g_EntityAPI_Table =
|
||||||
{
|
{
|
||||||
@ -2114,6 +2124,7 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
||||||
|
g_pFunctionTable=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2131,7 +2142,7 @@ C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interface
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
g_pFunctionTable_Post=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2154,6 +2165,7 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2171,6 +2183,7 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable_Post=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2195,6 +2208,7 @@ C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable,
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2212,6 +2226,7 @@ C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, i
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||||
|
g_pNewFunctionsTable_Post=pNewFunctionTable;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2439,11 +2454,14 @@ PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
|||||||
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
PFN_LOG g_fn_Log;
|
PFN_LOG g_fn_Log;
|
||||||
|
PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||||
PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
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_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||||
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||||
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
||||||
@ -2453,6 +2471,7 @@ PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized;
|
|||||||
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
||||||
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
||||||
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
||||||
|
PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||||
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
||||||
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
||||||
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
||||||
@ -2525,6 +2544,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
|
REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
@ -2560,7 +2580,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
||||||
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
||||||
REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY);
|
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
|
// Player
|
||||||
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
||||||
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
||||||
@ -2572,6 +2593,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
||||||
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
||||||
REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID);
|
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("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS);
|
||||||
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
||||||
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
||||||
@ -2626,7 +2648,19 @@ void MF_Log(const char *fmt, ...)
|
|||||||
vsprintf(msg, fmt, arglst);
|
vsprintf(msg, fmt, arglst);
|
||||||
va_end(arglst);
|
va_end(arglst);
|
||||||
|
|
||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
// :TODO: Overflow possible here
|
||||||
|
char msg[3072];
|
||||||
|
va_list arglst;
|
||||||
|
va_start(arglst, fmt);
|
||||||
|
vsprintf(msg, fmt, arglst);
|
||||||
|
va_end(arglst);
|
||||||
|
|
||||||
|
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2649,11 +2683,14 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_GetAmxStringLen(NULL);
|
MF_GetAmxStringLen(NULL);
|
||||||
MF_CopyAmxMemory(NULL, NULL, 0);
|
MF_CopyAmxMemory(NULL, NULL, 0);
|
||||||
MF_Log("str", "str", 0);
|
MF_Log("str", "str", 0);
|
||||||
|
MF_LogError(NULL, 0, NULL);
|
||||||
MF_RaiseAmxError(NULL, 0);
|
MF_RaiseAmxError(NULL, 0);
|
||||||
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
||||||
MF_ExecuteForward(0, 0, 0);
|
MF_ExecuteForward(0, 0, 0);
|
||||||
MF_PrepareCellArray(NULL, 0);
|
MF_PrepareCellArray(NULL, 0);
|
||||||
MF_PrepareCharArray(NULL, 0);
|
MF_PrepareCharArray(NULL, 0);
|
||||||
|
MF_PrepareCellArrayA(NULL, 0, true);
|
||||||
|
MF_PrepareCharArrayA(NULL, 0, true);
|
||||||
MF_IsPlayerValid(0);
|
MF_IsPlayerValid(0);
|
||||||
MF_GetPlayerName(0);
|
MF_GetPlayerName(0);
|
||||||
MF_GetPlayerIP(0);
|
MF_GetPlayerIP(0);
|
||||||
@ -2664,6 +2701,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_GetPlayerPlayTime(0);
|
MF_GetPlayerPlayTime(0);
|
||||||
MF_GetPlayerCurweapon(0);
|
MF_GetPlayerCurweapon(0);
|
||||||
MF_GetPlayerTeamID(0);
|
MF_GetPlayerTeamID(0);
|
||||||
|
MF_GetPlayerTeam(0);
|
||||||
MF_GetPlayerDeaths(0);
|
MF_GetPlayerDeaths(0);
|
||||||
MF_GetPlayerMenu(0);
|
MF_GetPlayerMenu(0);
|
||||||
MF_GetPlayerKeys(0);
|
MF_GetPlayerKeys(0);
|
||||||
|
@ -55,7 +55,7 @@ struct amxx_module_info_s
|
|||||||
// The next section is copied from the amx.h file
|
// The next section is copied from the amx.h file
|
||||||
// Copyright (c) ITB CompuPhase, 1997-2004
|
// Copyright (c) ITB CompuPhase, 1997-2004
|
||||||
|
|
||||||
#if defined __LCC__ || defined __DMC__ || defined __linux__
|
#if defined __LCC__ || defined __DMC__ || defined __linux__ || defined __GNUC__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||||
@ -929,7 +929,7 @@ void FN_EngineFprintf(FILE *pfile, char *szFmt, ...);
|
|||||||
#endif // FN_EngineFprintf
|
#endif // FN_EngineFprintf
|
||||||
|
|
||||||
#ifdef FN_PvAllocEntPrivateData
|
#ifdef FN_PvAllocEntPrivateData
|
||||||
void *FN_PvAllocEntPrivateData(edict_t *pEdict, long cb);
|
void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb);
|
||||||
#endif // FN_PvAllocEntPrivateData
|
#endif // FN_PvAllocEntPrivateData
|
||||||
|
|
||||||
#ifdef FN_PvEntPrivateData
|
#ifdef FN_PvEntPrivateData
|
||||||
@ -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 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_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/);
|
||||||
typedef void (*PFN_LOG) (const char * /*fmt*/, ...);
|
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_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/);
|
||||||
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
||||||
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
||||||
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
||||||
typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*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 int (*PFN_IS_PLAYER_VALID) (int /*id*/);
|
||||||
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
||||||
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
||||||
@ -1934,6 +1937,7 @@ typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/);
|
|||||||
typedef float (*PFN_GET_PLAYER_PLAYTIME) (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 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_TEAMID) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_MENU) (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_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||||
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||||
extern PFN_LOG g_fn_Log;
|
extern PFN_LOG g_fn_Log;
|
||||||
|
extern PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||||
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||||
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||||
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||||
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||||
extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
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_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||||
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||||
extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
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_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
extern PFN_FORMAT g_fn_Format;
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// 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) { }
|
char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { }
|
||||||
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
||||||
void MF_Log (const char * fmt, ...) { }
|
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_RaiseAmxError (AMX * amx, int error) { }
|
||||||
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
||||||
int MF_ExecuteForward (int id, ...) { }
|
int MF_ExecuteForward (int id, ...) { }
|
||||||
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
||||||
cell MF_PrepareCharArray (char * 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) { }
|
int MF_IsPlayerValid (int id) { }
|
||||||
const char * MF_GetPlayerName (int id) { }
|
const char * MF_GetPlayerName (int id) { }
|
||||||
const char * MF_GetPlayerIP (int id) { }
|
const char * MF_GetPlayerIP (int id) { }
|
||||||
@ -2059,6 +2070,7 @@ int MF_IsPlayerAuthorized (int id) { }
|
|||||||
float MF_GetPlayerTime (int id) { }
|
float MF_GetPlayerTime (int id) { }
|
||||||
float MF_GetPlayerPlayTime (int id) { }
|
float MF_GetPlayerPlayTime (int id) { }
|
||||||
int MF_GetPlayerCurweapon (int id) { }
|
int MF_GetPlayerCurweapon (int id) { }
|
||||||
|
const char * MF_GetPlayerTeam (int id) { }
|
||||||
int MF_GetPlayerTeamID (int id) { }
|
int MF_GetPlayerTeamID (int id) { }
|
||||||
int MF_GetPlayerDeaths (int id) { }
|
int MF_GetPlayerDeaths (int id) { }
|
||||||
int MF_GetPlayerMenu (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_GetAmxStringLen g_fn_GetAmxStringLen
|
||||||
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
||||||
void MF_Log(const char *fmt, ...);
|
void MF_Log(const char *fmt, ...);
|
||||||
|
void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||||
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
||||||
#define MF_RegisterForward g_fn_RegisterForward
|
#define MF_RegisterForward g_fn_RegisterForward
|
||||||
#define MF_ExecuteForward g_fn_ExecuteForward
|
#define MF_ExecuteForward g_fn_ExecuteForward
|
||||||
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
||||||
#define MF_PrepareCharArray g_fn_PrepareCharArray
|
#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_IsPlayerValid g_fn_IsPlayerValid
|
||||||
#define MF_GetPlayerName g_fn_GetPlayerName
|
#define MF_GetPlayerName g_fn_GetPlayerName
|
||||||
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
||||||
@ -2108,6 +2123,7 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
||||||
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
||||||
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
||||||
|
#define MF_GetPlayerTeam g_fn_GetPlayerTeam
|
||||||
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
||||||
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
||||||
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
||||||
@ -2133,7 +2149,7 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#define MF_Format g_fn_Format;
|
#define MF_Format g_fn_Format
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
|
@ -48,6 +48,8 @@ int gmsgSendAudio;
|
|||||||
int gmsgTextMsg;
|
int gmsgTextMsg;
|
||||||
int gmsgBarTime;
|
int gmsgBarTime;
|
||||||
|
|
||||||
|
int g_CurrentMsg;
|
||||||
|
|
||||||
cvar_t init_csstats_maxsize ={"csstats_maxsize","3500", 0 , 3500.0 };
|
cvar_t init_csstats_maxsize ={"csstats_maxsize","3500", 0 , 3500.0 };
|
||||||
cvar_t init_csstats_reset ={"csstats_reset","0"};
|
cvar_t init_csstats_reset ={"csstats_reset","0"};
|
||||||
cvar_t init_csstats_rank ={"csstats_rank","0"};
|
cvar_t init_csstats_rank ={"csstats_rank","0"};
|
||||||
@ -110,6 +112,18 @@ const char* get_localinfo( const char* name , const char* def = 0 )
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientKill(edict_t *pEntity){
|
||||||
|
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||||
|
if ( !pPlayer->IsAlive())
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
|
||||||
|
MF_ExecuteForward( iFDamage,pPlayer->index , pPlayer->index , 0, 0, 0, 0 );
|
||||||
|
pPlayer->saveKill(pPlayer,0,0,0);
|
||||||
|
MF_ExecuteForward( iFDeath,pPlayer->index, pPlayer->index, 0, 0, 0 );
|
||||||
|
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
|
void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
|
||||||
|
|
||||||
rankBots = (int)csstats_rankbots->value ? true:false;
|
rankBots = (int)csstats_rankbots->value ? true:false;
|
||||||
@ -150,7 +164,7 @@ void ServerDeactivate() {
|
|||||||
|
|
||||||
// clear custom weapons info
|
// clear custom weapons info
|
||||||
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++)
|
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++)
|
||||||
weaponData[i].ammoSlot = 0;
|
weaponData[i].used = false;
|
||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
@ -200,10 +214,11 @@ void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t
|
|||||||
mPlayer = 0;
|
mPlayer = 0;
|
||||||
}
|
}
|
||||||
mState = 0;
|
mState = 0;
|
||||||
if ( msg_type < 0 || msg_type >= MAX_REG_MSGS )
|
g_CurrentMsg = msg_type;
|
||||||
msg_type = 0;
|
if ( g_CurrentMsg < 0 || g_CurrentMsg >= MAX_REG_MSGS )
|
||||||
function=modMsgs[msg_type];
|
g_CurrentMsg = 0;
|
||||||
endfunction=modMsgsEnd[msg_type];
|
function=modMsgs[g_CurrentMsg];
|
||||||
|
endfunction=modMsgsEnd[g_CurrentMsg];
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +335,6 @@ void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnMetaAttach() {
|
void OnMetaAttach() {
|
||||||
|
|
||||||
CVAR_REGISTER (&init_csstats_maxsize);
|
CVAR_REGISTER (&init_csstats_maxsize);
|
||||||
CVAR_REGISTER (&init_csstats_reset);
|
CVAR_REGISTER (&init_csstats_reset);
|
||||||
CVAR_REGISTER (&init_csstats_rank);
|
CVAR_REGISTER (&init_csstats_rank);
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
// Module info
|
// Module info
|
||||||
#define MODULE_NAME "CSX"
|
#define MODULE_NAME "CSX"
|
||||||
#define MODULE_VERSION "0.20"
|
#define MODULE_VERSION "1.01"
|
||||||
#define MODULE_AUTHOR "AMXx Dev Team"
|
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||||
#define MODULE_URL "http://www.amxmodx.org/"
|
#define MODULE_URL "http://www.amxmodx.org/"
|
||||||
#define MODULE_LOGTAG "CSX"
|
#define MODULE_LOGTAG "CSX"
|
||||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||||
@ -70,7 +70,7 @@
|
|||||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
// #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_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_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||||
@ -332,7 +332,7 @@
|
|||||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||||
// #define FN_WalkMove_Post WalkMove_Post
|
// #define FN_WalkMove_Post WalkMove_Post
|
||||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||||
// #define FN_EmitSound_Post EmitSound_Post
|
#define FN_EmitSound_Post EmitSound_Post
|
||||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||||
#define FN_TraceLine_Post TraceLine_Post
|
#define FN_TraceLine_Post TraceLine_Post
|
||||||
// #define FN_TraceToss_Post TraceToss_Post
|
// #define FN_TraceToss_Post TraceToss_Post
|
||||||
|
29
dlls/csx/source/msvc/csx.sln
Executable file
29
dlls/csx/source/msvc/csx.sln
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csx", "csx.vcproj", "{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinCSX", "..\WinCSX\WinCSX.vcproj", "{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfiguration) = preSolution
|
||||||
|
Debug = Debug
|
||||||
|
Release = Release
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfiguration) = postSolution
|
||||||
|
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug.ActiveCfg = Debug|Win32
|
||||||
|
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug.Build.0 = Debug|Win32
|
||||||
|
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release.ActiveCfg = Release|Win32
|
||||||
|
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release.Build.0 = Release|Win32
|
||||||
|
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug.ActiveCfg = Debug|Win32
|
||||||
|
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug.Build.0 = Debug|Win32
|
||||||
|
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release.ActiveCfg = Release|Win32
|
||||||
|
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
311
dlls/csx/source/msvc/csx.vcproj
Executable file
311
dlls/csx/source/msvc/csx.vcproj
Executable file
@ -0,0 +1,311 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="7.10"
|
||||||
|
Name="csx"
|
||||||
|
ProjectGUID="{1DC4A99A-F23F-4AAE-881C-79D157C91155}"
|
||||||
|
SccProjectName=""
|
||||||
|
SccLocalPath="">
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"/>
|
||||||
|
</Platforms>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory=".\release"
|
||||||
|
IntermediateDirectory=".\release"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
AdditionalIncludeDirectories="..\..\metamod,..\..\sdk\common,..\..\sdk\engine,..\..\sdk\dlls"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;csx_EXPORTS;JIT"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
StructMemberAlignment="3"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderFile=".\release/csx.pch"
|
||||||
|
AssemblerListingLocation=".\release/"
|
||||||
|
ObjectFile=".\release/"
|
||||||
|
ProgramDataBaseFileName=".\release/"
|
||||||
|
BrowseInformation="1"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="release/csx_amxx.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
ProgramDatabaseFile=".\release/csx_amxx.pdb"
|
||||||
|
ImportLibrary=".\release/csx_amxx.lib"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\release/csx.tlb"
|
||||||
|
HeaderFileName=""/>
|
||||||
|
<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="Debug|Win32"
|
||||||
|
OutputDirectory=".\debug"
|
||||||
|
IntermediateDirectory=".\debug"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="..\..\metamod,..\..\sdk\common,..\..\sdk\engine,..\..\sdk\dlls,..\..\hlsdk\sourcecode\pm_shared"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;csx_EXPORTS"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderFile=".\debug/csx.pch"
|
||||||
|
AssemblerListingLocation=".\debug/"
|
||||||
|
ObjectFile=".\debug/"
|
||||||
|
ProgramDataBaseFileName=".\debug/"
|
||||||
|
BrowseInformation="1"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="debug/csx_amxx.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile=".\debug/csx_amxx.pdb"
|
||||||
|
ImportLibrary=".\debug/csx_amxx.lib"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\debug/csx.tlb"
|
||||||
|
HeaderFileName=""/>
|
||||||
|
<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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxxmodule.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CMisc.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CRank.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\meta_api.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\rank.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\usermsg.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;JIT;$(NoInherit)"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;csx_EXPORTS;$(NoInherit)"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
BrowseInformation="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl">
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxxmodule.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CMisc.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CRank.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\moduleconfig.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\rank.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
@ -7,15 +7,9 @@
|
|||||||
static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */
|
static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int attacker = params[2];
|
int attacker = params[2];
|
||||||
if (attacker<0||attacker>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(attacker);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->attackers[attacker].hits){
|
if (pPlayer->attackers[attacker].hits){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||||
@ -40,15 +34,9 @@ static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param *
|
|||||||
static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */
|
static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int victim = params[2];
|
int victim = params[2];
|
||||||
if (victim<0||victim>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(victim);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->victims[victim].hits){
|
if (pPlayer->victims[victim].hits){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||||
@ -73,13 +61,10 @@ static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param *
|
|||||||
static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end)
|
static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end)
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int weapon = params[2];
|
int weapon = params[2];
|
||||||
if (weapon<0||weapon>=MAX_WEAPONS){
|
if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
@ -104,13 +89,10 @@ static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param
|
|||||||
static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */
|
static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int weapon = params[2];
|
int weapon = params[2];
|
||||||
if (weapon<0||weapon>=MAX_WEAPONS){
|
if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
@ -135,10 +117,7 @@ static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param *
|
|||||||
static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */
|
static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYER(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
GET_PLAYER_POINTER_I(index)->restartStats();
|
GET_PLAYER_POINTER_I(index)->restartStats();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -146,10 +125,7 @@ static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param
|
|||||||
static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */
|
static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->rank){
|
if (pPlayer->rank){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
@ -171,10 +147,7 @@ static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param *
|
|||||||
static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */
|
static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if ( pPlayer->rank ){
|
if ( pPlayer->rank ){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
@ -200,10 +173,7 @@ static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */
|
|||||||
static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param */
|
static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param */
|
||||||
{
|
{
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if ( pPlayer->rank ){
|
if ( pPlayer->rank ){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
@ -218,7 +188,7 @@ static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param *
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 7 param */
|
||||||
{
|
{
|
||||||
|
|
||||||
int index = params[1] + 1;
|
int index = params[1] + 1;
|
||||||
@ -238,6 +208,8 @@ static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
|||||||
cpStats[7] = (*a).getPosition();
|
cpStats[7] = (*a).getPosition();
|
||||||
|
|
||||||
MF_SetAmxString(amx,params[4],(*a).getName(),params[5]);
|
MF_SetAmxString(amx,params[4],(*a).getName(),params[5]);
|
||||||
|
if (params[6] > 0)
|
||||||
|
MF_SetAmxString(amx, params[6], (*a).getUnique(), params[7]);
|
||||||
for(int i = 1; i < 8; ++i)
|
for(int i = 1; i < 8; ++i)
|
||||||
cpBodyHits[i] = (*a).bodyHits[i];
|
cpBodyHits[i] = (*a).bodyHits[i];
|
||||||
return --a ? index : 0;
|
return --a ? index : 0;
|
||||||
@ -247,7 +219,7 @@ static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 3 param */
|
static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 4 param */
|
||||||
{
|
{
|
||||||
|
|
||||||
int index = params[1] + 1;
|
int index = params[1] + 1;
|
||||||
@ -255,6 +227,8 @@ static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 3 param */
|
|||||||
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||||
if ((*a).getPosition() == index) {
|
if ((*a).getPosition() == index) {
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
|
if (params[4] > 0)
|
||||||
|
MF_SetAmxString(amx, params[3], (*a).getUnique(), params[4]);
|
||||||
|
|
||||||
cpStats[0] = (*a).bDefusions;
|
cpStats[0] = (*a).bDefusions;
|
||||||
cpStats[1] = (*a).bDefused;
|
cpStats[1] = (*a).bDefused;
|
||||||
@ -297,32 +271,25 @@ static cell AMX_NATIVE_CALL register_cwpn(AMX *amx, cell *params){ // name,melee
|
|||||||
static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
||||||
int weapon = params[1];
|
int weapon = params[1];
|
||||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){ // only for custom weapons
|
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){ // only for custom weapons
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int att = params[2];
|
int att = params[2];
|
||||||
if (att<1||att>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(att);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int vic = params[3];
|
int vic = params[3];
|
||||||
if (vic<1||vic>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(vic);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int dmg = params[4];
|
int dmg = params[4];
|
||||||
if ( dmg<1 ){
|
if ( dmg<1 ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid damage %d", dmg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int aim = params[5];
|
int aim = params[5];
|
||||||
if ( aim < 0 || aim > 7 ){
|
if ( aim < 0 || aim > 7 ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid aim %d", aim);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,15 +316,11 @@ static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,v
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid
|
static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid
|
||||||
int index = params[2];
|
int index = params[2];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYERRANGE(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int weapon = params[1];
|
int weapon = params[1];
|
||||||
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){
|
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,8 +333,7 @@ static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,w
|
|||||||
static cell AMX_NATIVE_CALL get_wpnname(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_wpnname(AMX *amx, cell *params){
|
||||||
int id = params[1];
|
int id = params[1];
|
||||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return MF_SetAmxString(amx,params[2],weaponData[id].name,params[3]);
|
return MF_SetAmxString(amx,params[2],weaponData[id].name,params[3]);
|
||||||
@ -380,8 +342,7 @@ static cell AMX_NATIVE_CALL get_wpnname(AMX *amx, cell *params){
|
|||||||
static cell AMX_NATIVE_CALL get_wpnlogname(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_wpnlogname(AMX *amx, cell *params){
|
||||||
int id = params[1];
|
int id = params[1];
|
||||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return MF_SetAmxString(amx,params[2],weaponData[id].logname,params[3]);
|
return MF_SetAmxString(amx,params[2],weaponData[id].logname,params[3]);
|
||||||
@ -390,8 +351,7 @@ static cell AMX_NATIVE_CALL get_wpnlogname(AMX *amx, cell *params){
|
|||||||
static cell AMX_NATIVE_CALL is_melee(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL is_melee(AMX *amx, cell *params){
|
||||||
int id = params[1];
|
int id = params[1];
|
||||||
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
MF_PrintSrvConsole("Weapon ID Is Not Valid!\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ( id == 29 )
|
if ( id == 29 )
|
||||||
@ -433,7 +393,7 @@ AMX_NATIVE_INFO stats_Natives[] = {
|
|||||||
{ "xmod_get_stats_size", get_stats_size },
|
{ "xmod_get_stats_size", get_stats_size },
|
||||||
|
|
||||||
//***************************************
|
//***************************************
|
||||||
{ "get_weaponname", get_wpnname },
|
//{ "get_weaponname", get_wpnname },
|
||||||
|
|
||||||
///*******************
|
///*******************
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef RANK_H
|
#ifndef RANK_H
|
||||||
#define RANK_H
|
#define RANK_H
|
||||||
|
|
||||||
@ -99,6 +96,56 @@ void Client_BarTime(void*);
|
|||||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
||||||
bool isModuleActive();
|
bool isModuleActive();
|
||||||
|
|
||||||
|
#define CHECK_ENTITY(x) \
|
||||||
|
if (x < 0 || x > gpGlobals->maxEntities) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
|
||||||
|
return 0; \
|
||||||
|
} else { \
|
||||||
|
if (x <= gpGlobals->maxClients) { \
|
||||||
|
if (!MF_IsPlayerIngame(x)) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d (not in-game)", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
} else { \
|
||||||
|
if (x != 0 && FNullEnt(INDEXENT(x))) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CHECK_PLAYER(x) \
|
||||||
|
if (x < 1 || x > gpGlobals->maxClients) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", x); \
|
||||||
|
return 0; \
|
||||||
|
} else { \
|
||||||
|
if (!MF_IsPlayerIngame(x) || FNullEnt(MF_GetPlayerEdict(x))) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CHECK_PLAYERRANGE(x) \
|
||||||
|
if (x > gpGlobals->maxClients || x < 0) \
|
||||||
|
{ \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Player out of range (%d)", x); \
|
||||||
|
return 0; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define CHECK_NONPLAYER(x) \
|
||||||
|
if (x < 1 || x <= gpGlobals->maxClients || x > gpGlobals->maxEntities) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Non-player entity %d out of range", x); \
|
||||||
|
return 0; \
|
||||||
|
} else { \
|
||||||
|
if (FNullEnt(INDEXENT(x))) { \
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid non-player entity %d", x); \
|
||||||
|
return 0; \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define GETEDICT(n) \
|
||||||
|
((n >= 1 && n <= gpGlobals->maxClients) ? MF_GetPlayerEdict(n) : INDEXENT(n))
|
||||||
|
|
||||||
#endif // RANK_H
|
#endif // RANK_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,11 +7,14 @@ int damage;
|
|||||||
int TA;
|
int TA;
|
||||||
int weapon;
|
int weapon;
|
||||||
int aim;
|
int aim;
|
||||||
|
bool ignore;
|
||||||
CPlayer *pAttacker;
|
CPlayer *pAttacker;
|
||||||
|
|
||||||
|
|
||||||
void Client_ResetHUD(void* mValue){
|
void Client_ResetHUD(void* mValue){
|
||||||
if ( mPlayer && mPlayer->IsAlive() )
|
if ( mPlayer ){
|
||||||
mPlayer->clearStats = gpGlobals->time + 0.25f;
|
mPlayer->clearStats = gpGlobals->time + 0.25f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_WeaponList(void* mValue){
|
void Client_WeaponList(void* mValue){
|
||||||
@ -49,18 +52,26 @@ void Client_Damage(void* mValue){
|
|||||||
static int bits;
|
static int bits;
|
||||||
switch (mState++) {
|
switch (mState++) {
|
||||||
case 1:
|
case 1:
|
||||||
|
ignore = false;
|
||||||
damage = *(int*)mValue;
|
damage = *(int*)mValue;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
bits = *(int*)mValue;
|
bits = *(int*)mValue;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (!mPlayer || !damage || !*(float*)mValue || bits) break;
|
if (!mPlayer || !damage || bits){
|
||||||
|
ignore = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
edict_t *enemy;
|
edict_t *enemy;
|
||||||
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
||||||
|
|
||||||
if ( FNullEnt( enemy ) )
|
if ( FNullEnt( enemy ) ){
|
||||||
|
ignore = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
aim = 0;
|
aim = 0;
|
||||||
weapon = 0;
|
weapon = 0;
|
||||||
pAttacker = NULL;
|
pAttacker = NULL;
|
||||||
@ -80,7 +91,7 @@ void Client_Damage(void* mValue){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client_Damage_End(void* mValue){
|
void Client_Damage_End(void* mValue){
|
||||||
if ( !mPlayer || !damage )
|
if ( ignore )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( !pAttacker ) pAttacker = mPlayer;
|
if ( !pAttacker ) pAttacker = mPlayer;
|
||||||
@ -203,3 +214,4 @@ void Client_BarTime(void* mValue){
|
|||||||
g_bombAnnounce = BOMB_DEFUSING;
|
g_bombAnnounce = BOMB_DEFUSING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
300
dlls/csx_sql/CMisc.cpp
Executable file
300
dlls/csx_sql/CMisc.cpp
Executable file
@ -0,0 +1,300 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#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 && !found ) {
|
||||||
|
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_sql/CMisc.h
Executable file
116
dlls/csx_sql/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
|
||||||
|
|
||||||
|
|
||||||
|
|
306
dlls/csx_sql/CRank.cpp
Executable file
306
dlls/csx_sql/CRank.cpp
Executable file
@ -0,0 +1,306 @@
|
|||||||
|
#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);
|
||||||
|
}
|
123
dlls/csx_sql/CRank.h
Executable file
123
dlls/csx_sql/CRank.h
Executable file
@ -0,0 +1,123 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#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 saveRankSql(); // JGHG added this one
|
||||||
|
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
|
234
dlls/csx_sql/CRank_sql.cpp
Executable file
234
dlls/csx_sql/CRank_sql.cpp
Executable file
@ -0,0 +1,234 @@
|
|||||||
|
// The good stuff: http://dev.mysql.com/doc/mysql/en/mysql_query.html
|
||||||
|
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "CRank.h"
|
||||||
|
#include "rank.h"
|
||||||
|
|
||||||
|
#ifndef __linux__
|
||||||
|
#define WINDOWS_LEAN_AND_MEAN
|
||||||
|
#include <winsock.h>
|
||||||
|
#endif
|
||||||
|
#include <mysql/mysql.h>
|
||||||
|
#include <mysql/errmsg.h>
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
#define MYSQL_QUERY_IS_A_OKAY 0
|
||||||
|
|
||||||
|
cvar_t init_csx_sqlstats_host = {"csx_sqlstats_host", "127.0.0.1", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||||
|
cvar_t init_csx_sqlstats_username = {"csx_sqlstats_username", "", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||||
|
cvar_t init_csx_sqlstats_password = {"csx_sqlstats_password", "", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||||
|
cvar_t init_csx_sqlstats_db = {"csx_sqlstats_db", "amxmodx_stats_cs", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||||
|
cvar_t init_csx_sqlstats_table = {"csx_sqlstats_table", "cs", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||||
|
cvar_t init_csx_sqlstats_exportstats = {"csx_sqlstats_exportstats", "0", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||||
|
cvar_t *csx_sqlstats_host;
|
||||||
|
cvar_t *csx_sqlstats_username;
|
||||||
|
cvar_t *csx_sqlstats_password;
|
||||||
|
cvar_t *csx_sqlstats_db;
|
||||||
|
cvar_t *csx_sqlstats_table;
|
||||||
|
cvar_t *csx_sqlstats_exportstats;
|
||||||
|
|
||||||
|
void OnMetaAttach_sql() {
|
||||||
|
CVAR_REGISTER(&init_csx_sqlstats_host);
|
||||||
|
CVAR_REGISTER(&init_csx_sqlstats_username);
|
||||||
|
CVAR_REGISTER(&init_csx_sqlstats_password);
|
||||||
|
CVAR_REGISTER(&init_csx_sqlstats_db);
|
||||||
|
CVAR_REGISTER(&init_csx_sqlstats_table);
|
||||||
|
CVAR_REGISTER(&init_csx_sqlstats_exportstats);
|
||||||
|
|
||||||
|
csx_sqlstats_host = CVAR_GET_POINTER(init_csx_sqlstats_host.name);
|
||||||
|
csx_sqlstats_username = CVAR_GET_POINTER(init_csx_sqlstats_username.name);
|
||||||
|
csx_sqlstats_password = CVAR_GET_POINTER(init_csx_sqlstats_password.name);
|
||||||
|
csx_sqlstats_db = CVAR_GET_POINTER(init_csx_sqlstats_db.name);
|
||||||
|
csx_sqlstats_table = CVAR_GET_POINTER(init_csx_sqlstats_table.name);
|
||||||
|
csx_sqlstats_exportstats = CVAR_GET_POINTER(init_csx_sqlstats_exportstats.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Error(MYSQL *mysql)
|
||||||
|
{
|
||||||
|
if (mysql == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return mysql_errno(mysql);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::saveRankSql()
|
||||||
|
{
|
||||||
|
// Don't do anything if cvar says so.
|
||||||
|
if (csx_sqlstats_exportstats->value == 0.0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MF_PrintSrvConsole("[CSX Sql] Exporting players' statistics to SQL db...");
|
||||||
|
clock_t startTime = clock();
|
||||||
|
|
||||||
|
MYSQL *mysql = NULL;
|
||||||
|
mysql = mysql_init(NULL);
|
||||||
|
|
||||||
|
|
||||||
|
/* Attempt to get a port */
|
||||||
|
int port = 0;
|
||||||
|
char *p = strchr(csx_sqlstats_host->string, ':');
|
||||||
|
if (p)
|
||||||
|
port = atoi(p+1);
|
||||||
|
/*************************/
|
||||||
|
//MF_PrintSrvConsole("Host: %s (%d) Port: %d", host, strcspn(csx_sqlstats_host->string, ":"), port);
|
||||||
|
|
||||||
|
int error = 0;
|
||||||
|
if (!mysql_real_connect(mysql, csx_sqlstats_host->string, csx_sqlstats_username->string, csx_sqlstats_password->string, NULL, port, NULL, 0)) {
|
||||||
|
error = Error(mysql);
|
||||||
|
if (error) {
|
||||||
|
MF_Log("DB Connection failed (%d): %s", error, mysql_error(mysql));
|
||||||
|
mysql_close(mysql);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mysql_select_db(mysql, csx_sqlstats_db->string) != 0) {
|
||||||
|
error = Error(mysql);
|
||||||
|
if (error) {
|
||||||
|
MF_Log("DB Select DB failed (%d): %s", error, mysql_error(mysql));
|
||||||
|
mysql_close(mysql);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query
|
||||||
|
char query[2048];
|
||||||
|
|
||||||
|
snprintf(query, 2047, "CREATE TABLE IF NOT EXISTS `%s` (`timestamp` int(11) NOT NULL default '0', `stats_authid` varchar(100) NOT NULL default '', `stats_name` varchar(100) NOT NULL default '', `stats_tks` int(11) NOT NULL default '0', `stats_damage` int(11) NOT NULL default '0', `stats_deaths` int(11) NOT NULL default '0', `stats_frags` int(11) NOT NULL default '0', `stats_shots` int(11) NOT NULL default '0', `stats_hits` int(11) NOT NULL default '0', `stats_hs` int(11) NOT NULL default '0', `stats_defusions` int(11) NOT NULL default '0', `stats_defused` int(11) NOT NULL default '0', `stats_plants` int(11) NOT NULL default '0', `stats_explosions` int(11) NOT NULL default '0', `stats_bodyhits0` int(11) NOT NULL default '0', `stats_bodyhits1` int(11) NOT NULL default '0', `stats_bodyhits2` int(11) NOT NULL default '0', `stats_bodyhits3` int(11) NOT NULL default '0', `stats_bodyhits4` int(11) NOT NULL default '0', `stats_bodyhits5` int(11) NOT NULL default '0', `stats_bodyhits6` int(11) NOT NULL default '0', `stats_bodyhits7` int(11) NOT NULL default '0', `stats_bodyhits8` int(11) NOT NULL default '0', `stats_score` int(11) NOT NULL default '0') TYPE=MyISAM",
|
||||||
|
csx_sqlstats_table->string);
|
||||||
|
int queryResult = mysql_query(mysql, query);
|
||||||
|
if (queryResult != MYSQL_QUERY_IS_A_OKAY)
|
||||||
|
{
|
||||||
|
error = Error(mysql);
|
||||||
|
MF_Log("DB Query Create Table If Not Exists failed (%d): %s", error, mysql_error(mysql));
|
||||||
|
mysql_close(mysql);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int exportedRecords = 0;
|
||||||
|
|
||||||
|
RankSystem::iterator a = front();
|
||||||
|
|
||||||
|
char *authid, *name;
|
||||||
|
int tks, damage, deaths, kills, shots, hits, hs, defusions, defused, plants, explosions, *bodyHits, score;
|
||||||
|
time_t now = time(NULL);
|
||||||
|
|
||||||
|
while ( a )
|
||||||
|
{
|
||||||
|
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||||
|
{
|
||||||
|
authid = (*a).unique;
|
||||||
|
if (strcmp(authid, "BOT") == 0 || strcmp(authid, "STEAM_ID_PENDING") == 0) {
|
||||||
|
--a;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
exportedRecords++;
|
||||||
|
|
||||||
|
name = (*a).name;
|
||||||
|
tks = (*a).tks;
|
||||||
|
damage = (*a).damage;
|
||||||
|
deaths = (*a).deaths;
|
||||||
|
kills = (*a).kills;
|
||||||
|
shots = (*a).shots;
|
||||||
|
hits = (*a).hits;
|
||||||
|
hs = (*a).hs;
|
||||||
|
defusions = (*a).bDefusions;
|
||||||
|
defused = (*a).bDefused;
|
||||||
|
plants = (*a).bPlants;
|
||||||
|
explosions = (*a).bExplosions;
|
||||||
|
bodyHits = ((*a).bodyHits);
|
||||||
|
score = (*a).score;
|
||||||
|
|
||||||
|
snprintf(query, 2047, "UPDATE `%s` SET `timestamp` = %d, `stats_name` = \"%s\", `stats_tks` = \"%d\", `stats_damage` = \"%d\", `stats_deaths` = \"%d\", `stats_frags` = \"%d\", `stats_shots` = \"%d\", `stats_hits` = \"%d\", `stats_hs` = \"%d\", `stats_defusions` = \"%d\", `stats_defused` = \"%d\", `stats_plants` = \"%d\", `stats_explosions` = \"%d\", `stats_bodyhits0` = \"%d\", `stats_bodyhits1` = \"%d\", `stats_bodyhits2` = \"%d\", `stats_bodyhits3` = \"%d\", `stats_bodyhits4` = \"%d\", `stats_bodyhits5` = \"%d\", `stats_bodyhits6` = \"%d\", `stats_bodyhits7` = \"%d\", `stats_bodyhits8` = \"%d\", `stats_score` = \"%d\" WHERE `stats_authid` = \"%s\" LIMIT 1",
|
||||||
|
csx_sqlstats_table->string,
|
||||||
|
now,
|
||||||
|
name,
|
||||||
|
tks,
|
||||||
|
damage,
|
||||||
|
deaths,
|
||||||
|
kills,
|
||||||
|
shots,
|
||||||
|
hits,
|
||||||
|
hs,
|
||||||
|
defusions,
|
||||||
|
defused,
|
||||||
|
plants,
|
||||||
|
explosions,
|
||||||
|
bodyHits[0],
|
||||||
|
bodyHits[1],
|
||||||
|
bodyHits[2],
|
||||||
|
bodyHits[3],
|
||||||
|
bodyHits[4],
|
||||||
|
bodyHits[5],
|
||||||
|
bodyHits[6],
|
||||||
|
bodyHits[7],
|
||||||
|
bodyHits[8],
|
||||||
|
score,
|
||||||
|
authid);
|
||||||
|
//
|
||||||
|
|
||||||
|
int queryResult = mysql_query(mysql, query);
|
||||||
|
if (queryResult != MYSQL_QUERY_IS_A_OKAY)
|
||||||
|
{
|
||||||
|
error = Error(mysql);
|
||||||
|
MF_Log("DB Query Update failed (%d): %s", error, mysql_error(mysql));
|
||||||
|
mysql_close(mysql);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mysql_affected_rows(mysql) == 0) {
|
||||||
|
// New player, do insert
|
||||||
|
snprintf(query, 2047, "INSERT INTO `%s` (`timestamp`, `stats_authid`, `stats_name`, `stats_tks`, `stats_damage`, `stats_deaths`, `stats_frags`, `stats_shots`, `stats_hits`, `stats_hs`, `stats_defusions`, `stats_defused`, `stats_plants`, `stats_explosions`, `stats_bodyhits0`, `stats_bodyhits1`, `stats_bodyhits2`, `stats_bodyhits3`, `stats_bodyhits4`, `stats_bodyhits5`, `stats_bodyhits6`, `stats_bodyhits7`, `stats_bodyhits8`, `stats_score`) VALUES (\"%d\", \"%s\", \"%s\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\")",
|
||||||
|
csx_sqlstats_table->string,
|
||||||
|
now,
|
||||||
|
|
||||||
|
authid,
|
||||||
|
name,
|
||||||
|
|
||||||
|
tks,
|
||||||
|
damage,
|
||||||
|
deaths,
|
||||||
|
kills,
|
||||||
|
shots,
|
||||||
|
|
||||||
|
hits,
|
||||||
|
hs,
|
||||||
|
defusions,
|
||||||
|
defused,
|
||||||
|
plants,
|
||||||
|
|
||||||
|
explosions,
|
||||||
|
|
||||||
|
bodyHits[0],
|
||||||
|
bodyHits[1],
|
||||||
|
bodyHits[2],
|
||||||
|
bodyHits[3],
|
||||||
|
bodyHits[4],
|
||||||
|
bodyHits[5],
|
||||||
|
bodyHits[6],
|
||||||
|
bodyHits[7],
|
||||||
|
bodyHits[8],
|
||||||
|
|
||||||
|
score
|
||||||
|
);
|
||||||
|
|
||||||
|
int queryResult = mysql_query(mysql, query);
|
||||||
|
if (queryResult != MYSQL_QUERY_IS_A_OKAY)
|
||||||
|
{
|
||||||
|
error = Error(mysql);
|
||||||
|
MF_Log("DB Query Insert failed (%d): %s", error, mysql_error(mysql));
|
||||||
|
mysql_close(mysql);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
--a;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disconnect
|
||||||
|
mysql_close(mysql);
|
||||||
|
|
||||||
|
clock_t stopTime = clock();
|
||||||
|
MF_PrintSrvConsole("...done! (exported %d records in %.2f seconds)\n", exportedRecords, (double)(stopTime - startTime) / (double)CLOCKS_PER_SEC);
|
||||||
|
}
|
404
dlls/csx_sql/CString.h
Executable file
404
dlls/csx_sql/CString.h
Executable file
@ -0,0 +1,404 @@
|
|||||||
|
/* 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 String
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
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(cSize + strlen(t) + 1);
|
||||||
|
strcat(v, t);
|
||||||
|
cSize = strlen(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
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(cSize + strlen(t));
|
||||||
|
strcat(v, t);
|
||||||
|
cSize = strlen(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
void assign(const String &src)
|
||||||
|
{
|
||||||
|
assign(src.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
void assign(const char *d)
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
v[0] = 0;
|
||||||
|
cSize = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int compare (const char *d)
|
||||||
|
{
|
||||||
|
if (v) {
|
||||||
|
if (d) {
|
||||||
|
return strcmp(v, d);
|
||||||
|
} else {
|
||||||
|
return strlen(v);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (d) {
|
||||||
|
return strlen(d);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Added this for amxx inclusion
|
||||||
|
bool empty()
|
||||||
|
{
|
||||||
|
if (!v || !cSize)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int size()
|
||||||
|
{
|
||||||
|
if (!v)
|
||||||
|
return 0;
|
||||||
|
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(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[cSize] = 0;
|
||||||
|
delete [] v;
|
||||||
|
}
|
||||||
|
v = t;
|
||||||
|
mSize = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char *v;
|
||||||
|
unsigned int mSize;
|
||||||
|
unsigned int cSize;
|
||||||
|
public:
|
||||||
|
static const int npos = -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //_INCLUDE_CSTRING_H
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user