Compare commits
314 Commits
amxmodx-0.
...
amxmodx-1.
Author | SHA1 | Date | |
---|---|---|---|
00a29a9f06 | |||
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 | |||
95b638dbcd | |||
c42fef6d48 | |||
d60d19a3d7 | |||
3f1c730863 | |||
89f5a45e1d | |||
2b2149b643 | |||
f074af039b | |||
30ec1eec60 | |||
0e279c5bc9 | |||
525dfceb1d | |||
83fa1aea27 | |||
6e3f2f9616 | |||
6a77edfa97 | |||
b24f44896c | |||
e23726ac54 | |||
fb2be2256f | |||
1ef7f8dd72 | |||
4008743091 | |||
bff11bc18e | |||
6ada631aaf | |||
9042efd195 | |||
04b88c16a9 | |||
1c6636b106 | |||
a6a03bf51e | |||
b05cf94a23 | |||
b641192e73 | |||
d14c107db1 | |||
2e24077b77 | |||
d819c76024 | |||
89b5496dfb | |||
de44b4382a | |||
c71fc25a9d | |||
5527afc91e | |||
47eb690a89 | |||
bb662770e0 | |||
4d04072672 | |||
4c00d8b95d | |||
f828e1c8a0 | |||
34abaa1d56 | |||
768ea7519f | |||
3eed3b7f07 | |||
3419aa4dc5 | |||
54a00466e8 | |||
5133915e9c | |||
895948ca45 | |||
d0c51bd637 | |||
2e028ebe20 | |||
26349730e5 | |||
c0374c5fe5 | |||
ab2794d4bd | |||
e0af113cac | |||
f9a57a83a0 | |||
b7c0c47c05 | |||
2d9ec5295d | |||
b3f01faf38 | |||
58578690ad | |||
4754ccdd1d | |||
f6facb5349 | |||
1728c02561 | |||
c90d922443 | |||
2f1de39dd3 | |||
ec5f944c03 | |||
d43807a248 | |||
1980c524d3 | |||
31604d44a8 | |||
dba30f7ee6 | |||
1aaf540be4 | |||
d3751054da | |||
0c2dbdbc47 | |||
1485014229 | |||
0ea68c81dc | |||
8fbbda13c6 | |||
a96d26d573 | |||
fb7d1c0a7d | |||
d7d8ba1398 | |||
36c78421ae | |||
083fe35188 | |||
9e4a611b7f | |||
4ed906248d | |||
44bb871f7e | |||
c1a138f370 | |||
569ef4d494 | |||
26465afbf7 | |||
e287a2f202 | |||
91decabfde | |||
9a21e3e9d3 | |||
60940512e2 | |||
d4e69d97e0 | |||
f171842cf8 | |||
3d9bf8bc93 | |||
d7325f4209 | |||
5c177aada0 | |||
5c6289e1f0 | |||
844fbf581e | |||
22bac3c8f4 | |||
35ffbf8ca6 | |||
926f995a3a | |||
8589f0bcf5 | |||
1a2ef38588 | |||
fed8228712 | |||
09d0ba039d | |||
f2dcb89609 |
@ -419,8 +419,7 @@ void EventsMngr::executeEvents()
|
|||||||
|
|
||||||
if ((err = amx_Exec((*iter).m_Plugin->getAMX(), NULL, (*iter).m_Func, 1, m_ParseVault ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE)
|
if ((err = amx_Exec((*iter).m_Plugin->getAMX(), NULL, (*iter).m_Func, 1, m_ParseVault ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE)
|
||||||
{
|
{
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err,
|
LogError((*iter).m_Plugin->getAMX(), err, "");
|
||||||
(*iter).m_Plugin->getAMX()->curline, (*iter).m_Plugin->getName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
|||||||
int err = amx_Execv(iter->pPlugin->getAMX(), &retVal, iter->func, m_NumParams, realParams);
|
int err = amx_Execv(iter->pPlugin->getAMX(), &retVal, iter->func, m_NumParams, realParams);
|
||||||
// log runtime error, if any
|
// log runtime error, if any
|
||||||
if (err != AMX_ERR_NONE)
|
if (err != AMX_ERR_NONE)
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err, iter->pPlugin->getAMX()->curline, iter->pPlugin->getName());
|
LogError(iter->pPlugin->getAMX(), err, "");
|
||||||
|
|
||||||
// cleanup strings & arrays
|
// cleanup strings & arrays
|
||||||
for (i = 0; i < m_NumParams; ++i)
|
for (i = 0; i < m_NumParams; ++i)
|
||||||
@ -128,6 +128,8 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
|||||||
else if (m_ParamTypes[i] == FP_ARRAY)
|
else if (m_ParamTypes[i] == FP_ARRAY)
|
||||||
{
|
{
|
||||||
// copy back
|
// copy back
|
||||||
|
if (preparedArrays[params[i]].copyBack)
|
||||||
|
{
|
||||||
cell *tmp = physAddrs[i];
|
cell *tmp = physAddrs[i];
|
||||||
if (preparedArrays[params[i]].type == Type_Cell)
|
if (preparedArrays[params[i]].type == Type_Cell)
|
||||||
{
|
{
|
||||||
@ -139,6 +141,7 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
|||||||
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
||||||
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
amx_Release(iter->pPlugin->getAMX(), realParams[i]);
|
amx_Release(iter->pPlugin->getAMX(), realParams[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -190,6 +193,7 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
|||||||
{
|
{
|
||||||
if (isFree)
|
if (isFree)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const int STRINGEX_MAXLENGTH = 128;
|
const int STRINGEX_MAXLENGTH = 128;
|
||||||
|
|
||||||
cell realParams[FORWARD_MAX_PARAMS];
|
cell realParams[FORWARD_MAX_PARAMS];
|
||||||
@ -240,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)
|
||||||
@ -258,6 +266,8 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
|||||||
else if (m_ParamTypes[i] == FP_ARRAY)
|
else if (m_ParamTypes[i] == FP_ARRAY)
|
||||||
{
|
{
|
||||||
// copy back
|
// copy back
|
||||||
|
if (preparedArrays[params[i]].copyBack)
|
||||||
|
{
|
||||||
cell *tmp = physAddrs[i];
|
cell *tmp = physAddrs[i];
|
||||||
if (preparedArrays[params[i]].type == Type_Cell)
|
if (preparedArrays[params[i]].type == Type_Cell)
|
||||||
{
|
{
|
||||||
@ -269,6 +279,7 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
|
|||||||
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
for (unsigned int j = 0; j < preparedArrays[params[i]].size; ++j)
|
||||||
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
*data++ = static_cast<char>(*tmp++ & 0xFF);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
amx_Release(m_Amx, realParams[i]);
|
amx_Release(m_Amx, realParams[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,11 +299,12 @@ int CForwardMngr::registerForward(const char *funcName, ForwardExecType et, int
|
|||||||
|
|
||||||
int CForwardMngr::registerSPForward(int func, AMX *amx, int numParams, const ForwardParam *paramTypes)
|
int CForwardMngr::registerSPForward(int func, AMX *amx, int numParams, const ForwardParam *paramTypes)
|
||||||
{
|
{
|
||||||
int retVal = (m_SPForwards.size() << 1) | 1;
|
int retVal = -1;
|
||||||
CSPForward *pForward;
|
CSPForward *pForward;
|
||||||
if (!m_FreeSPForwards.empty())
|
if (!m_FreeSPForwards.empty())
|
||||||
{
|
{
|
||||||
pForward = m_SPForwards[m_FreeSPForwards.front() >> 1];
|
retVal = m_FreeSPForwards.front();
|
||||||
|
pForward = m_SPForwards[retVal >> 1];
|
||||||
pForward->Set(func, amx, numParams, paramTypes);
|
pForward->Set(func, amx, numParams, paramTypes);
|
||||||
if (pForward->getFuncsNum() == 0)
|
if (pForward->getFuncsNum() == 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -300,6 +312,7 @@ int CForwardMngr::registerSPForward(int func, AMX *amx, int numParams, const For
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
retVal = (m_SPForwards.size() << 1) | 1;
|
||||||
pForward = new CSPForward();
|
pForward = new CSPForward();
|
||||||
if (!pForward)
|
if (!pForward)
|
||||||
return -1;
|
return -1;
|
||||||
@ -485,28 +498,40 @@ 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);
|
||||||
return g_forwards.executeForwards(id, params);
|
return g_forwards.executeForwards(id, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
cell CForwardMngr::prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type)
|
cell CForwardMngr::prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type, bool copyBack)
|
||||||
{
|
{
|
||||||
|
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;
|
||||||
|
|
||||||
return m_TmpArraysNum++;
|
return m_TmpArraysNum++;
|
||||||
}
|
}
|
||||||
|
|
||||||
cell prepareCellArray(cell *ptr, unsigned int size)
|
cell prepareCellArray(cell *ptr, unsigned int size, bool copyBack)
|
||||||
{
|
{
|
||||||
return g_forwards.prepareArray((void*)ptr, size, Type_Cell);
|
return g_forwards.prepareArray((void*)ptr, size, Type_Cell, copyBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
cell prepareCharArray(char *ptr, unsigned int size)
|
cell prepareCharArray(char *ptr, unsigned int size, bool copyBack)
|
||||||
{
|
{
|
||||||
return g_forwards.prepareArray((void*)ptr, size, Type_Char);
|
return g_forwards.prepareArray((void*)ptr, size, Type_Char, copyBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unregisterSPForward(int id)
|
void unregisterSPForward(int id)
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -79,6 +79,7 @@ struct ForwardPreparedArray
|
|||||||
void *ptr;
|
void *ptr;
|
||||||
ForwardArrayElemType type;
|
ForwardArrayElemType type;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
|
bool copyBack;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Normal forward
|
// Normal forward
|
||||||
@ -185,7 +186,8 @@ public:
|
|||||||
int getParamsNum(int id) const; // get num of params of a forward
|
int getParamsNum(int id) const; // get num of params of a forward
|
||||||
int getFuncsNum(int id) const; // get num of found functions of a forward
|
int getFuncsNum(int id) const; // get num of found functions of a forward
|
||||||
ForwardParam getParamType(int id, int paramId) const;
|
ForwardParam getParamType(int id, int paramId) const;
|
||||||
cell prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type); // prepare array
|
cell prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type,
|
||||||
|
bool copyBack); // prepare array
|
||||||
};
|
};
|
||||||
|
|
||||||
// (un)register forward
|
// (un)register forward
|
||||||
@ -197,8 +199,8 @@ void unregisterSPForward(int id);
|
|||||||
// execute forwards
|
// execute forwards
|
||||||
cell executeForwards(int id, ...);
|
cell executeForwards(int id, ...);
|
||||||
// prepare array
|
// prepare array
|
||||||
cell prepareCellArray(cell *ptr, unsigned int size);
|
cell prepareCellArray(cell *ptr, unsigned int size, bool copyBack = false);
|
||||||
cell prepareCharArray(char *ptr, unsigned int size);
|
cell prepareCharArray(char *ptr, unsigned int size, bool copyBack = false);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -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);
|
||||||
@ -1084,6 +1093,7 @@ int CLangMngr::MergeDefinitionFile(const char *file)
|
|||||||
{
|
{
|
||||||
MergeDefinitions(language, Defq);
|
MergeDefinitions(language, Defq);
|
||||||
}
|
}
|
||||||
|
fclose(fp);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,28 +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)
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
LogError(a->plugin->getAMX(), err, "");
|
||||||
err,a->plugin->getAMX()->curline,a->plugin->getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLEEXEPTIONS
|
|
||||||
}
|
|
||||||
catch( ... )
|
|
||||||
{
|
|
||||||
AMXXLOG_Log( "[AMXX] fatal error at log forward function execution");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ void CPluginMngr::unloadPlugin( CPlugin** a ) {
|
|||||||
|
|
||||||
int CPluginMngr::loadPluginsFromFile( const char* filename )
|
int CPluginMngr::loadPluginsFromFile( const char* filename )
|
||||||
{
|
{
|
||||||
File fp( build_pathname("%s",filename) , "r" );
|
FILE *fp = fopen(build_pathname("%s",filename) , "rt");
|
||||||
|
|
||||||
if ( !fp )
|
if ( !fp )
|
||||||
{
|
{
|
||||||
@ -59,25 +59,26 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find now folder
|
// Find now folder
|
||||||
char pluginName[256], line[256], error[256], debug[256];
|
char pluginName[256], error[256], debug[256];
|
||||||
int debugFlag = 0;
|
int debugFlag = 0;
|
||||||
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins");
|
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins");
|
||||||
|
|
||||||
|
String line;
|
||||||
|
|
||||||
while ( fp.getline(line , 255 ) )
|
while ( !feof(fp) )
|
||||||
{
|
{
|
||||||
*pluginName = 0;
|
*pluginName = 0;
|
||||||
*debug = 0;
|
*debug = 0;
|
||||||
debugFlag = 0;
|
debugFlag = 0;
|
||||||
sscanf(line,"%s %s",pluginName, debug);
|
line.clear();
|
||||||
|
line._fread(fp);
|
||||||
|
sscanf(line.c_str(),"%s %s",pluginName, debug);
|
||||||
if (!isalnum(*pluginName)) continue;
|
if (!isalnum(*pluginName)) continue;
|
||||||
|
|
||||||
#ifdef JIT
|
|
||||||
if (isalnum(*debug) && strcmp(debug, "debug") == 0)
|
if (isalnum(*debug) && strcmp(debug, "debug") == 0)
|
||||||
{
|
{
|
||||||
debugFlag = 1;
|
debugFlag = 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
CPlugin* plugin = loadPlugin( pluginsDir , pluginName , error, debugFlag);
|
CPlugin* plugin = loadPlugin( pluginsDir , pluginName , error, debugFlag);
|
||||||
|
|
||||||
@ -90,6 +91,8 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
return pCounter;
|
return pCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +133,16 @@ CPluginMngr::CPlugin* CPluginMngr::findPlugin(const char* name) {
|
|||||||
|
|
||||||
const char* CPluginMngr::CPlugin::getStatus() const {
|
const char* CPluginMngr::CPlugin::getStatus() const {
|
||||||
switch(status){
|
switch(status){
|
||||||
case ps_running: return "running";
|
case ps_running:
|
||||||
|
{
|
||||||
|
if (getAMX()->flags & AMX_FLAG_DEBUG)
|
||||||
|
{
|
||||||
|
return "debug";
|
||||||
|
} else {
|
||||||
|
return "running";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ps_paused: return "paused";
|
case ps_paused: return "paused";
|
||||||
case ps_bad_load: return "bad load";
|
case ps_bad_load: return "bad load";
|
||||||
case ps_stopped: return "stopped";
|
case ps_stopped: return "stopped";
|
||||||
|
@ -81,6 +81,7 @@ public:
|
|||||||
inline int getStatusCode() { return status; }
|
inline int getStatusCode() { return status; }
|
||||||
inline int getId() const { return id; }
|
inline int getId() const { return id; }
|
||||||
inline AMX* getAMX() { return &amx; }
|
inline AMX* getAMX() { return &amx; }
|
||||||
|
inline const AMX* getAMX() const { return &amx; }
|
||||||
inline void setTitle( const char* n ) { title.assign(n); }
|
inline void setTitle( const char* n ) { title.assign(n); }
|
||||||
inline void setAuthor( const char* n ) { author.assign(n); }
|
inline void setAuthor( const char* n ) { author.assign(n); }
|
||||||
inline void setVersion( const char* n ) { version.assign(n); }
|
inline void setVersion( const char* n ) { version.assign(n); }
|
||||||
|
@ -187,7 +187,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (c == '\f' || c == '\n' ||
|
if (c == '\f' || c == '\n' ||
|
||||||
c == '\t' || c == '\r' ||
|
c == '\t' || c == '\r' ||
|
||||||
c == 'v' || c == ' ')
|
c == '\v' || c == ' ')
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,11 @@ void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags,
|
|||||||
|
|
||||||
void CTaskMngr::CTask::clear()
|
void CTaskMngr::CTask::clear()
|
||||||
{
|
{
|
||||||
|
if (m_iFunc >= 0)
|
||||||
|
{
|
||||||
|
unregisterSPForward(m_iFunc);
|
||||||
|
m_iFunc = -1;
|
||||||
|
}
|
||||||
m_bFree = true;
|
m_bFree = true;
|
||||||
if (m_pParams)
|
if (m_pParams)
|
||||||
{
|
{
|
||||||
@ -122,6 +127,9 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
|||||||
executeForwards(m_iFunc, m_iId);
|
executeForwards(m_iFunc, m_iId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isFree())
|
||||||
|
return;
|
||||||
|
|
||||||
// set new exec time OR remove the task if needed
|
// set new exec time OR remove the task if needed
|
||||||
if (m_bLoop || (--m_iRepeat > 0))
|
if (m_bLoop || (--m_iRepeat > 0))
|
||||||
{
|
{
|
||||||
@ -130,7 +138,7 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
unregisterSPForward(m_iFunc);
|
unregisterSPForward(m_iFunc);
|
||||||
m_iFunc = 0;
|
m_iFunc = -1;
|
||||||
m_bFree = true;
|
m_bFree = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,12 @@
|
|||||||
|
|
||||||
; Revision History
|
; Revision History
|
||||||
;------------------
|
;------------------
|
||||||
|
; 16 September 2004 by David "BAILOPAN" Anderson
|
||||||
|
; Implemented a compile time toggleable debug hook on OP_CALL and OP_RET.
|
||||||
|
; NOTE: JIT has not had debug hooks since 1999.
|
||||||
|
; 8 September 2004 by David "BAILOPAN" Anderson
|
||||||
|
; Changed OP_LINE call to be compile-time toggle-able between compiling
|
||||||
|
; line ops or not.
|
||||||
; 29 June 2004 by G.W.M. Vissers
|
; 29 June 2004 by G.W.M. Vissers
|
||||||
; Translated the thing into NASM. The actual generation of the code is
|
; Translated the thing into NASM. The actual generation of the code is
|
||||||
; put into the data section because the code modifies itself whereas the
|
; put into the data section because the code modifies itself whereas the
|
||||||
@ -147,8 +153,15 @@ _dbgcode: resd 1
|
|||||||
_dbgaddr: resd 1
|
_dbgaddr: resd 1
|
||||||
_dbgparam: resd 1
|
_dbgparam: resd 1
|
||||||
_dbgname: resd 1
|
_dbgname: resd 1
|
||||||
_usertags: resd 4 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
;usertags and userdata are 16 bytes on AMX Mod X
|
||||||
_userdata: resd 4 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
_usertags1: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_usertags2: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_usertags3: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_usertags4: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata1: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata2: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata3: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata4: resd 1 ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
_error: resd 1
|
_error: resd 1
|
||||||
_pri: resd 1
|
_pri: resd 1
|
||||||
_alt: resd 1
|
_alt: resd 1
|
||||||
@ -265,6 +278,14 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
|||||||
|
|
||||||
;
|
;
|
||||||
; This is the work horse of the whole JIT: It actually copies the code.
|
; This is the work horse of the whole JIT: It actually copies the code.
|
||||||
|
; Notes from ~dvander (with help of dJeyL)
|
||||||
|
; This takes a source and ending address pointer in the assembled JIT code.
|
||||||
|
; Then it subtracts them and copies the code in between.
|
||||||
|
; The last parameter is the number of bytes the opcode is so it can jump
|
||||||
|
; to the next one.
|
||||||
|
; Also note that the "in between" code is NEVER executed during the compile
|
||||||
|
; phase of the JIT. It's only assembled in memory, and copied into the
|
||||||
|
; final output bytecode by this function.
|
||||||
%macro GO_ON 2-3 4
|
%macro GO_ON 2-3 4
|
||||||
mov esi, %1 ;get source address of JIT code
|
mov esi, %1 ;get source address of JIT code
|
||||||
mov ecx,%2-%1 ;get number of bytes to copy
|
mov ecx,%2-%1 ;get number of bytes to copy
|
||||||
@ -280,6 +301,8 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
|||||||
; Nasm can't handle the determination of the maximum code size as was done
|
; Nasm can't handle the determination of the maximum code size as was done
|
||||||
; in the Masm implementation, since it only does two passes. This macro is
|
; in the Masm implementation, since it only does two passes. This macro is
|
||||||
; called *after* the code for each Small instruction.
|
; called *after* the code for each Small instruction.
|
||||||
|
; Notes by ~dvander: This just substracts a label's ip from the current ip.
|
||||||
|
; Therefore you get an instant size check - see RELOC
|
||||||
%macro CHECKCODESIZE 1
|
%macro CHECKCODESIZE 1
|
||||||
%if MAXCODESIZE < $-%1
|
%if MAXCODESIZE < $-%1
|
||||||
%assign MAXCODESIZE $-%1
|
%assign MAXCODESIZE $-%1
|
||||||
@ -290,6 +313,11 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
|||||||
; Modify the argument of an x86 instruction with the Small opcode's parameter
|
; Modify the argument of an x86 instruction with the Small opcode's parameter
|
||||||
; before copying the code.
|
; before copying the code.
|
||||||
;
|
;
|
||||||
|
; Notes by ~dvander (thanks to dJeyL) - this will take an address and modify
|
||||||
|
; the dword at it. Since the JIT copies already assembled code, you see
|
||||||
|
; things like "call 12345678h". This is an arbitrary value as putval
|
||||||
|
; will modify it in memory and then GO_ON will add it to the program.
|
||||||
|
; It is important to get the putval address right - it's in bytes.
|
||||||
%macro putval 1
|
%macro putval 1
|
||||||
mov eax,[ebx+4]
|
mov eax,[ebx+4]
|
||||||
mov dword [%1],eax
|
mov dword [%1],eax
|
||||||
@ -298,7 +326,12 @@ AMX_FLAG_RELOC equ 8000h ; jump/call addresses relocated
|
|||||||
;
|
;
|
||||||
; Add an entry to the table of addresses which have to be relocated after the
|
; Add an entry to the table of addresses which have to be relocated after the
|
||||||
; code compilation is done.
|
; code compilation is done.
|
||||||
;
|
; Notes by ~dvander: This is sort of what amx_BrowseRelocate() does, although
|
||||||
|
; relocation is actually done after code generation (this just adds to a
|
||||||
|
; table). Like putval, this takes in an address and marks it to be
|
||||||
|
; rewritten. It is a good idea to just use labels to find relocation
|
||||||
|
; offsets (see OP_CALL and OP_RETN). After code generation, this table
|
||||||
|
; is browsed and the correct threaded jumps are placed.
|
||||||
%macro RELOC 1-2 ; adr, dest
|
%macro RELOC 1-2 ; adr, dest
|
||||||
mov ebp,[reloc_num]
|
mov ebp,[reloc_num]
|
||||||
%if %0 < 2
|
%if %0 < 2
|
||||||
@ -1040,22 +1073,119 @@ OP_RET:
|
|||||||
;good
|
;good
|
||||||
OP_RETN:
|
OP_RETN:
|
||||||
;nop;
|
;nop;
|
||||||
GO_ON j_retn, OP_CALL
|
;save registers
|
||||||
|
push eax
|
||||||
|
push ebp
|
||||||
|
;get .amx flags
|
||||||
|
mov ebp,[amxhead]
|
||||||
|
mov eax,[ebp+_h_flags]
|
||||||
|
;check to see if the flag has line ops
|
||||||
|
and eax,AMX_FLAG_DEBUG
|
||||||
|
cmp eax,AMX_FLAG_DEBUG
|
||||||
|
;restore registers
|
||||||
|
pop ebp
|
||||||
|
pop eax
|
||||||
|
;if so, skip down to debug compiler
|
||||||
|
jmp _go_jit_retn_debug
|
||||||
|
|
||||||
|
_go_jit_retn_nodebug:
|
||||||
|
GO_ON j_retn_nodebug, _go_jit_retn_go
|
||||||
|
j_retn_nodebug:
|
||||||
|
jmp [jit_retn]
|
||||||
|
CHECKCODESIZE j_retn_nodebug
|
||||||
|
_go_jit_retn_go:
|
||||||
|
jmp _go_jit_retn_end
|
||||||
|
|
||||||
|
_go_jit_retn_debug:
|
||||||
|
GO_ON j_retn, OP_CALL
|
||||||
j_retn:
|
j_retn:
|
||||||
|
push ebp
|
||||||
|
push eax
|
||||||
|
push edx
|
||||||
|
;get AMX
|
||||||
|
mov ebp,amx
|
||||||
|
;get debug call ptr
|
||||||
|
mov eax,[ebp+_userdata2]
|
||||||
|
;check validity
|
||||||
|
mov edx, dword 0
|
||||||
|
cmp eax, edx
|
||||||
|
je _go_jit_skip_debug
|
||||||
|
xchg esp,esi ;switch stack
|
||||||
|
push 1 ;param 2 mode 1 = pop
|
||||||
|
push ebp ;param 1 - amx
|
||||||
|
call eax ;indirect debug call
|
||||||
|
add esp, 8 ;restore stack
|
||||||
|
xchg esp,esi ;return to AMX stack
|
||||||
|
mov ebp,amx ;restore AMX [necessary?]
|
||||||
|
_go_jit_skip_debug:
|
||||||
|
pop edx
|
||||||
|
pop eax
|
||||||
|
pop ebp
|
||||||
jmp [jit_retn]
|
jmp [jit_retn]
|
||||||
CHECKCODESIZE j_retn
|
CHECKCODESIZE j_retn
|
||||||
|
_go_jit_retn_end:
|
||||||
|
|
||||||
;good
|
;good
|
||||||
OP_CALL:
|
OP_CALL:
|
||||||
;nop;
|
;nop;
|
||||||
RELOC 1
|
;save registers
|
||||||
GO_ON j_call, OP_CALL_I, 8
|
push eax
|
||||||
|
push ebp
|
||||||
|
;get .amx flags
|
||||||
|
mov ebp,[amxhead]
|
||||||
|
mov eax,[ebp+_h_flags]
|
||||||
|
;check to see if the flag has line ops
|
||||||
|
and eax,AMX_FLAG_DEBUG
|
||||||
|
cmp eax,AMX_FLAG_DEBUG
|
||||||
|
;restore registers
|
||||||
|
pop ebp
|
||||||
|
pop eax
|
||||||
|
;if so, skip down to debug compiler
|
||||||
|
jmp _go_jit_debug
|
||||||
|
|
||||||
|
_go_jit_nodebug:
|
||||||
|
RELOC 1
|
||||||
|
GO_ON j_call_nodebug, _j_call_go_on, 8
|
||||||
|
j_call_nodebug:
|
||||||
|
db 0e8h, 0, 0, 0, 0
|
||||||
|
CHECKCODESIZE j_call_nodebug
|
||||||
|
|
||||||
|
_j_call_go_on:
|
||||||
|
jmp _opcall_end
|
||||||
|
|
||||||
|
_go_jit_debug:
|
||||||
|
;thanks to Julien "dJeyL" Laurent for code relocation explanation
|
||||||
|
RELOC _go_jit_reloc-j_call+1
|
||||||
|
GO_ON j_call, OP_CALL_I, 8
|
||||||
j_call:
|
j_call:
|
||||||
;call 12345678h ; tasm chokes on this out of a sudden
|
; save some registers
|
||||||
|
push ebp
|
||||||
|
push eax
|
||||||
|
push edx
|
||||||
|
; get AMX
|
||||||
|
mov ebp,amx
|
||||||
|
; get debug call pointer
|
||||||
|
mov eax,[ebp+_userdata2]
|
||||||
|
; check to see if it's valid
|
||||||
|
mov edx, dword 0
|
||||||
|
cmp eax,edx
|
||||||
|
je _go_jit_skip_call
|
||||||
|
xchg esp,esi ;switch to caller stack
|
||||||
|
push 2 ;param mode=2, push
|
||||||
|
push ebp ;param amx
|
||||||
|
call eax ;indirect call
|
||||||
|
add esp, 8 ;restore stack
|
||||||
|
xchg esp,esi ;return to AMX stack
|
||||||
|
mov ebp,amx ;restore AMX [necessary?]
|
||||||
|
_go_jit_skip_call:
|
||||||
|
;restore original registers
|
||||||
|
pop edx
|
||||||
|
pop eax
|
||||||
|
pop ebp
|
||||||
|
_go_jit_reloc:
|
||||||
db 0e8h, 0, 0, 0, 0
|
db 0e8h, 0, 0, 0, 0
|
||||||
CHECKCODESIZE j_call
|
CHECKCODESIZE j_call
|
||||||
|
_opcall_end:
|
||||||
|
|
||||||
OP_CALL_I:
|
OP_CALL_I:
|
||||||
;nop;
|
;nop;
|
||||||
@ -2223,7 +2353,6 @@ JIT_OP_LINE:
|
|||||||
pop eax
|
pop eax
|
||||||
jmp ecx ; jump back
|
jmp ecx ; jump back
|
||||||
|
|
||||||
|
|
||||||
JIT_OP_SWITCH:
|
JIT_OP_SWITCH:
|
||||||
pop ebp ; pop return address = table address
|
pop ebp ; pop return address = table address
|
||||||
mov ecx,[ebp] ; ECX = number of records
|
mov ecx,[ebp] ; ECX = number of records
|
||||||
@ -2241,7 +2370,6 @@ JIT_OP_SWITCH:
|
|||||||
jmp ebp
|
jmp ebp
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
; The caller of asm_runJIT() can determine the maximum size of the compiled
|
; The caller of asm_runJIT() can determine the maximum size of the compiled
|
||||||
; code by multiplying the result of this function by the number of opcodes in
|
; code by multiplying the result of this function by the number of opcodes in
|
||||||
; Small module.
|
; Small module.
|
||||||
|
Binary file not shown.
Binary file not shown.
368
amxmodx/amx.cpp
368
amxmodx/amx.cpp
@ -39,11 +39,13 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h> /* for wchar_t */
|
#include <stddef.h> /* for wchar_t */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <malloc.h>
|
||||||
#include "osdefs.h"
|
#include "osdefs.h"
|
||||||
#if defined LINUX
|
#if defined LINUX
|
||||||
#include <sclinux.h>
|
#include <sclinux.h>
|
||||||
@ -426,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;
|
||||||
@ -435,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
|
||||||
@ -479,6 +483,62 @@ int AMXAPI amx_Debug(AMX *amx)
|
|||||||
return AMX_ERR_DEBUG;
|
return AMX_ERR_DEBUG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Here is the actual debugger that AMX Mod X uses
|
||||||
|
int AMXAPI amx_DebugCall(AMX *amx, int mode)
|
||||||
|
{
|
||||||
|
//right away, check for debugging
|
||||||
|
AMX_HEADER *hdr;
|
||||||
|
AMX_DBG *p = 0;
|
||||||
|
AMX_TRACE *t = 0;
|
||||||
|
hdr = (AMX_HEADER *)amx->base;
|
||||||
|
if ( !(amx->flags & AMX_FLAG_DEBUG) || !(amx->flags & AMX_FLAG_LINEOPS))
|
||||||
|
return AMX_ERR_NONE;
|
||||||
|
p = (AMX_DBG *)(amx->userdata[0]);
|
||||||
|
if ( !p )
|
||||||
|
return AMX_ERR_NONE;
|
||||||
|
if (mode == 2)
|
||||||
|
{
|
||||||
|
//mode - push onto the stack
|
||||||
|
t = (AMX_TRACE *)malloc(sizeof(AMX_TRACE));
|
||||||
|
memset(t, 0, sizeof(AMX_TRACE));
|
||||||
|
if (!p->head)
|
||||||
|
{
|
||||||
|
p->head = t;
|
||||||
|
t->prev = NULL;
|
||||||
|
} else {
|
||||||
|
t->prev = p->tail;
|
||||||
|
p->tail->next = t;
|
||||||
|
}
|
||||||
|
p->tail = t;
|
||||||
|
t->line = amx->curline;
|
||||||
|
t->file = amx->curfile;
|
||||||
|
} else if (mode == 1) {
|
||||||
|
//mode <0 - pop from the stack
|
||||||
|
t = p->tail;
|
||||||
|
if (t)
|
||||||
|
{
|
||||||
|
p->tail = t->prev;
|
||||||
|
free(t);
|
||||||
|
}
|
||||||
|
if (p->tail == NULL)
|
||||||
|
p->head = NULL;
|
||||||
|
} else if (mode == 0) {
|
||||||
|
AMX_TRACE *m;
|
||||||
|
//mode == 0 - clear stack
|
||||||
|
t = p->head;
|
||||||
|
while (t)
|
||||||
|
{
|
||||||
|
m = t->next;
|
||||||
|
free(t);
|
||||||
|
t = m;
|
||||||
|
}
|
||||||
|
p->head = 0;
|
||||||
|
p->tail = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AMX_ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined JIT
|
#if defined JIT
|
||||||
#if defined WIN32 || defined __cplusplus
|
#if defined WIN32 || defined __cplusplus
|
||||||
extern "C" int AMXAPI getMaxCodeSize(void);
|
extern "C" int AMXAPI getMaxCodeSize(void);
|
||||||
@ -508,7 +568,6 @@ static int amx_BrowseRelocate(AMX *amx)
|
|||||||
cell cip;
|
cell cip;
|
||||||
long codesize;
|
long codesize;
|
||||||
OPCODE op;
|
OPCODE op;
|
||||||
int debug;
|
|
||||||
int last_sym_global = 0;
|
int last_sym_global = 0;
|
||||||
#if defined __GNUC__ || defined ASM32 || defined JIT
|
#if defined __GNUC__ || defined ASM32 || defined JIT
|
||||||
cell *opcode_list;
|
cell *opcode_list;
|
||||||
@ -535,13 +594,22 @@ static int amx_BrowseRelocate(AMX *amx)
|
|||||||
assert(OP_MOVS==117);
|
assert(OP_MOVS==117);
|
||||||
assert(OP_SYMBOL==126);
|
assert(OP_SYMBOL==126);
|
||||||
|
|
||||||
/* check the debug hook */
|
|
||||||
amx->dbgcode=DBG_INIT;
|
|
||||||
assert(amx->flags==0);
|
|
||||||
amx->flags=AMX_FLAG_BROWSE;
|
amx->flags=AMX_FLAG_BROWSE;
|
||||||
debug= amx->debug(amx)==AMX_ERR_NONE;
|
|
||||||
if (debug)
|
/* check the debug hook */
|
||||||
amx->flags|=AMX_FLAG_DEBUG;
|
if ((hdr->flags & AMX_FLAG_LINEOPS) && !(hdr->flags & AMX_FLAG_TRACED))
|
||||||
|
{
|
||||||
|
amx->userdata[0] = (AMX_DBG *)malloc(sizeof(AMX_DBG));
|
||||||
|
amx->userdata[1] = (void *)amx_DebugCall;
|
||||||
|
memset(amx->userdata[0], 0, sizeof(AMX_DBG));
|
||||||
|
amx->flags |= AMX_FLAG_LINEOPS;
|
||||||
|
amx->flags |= AMX_FLAG_TRACED;
|
||||||
|
amx->flags |= AMX_FLAG_DEBUG;
|
||||||
|
} else {
|
||||||
|
amx->userdata[0] = 0;
|
||||||
|
amx->userdata[1] = 0;
|
||||||
|
amx->userdata[2] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined __GNUC__ || defined ASM32 || defined JIT && !defined __64BIT__
|
#if defined __GNUC__ || defined ASM32 || defined JIT && !defined __64BIT__
|
||||||
amx_Exec(amx, (cell*)&opcode_list, 0, 0);
|
amx_Exec(amx, (cell*)&opcode_list, 0, 0);
|
||||||
@ -722,21 +790,25 @@ static int amx_BrowseRelocate(AMX *amx)
|
|||||||
DBGPARAM(amx->curfile);
|
DBGPARAM(amx->curfile);
|
||||||
amx->dbgname=(char *)(code+(int)cip);
|
amx->dbgname=(char *)(code+(int)cip);
|
||||||
cip+=num - sizeof(cell);
|
cip+=num - sizeof(cell);
|
||||||
if (debug) {
|
if (!(hdr->flags & AMX_FLAG_TRACED) && amx->userdata[0] != NULL)
|
||||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
{
|
||||||
amx->dbgcode=DBG_FILE;
|
AMX_DBG *pDbg = (AMX_DBG *)(amx->userdata[0]);
|
||||||
amx->debug(amx);
|
if (pDbg->numFiles == 0)
|
||||||
|
{
|
||||||
|
pDbg->numFiles++;
|
||||||
|
pDbg->files = (char **)malloc(sizeof(char *) * 1);
|
||||||
|
} else {
|
||||||
|
pDbg->numFiles++;
|
||||||
|
pDbg->files = (char **)realloc(pDbg->files, pDbg->numFiles * sizeof(char*));
|
||||||
|
}
|
||||||
|
pDbg->files[pDbg->numFiles-1] = (char *)malloc((sizeof(char) * strlen(amx->dbgname)) + 1);
|
||||||
|
strcpy(pDbg->files[pDbg->numFiles-1], amx->dbgname);
|
||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
} /* case */
|
} /* case */
|
||||||
case OP_LINE:
|
case OP_LINE:
|
||||||
DBGPARAM(amx->curline);
|
DBGPARAM(amx->curline);
|
||||||
DBGPARAM(amx->curfile);
|
DBGPARAM(amx->curfile);
|
||||||
if (debug) {
|
|
||||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
|
||||||
amx->dbgcode=DBG_LINE;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_SYMBOL: {
|
case OP_SYMBOL: {
|
||||||
cell num;
|
cell num;
|
||||||
@ -746,29 +818,14 @@ static int amx_BrowseRelocate(AMX *amx)
|
|||||||
amx->dbgname=(char *)(code+(int)cip);
|
amx->dbgname=(char *)(code+(int)cip);
|
||||||
cip+=num - 2*sizeof(cell);
|
cip+=num - 2*sizeof(cell);
|
||||||
last_sym_global = (amx->dbgparam >> 8)==0;
|
last_sym_global = (amx->dbgparam >> 8)==0;
|
||||||
if (debug && last_sym_global) { /* do global symbols only */
|
|
||||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
|
||||||
amx->dbgcode=DBG_SYMBOL;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
} /* case */
|
} /* case */
|
||||||
case OP_SRANGE:
|
case OP_SRANGE:
|
||||||
DBGPARAM(amx->dbgaddr); /* dimension level */
|
DBGPARAM(amx->dbgaddr); /* dimension level */
|
||||||
DBGPARAM(amx->dbgparam); /* length */
|
DBGPARAM(amx->dbgparam); /* length */
|
||||||
if (debug && last_sym_global) { /* do global symbols only */
|
|
||||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
|
||||||
amx->dbgcode=DBG_SRANGE;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_SYMTAG:
|
case OP_SYMTAG:
|
||||||
DBGPARAM(amx->dbgparam); /* tag id */
|
DBGPARAM(amx->dbgparam); /* tag id */
|
||||||
if (debug && last_sym_global) { /* do global symbols only */
|
|
||||||
assert(amx->flags==(AMX_FLAG_DEBUG | AMX_FLAG_BROWSE));
|
|
||||||
amx->dbgcode=DBG_SYMTAG;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_CASETBL: {
|
case OP_CASETBL: {
|
||||||
cell num;
|
cell num;
|
||||||
@ -797,6 +854,7 @@ static int amx_BrowseRelocate(AMX *amx)
|
|||||||
|
|
||||||
amx->flags &= ~AMX_FLAG_BROWSE;
|
amx->flags &= ~AMX_FLAG_BROWSE;
|
||||||
amx->flags |= AMX_FLAG_RELOC;
|
amx->flags |= AMX_FLAG_RELOC;
|
||||||
|
amx->flags |= AMX_FLAG_TRACED;
|
||||||
return AMX_ERR_NONE;
|
return AMX_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -936,8 +994,6 @@ int AMXAPI amx_Init(AMX *amx,void *program)
|
|||||||
amx->stk=amx->stp;
|
amx->stk=amx->stp;
|
||||||
if (amx->callback==NULL)
|
if (amx->callback==NULL)
|
||||||
amx->callback=amx_Callback;
|
amx->callback=amx_Callback;
|
||||||
if (amx->debug==NULL)
|
|
||||||
amx->debug=amx_Debug;
|
|
||||||
amx->curline=0;
|
amx->curline=0;
|
||||||
amx->curfile=0;
|
amx->curfile=0;
|
||||||
amx->data=NULL;
|
amx->data=NULL;
|
||||||
@ -1058,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 __ */
|
||||||
|
|
||||||
@ -1072,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 */
|
||||||
@ -1755,7 +1822,8 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
ucell codesize;
|
ucell codesize;
|
||||||
int num,i;
|
int num,i;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int debug;
|
AMX_DEBUGCALL tracer = 0;
|
||||||
|
AMX_DBG *pdbg = 0;
|
||||||
|
|
||||||
/* HACK: return label table (for amx_BrowseRelocate) if amx structure
|
/* HACK: return label table (for amx_BrowseRelocate) if amx structure
|
||||||
* has the AMX_FLAG_BROWSE flag set.
|
* has the AMX_FLAG_BROWSE flag set.
|
||||||
@ -1763,7 +1831,12 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
if ((amx->flags & AMX_FLAG_BROWSE)==AMX_FLAG_BROWSE) {
|
if ((amx->flags & AMX_FLAG_BROWSE)==AMX_FLAG_BROWSE) {
|
||||||
assert(sizeof(cell)==sizeof(void *));
|
assert(sizeof(cell)==sizeof(void *));
|
||||||
assert(retval!=NULL);
|
assert(retval!=NULL);
|
||||||
*retval=(cell)((amx->flags & AMX_FLAG_DEBUG)==0 ? amx_opcodelist_nodebug : amx_opcodelist);
|
if (amx->flags & AMX_FLAG_DEBUG)
|
||||||
|
{
|
||||||
|
*retval=(cell)(amx_opcodelist);
|
||||||
|
} else {
|
||||||
|
*retval=(cell)(amx_opcodelist_nodebug);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
@ -1776,7 +1849,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
if ((amx->flags & AMX_FLAG_RELOC)==0)
|
if ((amx->flags & AMX_FLAG_RELOC)==0)
|
||||||
return AMX_ERR_INIT;
|
return AMX_ERR_INIT;
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
debug= (amx->flags & AMX_FLAG_DEBUG)!=0;
|
|
||||||
|
|
||||||
/* set up the registers */
|
/* set up the registers */
|
||||||
hdr=(AMX_HEADER *)amx->base;
|
hdr=(AMX_HEADER *)amx->base;
|
||||||
@ -1818,15 +1890,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
CHKHEAP();
|
CHKHEAP();
|
||||||
init_little_endian();
|
init_little_endian();
|
||||||
|
|
||||||
if (debug && index!=AMX_EXEC_CONT) {
|
|
||||||
/* set the entry point in the debugger by marking a "call" to the
|
|
||||||
* exported function
|
|
||||||
*/
|
|
||||||
amx->dbgcode=DBG_CALL;
|
|
||||||
amx->dbgaddr=(ucell)((unsigned char*)cip-code);
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
assert(OP_PUSH_PRI==36);
|
assert(OP_PUSH_PRI==36);
|
||||||
assert(OP_PROC==46);
|
assert(OP_PROC==46);
|
||||||
@ -1869,6 +1932,20 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
/* check stack/heap before starting to run */
|
/* check stack/heap before starting to run */
|
||||||
CHKMARGIN();
|
CHKMARGIN();
|
||||||
|
|
||||||
|
if ((amx->flags & AMX_FLAG_DEBUG) && (amx->flags & AMX_FLAG_LINEOPS))
|
||||||
|
{
|
||||||
|
if (amx->userdata[0])
|
||||||
|
{
|
||||||
|
tracer = (AMX_DEBUGCALL)amx->userdata[1];
|
||||||
|
pdbg = (AMX_DBG *)(amx->userdata[0]);
|
||||||
|
if (tracer)
|
||||||
|
{
|
||||||
|
//as a precaution, clear the call stack
|
||||||
|
(tracer)(amx, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* start running */
|
/* start running */
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
|
|
||||||
@ -2132,12 +2209,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
stk+=offs;
|
stk+=offs;
|
||||||
CHKMARGIN();
|
CHKMARGIN();
|
||||||
CHKSTACK();
|
CHKSTACK();
|
||||||
if (debug && offs>0) {
|
|
||||||
amx->dbgcode=DBG_CLRSYM;
|
|
||||||
amx->stk=stk;
|
|
||||||
amx->hea=hea;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_stack_nodebug:
|
op_stack_nodebug:
|
||||||
GETPARAM(offs);
|
GETPARAM(offs);
|
||||||
@ -2159,19 +2230,16 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
CHKMARGIN();
|
CHKMARGIN();
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_ret:
|
op_ret:
|
||||||
|
if (tracer)
|
||||||
|
{
|
||||||
|
(tracer)(amx, 1);
|
||||||
|
}
|
||||||
POP(frm);
|
POP(frm);
|
||||||
POP(offs);
|
POP(offs);
|
||||||
/* verify the return address */
|
/* verify the return address */
|
||||||
if ((ucell)offs>=codesize)
|
if ((ucell)offs>=codesize)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
cip=(cell *)(code+(int)offs);
|
cip=(cell *)(code+(int)offs);
|
||||||
if (debug) {
|
|
||||||
amx->stk=stk;
|
|
||||||
amx->hea=hea;
|
|
||||||
amx->dbgcode=DBG_RETURN;
|
|
||||||
amx->dbgparam=pri; /* store "return value" */
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_ret_nodebug:
|
op_ret_nodebug:
|
||||||
POP(frm);
|
POP(frm);
|
||||||
@ -2182,6 +2250,10 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
cip=(cell *)(code+(int)offs);
|
cip=(cell *)(code+(int)offs);
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_retn:
|
op_retn:
|
||||||
|
if (tracer)
|
||||||
|
{
|
||||||
|
(tracer)(amx, 1);
|
||||||
|
}
|
||||||
POP(frm);
|
POP(frm);
|
||||||
POP(offs);
|
POP(offs);
|
||||||
/* verify the return address */
|
/* verify the return address */
|
||||||
@ -2189,15 +2261,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
cip=(cell *)(code+(int)offs);
|
cip=(cell *)(code+(int)offs);
|
||||||
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
||||||
if (debug) {
|
|
||||||
amx->stk=stk;
|
|
||||||
amx->hea=hea;
|
|
||||||
amx->dbgcode=DBG_RETURN;
|
|
||||||
amx->dbgparam=pri; /* store "return value" */
|
|
||||||
amx->debug(amx);
|
|
||||||
amx->dbgcode=DBG_CLRSYM;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_retn_nodebug:
|
op_retn_nodebug:
|
||||||
POP(frm);
|
POP(frm);
|
||||||
@ -2209,26 +2272,24 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_call:
|
op_call:
|
||||||
|
if (tracer)
|
||||||
|
{
|
||||||
|
(tracer)(amx, 2);
|
||||||
|
}
|
||||||
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* push address behind instruction */
|
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* push address behind instruction */
|
||||||
cip=JUMPABS(code, cip); /* jump to the address */
|
cip=JUMPABS(code, cip); /* jump to the address */
|
||||||
if (debug) {
|
|
||||||
amx->dbgcode=DBG_CALL;
|
|
||||||
amx->dbgaddr=(ucell)((unsigned char*)cip-code);
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_call_nodebug:
|
op_call_nodebug:
|
||||||
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* push address behind instruction */
|
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* push address behind instruction */
|
||||||
cip=JUMPABS(code, cip); /* jump to the address */
|
cip=JUMPABS(code, cip); /* jump to the address */
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_call_pri:
|
op_call_pri:
|
||||||
|
if (tracer)
|
||||||
|
{
|
||||||
|
(tracer)(amx, 2);
|
||||||
|
}
|
||||||
PUSH((unsigned char *)cip-code);
|
PUSH((unsigned char *)cip-code);
|
||||||
cip=(cell *)(code+(int)pri);
|
cip=(cell *)(code+(int)pri);
|
||||||
if (debug) {
|
|
||||||
amx->dbgcode=DBG_CALL;
|
|
||||||
amx->dbgaddr=pri;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_call_pri_nodebug:
|
op_call_pri_nodebug:
|
||||||
PUSH((unsigned char *)cip-code);
|
PUSH((unsigned char *)cip-code);
|
||||||
@ -2560,12 +2621,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
amx->pri=pri;
|
amx->pri=pri;
|
||||||
amx->alt=alt;
|
amx->alt=alt;
|
||||||
amx->cip=(cell)((unsigned char*)cip-code);
|
amx->cip=(cell)((unsigned char*)cip-code);
|
||||||
if (debug) {
|
|
||||||
amx->dbgcode=DBG_TERMINATE;
|
|
||||||
amx->dbgaddr=(cell)((unsigned char *)cip-code);
|
|
||||||
amx->dbgparam=offs;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
if (offs==AMX_ERR_SLEEP) {
|
if (offs==AMX_ERR_SLEEP) {
|
||||||
amx->reset_stk=reset_stk;
|
amx->reset_stk=reset_stk;
|
||||||
amx->reset_hea=reset_hea;
|
amx->reset_hea=reset_hea;
|
||||||
@ -2642,23 +2697,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
GETPARAM(amx->curline);
|
GETPARAM(amx->curline);
|
||||||
GETPARAM(amx->curfile);
|
GETPARAM(amx->curfile);
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm;
|
|
||||||
amx->stk=stk;
|
|
||||||
amx->hea=hea;
|
|
||||||
amx->dbgcode=DBG_LINE;
|
|
||||||
num=amx->debug(amx);
|
|
||||||
if (num!=AMX_ERR_NONE) {
|
|
||||||
if (num==AMX_ERR_SLEEP) {
|
|
||||||
amx->pri=pri;
|
|
||||||
amx->alt=alt;
|
|
||||||
amx->cip=(cell)((unsigned char*)cip-code);
|
|
||||||
amx->reset_stk=reset_stk;
|
|
||||||
amx->reset_hea=reset_hea;
|
|
||||||
} /* if */
|
|
||||||
ABORT(amx,num);
|
|
||||||
} /* if */
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_line_nodebug:
|
op_line_nodebug:
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
@ -2674,10 +2712,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
cip=(cell *)((unsigned char *)cip + (int)offs - 2*sizeof(cell));
|
cip=(cell *)((unsigned char *)cip + (int)offs - 2*sizeof(cell));
|
||||||
amx->dbgcode=DBG_SYMBOL;
|
amx->dbgcode=DBG_SYMBOL;
|
||||||
assert((amx->dbgparam >> 8)>0); /* local symbols only */
|
assert((amx->dbgparam >> 8)>0); /* local symbols only */
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_symbol_nodebug:
|
op_symbol_nodebug:
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
@ -2689,10 +2723,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
GETPARAM(amx->dbgaddr); /* dimension level */
|
GETPARAM(amx->dbgaddr); /* dimension level */
|
||||||
GETPARAM(amx->dbgparam); /* length */
|
GETPARAM(amx->dbgparam); /* length */
|
||||||
amx->dbgcode=DBG_SRANGE;
|
amx->dbgcode=DBG_SRANGE;
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_srange_nodebug:
|
op_srange_nodebug:
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
@ -2702,10 +2732,6 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
GETPARAM(amx->dbgparam); /* tag id */
|
GETPARAM(amx->dbgparam); /* tag id */
|
||||||
amx->dbgcode=DBG_SYMTAG;
|
amx->dbgcode=DBG_SYMTAG;
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
NEXT(cip);
|
NEXT(cip);
|
||||||
op_symtag_nodebug:
|
op_symtag_nodebug:
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
@ -2798,7 +2824,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
ucell codesize;
|
ucell codesize;
|
||||||
int i;
|
int i;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int debug;
|
|
||||||
#if defined ASM32 || defined JIT
|
#if defined ASM32 || defined JIT
|
||||||
#ifdef __WATCOMC__
|
#ifdef __WATCOMC__
|
||||||
#pragma aux amx_opcodelist "_*"
|
#pragma aux amx_opcodelist "_*"
|
||||||
@ -2810,6 +2835,8 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
cell offs;
|
cell offs;
|
||||||
int num;
|
int num;
|
||||||
#endif
|
#endif
|
||||||
|
AMX_DEBUGCALL tracer = 0;
|
||||||
|
AMX_DBG *pdbg = 0;
|
||||||
|
|
||||||
#if defined ASM32 || defined JIT
|
#if defined ASM32 || defined JIT
|
||||||
/* HACK: return label table (for amx_BrowseRelocate) if amx structure
|
/* HACK: return label table (for amx_BrowseRelocate) if amx structure
|
||||||
@ -2825,12 +2852,27 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
*/
|
*/
|
||||||
*retval=(cell)amx_opcodelist;
|
*retval=(cell)amx_opcodelist;
|
||||||
#else
|
#else
|
||||||
*retval=(cell)((amx->flags & AMX_FLAG_DEBUG)==0 ? amx_opcodelist_nodebug : amx_opcodelist);
|
if (amx->flags & AMX_FLAG_DEBUG)
|
||||||
|
{
|
||||||
|
*retval=(cell)(amx_opcodelist);
|
||||||
|
} else {
|
||||||
|
*retval=(cell)(amx_opcodelist_nodebug);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
} /* if */
|
} /* if */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
if ((amx->flags & AMX_FLAG_DEBUG) && (amx->flags & AMX_FLAG_LINEOPS))
|
||||||
|
{
|
||||||
|
if (amx->userdata[0])
|
||||||
|
{
|
||||||
|
tracer = (AMX_DEBUGCALL)amx->userdata[1];
|
||||||
|
pdbg = (AMX_DBG *)(amx->userdata[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (amx->callback==NULL)
|
if (amx->callback==NULL)
|
||||||
return AMX_ERR_CALLBACK;
|
return AMX_ERR_CALLBACK;
|
||||||
i=amx_Register(amx,NULL,0); /* verify that all natives are registered */
|
i=amx_Register(amx,NULL,0); /* verify that all natives are registered */
|
||||||
@ -2840,8 +2882,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
if ((amx->flags & AMX_FLAG_RELOC)==0)
|
if ((amx->flags & AMX_FLAG_RELOC)==0)
|
||||||
return AMX_ERR_INIT;
|
return AMX_ERR_INIT;
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
debug= (amx->flags & AMX_FLAG_DEBUG)!=0;
|
|
||||||
|
|
||||||
/* set up the registers */
|
/* set up the registers */
|
||||||
hdr=(AMX_HEADER *)amx->base;
|
hdr=(AMX_HEADER *)amx->base;
|
||||||
assert(hdr->magic==AMX_MAGIC);
|
assert(hdr->magic==AMX_MAGIC);
|
||||||
@ -2882,15 +2922,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
CHKHEAP();
|
CHKHEAP();
|
||||||
init_little_endian();
|
init_little_endian();
|
||||||
|
|
||||||
if (debug && index!=AMX_EXEC_CONT) {
|
|
||||||
/* set the entry point in the debugger by marking a "call" to the
|
|
||||||
* exported function
|
|
||||||
*/
|
|
||||||
amx->dbgcode=DBG_CALL;
|
|
||||||
amx->dbgaddr=(ucell)((unsigned char *)cip-code);
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
assert(OP_PUSH_PRI==36);
|
assert(OP_PUSH_PRI==36);
|
||||||
assert(OP_PROC==46);
|
assert(OP_PROC==46);
|
||||||
@ -3228,12 +3259,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
stk+=offs;
|
stk+=offs;
|
||||||
CHKMARGIN();
|
CHKMARGIN();
|
||||||
CHKSTACK();
|
CHKSTACK();
|
||||||
if (debug && offs>0) {
|
|
||||||
amx->dbgcode=DBG_CLRSYM;
|
|
||||||
amx->hea=hea;
|
|
||||||
amx->stk=stk;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_HEAP:
|
case OP_HEAP:
|
||||||
GETPARAM(offs);
|
GETPARAM(offs);
|
||||||
@ -3254,13 +3279,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
if ((ucell)offs>=codesize)
|
if ((ucell)offs>=codesize)
|
||||||
ABORT(amx,AMX_ERR_MEMACCESS);
|
ABORT(amx,AMX_ERR_MEMACCESS);
|
||||||
cip=(cell *)(code+(int)offs);
|
cip=(cell *)(code+(int)offs);
|
||||||
if (debug) {
|
|
||||||
amx->stk=stk;
|
|
||||||
amx->hea=hea;
|
|
||||||
amx->dbgcode=DBG_RETURN;
|
|
||||||
amx->dbgparam=pri; /* store "return value" */
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_RETN:
|
case OP_RETN:
|
||||||
POP(frm);
|
POP(frm);
|
||||||
@ -3271,33 +3289,22 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
cip=(cell *)(code+(int)offs);
|
cip=(cell *)(code+(int)offs);
|
||||||
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
stk+= *(cell *)(data+(int)stk) + sizeof(cell); /* remove parameters from the stack */
|
||||||
amx->stk=stk;
|
amx->stk=stk;
|
||||||
if (debug) {
|
if (tracer)
|
||||||
amx->stk=stk;
|
{
|
||||||
amx->hea=hea;
|
(tracer)(amx, 1);
|
||||||
amx->dbgcode=DBG_RETURN;
|
}
|
||||||
amx->dbgparam=pri; /* store "return value" */
|
|
||||||
amx->debug(amx);
|
|
||||||
amx->dbgcode=DBG_CLRSYM;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_CALL:
|
case OP_CALL:
|
||||||
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* skip address */
|
PUSH(((unsigned char *)cip-code)+sizeof(cell));/* skip address */
|
||||||
cip=JUMPABS(code, cip); /* jump to the address */
|
cip=JUMPABS(code, cip); /* jump to the address */
|
||||||
if (debug) {
|
if (tracer)
|
||||||
amx->dbgcode=DBG_CALL;
|
{
|
||||||
amx->dbgaddr=(ucell)((unsigned char *)cip-code);
|
(tracer)(amx, 2);
|
||||||
amx->debug(amx);
|
}
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_CALL_PRI:
|
case OP_CALL_PRI:
|
||||||
PUSH((unsigned char *)cip-code);
|
PUSH((unsigned char *)cip-code);
|
||||||
cip=(cell *)(code+(int)pri);
|
cip=(cell *)(code+(int)pri);
|
||||||
if (debug) {
|
|
||||||
amx->dbgcode=DBG_CALL;
|
|
||||||
amx->dbgaddr=pri;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_JUMP:
|
case OP_JUMP:
|
||||||
/* since the GETPARAM() macro modifies cip, you cannot
|
/* since the GETPARAM() macro modifies cip, you cannot
|
||||||
@ -3412,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 */
|
||||||
@ -3625,12 +3631,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
amx->pri=pri;
|
amx->pri=pri;
|
||||||
amx->alt=alt;
|
amx->alt=alt;
|
||||||
amx->cip=(cell)((unsigned char*)cip-code);
|
amx->cip=(cell)((unsigned char*)cip-code);
|
||||||
if (debug) {
|
|
||||||
amx->dbgcode=DBG_TERMINATE;
|
|
||||||
amx->dbgaddr=(cell)((unsigned char *)cip-code);
|
|
||||||
amx->dbgparam=offs;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
if (offs==AMX_ERR_SLEEP) {
|
if (offs==AMX_ERR_SLEEP) {
|
||||||
amx->reset_stk=reset_stk;
|
amx->reset_stk=reset_stk;
|
||||||
amx->reset_hea=reset_hea;
|
amx->reset_hea=reset_hea;
|
||||||
@ -3707,23 +3707,6 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
GETPARAM(amx->curline);
|
GETPARAM(amx->curline);
|
||||||
GETPARAM(amx->curfile);
|
GETPARAM(amx->curfile);
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm;
|
|
||||||
amx->stk=stk;
|
|
||||||
amx->hea=hea;
|
|
||||||
amx->dbgcode=DBG_LINE;
|
|
||||||
num=amx->debug(amx);
|
|
||||||
if (num!=AMX_ERR_NONE) {
|
|
||||||
if (num==AMX_ERR_SLEEP) {
|
|
||||||
amx->pri=pri;
|
|
||||||
amx->alt=alt;
|
|
||||||
amx->cip=(cell)((unsigned char*)cip-code);
|
|
||||||
amx->reset_stk=reset_stk;
|
|
||||||
amx->reset_hea=reset_hea;
|
|
||||||
} /* if */
|
|
||||||
ABORT(amx,num);
|
|
||||||
} /* if */
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_SYMBOL:
|
case OP_SYMBOL:
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
@ -3733,30 +3716,15 @@ int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
|||||||
amx->dbgname=(char *)cip;
|
amx->dbgname=(char *)cip;
|
||||||
cip=(cell *)((unsigned char *)cip + (int)offs - 2*sizeof(cell));
|
cip=(cell *)((unsigned char *)cip + (int)offs - 2*sizeof(cell));
|
||||||
assert((amx->dbgparam >> 8)>0); /* local symbols only */
|
assert((amx->dbgparam >> 8)>0); /* local symbols only */
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
|
||||||
amx->dbgcode=DBG_SYMBOL;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_SRANGE:
|
case OP_SRANGE:
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
GETPARAM(amx->dbgaddr); /* dimension level */
|
GETPARAM(amx->dbgaddr); /* dimension level */
|
||||||
GETPARAM(amx->dbgparam); /* length */
|
GETPARAM(amx->dbgparam); /* length */
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
|
||||||
amx->dbgcode=DBG_SRANGE;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_SYMTAG:
|
case OP_SYMTAG:
|
||||||
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
assert((amx->flags & AMX_FLAG_BROWSE)==0);
|
||||||
GETPARAM(amx->dbgparam); /* tag id */
|
GETPARAM(amx->dbgparam); /* tag id */
|
||||||
if (debug) {
|
|
||||||
amx->frm=frm; /* debugger needs this to relocate the symbols */
|
|
||||||
amx->dbgcode=DBG_SYMTAG;
|
|
||||||
amx->debug(amx);
|
|
||||||
} /* if */
|
|
||||||
break;
|
break;
|
||||||
case OP_JUMP_PRI:
|
case OP_JUMP_PRI:
|
||||||
cip=(cell *)(code+(int)pri);
|
cip=(cell *)(code+(int)pri);
|
||||||
|
@ -134,6 +134,7 @@ typedef cell (AMX_NATIVE_CALL *AMX_NATIVE)(struct tagAMX *amx, cell *params);
|
|||||||
typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index,
|
typedef int (AMXAPI *AMX_CALLBACK)(struct tagAMX *amx, cell index,
|
||||||
cell *result, cell *params);
|
cell *result, cell *params);
|
||||||
typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
|
typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
|
||||||
|
typedef int (AMXAPI *AMX_DEBUGCALL)(struct tagAMX *amx, int mode);
|
||||||
#if !defined _FAR
|
#if !defined _FAR
|
||||||
#define _FAR
|
#define _FAR
|
||||||
#endif
|
#endif
|
||||||
@ -246,6 +247,23 @@ typedef struct tagAMX_HEADER {
|
|||||||
} AMX_HEADER PACKED;
|
} AMX_HEADER PACKED;
|
||||||
#define AMX_MAGIC 0xf1e0
|
#define AMX_MAGIC 0xf1e0
|
||||||
|
|
||||||
|
//double linked list for stack
|
||||||
|
typedef struct tagAMX_TRACE
|
||||||
|
{
|
||||||
|
cell line PACKED;
|
||||||
|
cell file PACKED;
|
||||||
|
struct tagAMX_TRACE *next PACKED;
|
||||||
|
struct tagAMX_TRACE *prev PACKED;
|
||||||
|
} AMX_TRACE PACKED;
|
||||||
|
|
||||||
|
typedef struct tagAMX_DBG
|
||||||
|
{
|
||||||
|
int32_t numFiles PACKED; /* number of chars in array */
|
||||||
|
char **files PACKED; /* array of files */
|
||||||
|
AMX_TRACE *head PACKED; /* begin of link list */
|
||||||
|
AMX_TRACE *tail PACKED; /* end of link list */
|
||||||
|
} AMX_DBG PACKED;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
AMX_ERR_NONE,
|
AMX_ERR_NONE,
|
||||||
/* reserve the first 15 error codes for exit codes of the abstract machine */
|
/* reserve the first 15 error codes for exit codes of the abstract machine */
|
||||||
@ -294,6 +312,7 @@ enum {
|
|||||||
#define AMX_FLAG_BIGENDIAN 0x08 /* big endian encoding */
|
#define AMX_FLAG_BIGENDIAN 0x08 /* big endian encoding */
|
||||||
#define AMX_FLAG_NOCHECKS 0x10 /* no array bounds checking */
|
#define AMX_FLAG_NOCHECKS 0x10 /* no array bounds checking */
|
||||||
#define AMX_FLAG_LINEOPS 0x20 /* line ops are parsed by the JIT [loadtime only flag] */
|
#define AMX_FLAG_LINEOPS 0x20 /* line ops are parsed by the JIT [loadtime only flag] */
|
||||||
|
#define AMX_FLAG_TRACED 0x40 /* the file has already been traced */
|
||||||
#define AMX_FLAG_BROWSE 0x4000 /* browsing/relocating or executing */
|
#define AMX_FLAG_BROWSE 0x4000 /* browsing/relocating or executing */
|
||||||
#define AMX_FLAG_RELOC 0x8000 /* jump/call addresses relocated */
|
#define AMX_FLAG_RELOC 0x8000 /* jump/call addresses relocated */
|
||||||
|
|
||||||
@ -348,6 +367,7 @@ int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, cell *params);
|
|||||||
int AMXAPI amx_Cleanup(AMX *amx);
|
int AMXAPI amx_Cleanup(AMX *amx);
|
||||||
int AMXAPI amx_Clone(AMX *amxClone, AMX *amxSource, void *data);
|
int AMXAPI amx_Clone(AMX *amxClone, AMX *amxSource, void *data);
|
||||||
int AMXAPI amx_Debug(AMX *amx); /* default debug procedure, does nothing */
|
int AMXAPI amx_Debug(AMX *amx); /* default debug procedure, does nothing */
|
||||||
|
int AMXAPI amx_DebugCall(AMX *amx, int mode);
|
||||||
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...);
|
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...);
|
||||||
int AMXAPI amx_Execv(AMX *amx, cell *retval, int index, int numparams, cell params[]);
|
int AMXAPI amx_Execv(AMX *amx, cell *retval, int index, int numparams, cell params[]);
|
||||||
int AMXAPI amx_FindNative(AMX *amx, const char *name, int *index);
|
int AMXAPI amx_FindNative(AMX *amx, const char *name, int *index);
|
||||||
|
@ -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 ;
|
|
@ -117,8 +117,14 @@
|
|||||||
_dbgaddr EQU 38h ;DD ?
|
_dbgaddr EQU 38h ;DD ?
|
||||||
_dbgparam EQU 3ch ;DD ?
|
_dbgparam EQU 3ch ;DD ?
|
||||||
_dbgname EQU 40h ;DD ?
|
_dbgname EQU 40h ;DD ?
|
||||||
_usertags EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
_usertags1 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
_userdata EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
_usertags2 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_usertags3 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_usertags4 EQU 44h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata1 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata2 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata3 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
|
_userdata4 EQU 54h ;DD 4 DUP (?) ; 4 = AMX_USERNUM (#define'd in amx.h)
|
||||||
_error EQU 64h ;DD ?
|
_error EQU 64h ;DD ?
|
||||||
_pri EQU 68h ;DD ?
|
_pri EQU 68h ;DD ?
|
||||||
_alt EQU 6ch ;DD ?
|
_alt EQU 6ch ;DD ?
|
||||||
@ -171,6 +177,8 @@
|
|||||||
|
|
||||||
AMX_FLAG_CHAR16 EQU 0001h ; characters are 16-bit
|
AMX_FLAG_CHAR16 EQU 0001h ; characters are 16-bit
|
||||||
AMX_FLAG_DEBUG EQU 0002h ; symbolic info. available
|
AMX_FLAG_DEBUG EQU 0002h ; symbolic info. available
|
||||||
|
AMX_FLAG_LINEOPS EQU 0020h ; line op information
|
||||||
|
AMX_FLAG_TRACED EQU 0040h ;
|
||||||
AMX_FLAG_BROWSE EQU 4000h
|
AMX_FLAG_BROWSE EQU 4000h
|
||||||
AMX_FLAG_RELOC EQU 8000h ; jump/call addresses relocated
|
AMX_FLAG_RELOC EQU 8000h ; jump/call addresses relocated
|
||||||
|
|
||||||
|
@ -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;
|
||||||
@ -2304,16 +2337,16 @@ static cell AMX_NATIVE_CALL get_module(AMX *amx, cell *params)
|
|||||||
if ((*moduleIter).isAmxx())
|
if ((*moduleIter).isAmxx())
|
||||||
{
|
{
|
||||||
const amxx_module_info_s *info = (*moduleIter).getInfoNew();
|
const amxx_module_info_s *info = (*moduleIter).getInfoNew();
|
||||||
set_amxstring(amx, params[2], info->name, params[3]);
|
set_amxstring(amx, params[2], info && info->name ? info->name : "unk", params[3]);
|
||||||
set_amxstring(amx, params[4], info->author, params[5]);
|
set_amxstring(amx, params[4], info && info->author ? info->author : "unk", params[5]);
|
||||||
set_amxstring(amx, params[6], info->version, params[7]);
|
set_amxstring(amx, params[6], info && info->version ? info->version : "unk", params[7]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
module_info_s *info = (*moduleIter).getInfo();
|
module_info_s *info = (*moduleIter).getInfo();
|
||||||
set_amxstring(amx, params[2], info->name, params[3]);
|
set_amxstring(amx, params[2], info && info->name ? info->name : "unk", params[3]);
|
||||||
set_amxstring(amx, params[4], info->author, params[5]);
|
set_amxstring(amx, params[4], info && info->author ? info->author : "unk", params[5]);
|
||||||
set_amxstring(amx, params[6], info->version, params[7]);
|
set_amxstring(amx, params[6], info && info->version ? info->version : "unk", params[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compatibility problem possible
|
// compatibility problem possible
|
||||||
@ -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(amx, 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)
|
||||||
{
|
{
|
||||||
@ -2442,7 +2518,7 @@ static cell AMX_NATIVE_CALL callfunc_end(AMX *amx, cell *params)
|
|||||||
// actual call
|
// actual call
|
||||||
if ((err = amx_Execv(plugin->getAMX(), &retVal, func, curParam, gparams)) != AMX_ERR_NONE)
|
if ((err = amx_Execv(plugin->getAMX(), &retVal, func, curParam, gparams)) != AMX_ERR_NONE)
|
||||||
{
|
{
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err, curPlugin->getAMX()->curline, curPlugin->getName());
|
LogError(amx, err, "");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2666,6 +2742,35 @@ 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;
|
||||||
|
}
|
||||||
|
|
||||||
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 +2821,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 +2837,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 +2907,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 +2933,6 @@ 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},
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
@ -33,6 +33,10 @@
|
|||||||
#define AMXMODX_H
|
#define AMXMODX_H
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include <extdll.h>
|
#include <extdll.h>
|
||||||
#include <meta_api.h>
|
#include <meta_api.h>
|
||||||
@ -62,7 +66,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.00"
|
||||||
|
|
||||||
extern AMX_NATIVE_INFO core_Natives[];
|
extern AMX_NATIVE_INFO core_Natives[];
|
||||||
extern AMX_NATIVE_INFO time_Natives[];
|
extern AMX_NATIVE_INFO time_Natives[];
|
||||||
@ -255,6 +259,7 @@ void free_amxmemory(void **ptr);
|
|||||||
// get_localinfo
|
// get_localinfo
|
||||||
const char* get_localinfo( const char* name , const char* def );
|
const char* get_localinfo( const char* name , const char* def );
|
||||||
cell AMX_NATIVE_CALL require_module(AMX *amx, cell *params);
|
cell AMX_NATIVE_CALL require_module(AMX *amx, cell *params);
|
||||||
|
void LogError(AMX *amx, int err, const char *fmt, ...);
|
||||||
|
|
||||||
enum ModuleCallReason
|
enum ModuleCallReason
|
||||||
{
|
{
|
||||||
|
@ -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,6 +2344,14 @@ 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)
|
||||||
{
|
{
|
||||||
// Load the library
|
// Load the library
|
||||||
@ -2390,7 +2398,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)
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
@ -87,6 +87,7 @@ float g_game_restarting;
|
|||||||
float g_game_timeleft;
|
float g_game_timeleft;
|
||||||
float g_task_time;
|
float g_task_time;
|
||||||
float g_auth_time;
|
float g_auth_time;
|
||||||
|
bool g_initialized = false;
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
#ifdef MEMORY_TEST
|
||||||
float g_next_memreport_time;
|
float g_next_memreport_time;
|
||||||
@ -105,7 +106,7 @@ int g_srvindex;
|
|||||||
|
|
||||||
cvar_t init_amxmodx_version = {"amxmodx_version", "", FCVAR_SERVER | FCVAR_SPONLY};
|
cvar_t init_amxmodx_version = {"amxmodx_version", "", FCVAR_SERVER | FCVAR_SPONLY};
|
||||||
cvar_t init_amxmodx_modules = {"amxmodx_modules", "", FCVAR_SPONLY};
|
cvar_t init_amxmodx_modules = {"amxmodx_modules", "", FCVAR_SPONLY};
|
||||||
cvar_t init_amxmodx_debug = {"amx_debug", "", FCVAR_SPONLY};
|
cvar_t init_amxmodx_debug = {"amx_debug", "1", FCVAR_SPONLY};
|
||||||
cvar_t* amxmodx_version = NULL;
|
cvar_t* amxmodx_version = NULL;
|
||||||
cvar_t* amxmodx_modules = NULL;
|
cvar_t* amxmodx_modules = NULL;
|
||||||
cvar_t* hostname = NULL;
|
cvar_t* hostname = NULL;
|
||||||
@ -200,6 +201,9 @@ const char* get_localinfo( const char* name , const char* def )
|
|||||||
// Initialize AMX stuff and load it's plugins from plugins.ini list
|
// Initialize AMX stuff and load it's plugins from plugins.ini list
|
||||||
// Call precache forward function from plugins
|
// Call precache forward function from plugins
|
||||||
int C_Spawn( edict_t *pent ) {
|
int C_Spawn( edict_t *pent ) {
|
||||||
|
if (g_initialized)
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||||
|
g_initialized = true;
|
||||||
g_forcedmodules = false;
|
g_forcedmodules = false;
|
||||||
g_forcedsounds = false;
|
g_forcedsounds = false;
|
||||||
|
|
||||||
@ -277,7 +281,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);
|
||||||
@ -296,10 +300,6 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
(*a).getMin(),(*a).getMax(),(*a).getFilename());
|
(*a).getMin(),(*a).getMax(),(*a).getFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// HACKHACK:
|
|
||||||
// Make sure this function wont be called anymore
|
|
||||||
g_FakeMeta.m_Plugins.begin()->GetDllFuncTable().pfnSpawn = NULL;
|
|
||||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,20 +441,15 @@ void C_ServerDeactivate() {
|
|||||||
// However leave AMX modules which are loaded only once
|
// However leave AMX modules which are loaded only once
|
||||||
void C_ServerDeactivate_Post() {
|
void C_ServerDeactivate_Post() {
|
||||||
|
|
||||||
// HACKHACK:
|
|
||||||
// Make sure the spawn function will be called again
|
|
||||||
// pft that's not really a hack
|
|
||||||
g_FakeMeta.m_Plugins.begin()->GetDllFuncTable().pfnSpawn = C_Spawn;
|
|
||||||
|
|
||||||
detachReloadModules();
|
detachReloadModules();
|
||||||
g_auth.clear();
|
g_auth.clear();
|
||||||
g_forwards.clear();
|
|
||||||
g_commands.clear();
|
g_commands.clear();
|
||||||
g_forcemodels.clear();
|
g_forcemodels.clear();
|
||||||
g_forcesounds.clear();
|
g_forcesounds.clear();
|
||||||
g_forcegeneric.clear();
|
g_forcegeneric.clear();
|
||||||
g_grenades.clear();
|
g_grenades.clear();
|
||||||
g_tasksMngr.clear();
|
g_tasksMngr.clear();
|
||||||
|
g_forwards.clear();
|
||||||
g_logevents.clearLogEvents();
|
g_logevents.clearLogEvents();
|
||||||
g_events.clearEvents();
|
g_events.clearEvents();
|
||||||
g_menucmds.clear();
|
g_menucmds.clear();
|
||||||
@ -464,7 +459,6 @@ void C_ServerDeactivate_Post() {
|
|||||||
g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxmodx/data")));
|
g_langMngr.Save(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxmodx/data")));
|
||||||
g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxmodx/data")));
|
g_langMngr.SaveCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxmodx/data")));
|
||||||
g_langMngr.Clear();
|
g_langMngr.Clear();
|
||||||
|
|
||||||
//clear module name cache
|
//clear module name cache
|
||||||
while (!CurModuleList.empty())
|
while (!CurModuleList.empty())
|
||||||
{
|
{
|
||||||
@ -524,6 +518,7 @@ void C_ServerDeactivate_Post() {
|
|||||||
}
|
}
|
||||||
#endif // MEMORY_TEST
|
#endif // MEMORY_TEST
|
||||||
|
|
||||||
|
g_initialized = false;
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -607,6 +602,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
|
||||||
@ -623,10 +647,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{
|
||||||
@ -642,8 +663,7 @@ void C_ClientCommand( edict_t *pEntity ) {
|
|||||||
{
|
{
|
||||||
|
|
||||||
if ((err =amx_Exec((*aa).getPlugin()->getAMX(), &ret , (*aa).getFunction() , 3, pPlayer->index, (*aa).getFlags(),(*aa).getId() )) != AMX_ERR_NONE)
|
if ((err =amx_Exec((*aa).getPlugin()->getAMX(), &ret , (*aa).getFunction() , 3, pPlayer->index, (*aa).getFlags(),(*aa).getId() )) != AMX_ERR_NONE)
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
LogError((*aa).getPlugin()->getAMX(), err, "");
|
||||||
err,(*aa).getPlugin()->getAMX()->curline,(*aa).getPlugin()->getName());
|
|
||||||
|
|
||||||
if ( ret & 2 ) result = MRES_SUPERCEDE;
|
if ( ret & 2 ) result = MRES_SUPERCEDE;
|
||||||
if ( ret & 1 ) RETURN_META(MRES_SUPERCEDE);
|
if ( ret & 1 ) RETURN_META(MRES_SUPERCEDE);
|
||||||
@ -682,8 +702,7 @@ void C_ClientCommand( edict_t *pEntity ) {
|
|||||||
{
|
{
|
||||||
|
|
||||||
if ( ( err = amx_Exec((*a).getPlugin()->getAMX(), &ret ,(*a).getFunction() , 2, pPlayer->index,pressed_key)) != AMX_ERR_NONE)
|
if ( ( err = amx_Exec((*a).getPlugin()->getAMX(), &ret ,(*a).getFunction() , 2, pPlayer->index,pressed_key)) != AMX_ERR_NONE)
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
LogError((*a).getPlugin()->getAMX(), err, "");
|
||||||
err,(*a).getPlugin()->getAMX()->curline,(*a).getPlugin()->getName());
|
|
||||||
|
|
||||||
if ( ret & 2 ) result = MRES_SUPERCEDE;
|
if ( ret & 2 ) result = MRES_SUPERCEDE;
|
||||||
if ( ret & 1 ) RETURN_META(MRES_SUPERCEDE);
|
if ( ret & 1 ) RETURN_META(MRES_SUPERCEDE);
|
||||||
@ -888,7 +907,7 @@ void C_MessageEnd_Post(void) {
|
|||||||
{
|
{
|
||||||
|
|
||||||
if ((err = amx_Exec((*a).getPlugin()->getAMX(), NULL , (*a).getFunction() , 1, mPlayerIndex /*g_events.getArgInteger(0)*/ )) != AMX_ERR_NONE)
|
if ((err = amx_Exec((*a).getPlugin()->getAMX(), NULL , (*a).getFunction() , 1, mPlayerIndex /*g_events.getArgInteger(0)*/ )) != AMX_ERR_NONE)
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",err,(*a).getPlugin()->getAMX()->curline,(*a).getPlugin()->getName());
|
LogError((*a).getPlugin()->getAMX(), err, "");
|
||||||
|
|
||||||
|
|
||||||
++a;
|
++a;
|
||||||
@ -991,7 +1010,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);
|
||||||
|
@ -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"
|
||||||
@ -148,13 +153,12 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
|||||||
return (amx->error = AMX_ERR_FORMAT);
|
return (amx->error = AMX_ERR_FORMAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JIT
|
if ( (int)CVAR_GET_FLOAT("amx_debug") >= 2 || debug)
|
||||||
if ( ((int)CVAR_GET_FLOAT("amx_debug") == 2 || (debug && (int)CVAR_GET_FLOAT("amx_debug"))) )
|
|
||||||
{
|
{
|
||||||
//automatic debug mode
|
//automatic debug mode
|
||||||
hdr->flags |= AMX_FLAG_LINEOPS;
|
hdr->flags |= AMX_FLAG_LINEOPS;
|
||||||
|
hdr->flags |= AMX_FLAG_DEBUG;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
int err;
|
int err;
|
||||||
memset(amx, 0, sizeof(*amx));
|
memset(amx, 0, sizeof(*amx));
|
||||||
@ -175,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;
|
||||||
@ -194,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,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();
|
||||||
|
|
||||||
@ -1110,6 +1124,141 @@ void MNF_Log(const char *fmt, ...)
|
|||||||
AMXXLOG_Log("%s", msg);
|
AMXXLOG_Log("%s", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//by BAILOPAN
|
||||||
|
// generic error printing routine
|
||||||
|
void GenericError(AMX *amx, int err, int line, char buf[], const char *file)
|
||||||
|
{
|
||||||
|
static const char *amx_errs[] =
|
||||||
|
{
|
||||||
|
NULL,
|
||||||
|
"forced exit",
|
||||||
|
"assertion failed",
|
||||||
|
"stack error",
|
||||||
|
"index out of bounds",
|
||||||
|
"memory access",
|
||||||
|
"invalid instruction",
|
||||||
|
"stack low",
|
||||||
|
"heap low",
|
||||||
|
"callback",
|
||||||
|
"native",
|
||||||
|
"divide",
|
||||||
|
"sleep",
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
"out of memory", //16
|
||||||
|
"bad file format",
|
||||||
|
"bad file version",
|
||||||
|
"function not found",
|
||||||
|
"invalid entry point",
|
||||||
|
"debugger cannot run",
|
||||||
|
"plugin un or re-initialized",
|
||||||
|
"userdata table full",
|
||||||
|
"JIT failed to initialize",
|
||||||
|
"parameter error",
|
||||||
|
"domain error",
|
||||||
|
};
|
||||||
|
//does this plugin have line ops?
|
||||||
|
const char *geterr = NULL;
|
||||||
|
if (err > 26 || err < 0)
|
||||||
|
geterr = NULL;
|
||||||
|
else
|
||||||
|
geterr = amx_errs[err];
|
||||||
|
if (!(amx->flags & AMX_FLAG_LINEOPS))
|
||||||
|
{
|
||||||
|
if (geterr == NULL)
|
||||||
|
{
|
||||||
|
sprintf(buf, "Run time error %d (plugin \"%s\" - debug not enabled).", err, g_plugins.findPluginFast(amx)->getName());
|
||||||
|
} else {
|
||||||
|
sprintf(buf, "Run time error %d (%s) (plugin \"%s\") - debug not enabled.", err, geterr, g_plugins.findPluginFast(amx)->getName());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (geterr == NULL)
|
||||||
|
{
|
||||||
|
sprintf(buf, "Run time error %d on line %d (%s \"%s\").", err, line, (file?"file":"plugin"), (file?file:g_plugins.findPluginFast(amx)->getName()));
|
||||||
|
} else {
|
||||||
|
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 {
|
||||||
|
sprintf(buf, "Run time error %d (%s) on line %d (%s \"%s\").", err, geterr, line, (file?"file":"plugin"), (file?file:g_plugins.findPluginFast(amx)->getName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//by BAILOPAN
|
||||||
|
// debugger engine front end
|
||||||
|
void LogError(AMX *amx, int err, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
//does this plugin have debug info?
|
||||||
|
va_list arg;
|
||||||
|
AMX_DBG *dbg = (AMX_DBG *)(amx->userdata[0]);
|
||||||
|
static char buf[1024];
|
||||||
|
static char vbuf[1024];
|
||||||
|
*buf = 0;
|
||||||
|
*vbuf = 0;
|
||||||
|
|
||||||
|
va_start(arg, fmt);
|
||||||
|
vsprintf(vbuf, fmt, arg);
|
||||||
|
va_end(arg);
|
||||||
|
|
||||||
|
if (!dbg || !(dbg->tail))
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
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 {
|
||||||
|
AMX_TRACE *t = dbg->tail;
|
||||||
|
AMX_DEBUGCALL tracer = (AMX_DEBUGCALL)(amx->userdata[1]);
|
||||||
|
//actuall
|
||||||
|
cell line = amx->curline;
|
||||||
|
cell file = amx->curfile;
|
||||||
|
int i = 0;
|
||||||
|
GenericError(amx, err, line, buf, NULL);
|
||||||
|
AMXXLOG_Log("[AMXX] %s", buf);
|
||||||
|
if (*vbuf)
|
||||||
|
{
|
||||||
|
AMXXLOG_Log("%s", vbuf);
|
||||||
|
}
|
||||||
|
AMXXLOG_Log("[AMXX] Debug Trace =>");
|
||||||
|
//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)
|
||||||
|
{
|
||||||
|
line = t->line;
|
||||||
|
file = t->file;
|
||||||
|
if (file >= dbg->numFiles)
|
||||||
|
{
|
||||||
|
AMXXLOG_Log("[AMXX] [%d] Line %d, File \"%s\"", i++, line, g_plugins.findPluginFast(amx)->getName());
|
||||||
|
} else {
|
||||||
|
AMXXLOG_Log("[AMXX] [%d] Line %d, File \"%s\"", i++, line, dbg->files[file]);
|
||||||
|
}
|
||||||
|
if (tracer)
|
||||||
|
(tracer)(amx, 1); //pop
|
||||||
|
t = dbg->tail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MNF_MergeDefinitionFile(const char *file)
|
void MNF_MergeDefinitionFile(const char *file)
|
||||||
{
|
{
|
||||||
g_langMngr.MergeDefinitionFile(file);
|
g_langMngr.MergeDefinitionFile(file);
|
||||||
@ -1131,6 +1280,14 @@ const char *MNF_Format(const char *fmt, ...)
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *MNF_GetPlayerTeam(int id)
|
||||||
|
{
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return (GET_PLAYER_POINTER_I(id)->team.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef MEMORY_TEST
|
#ifndef MEMORY_TEST
|
||||||
void *MNF_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, const unsigned int allocationType, const size_t reportedSize)
|
void *MNF_Allocator(const char *sourceFile, const unsigned int sourceLine, const char *sourceFunc, const unsigned int allocationType, const size_t reportedSize)
|
||||||
{
|
{
|
||||||
@ -1148,6 +1305,18 @@ void MNF_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// 09/18/2004 : added these two funcs that default to copyBack=false so we don't break all modules
|
||||||
|
cell MNF_PrepareCellArray(cell *ptr, unsigned int size)
|
||||||
|
{
|
||||||
|
return prepareCellArray(ptr, size, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
cell MNF_PrepareCharArray(char *ptr, unsigned int size)
|
||||||
|
{
|
||||||
|
return prepareCharArray(ptr, size, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Fnptr Request function for the new interface
|
// Fnptr Request function for the new interface
|
||||||
const char *g_LastRequestedFunc = NULL;
|
const char *g_LastRequestedFunc = NULL;
|
||||||
#define REGISTER_FUNC(name, func) { name, (void*)func },
|
#define REGISTER_FUNC(name, func) { name, (void*)func },
|
||||||
@ -1165,6 +1334,7 @@ void *Module_ReqFnptr(const char *funcName)
|
|||||||
REGISTER_FUNC("PrintSrvConsole", print_srvconsole)
|
REGISTER_FUNC("PrintSrvConsole", print_srvconsole)
|
||||||
REGISTER_FUNC("GetModname", MNF_GetModname)
|
REGISTER_FUNC("GetModname", MNF_GetModname)
|
||||||
REGISTER_FUNC("Log", MNF_Log)
|
REGISTER_FUNC("Log", MNF_Log)
|
||||||
|
REGISTER_FUNC("LogError", LogError)
|
||||||
REGISTER_FUNC("MergeDefinitionFile", MNF_MergeDefinitionFile)
|
REGISTER_FUNC("MergeDefinitionFile", MNF_MergeDefinitionFile)
|
||||||
REGISTER_FUNC("Format", MNF_Format)
|
REGISTER_FUNC("Format", MNF_Format)
|
||||||
|
|
||||||
@ -1199,8 +1369,10 @@ void *Module_ReqFnptr(const char *funcName)
|
|||||||
REGISTER_FUNC("RegisterSPForwardByName", registerSPForwardByName)
|
REGISTER_FUNC("RegisterSPForwardByName", registerSPForwardByName)
|
||||||
REGISTER_FUNC("UnregisterSPForward", unregisterSPForward)
|
REGISTER_FUNC("UnregisterSPForward", unregisterSPForward)
|
||||||
REGISTER_FUNC("ExecuteForward", executeForwards)
|
REGISTER_FUNC("ExecuteForward", executeForwards)
|
||||||
REGISTER_FUNC("PrepareCellArray", prepareCellArray)
|
REGISTER_FUNC("PrepareCellArray", MNF_PrepareCellArray)
|
||||||
REGISTER_FUNC("PrepareCharArray", prepareCharArray)
|
REGISTER_FUNC("PrepareCharArray", MNF_PrepareCharArray)
|
||||||
|
REGISTER_FUNC("PrepareCellArrayA", prepareCellArray)
|
||||||
|
REGISTER_FUNC("PrepareCharArrayA", prepareCharArray)
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
REGISTER_FUNC("GetPlayerFlags", MNF_GetPlayerFlags)
|
REGISTER_FUNC("GetPlayerFlags", MNF_GetPlayerFlags)
|
||||||
@ -1214,6 +1386,7 @@ void *Module_ReqFnptr(const char *funcName)
|
|||||||
REGISTER_FUNC("GetPlayerPlayTime", MNF_GetPlayerPlayTime)
|
REGISTER_FUNC("GetPlayerPlayTime", MNF_GetPlayerPlayTime)
|
||||||
REGISTER_FUNC("GetPlayerCurweapon", MNF_GetPlayerCurweapon)
|
REGISTER_FUNC("GetPlayerCurweapon", MNF_GetPlayerCurweapon)
|
||||||
REGISTER_FUNC("GetPlayerTeamID", MNF_GetPlayerTeamID)
|
REGISTER_FUNC("GetPlayerTeamID", MNF_GetPlayerTeamID)
|
||||||
|
REGISTER_FUNC("GetPlayerTeam", MNF_GetPlayerTeam)
|
||||||
REGISTER_FUNC("GetPlayerDeaths", MNF_GetPlayerDeaths)
|
REGISTER_FUNC("GetPlayerDeaths", MNF_GetPlayerDeaths)
|
||||||
REGISTER_FUNC("GetPlayerFrags", MNF_GetPlayerFrags)
|
REGISTER_FUNC("GetPlayerFrags", MNF_GetPlayerFrags)
|
||||||
REGISTER_FUNC("GetPlayerMenu", MNF_GetPlayerMenu)
|
REGISTER_FUNC("GetPlayerMenu", MNF_GetPlayerMenu)
|
||||||
|
807
amxmodx/msvc/amxmodx_mm.vcproj
Executable file
807
amxmodx/msvc/amxmodx_mm.vcproj
Executable file
@ -0,0 +1,807 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="7.10"
|
||||||
|
Name="amxmodx"
|
||||||
|
ProjectGUID="{2BF64D1A-AC89-41B0-9D02-FB8CB610F850}"
|
||||||
|
SccProjectName=""
|
||||||
|
SccLocalPath="">
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"/>
|
||||||
|
</Platforms>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory=".\Debug"
|
||||||
|
IntermediateDirectory=".\Debug"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="5"
|
||||||
|
StructMemberAlignment="3"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\debug/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\debug/"
|
||||||
|
ObjectFile=".\debug/"
|
||||||
|
ProgramDataBaseFileName=".\debug/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||||
|
OutputFile="debug/amxmodx_mm.dll"
|
||||||
|
Version="0.1"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile=".\debug/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\debug/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory=".\Release"
|
||||||
|
IntermediateDirectory=".\Release"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
GlobalOptimizations="TRUE"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="4"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\release/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\release/"
|
||||||
|
ObjectFile=".\release/"
|
||||||
|
ProgramDataBaseFileName=".\release/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||||
|
OutputFile="release/amxmodx_mm.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
ProgramDatabaseFile=".\release/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\release/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="MemtestDebug|Win32"
|
||||||
|
OutputDirectory="MemtestDebug"
|
||||||
|
IntermediateDirectory="MemtestDebug"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="5"
|
||||||
|
StructMemberAlignment="3"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\memtestdebug/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\memtestdebug/"
|
||||||
|
ObjectFile=".\memtestdebug/"
|
||||||
|
ProgramDataBaseFileName=".\memtestdebug/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||||
|
OutputFile="memtestdebug/amxmodx_mm.dll"
|
||||||
|
Version="0.1"
|
||||||
|
LinkIncremental="2"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile=".\memtestdebug/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\memtestdebug/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="MemtestRelease|Win32"
|
||||||
|
OutputDirectory="MemtestRelease"
|
||||||
|
IntermediateDirectory="MemtestRelease"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
GlobalOptimizations="TRUE"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="4"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\memtestrelease/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\memtestrelease/"
|
||||||
|
ObjectFile=".\memtestrelease/"
|
||||||
|
ProgramDataBaseFileName=".\memtestrelease/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||||
|
OutputFile="memtestrelease/amxmodx_mm.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
ProgramDatabaseFile=".\memtestrelease/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\memtestrelease/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="JITDebug|Win32"
|
||||||
|
OutputDirectory="JITDebug"
|
||||||
|
IntermediateDirectory="JITDebug"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""C:\Hry\Half-Life\SDK\Multiplayer Source\pm_shared";"C:\Hry\Half-Life\SDK\Multiplayer Source\dlls";"C:\Hry\Half-Life\SDK\Multiplayer Source\engine";"C:\Hry\Half-Life\SDK\Multiplayer Source\common";C:\Files\Programming\metamod\metamod"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="5"
|
||||||
|
StructMemberAlignment="3"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\jitdebug/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\jitdebug/"
|
||||||
|
ObjectFile=".\jitdebug/"
|
||||||
|
ProgramDataBaseFileName=".\jitdebug/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="..\jit\jits.obj ..\zlib\zlib.lib"
|
||||||
|
OutputFile="jitdebug/amxmodx_mm.dll"
|
||||||
|
Version="0.1"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile=".\jitdebug/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\jitdebug/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\debug/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="JITRelease|Win32"
|
||||||
|
OutputDirectory="JITRelease"
|
||||||
|
IntermediateDirectory="JITRelease"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
GlobalOptimizations="TRUE"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="4"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\jitrelease/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\jitrelease/"
|
||||||
|
ObjectFile=".\jitrelease/"
|
||||||
|
ProgramDataBaseFileName=".\jitrelease/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="..\jit\jits.obj ..\zlib\zlib.lib"
|
||||||
|
OutputFile="jitrelease/amxmodx_mm.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
ProgramDatabaseFile=".\jitrelease/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\jitrelease/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="JITMemtestRelease|Win32"
|
||||||
|
OutputDirectory="JITMemtestRelease"
|
||||||
|
IntermediateDirectory="JITMemtestRelease"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
GlobalOptimizations="TRUE"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;MEMORY_TEST;JIT"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="4"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\jitmemtestrelease/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\jitmemtestrelease/"
|
||||||
|
ObjectFile=".\jitmemtestrelease/"
|
||||||
|
ProgramDataBaseFileName=".\jitmemtestrelease/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||||
|
OutputFile="jitmemtestrelease/amxmodx_mm.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
ProgramDatabaseFile=".\jitmemtestrelease/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\jitmemtestrelease/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="MaximalSpeed|Win32"
|
||||||
|
OutputDirectory="MaximalSpeed"
|
||||||
|
IntermediateDirectory="MaximalSpeed"
|
||||||
|
ConfigurationType="2"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
GlobalOptimizations="TRUE"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
EnableIntrinsicFunctions="TRUE"
|
||||||
|
FavorSizeOrSpeed="1"
|
||||||
|
OptimizeForProcessor="2"
|
||||||
|
OptimizeForWindowsApplication="TRUE"
|
||||||
|
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmodx_EXPORTS;JIT"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="4"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderThrough="amxmodx.h"
|
||||||
|
PrecompiledHeaderFile=".\MaximalSpeed/amxmodx.pch"
|
||||||
|
AssemblerListingLocation=".\MaximalSpeed/"
|
||||||
|
ObjectFile=".\MaximalSpeed/"
|
||||||
|
ProgramDataBaseFileName=".\MaximalSpeed/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
AdditionalOptions="/MACHINE:I386"
|
||||||
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||||
|
OutputFile="MaximalSpeed/amxmodx_mm.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
ModuleDefinitionFile=""
|
||||||
|
ProgramDatabaseFile=".\MaximalSpeede/amxx_mm.pdb"
|
||||||
|
ImportLibrary=".\jitrelease/amxx_mm.lib"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\release/amxmodx.tlb"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||||
|
<File
|
||||||
|
RelativePath="..\amx.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxcore.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxmodx.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxtime.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxxfile.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxxlog.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CCmd.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CEvent.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CFile.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CForward.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CLang.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CLogEvent.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CMenu.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CMisc.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CModule.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CPlugin.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CTask.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CVault.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\emsg.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\fakemeta.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="MemtestDebug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
GeneratePreprocessedFile="0"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\file.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\float.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\md5.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\meta_api.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\modules.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\power.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\srvcmd.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\string.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\strptime.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\util.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\vault.cpp">
|
||||||
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="mmgr"
|
||||||
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath="..\mmgr\mmgr.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
ExcludedFromBuild="TRUE">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32"
|
||||||
|
ExcludedFromBuild="TRUE">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="JITDebug|Win32"
|
||||||
|
ExcludedFromBuild="TRUE">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="JITRelease|Win32"
|
||||||
|
ExcludedFromBuild="TRUE">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="MaximalSpeed|Win32"
|
||||||
|
ExcludedFromBuild="TRUE">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl">
|
||||||
|
<File
|
||||||
|
RelativePath="..\amx.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxmodx.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxxfile.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\amxxlog.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CCmd.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CEvent.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CFile.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CForward.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CLang.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CList.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CLogEvent.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CMenu.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CMisc.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CModule.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CPlugin.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CQueue.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CRList.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CString.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CTask.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CVault.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\CVector.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\fakemeta.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\md5.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\modules.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\resource.h">
|
||||||
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="mmgr"
|
||||||
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath="..\mmgr\mmgr.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\mmgr\nommgr.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="rc">
|
||||||
|
<File
|
||||||
|
RelativePath="..\version.rc">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
@ -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);
|
||||||
@ -2629,6 +2651,18 @@ void MF_Log(const char *fmt, ...)
|
|||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_NAME, 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_NAME, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// validate macros
|
// validate macros
|
||||||
@ -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);
|
||||||
|
@ -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
|
||||||
@ -283,10 +283,9 @@ void plugin_srvcmd()
|
|||||||
|
|
||||||
if ((err = amx_Exec( (*a).getPlugin()->getAMX(), &ret , (*a).getFunction()
|
if ((err = amx_Exec( (*a).getPlugin()->getAMX(), &ret , (*a).getFunction()
|
||||||
, 3 , g_srvindex , (*a).getFlags() , (*a).getId() )) != AMX_ERR_NONE)
|
, 3 , g_srvindex , (*a).getFlags() , (*a).getId() )) != AMX_ERR_NONE)
|
||||||
|
{
|
||||||
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")",
|
LogError((*a).getPlugin()->getAMX(), err, "");
|
||||||
err,(*a).getPlugin()->getAMX()->curline,(*a).getPlugin()->getName());
|
}
|
||||||
|
|
||||||
if ( ret ) break;
|
if ( ret ) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,6 +448,60 @@ char* format_arguments(AMX *amx, int parm,int& len)
|
|||||||
return *buffer;
|
return *buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//added by BAILOPAN for jtp10181
|
||||||
|
//takes a string and breaks it into a 1st param and rest params
|
||||||
|
//different from strbreak because it's more crafted for control
|
||||||
|
static cell AMX_NATIVE_CALL amx_strtok(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int left_pos = 0;
|
||||||
|
int right_pos = 0;
|
||||||
|
unsigned int i = 0;
|
||||||
|
bool done_flag = false;
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
|
//string[]
|
||||||
|
char *string = get_amxstring(amx, params[1], 0, len);
|
||||||
|
//left[]
|
||||||
|
char *left = new char[len+1];
|
||||||
|
//right[]
|
||||||
|
char *right = new char[len+1];
|
||||||
|
int leftMax = params[3];
|
||||||
|
int rightMax = params[5];
|
||||||
|
//token
|
||||||
|
char token = params[6];
|
||||||
|
//trim
|
||||||
|
int trim = params[7];
|
||||||
|
for (i=0; i<len; i++)
|
||||||
|
{
|
||||||
|
if (trim && !done_flag)
|
||||||
|
{
|
||||||
|
if (isspace(string[i]))
|
||||||
|
{
|
||||||
|
while (isspace(string[++i]));
|
||||||
|
done_flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!done_flag && string[i] == token)
|
||||||
|
{
|
||||||
|
done_flag = true;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (done_flag)
|
||||||
|
{
|
||||||
|
right[right_pos++] = string[i];
|
||||||
|
} else {
|
||||||
|
left[left_pos++] = string[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
right[right_pos] = 0;
|
||||||
|
left[left_pos] = 0;
|
||||||
|
set_amxstring(amx, params[2], left, leftMax);
|
||||||
|
set_amxstring(amx, params[4], right, rightMax);
|
||||||
|
delete [] left;
|
||||||
|
delete [] right;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
//added by BAILOPAN
|
//added by BAILOPAN
|
||||||
//Takes a string and breaks it into a 1st param and rest params
|
//Takes a string and breaks it into a 1st param and rest params
|
||||||
//strbreak(String[], First[], FirstLen, Rest[], RestLen)
|
//strbreak(String[], First[], FirstLen, Rest[], RestLen)
|
||||||
@ -467,7 +521,7 @@ static cell AMX_NATIVE_CALL strbreak(AMX *amx, cell *params) /* 5 param */
|
|||||||
int LeftMax = params[3];
|
int LeftMax = params[3];
|
||||||
int RightMax = params[5];
|
int RightMax = params[5];
|
||||||
|
|
||||||
for (i=0; i<strlen(string); i++) {
|
for (i=0; i<l; i++) {
|
||||||
if (string[i] == '"' && !quote_flag) {
|
if (string[i] == '"' && !quote_flag) {
|
||||||
quote_flag = true;
|
quote_flag = true;
|
||||||
} else if (string[i] == '"' && quote_flag) {
|
} else if (string[i] == '"' && quote_flag) {
|
||||||
@ -611,5 +665,6 @@ AMX_NATIVE_INFO string_Natives[] = {
|
|||||||
{ "str_to_num", strtonum },
|
{ "str_to_num", strtonum },
|
||||||
{ "trim", amx_trim },
|
{ "trim", amx_trim },
|
||||||
{ "ucfirst", amx_ucfirst },
|
{ "ucfirst", amx_ucfirst },
|
||||||
|
{ "strtok", amx_strtok },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
@ -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,0,0
|
||||||
PRODUCTVERSION 0,2,0,0
|
PRODUCTVERSION 1,0,0,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.00"
|
||||||
VALUE "InternalName", "amxmodx\0"
|
VALUE "InternalName", "amxmodx"
|
||||||
VALUE "LegalCopyright", "Copyright (c) 2004, AMX Mod X Dev Team\0"
|
VALUE "LegalCopyright", "Copyright (c) 2004, 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.00"
|
||||||
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
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
@ -13,4 +13,4 @@ amxx_vault addons/amxmodx/data/vault.ini
|
|||||||
; 1 - one logfile / day
|
; 1 - one logfile / day
|
||||||
; 2 - one logfile / map
|
; 2 - one logfile / map
|
||||||
; 3 - HL Logs
|
; 3 - HL Logs
|
||||||
amx_logging 1
|
amxx_logging 1
|
||||||
|
@ -15,4 +15,4 @@ csstats addons/amxmodx/data/csstats.dat
|
|||||||
; 1 - one logfile / day
|
; 1 - one logfile / day
|
||||||
; 2 - one logfile / map
|
; 2 - one logfile / map
|
||||||
; 3 - HL Logs
|
; 3 - HL Logs
|
||||||
amx_logging 1
|
amxx_logging 1
|
||||||
|
@ -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,6 +29,7 @@ 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
|
||||||
@ -37,27 +41,39 @@ fun_amxx.dll
|
|||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;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
|
||||||
|
9
configs/cstrike/stats.ini
Executable file
9
configs/cstrike/stats.ini
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
;Generated by Stats Configuration Plugin. Do not modify!
|
||||||
|
;Variable Description
|
||||||
|
ShowAttackers ;Show Attackers
|
||||||
|
ShowVictims ;Show Victims
|
||||||
|
ShowStats ;HUD-stats default
|
||||||
|
SayRankStats ;Say /rankstats
|
||||||
|
SayRank ;Say /rank
|
||||||
|
SayTop15 ;Say /top15
|
||||||
|
ShowStats ;HUD-stats default
|
13
configs/custommenuitems.cfg
Executable file
13
configs/custommenuitems.cfg
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
// Here you can add menu items from any plugin to Menus Front-End plugin, aka "amxmodmenu".
|
||||||
|
//
|
||||||
|
// Usage: "amx_addmenuitem <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"
|
||||||
|
|
@ -13,7 +13,7 @@ amxx_vault addons/amxmodx/data/vault.ini
|
|||||||
; 1 - one logfile / day
|
; 1 - one logfile / day
|
||||||
; 2 - one logfile / map
|
; 2 - one logfile / map
|
||||||
; 3 - HL Logs
|
; 3 - HL Logs
|
||||||
amx_logging 1
|
amxx_logging 1
|
||||||
|
|
||||||
dodstats_score addons/amxmodx/data/dodstats.amxx
|
dodstats_score addons/amxmodx/data/dodstats.amxx
|
||||||
dodstats addons/amxmodx/data/dodstats.dat
|
dodstats addons/amxmodx/data/dodstats.dat
|
||||||
|
@ -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,6 +29,7 @@ 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
|
||||||
@ -37,27 +41,39 @@ fun_amxx.dll
|
|||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;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
|
||||||
|
@ -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
|
||||||
|
;fakeneta_amxx_amd64.so
|
||||||
|
|
||||||
; -------------------------------------------
|
; -------------------------------------------
|
||||||
; Database Access - only enable one of these
|
; Database Access - only enable one of these
|
||||||
@ -26,6 +29,7 @@ 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
|
||||||
@ -37,15 +41,25 @@ fun_amxx.dll
|
|||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;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
|
@ -68,9 +68,6 @@ amx_extendmap_max 90
|
|||||||
// Step for each extending
|
// Step for each extending
|
||||||
amx_extendmap_step 15
|
amx_extendmap_step 15
|
||||||
|
|
||||||
// Ignore the minimum and maximum settings for maps in the mapcycle
|
|
||||||
amx_mapnum_ignore 0
|
|
||||||
|
|
||||||
//If you set this to 0, clients cannot chose their language
|
//If you set this to 0, clients cannot chose their language
|
||||||
amx_client_languages 1
|
amx_client_languages 1
|
||||||
|
|
||||||
@ -80,3 +77,14 @@ amx_client_languages 1
|
|||||||
// 2 - All plugins are put in debug mode
|
// 2 - All plugins are put in debug mode
|
||||||
// Note - debug mode will affect JIT performance
|
// Note - debug mode will affect JIT performance
|
||||||
amx_debug 1
|
amx_debug 1
|
||||||
|
|
||||||
|
// Ignore the minimum and maximum settings for maps in the mapcycle
|
||||||
|
amx_mapnum_ignore 0
|
||||||
|
|
||||||
|
// Idle Kicker Settings:
|
||||||
|
amx_idle_time 120 // Time players must be idle to be kicked
|
||||||
|
amx_idle_min_players 8 // Minimum players on the server before kicking starts
|
||||||
|
amx_idle_ignore_immunity 1 // Kick idle admins with immunity?
|
||||||
|
|
||||||
|
// Change this value to alter the frequency (in seconds) players can say /stuck to free themselves.
|
||||||
|
//amx_unstuck_frequency 4
|
||||||
|
@ -4,24 +4,26 @@
|
|||||||
|
|
||||||
; 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_faceoff
|
co_faceoff
|
||||||
ns_mineshaft
|
ns_mineshaft
|
||||||
co_daimos
|
co_daimos
|
||||||
|
ns_bast
|
||||||
ns_origin
|
ns_origin
|
||||||
co_kestrel
|
co_kestrel
|
||||||
ns_tanith
|
ns_tanith
|
||||||
co_rebirth
|
|
||||||
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_agora
|
||||||
co_ulysses
|
ns_altair
|
||||||
|
@ -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,6 +29,7 @@ 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
|
||||||
@ -37,21 +41,31 @@ fun_amxx.dll
|
|||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;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
|
||||||
|
40
configs/ns/plugins.ini
Executable file
40
configs/ns/plugins.ini
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
; AMX Mod X plugins
|
||||||
|
|
||||||
|
; Admin Base - Always one has to be activated
|
||||||
|
admin.amxx ; admin base (required for any admin-related)
|
||||||
|
;admin_sql.amxx ; admin base - SQL version (comment admin.amxx)
|
||||||
|
|
||||||
|
; Basic
|
||||||
|
admincmd.amxx ; basic admin console commands
|
||||||
|
adminhelp.amxx ; help command for admin console commands
|
||||||
|
adminslots.amxx ; slot reservation
|
||||||
|
multilingual.amxx ; Multi-Lingual management
|
||||||
|
|
||||||
|
; Menus
|
||||||
|
menufront.amxx ; front-end for admin menus
|
||||||
|
cmdmenu.amxx ; command menu (speech, settings)
|
||||||
|
plmenu.amxx ; players menu (kick, ban, client cmds.)
|
||||||
|
;telemenu.amxx ; teleport menu (Fun Module required!)
|
||||||
|
mapsmenu.amxx ; maps menu (vote, changelevel)
|
||||||
|
|
||||||
|
; Chat / Messages
|
||||||
|
adminchat.amxx ; console chat commands
|
||||||
|
antiflood.amxx ; prevent clients from chat-flooding the server
|
||||||
|
scrollmsg.amxx ; displays a scrolling message
|
||||||
|
imessage.amxx ; displays information messages
|
||||||
|
adminvote.amxx ; vote commands
|
||||||
|
|
||||||
|
; Map related
|
||||||
|
nextmap.amxx ; displays next map in mapcycle
|
||||||
|
mapchooser.amxx ; allows to vote for next map
|
||||||
|
timeleft.amxx ; displays time left on map
|
||||||
|
|
||||||
|
; Configuration
|
||||||
|
pausecfg.amxx ; allows to pause and unpause some plugins
|
||||||
|
|
||||||
|
; NS Specific plugins
|
||||||
|
idlekicker.amxx ; kicks idle players
|
||||||
|
nscommands.amxx ; extra commands for Natural-Selection
|
||||||
|
;unstuck.amxx ; Free stuck players (engine & ns modules required!)
|
||||||
|
|
||||||
|
; Custom - Add 3rd party plugins here
|
49
configs/ns/users.ini
Executable file
49
configs/ns/users.ini
Executable file
@ -0,0 +1,49 @@
|
|||||||
|
; Users configuration file
|
||||||
|
; File location: $moddir/addons/amxx/configs/users.ini
|
||||||
|
|
||||||
|
; Line starting with ; is a comment
|
||||||
|
|
||||||
|
; Access flags:
|
||||||
|
; a - immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
|
||||||
|
; b - reservation (can join on reserved slots)
|
||||||
|
; c - amx_kick command
|
||||||
|
; d - amx_ban and amx_unban commands
|
||||||
|
; e - amx_slay and amx_slap commands
|
||||||
|
; f - amx_map command
|
||||||
|
; g - amx_cvar command (not all cvars will be available)
|
||||||
|
; h - amx_cfg command
|
||||||
|
; i - amx_chat and other chat commands
|
||||||
|
; j - amx_vote and other vote commands
|
||||||
|
; k - access to sv_password cvar (by amx_cvar command)
|
||||||
|
; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
|
||||||
|
; m - custom level A (for additional plugins)
|
||||||
|
; n - custom level B
|
||||||
|
; o - custom level C
|
||||||
|
; p - custom level D
|
||||||
|
; q - custom level E
|
||||||
|
; r - custom level F
|
||||||
|
; s - custom level G
|
||||||
|
; t - ns commands (amx_random, amx_readyroom, amx_uncomm, amx_alien, amx_marine)
|
||||||
|
; u - menu access
|
||||||
|
; z - user (no admin)
|
||||||
|
|
||||||
|
; Account flags:
|
||||||
|
; a - disconnect player on invalid password
|
||||||
|
; b - clan tag
|
||||||
|
; c - this is steamid/wonid
|
||||||
|
; d - this is ip
|
||||||
|
; e - password is not checked (only name/ip/steamid needed)
|
||||||
|
|
||||||
|
; Password:
|
||||||
|
; Add to your autoexec.cfg: setinfo _pw "<password>"
|
||||||
|
; Change _pw to the value of amx_password_field
|
||||||
|
|
||||||
|
; Format of admin account:
|
||||||
|
; <name|ip|steamid> <password> <access flags> <account flags>
|
||||||
|
|
||||||
|
; Examples of admin accounts:
|
||||||
|
; "STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"
|
||||||
|
; "123.45.67.89" "" "abcdefghijklmnopqrstu" "de"
|
||||||
|
; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"
|
||||||
|
|
||||||
|
"loopback" "" "abcdefghijklmnopqrstu" "de"
|
@ -15,4 +15,4 @@ tfcstats addons/amxmodx/data/tfcstats.dat
|
|||||||
; 1 - one logfile / day
|
; 1 - one logfile / day
|
||||||
; 2 - one logfile / map
|
; 2 - one logfile / map
|
||||||
; 3 - HL Logs
|
; 3 - HL Logs
|
||||||
amx_logging 1
|
amxx_logging 1
|
||||||
|
@ -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,6 +29,7 @@ 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
|
||||||
@ -37,21 +41,32 @@ fun_amxx.dll
|
|||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;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
|
@ -2,8 +2,8 @@
|
|||||||
amxx_logdir addons/amxmodx/logs
|
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.inia
|
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
|
||||||
@ -15,4 +15,4 @@ tsstats addons/amxmodx/data/tsstats.dat
|
|||||||
; 1 - one logfile / day
|
; 1 - one logfile / day
|
||||||
; 2 - one logfile / map
|
; 2 - one logfile / map
|
||||||
; 3 - HL Logs
|
; 3 - HL Logs
|
||||||
amx_logging 1
|
amxx_logging 1
|
||||||
|
@ -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,6 +29,7 @@ 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
|
||||||
@ -37,21 +41,32 @@ fun_amxx.dll
|
|||||||
; ---------------------------------------------
|
; ---------------------------------------------
|
||||||
;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
|
@ -306,4 +306,3 @@ void RankSystem::saveRank( const char* filename )
|
|||||||
|
|
||||||
fclose(bfp);
|
fclose(bfp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,4 +120,3 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ bool rankBots;
|
|||||||
int gmsgCurWeapon;
|
int gmsgCurWeapon;
|
||||||
int gmsgDeathMsg;
|
int gmsgDeathMsg;
|
||||||
int gmsgDamage;
|
int gmsgDamage;
|
||||||
int gmsgDamageEnd;
|
|
||||||
int gmsgWeaponList;
|
int gmsgWeaponList;
|
||||||
int gmsgResetHUD;
|
int gmsgResetHUD;
|
||||||
int gmsgAmmoX;
|
int gmsgAmmoX;
|
||||||
@ -57,7 +56,6 @@ struct sUserMsg {
|
|||||||
} g_user_msg[] = {
|
} g_user_msg[] = {
|
||||||
{ "CurWeapon" , &gmsgCurWeapon , Client_CurWeapon, false },
|
{ "CurWeapon" , &gmsgCurWeapon , Client_CurWeapon, false },
|
||||||
{ "Damage" , &gmsgDamage,Client_Damage, false },
|
{ "Damage" , &gmsgDamage,Client_Damage, false },
|
||||||
{ "Damage" , &gmsgDamageEnd, Client_Damage_End, true },
|
|
||||||
{ "WeaponList" , &gmsgWeaponList, Client_WeaponList, false },
|
{ "WeaponList" , &gmsgWeaponList, Client_WeaponList, false },
|
||||||
{ "ResetHUD" , &gmsgResetHUD,Client_ResetHUD, true },
|
{ "ResetHUD" , &gmsgResetHUD,Client_ResetHUD, true },
|
||||||
{ "AmmoX" , &gmsgAmmoX, Client_AmmoX , false },
|
{ "AmmoX" , &gmsgAmmoX, Client_AmmoX , false },
|
||||||
@ -289,7 +287,7 @@ void OnMetaAttach() {
|
|||||||
|
|
||||||
void OnAmxxAttach(){
|
void OnAmxxAttach(){
|
||||||
MF_AddNatives(stats_Natives);
|
MF_AddNatives(stats_Natives);
|
||||||
const char* path = get_localinfo("csstats_score","addons/amxmodx/data/csstats.amxx");
|
const char* path = get_localinfo("csstats_score");
|
||||||
if ( path && *path )
|
if ( path && *path )
|
||||||
{
|
{
|
||||||
char error[128];
|
char error[128];
|
||||||
@ -299,7 +297,7 @@ void OnAmxxAttach(){
|
|||||||
if ( !g_rank.begin() )
|
if ( !g_rank.begin() )
|
||||||
{
|
{
|
||||||
g_rank.loadRank( MF_BuildPathname("%s",
|
g_rank.loadRank( MF_BuildPathname("%s",
|
||||||
get_localinfo("csstats","addons/amxmodx/data/csstats.dat") ) );
|
get_localinfo("csstats") ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,6 @@ extern int mPlayerIndex;
|
|||||||
extern int mState;
|
extern int mState;
|
||||||
|
|
||||||
extern int gmsgCurWeapon;
|
extern int gmsgCurWeapon;
|
||||||
extern int gmsgDamageEnd;
|
|
||||||
extern int gmsgDamage;
|
extern int gmsgDamage;
|
||||||
extern int gmsgWeaponList;
|
extern int gmsgWeaponList;
|
||||||
extern int gmsgResetHUD;
|
extern int gmsgResetHUD;
|
||||||
@ -69,7 +68,6 @@ void Client_CurWeapon(void*);
|
|||||||
void Client_Damage(void*);
|
void Client_Damage(void*);
|
||||||
void Client_WeaponList(void*);
|
void Client_WeaponList(void*);
|
||||||
void Client_AmmoPickup(void*);
|
void Client_AmmoPickup(void*);
|
||||||
void Client_Damage_End(void*);
|
|
||||||
void Client_ScoreInfo(void*);
|
void Client_ScoreInfo(void*);
|
||||||
void Client_ResetHUD(void*);
|
void Client_ResetHUD(void*);
|
||||||
|
|
||||||
|
@ -5,12 +5,6 @@
|
|||||||
|
|
||||||
weaponsVault weaponData[MAX_WEAPONS];
|
weaponsVault weaponData[MAX_WEAPONS];
|
||||||
|
|
||||||
int damage;
|
|
||||||
int TK;
|
|
||||||
int weapon;
|
|
||||||
int aim;
|
|
||||||
CPlayer *pAttacker;
|
|
||||||
|
|
||||||
int g_Planter;
|
int g_Planter;
|
||||||
int g_Defuser;
|
int g_Defuser;
|
||||||
|
|
||||||
@ -52,6 +46,13 @@ void Client_WeaponList(void* mValue){
|
|||||||
|
|
||||||
void Client_Damage(void* mValue){
|
void Client_Damage(void* mValue){
|
||||||
static int bits;
|
static int bits;
|
||||||
|
static int damage;
|
||||||
|
static int TK;
|
||||||
|
static int weapon;
|
||||||
|
static int aim;
|
||||||
|
static bool ignore;
|
||||||
|
static CPlayer *pAttacker;
|
||||||
|
|
||||||
switch (mState++) {
|
switch (mState++) {
|
||||||
case 1:
|
case 1:
|
||||||
damage = *(int*)mValue;
|
damage = *(int*)mValue;
|
||||||
@ -60,7 +61,7 @@ void Client_Damage(void* mValue){
|
|||||||
bits = *(int*)mValue;
|
bits = *(int*)mValue;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (!mPlayer || !damage || !*(float*)mValue || bits) break;
|
if ( ignore = (!mPlayer || !damage || !*(float*)mValue || bits) ) break;
|
||||||
edict_t *enemy;
|
edict_t *enemy;
|
||||||
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
||||||
|
|
||||||
@ -79,19 +80,19 @@ void Client_Damage(void* mValue){
|
|||||||
}
|
}
|
||||||
if( g_grenades.find(enemy , &pAttacker , &weapon ) )
|
if( g_grenades.find(enemy , &pAttacker , &weapon ) )
|
||||||
pAttacker->saveHit( mPlayer , weapon , damage, aim );
|
pAttacker->saveHit( mPlayer , weapon , damage, aim );
|
||||||
}
|
break;
|
||||||
}
|
case 4:
|
||||||
|
if ( ignore || mPlayer->IsAlive() )
|
||||||
void Client_Damage_End(void* mValue){
|
break;
|
||||||
if ( !mPlayer || !damage || mPlayer->IsAlive() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( !pAttacker )
|
if ( !pAttacker )
|
||||||
pAttacker = mPlayer;
|
pAttacker = mPlayer;
|
||||||
TK = 0;
|
TK = 0;
|
||||||
if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) )
|
if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) )
|
||||||
TK = 1;
|
TK = 1;
|
||||||
pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TK);
|
pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TK);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_CurWeapon(void* mValue){
|
void Client_CurWeapon(void* mValue){
|
||||||
|
@ -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);
|
||||||
@ -2629,6 +2651,18 @@ void MF_Log(const char *fmt, ...)
|
|||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_NAME, 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_NAME, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// validate macros
|
// validate macros
|
||||||
@ -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);
|
||||||
@ -432,20 +352,10 @@ static cell AMX_NATIVE_CALL cs_get_user_vip(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 *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP )
|
if ( *((int *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP )
|
||||||
return 1;
|
return 1;
|
||||||
@ -460,20 +370,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 +422,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 +438,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 +469,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 +486,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 +500,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 +519,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 +565,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 +588,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 +653,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 +718,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 +735,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 +800,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 +815,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 +833,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 +864,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 +878,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 +907,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,29 +925,22 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined __amd64__
|
||||||
int following = *((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW);
|
int following = *((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW);
|
||||||
|
#else
|
||||||
|
long following = *((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW);
|
||||||
|
#endif
|
||||||
if (following == 0)
|
if (following == 0)
|
||||||
return following;
|
return following;
|
||||||
|
|
||||||
@ -1195,7 +948,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1209,51 +962,39 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set to not follow anything?
|
// Set to not follow anything?
|
||||||
if (params[2] == 0) {
|
if (params[2] == 0) {
|
||||||
|
#if !defined __amd64__
|
||||||
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = 0;
|
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = 0;
|
||||||
|
#else
|
||||||
|
*((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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__
|
||||||
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (int)pEntity;
|
*((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (int)pEntity;
|
||||||
|
#else
|
||||||
|
*((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (long)pEntity;
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1263,21 +1004,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1288,21 +1019,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;
|
||||||
@ -1314,14 +1035,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);
|
||||||
}
|
}
|
||||||
@ -1340,6 +1057,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},
|
||||||
@ -1373,6 +1188,11 @@ 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},
|
||||||
//------------------- <-- max 19 characters!
|
//------------------- <-- max 19 characters!
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* AMX Mod X
|
/* AMX Mod X
|
||||||
* Counter-Strike Module
|
* Counter-Strike Module
|
||||||
*
|
*
|
||||||
* by the AMX Mod X Development Team
|
* by the AMX Mod X Development Team
|
||||||
@ -46,43 +46,96 @@
|
|||||||
|
|
||||||
#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...
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
// "player" entities
|
// "player" entities
|
||||||
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
#if !defined __amd64__
|
||||||
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
// 32 bit offsets here
|
||||||
#define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET
|
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
||||||
#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET
|
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
||||||
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET
|
#define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET
|
||||||
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
#define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET
|
||||||
#define OFFSET_VIP 215 + EXTRAOFFSET
|
#define OFFSET_NVGOGGLES 129 + EXTRAOFFSET
|
||||||
#define OFFSET_BUYZONE 241 + EXTRAOFFSET
|
#define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET
|
||||||
|
#define OFFSET_VIP 209 + 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
|
||||||
// "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
|
||||||
|
// Amd64 offsets here
|
||||||
|
#define OFFSET_TEAM 139 + EXTRAOFFSET // +25
|
||||||
|
#define OFFSET_CSMONEY 140 + EXTRAOFFSET // +25
|
||||||
|
#define OFFSET_PRIMARYWEAPON 141 + EXTRAOFFSET // +25
|
||||||
|
#define OFFSET_INTERNALMODEL 152 + EXTRAOFFSET // +26
|
||||||
|
#define OFFSET_NVGOGGLES 155 + EXTRAOFFSET // +26
|
||||||
|
#define OFFSET_DEFUSE_PLANT 219 + EXTRAOFFSET // +26
|
||||||
|
#define OFFSET_VIP 242 + EXTRAOFFSET // +27
|
||||||
|
#define OFFSET_TK 249 + EXTRAOFFSET // +33 040927
|
||||||
|
#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_SCOUT_AMMO 427 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_PARA_AMMO 428 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_FAMAS_AMMO 429 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_M3_AMMO 430 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_USP_AMMO 431 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_FIVESEVEN_AMMO 432 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_DEAGLE_AMMO 433 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_P228_AMMO 434 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_GLOCK_AMMO 435 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_FLASH_AMMO 436 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_HE_AMMO 437 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_SMOKE_AMMO 438 + EXTRAOFFSET // +44
|
||||||
|
#define OFFSET_C4_AMMO 439 + EXTRAOFFSET // +44
|
||||||
|
|
||||||
|
#define OFFSET_CSDEATHS 493 + EXTRAOFFSET // +49
|
||||||
|
// "weapon_*" entities
|
||||||
|
#define OFFSET_WEAPONTYPE 57 + EXTRAOFFSET // +14
|
||||||
|
#define OFFSET_CLIPAMMO 65 + EXTRAOFFSET // +14
|
||||||
|
#define OFFSET_SILENCER_FIREMODE 88 + EXTRAOFFSET // +14
|
||||||
|
// "hostage_entity" entities
|
||||||
|
#define OFFSET_HOSTAGEFOLLOW 51 + EXTRAOFFSET // +21, long=51, int=107! (must use the long* offset 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
|
||||||
|
#endif
|
||||||
|
|
||||||
// Ids of weapons in CS
|
// Ids of weapons in CS
|
||||||
#define CSW_P228 1
|
#define CSW_P228 1
|
||||||
@ -149,6 +202,9 @@
|
|||||||
#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
|
||||||
|
|
||||||
enum CS_Internal_Models {
|
enum CS_Internal_Models {
|
||||||
CS_DONTCHANGE = 0,
|
CS_DONTCHANGE = 0,
|
||||||
CS_CT_URBAN = 1,
|
CS_CT_URBAN = 1,
|
||||||
@ -167,3 +223,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.00"
|
||||||
#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"
|
||||||
|
177
dlls/csx/plugins/tp/amx_csx_gasnades.sma
Executable file
177
dlls/csx/plugins/tp/amx_csx_gasnades.sma
Executable file
@ -0,0 +1,177 @@
|
|||||||
|
/* Gasnades */
|
||||||
|
|
||||||
|
#include <amxmodx>
|
||||||
|
#include <fun>
|
||||||
|
#include <engine>
|
||||||
|
#include <csx>
|
||||||
|
|
||||||
|
new g_Gas
|
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
public plugin_init()
|
||||||
|
{
|
||||||
|
register_plugin("Gasgrenades", "1.3 (CSX)", "RichoDemus/AssKicR/T(+)rget")
|
||||||
|
|
||||||
|
register_cvar("amx_gasnades", "1")
|
||||||
|
register_cvar("amx_gasdmg", "10")
|
||||||
|
register_cvar("amx_gascheck", "3")
|
||||||
|
register_cvar("amx_gasradius", "200")
|
||||||
|
register_cvar("amx_smokegasp", "1")
|
||||||
|
register_cvar("amx_gasobeyFF", "1")
|
||||||
|
|
||||||
|
g_Gas = custom_weapon_add("gasnade",0,"gasnade")
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
public plugin_precache()
|
||||||
|
{
|
||||||
|
precache_sound("player/gasp1.wav")
|
||||||
|
precache_sound("player/gasp2.wav")
|
||||||
|
}
|
||||||
|
|
||||||
|
public gas(par[])
|
||||||
|
{
|
||||||
|
new grenadeid = par[1]
|
||||||
|
new id = par[0]
|
||||||
|
|
||||||
|
if ( !is_valid_ent(grenadeid) )
|
||||||
|
return
|
||||||
|
|
||||||
|
new player[3], inum, Float:temp_grenade[3], grenade[3], players[32]
|
||||||
|
if(get_cvar_num("amx_gasobeyFF") != 1)
|
||||||
|
get_players(players, inum) // Get number of players
|
||||||
|
else{
|
||||||
|
new FFOn = get_cvar_num("mp_friendlyfire")
|
||||||
|
if(FFOn == 0){
|
||||||
|
new team[33]
|
||||||
|
get_user_team(id, team, 32)
|
||||||
|
if(equali(team, "CT"))
|
||||||
|
get_players(players, inum, "ae", "TERRORIST")
|
||||||
|
else
|
||||||
|
get_players(players, inum, "ae", "CT")
|
||||||
|
}
|
||||||
|
else
|
||||||
|
get_players(players, inum) // Get number of players
|
||||||
|
}
|
||||||
|
entity_get_vector(grenadeid, EV_VEC_origin, temp_grenade) // Get the position of the grenade
|
||||||
|
grenade[0] = floatround(temp_grenade[0])
|
||||||
|
grenade[1] = floatround(temp_grenade[1])
|
||||||
|
grenade[2] = floatround(temp_grenade[2])
|
||||||
|
for(new i = 0; i < inum; ++i){ // Loop through all players
|
||||||
|
get_user_origin(players[i],player,0)
|
||||||
|
new distance = get_distance(grenade, player)
|
||||||
|
|
||||||
|
if((distance < get_cvar_num("amx_gasradius"))){ // Check who is standing close
|
||||||
|
if(get_cvar_num("amx_smokegasp") != 0){
|
||||||
|
if(get_cvar_num("amx_gascheck") >= 1){
|
||||||
|
new number = random_num(1, 2)
|
||||||
|
if(is_user_alive(players[i])){
|
||||||
|
switch (number){
|
||||||
|
case 1:emit_sound(players[i], CHAN_VOICE, "player/gasp1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
|
||||||
|
case 2:emit_sound(players[i], CHAN_VOICE, "player/gasp2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
message_begin(MSG_ONE, get_user_msgid("Damage"), {0,0,0}, players[i])
|
||||||
|
write_byte(30) // dmg_save
|
||||||
|
write_byte(30) // dmg_take
|
||||||
|
write_long((1 << 16)) // visibleDamageBits
|
||||||
|
write_coord(grenade[0]) // damageOrigin.x
|
||||||
|
write_coord(grenade[1]) // damageOrigin.y
|
||||||
|
write_coord(grenade[2]) // damageOrigin.z
|
||||||
|
message_end()
|
||||||
|
if(is_user_alive(id))
|
||||||
|
ExtraDamage(players[i], id, get_cvar_num("amx_gasdmg"), "gasgrenade")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set_task(get_cvar_float("amx_gascheck"), "gas",grenadeid,par,2) // If the grenade still exists we do a new check in get_cvar_num("amx_gascheck") second
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
public grenade_throw(index,greindex,wId){
|
||||||
|
if ( task_exists(greindex) )
|
||||||
|
remove_task(greindex)
|
||||||
|
if( get_cvar_num("amx_gasnades") !=1 || wId != CSW_SMOKEGRENADE )
|
||||||
|
return PLUGIN_CONTINUE
|
||||||
|
if (g_Gas) custom_weapon_shot(g_Gas,index)
|
||||||
|
new par[2]
|
||||||
|
par[0] = index
|
||||||
|
par[1] = greindex
|
||||||
|
set_task(1.5, "gas", greindex,par,2)
|
||||||
|
return PLUGIN_CONTINUE
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
stock ExtraDamage(id, attacker, damage, weaponDescription[])
|
||||||
|
{
|
||||||
|
if(is_user_alive(id))
|
||||||
|
{
|
||||||
|
new userHealth = get_user_health(id)
|
||||||
|
set_user_health(id, userHealth - damage)
|
||||||
|
if (g_Gas)
|
||||||
|
custom_weapon_dmg(g_Gas,attacker,id,damage)
|
||||||
|
|
||||||
|
if(userHealth - damage <= 0)
|
||||||
|
{
|
||||||
|
logKill(attacker, id, weaponDescription)
|
||||||
|
if(get_user_team(id) != get_user_team(attacker))
|
||||||
|
{
|
||||||
|
// The person dying shouldn't get negative credit for this kill (so add it back)
|
||||||
|
set_user_frags(id, get_user_frags(id) + 1)
|
||||||
|
// The killing should get credit for the frag
|
||||||
|
set_user_frags(attacker, get_user_frags(attacker) + 1)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// The person dying shouldn't get negative credit for this kill (so add it back)
|
||||||
|
set_user_frags(id, get_user_frags(id) + 1)
|
||||||
|
// The killer killed a teammember or self
|
||||||
|
// Engine gives credit for the kill so let's take away that + 1
|
||||||
|
set_user_frags(attacker, get_user_frags(attacker) - 2)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(get_cvar_num("mp_logdetail") == 3){
|
||||||
|
logDmg(attacker, id, weaponDescription,"body",damage,userHealth-damage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------------------------
|
||||||
|
/* Log a kill using standard HL-logging format */
|
||||||
|
stock logKill(attacker, victim, weaponDescription[])
|
||||||
|
{
|
||||||
|
// Save Hummiliation
|
||||||
|
new namea[24], namev[24], authida[20], authidv[20], teama[10], teamv[10]
|
||||||
|
|
||||||
|
// Info On Attacker
|
||||||
|
get_user_name(attacker, namea, 23)
|
||||||
|
get_user_team(attacker, teama, 9)
|
||||||
|
get_user_authid(attacker, authida, 19)
|
||||||
|
// Info On Victim
|
||||||
|
get_user_name(victim, namev, 23)
|
||||||
|
get_user_team(victim, teamv, 9)
|
||||||
|
get_user_authid(victim, authidv, 19)
|
||||||
|
// Log This Kill
|
||||||
|
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",
|
||||||
|
namea, get_user_userid(attacker), authida, teama, namev, get_user_userid(victim), authidv, teamv, weaponDescription)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Log damage using standard HL-logging format */
|
||||||
|
stock logDmg(attacker, victim, weaponDescription[],hit[],damage,health)
|
||||||
|
{
|
||||||
|
// Save Hummiliation
|
||||||
|
new namea[24], namev[24], authida[20], authidv[20], teama[10], teamv[10]
|
||||||
|
|
||||||
|
// Info On Attacker
|
||||||
|
get_user_name(attacker, namea, 23)
|
||||||
|
get_user_team(attacker, teama, 9)
|
||||||
|
get_user_authid(attacker, authida, 19)
|
||||||
|
// Info On Victim
|
||||||
|
get_user_name(victim, namev, 23)
|
||||||
|
get_user_team(victim, teamv, 9)
|
||||||
|
get_user_authid(victim, authidv, 19)
|
||||||
|
// Log This Damage
|
||||||
|
log_message("^"%s<%d><%s><%s>^" attacked ^"%s<%d><%s><%s>^" with ^"%s^" (hit ^"%s^") (damage ^"%d^") (health ^"%d^")",
|
||||||
|
namea,get_user_userid(attacker),authida,teama,namev,get_user_userid(victim),authidv,teamv,weaponDescription,hit,damage,health)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------
|
299
dlls/csx/source/CMisc.cpp
Executable file
299
dlls/csx/source/CMisc.cpp
Executable file
@ -0,0 +1,299 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "CMisc.h"
|
||||||
|
#include "rank.h"
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class Grenades
|
||||||
|
// *****************************************************
|
||||||
|
void Grenades::put( edict_t* grenade, float time, int type, CPlayer* player )
|
||||||
|
{
|
||||||
|
Obj* a = new Obj;
|
||||||
|
if ( a == 0 ) return;
|
||||||
|
a->player = player;
|
||||||
|
a->grenade = grenade;
|
||||||
|
a->time = gpGlobals->time + time;
|
||||||
|
a->type = type;
|
||||||
|
a->prev = 0;
|
||||||
|
a->next = head;
|
||||||
|
if ( head ) head->prev = a;
|
||||||
|
head = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Grenades::find( edict_t* enemy, CPlayer** p, int* type )
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
Obj* a = head;
|
||||||
|
while ( a ){
|
||||||
|
if ( a->time > gpGlobals->time ) {
|
||||||
|
if ( a->grenade == enemy ) {
|
||||||
|
found = true;
|
||||||
|
*p = a->player;
|
||||||
|
*type = a->type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Obj* next = a->next;
|
||||||
|
if (a->prev) a->prev->next = next;
|
||||||
|
else head = next;
|
||||||
|
if (next) next->prev = a->prev;
|
||||||
|
delete a;
|
||||||
|
a = next;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
a = a->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Grenades::clear()
|
||||||
|
{
|
||||||
|
while(head){
|
||||||
|
Obj* a = head->next;
|
||||||
|
delete head;
|
||||||
|
head = a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class CPlayer
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
void CPlayer::Disconnect(){
|
||||||
|
|
||||||
|
if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
|
||||||
|
return;
|
||||||
|
|
||||||
|
rank->updatePosition( &life );
|
||||||
|
rank = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::PutInServer(){
|
||||||
|
|
||||||
|
if ( ignoreBots(pEdict) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
restartStats();
|
||||||
|
const char* name = STRING(pEdict->v.netname);
|
||||||
|
const char* unique = name;
|
||||||
|
switch((int)csstats_rank->value) {
|
||||||
|
case 1:
|
||||||
|
if ( (unique = GETPLAYERAUTHID(pEdict)) == 0 )
|
||||||
|
unique = name; // failed to get authid
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
unique = ip;
|
||||||
|
}
|
||||||
|
rank = g_rank.findEntryInRank( unique , name );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::Connect(const char* address ){
|
||||||
|
bot = IsBot();
|
||||||
|
strcpy(ip,address);
|
||||||
|
rank = 0;
|
||||||
|
clearStats = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::restartStats(bool all)
|
||||||
|
{
|
||||||
|
if ( all ) memset(weapons,0,sizeof(weapons));
|
||||||
|
memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
|
||||||
|
memset(attackers,0,sizeof(attackers));
|
||||||
|
memset(victims,0,sizeof(victims));
|
||||||
|
memset(&life,0,sizeof(life));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::Init( int pi, edict_t* pe )
|
||||||
|
{
|
||||||
|
pEdict = pe;
|
||||||
|
index = pi;
|
||||||
|
current = 0;
|
||||||
|
clearStats = 0.0f;
|
||||||
|
rank = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
|
||||||
|
|
||||||
|
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( pVictim->index == index ){ // killed self
|
||||||
|
pVictim->weapons[0].deaths++;
|
||||||
|
pVictim->life.deaths++;
|
||||||
|
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pVictim->attackers[index].name = weaponData[wweapon].name;
|
||||||
|
pVictim->attackers[index].kills++;
|
||||||
|
pVictim->attackers[index].hs += hhs;
|
||||||
|
pVictim->attackers[index].tks += ttk;
|
||||||
|
pVictim->attackers[0].kills++;
|
||||||
|
pVictim->attackers[0].hs += hhs;
|
||||||
|
pVictim->attackers[0].tks += ttk;
|
||||||
|
pVictim->weapons[pVictim->current].deaths++;
|
||||||
|
pVictim->weapons[0].deaths++;
|
||||||
|
pVictim->life.deaths++;
|
||||||
|
|
||||||
|
|
||||||
|
pVictim->weaponsRnd[pVictim->current].deaths++; // DEC-Weapon (round) stats
|
||||||
|
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||||
|
|
||||||
|
int vi = pVictim->index;
|
||||||
|
victims[vi].name = weaponData[wweapon].name;
|
||||||
|
victims[vi].deaths++;
|
||||||
|
victims[vi].hs += hhs;
|
||||||
|
victims[vi].tks += ttk;
|
||||||
|
victims[0].deaths++;
|
||||||
|
victims[0].hs += hhs;
|
||||||
|
victims[0].tks += ttk;
|
||||||
|
|
||||||
|
weaponsRnd[wweapon].kills++; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[wweapon].hs += hhs; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[wweapon].tks += ttk; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[0].kills++; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[0].hs += hhs; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[0].tks += ttk; // DEC-Weapon (round) stats
|
||||||
|
|
||||||
|
weapons[wweapon].kills++;
|
||||||
|
weapons[wweapon].hs += hhs;
|
||||||
|
weapons[wweapon].tks += ttk;
|
||||||
|
weapons[0].kills++;
|
||||||
|
weapons[0].hs += hhs;
|
||||||
|
weapons[0].tks += ttk;
|
||||||
|
life.kills++;
|
||||||
|
life.hs += hhs;
|
||||||
|
life.tks += ttk;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
|
||||||
|
|
||||||
|
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( index == pVictim->index ) return;
|
||||||
|
|
||||||
|
pVictim->attackers[index].hits++;
|
||||||
|
pVictim->attackers[index].damage += ddamage;
|
||||||
|
pVictim->attackers[index].bodyHits[bbody]++;
|
||||||
|
pVictim->attackers[0].hits++;
|
||||||
|
pVictim->attackers[0].damage += ddamage;
|
||||||
|
pVictim->attackers[0].bodyHits[bbody]++;
|
||||||
|
|
||||||
|
|
||||||
|
int vi = pVictim->index;
|
||||||
|
victims[vi].hits++;
|
||||||
|
victims[vi].damage += ddamage;
|
||||||
|
victims[vi].bodyHits[bbody]++;
|
||||||
|
victims[0].hits++;
|
||||||
|
victims[0].damage += ddamage;
|
||||||
|
victims[0].bodyHits[bbody]++;
|
||||||
|
|
||||||
|
weaponsRnd[wweapon].hits++; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[wweapon].damage += ddamage; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[wweapon].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[0].hits++; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[0].damage += ddamage; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[0].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||||
|
|
||||||
|
weapons[wweapon].hits++;
|
||||||
|
weapons[wweapon].damage += ddamage;
|
||||||
|
weapons[wweapon].bodyHits[bbody]++;
|
||||||
|
weapons[0].hits++;
|
||||||
|
weapons[0].damage += ddamage;
|
||||||
|
weapons[0].bodyHits[bbody]++;
|
||||||
|
|
||||||
|
life.hits++;
|
||||||
|
life.damage += ddamage;
|
||||||
|
life.bodyHits[bbody]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CPlayer::saveShot(int weapon){
|
||||||
|
|
||||||
|
if ( ignoreBots(pEdict) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
victims[0].shots++;
|
||||||
|
weapons[weapon].shots++;
|
||||||
|
weapons[0].shots++;
|
||||||
|
life.shots++;
|
||||||
|
weaponsRnd[weapon].shots++; // DEC-Weapon (round) stats
|
||||||
|
weaponsRnd[0].shots++; // DEC-Weapon (round) stats
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CPlayer::saveBPlant(){
|
||||||
|
life.bPlants++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::saveBExplode(){
|
||||||
|
life.bExplosions++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::saveBDefusing(){
|
||||||
|
life.bDefusions++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::saveBDefused(){
|
||||||
|
life.bDefused++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class Forward
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
void Forward::put( AMX *a , int i ){
|
||||||
|
head = new AmxCall( a, i , head );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Forward::clear(){
|
||||||
|
while ( head ) {
|
||||||
|
AmxCall* a = head->next;
|
||||||
|
delete head;
|
||||||
|
head = a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Forward::exec(int p1,int p2,int p3,int p4,int p5,int p6){
|
||||||
|
AmxCall* a = head;
|
||||||
|
while ( a ){
|
||||||
|
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 6,p1, p2, p3, p4, p5, p6);
|
||||||
|
a = a->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Forward::exec(int p1,int p2,int p3,int p4,int p5){
|
||||||
|
AmxCall* a = head;
|
||||||
|
while ( a ){
|
||||||
|
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 5,p1, p2, p3, p4, p5);
|
||||||
|
a = a->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Forward::exec(int p1,int p2){
|
||||||
|
AmxCall* a = head;
|
||||||
|
while ( a ){
|
||||||
|
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 2,p1, p2);
|
||||||
|
a = a->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
bool ignoreBots (edict_t *pEnt, edict_t *pOther){
|
||||||
|
if ( !rankBots && ( pEnt->v.flags & FL_FAKECLIENT || ( pOther && pOther->v.flags & FL_FAKECLIENT ) ) )
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isModuleActive(){
|
||||||
|
if ( !(int)CVAR_GET_FLOAT("csstats_pause") )
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
116
dlls/csx/source/CMisc.h
Executable file
116
dlls/csx/source/CMisc.h
Executable file
@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef CMISC_H
|
||||||
|
#define CMISC_H
|
||||||
|
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "CRank.h"
|
||||||
|
|
||||||
|
#define MAX_CWEAPONS 6
|
||||||
|
|
||||||
|
#define CSW_HEGRENADE 4
|
||||||
|
#define CSW_C4 6
|
||||||
|
#define CSW_SMOKEGRENADE 9
|
||||||
|
#define CSW_FLASHBANG 25
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class CPlayer
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
struct CPlayer {
|
||||||
|
edict_t* pEdict;
|
||||||
|
char ip[32];
|
||||||
|
int index;
|
||||||
|
int aiming;
|
||||||
|
int current;
|
||||||
|
bool bot;
|
||||||
|
float clearStats;
|
||||||
|
RankSystem::RankStats* rank;
|
||||||
|
|
||||||
|
struct PlayerWeapon : Stats {
|
||||||
|
const char* name;
|
||||||
|
int ammo;
|
||||||
|
int clip;
|
||||||
|
};
|
||||||
|
|
||||||
|
PlayerWeapon weapons[MAX_WEAPONS+MAX_CWEAPONS];
|
||||||
|
PlayerWeapon attackers[33];
|
||||||
|
PlayerWeapon victims[33];
|
||||||
|
Stats weaponsRnd[MAX_WEAPONS+MAX_CWEAPONS]; // DEC-Weapon (Round) stats
|
||||||
|
Stats life;
|
||||||
|
|
||||||
|
int teamId;
|
||||||
|
|
||||||
|
void Init( int pi, edict_t* pe );
|
||||||
|
void Connect(const char* ip );
|
||||||
|
void PutInServer();
|
||||||
|
void Disconnect();
|
||||||
|
void saveKill(CPlayer* pVictim, int weapon, int hs, int tk);
|
||||||
|
void saveHit(CPlayer* pVictim, int weapon, int damage, int aiming);
|
||||||
|
void saveShot(int weapon);
|
||||||
|
|
||||||
|
void saveBPlant();
|
||||||
|
void saveBExplode();
|
||||||
|
void saveBDefusing();
|
||||||
|
void saveBDefused();
|
||||||
|
|
||||||
|
void restartStats(bool all = true);
|
||||||
|
inline bool IsBot(){
|
||||||
|
const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict);
|
||||||
|
return ( auth && !strcmp( auth , "BOT" ) );
|
||||||
|
}
|
||||||
|
inline bool IsAlive(){
|
||||||
|
return ((pEdict->v.deadflag==DEAD_NO)&&(pEdict->v.health>0));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class Grenades
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
class Grenades
|
||||||
|
{
|
||||||
|
struct Obj
|
||||||
|
{
|
||||||
|
CPlayer* player;
|
||||||
|
edict_t* grenade;
|
||||||
|
float time;
|
||||||
|
int type;
|
||||||
|
Obj* next;
|
||||||
|
Obj* prev;
|
||||||
|
} *head;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Grenades() { head = 0; }
|
||||||
|
~Grenades() { clear(); }
|
||||||
|
void put( edict_t* grenade, float time, int type, CPlayer* player );
|
||||||
|
bool find( edict_t* enemy, CPlayer** p, int* type );
|
||||||
|
void clear();
|
||||||
|
};
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class Forward
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
class Forward
|
||||||
|
{
|
||||||
|
struct AmxCall {
|
||||||
|
AMX *amx;
|
||||||
|
int iFunctionIdx;
|
||||||
|
AmxCall* next;
|
||||||
|
AmxCall( AMX *a , int i, AmxCall* n ): amx(a), iFunctionIdx(i), next(n) {}
|
||||||
|
} *head;
|
||||||
|
public:
|
||||||
|
Forward() { head = 0; }
|
||||||
|
~Forward() { clear(); }
|
||||||
|
void clear();
|
||||||
|
void put( AMX *a , int i );
|
||||||
|
void exec(int p1,int p2,int p3,int p4,int p5,int p6);
|
||||||
|
void exec(int p1,int p2,int p3,int p4,int p5);
|
||||||
|
void exec(int p1,int p2);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CMISC_H
|
||||||
|
|
||||||
|
|
||||||
|
|
308
dlls/csx/source/CRank.cpp
Executable file
308
dlls/csx/source/CRank.cpp
Executable file
@ -0,0 +1,308 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "CRank.h"
|
||||||
|
#include "rank.h"
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class Stats
|
||||||
|
// *****************************************************
|
||||||
|
Stats::Stats(){
|
||||||
|
hits = shots = damage = hs = tks = kills = deaths = bDefusions = bDefused = bPlants = bExplosions = 0;
|
||||||
|
memset( bodyHits , 0 ,sizeof( bodyHits ) );
|
||||||
|
}
|
||||||
|
void Stats::commit(Stats* a){
|
||||||
|
hits += a->hits;
|
||||||
|
shots += a->shots;
|
||||||
|
damage += a->damage;
|
||||||
|
hs += a->hs;
|
||||||
|
tks += a->tks;
|
||||||
|
kills += a->kills;
|
||||||
|
deaths += a->deaths;
|
||||||
|
|
||||||
|
bDefusions += a->bDefusions;
|
||||||
|
bDefused += a->bDefused;
|
||||||
|
bPlants += a->bPlants;
|
||||||
|
bExplosions += a->bExplosions;
|
||||||
|
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
bodyHits[i] += a->bodyHits[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class RankSystem
|
||||||
|
// *****************************************************
|
||||||
|
RankSystem::RankStats::RankStats( const char* uu, const char* nn, RankSystem* pp ) {
|
||||||
|
name = 0;
|
||||||
|
namelen = 0;
|
||||||
|
unique = 0;
|
||||||
|
uniquelen = 0;
|
||||||
|
score = 0;
|
||||||
|
parent = pp;
|
||||||
|
id = ++parent->rankNum;
|
||||||
|
next = prev = 0;
|
||||||
|
setName( nn );
|
||||||
|
setUnique( uu );
|
||||||
|
}
|
||||||
|
|
||||||
|
RankSystem::RankStats::~RankStats() {
|
||||||
|
delete[] name;
|
||||||
|
delete[] unique;
|
||||||
|
--parent->rankNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::RankStats::setName( const char* nn ) {
|
||||||
|
delete[] name;
|
||||||
|
namelen = strlen(nn) + 1;
|
||||||
|
name = new char[namelen];
|
||||||
|
if ( name )
|
||||||
|
strcpy( name , nn );
|
||||||
|
else
|
||||||
|
namelen = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::RankStats::setUnique( const char* nn ) {
|
||||||
|
delete[] unique;
|
||||||
|
uniquelen = strlen(nn) + 1;
|
||||||
|
unique = new char[uniquelen];
|
||||||
|
if ( unique )
|
||||||
|
strcpy( unique , nn );
|
||||||
|
else
|
||||||
|
uniquelen = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
RankSystem::RankSystem() {
|
||||||
|
head = 0;
|
||||||
|
tail = 0;
|
||||||
|
rankNum = 0;
|
||||||
|
calc.code = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
RankSystem::~RankSystem() {
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::put_before( RankStats* a, RankStats* ptr ){
|
||||||
|
a->next = ptr;
|
||||||
|
if ( ptr ){
|
||||||
|
a->prev = ptr->prev;
|
||||||
|
ptr->prev = a;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
a->prev = head;
|
||||||
|
head = a;
|
||||||
|
}
|
||||||
|
if ( a->prev ) a->prev->next = a;
|
||||||
|
else tail = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::put_after( RankStats* a, RankStats* ptr ) {
|
||||||
|
a->prev = ptr;
|
||||||
|
if ( ptr ){
|
||||||
|
a->next = ptr->next;
|
||||||
|
ptr->next = a;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
a->next = tail;
|
||||||
|
tail = a;
|
||||||
|
}
|
||||||
|
if ( a->next ) a->next->prev = a;
|
||||||
|
else head = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::unlink( RankStats* ptr ){
|
||||||
|
if (ptr->prev) ptr->prev->next = ptr->next;
|
||||||
|
else tail = ptr->next;
|
||||||
|
if (ptr->next) ptr->next->prev = ptr->prev;
|
||||||
|
else head = ptr->prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::clear(){
|
||||||
|
while( tail ){
|
||||||
|
head = tail->next;
|
||||||
|
delete tail;
|
||||||
|
tail = head;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool RankSystem::loadCalc(const char* filename, char* error)
|
||||||
|
{
|
||||||
|
if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error,0)!=AMX_ERR_NONE)||
|
||||||
|
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr1, &calc.physAddr1)!=AMX_ERR_NONE)||
|
||||||
|
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr2, &calc.physAddr2)!=AMX_ERR_NONE)||
|
||||||
|
(MF_AmxFindPublic(&calc.amx,"get_score",&calc.func)!=AMX_ERR_NONE)){
|
||||||
|
LOG_CONSOLE( PLID, "Couldn't load plugin (file \"%s\")",filename);
|
||||||
|
MF_UnloadAmxScript(&calc.amx, &calc.code);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::unloadCalc()
|
||||||
|
{
|
||||||
|
MF_UnloadAmxScript(&calc.amx , &calc.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
RankSystem::RankStats* RankSystem::findEntryInRank(const char* unique, const char* name )
|
||||||
|
{
|
||||||
|
RankStats* a = head;
|
||||||
|
|
||||||
|
while ( a )
|
||||||
|
{
|
||||||
|
if ( strcmp( a->getUnique() ,unique ) == 0 )
|
||||||
|
return a;
|
||||||
|
|
||||||
|
a = a->prev;
|
||||||
|
}
|
||||||
|
a = new RankStats( unique ,name,this );
|
||||||
|
if ( a == 0 ) return 0;
|
||||||
|
put_after( a , 0 );
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::updatePos( RankStats* rr , Stats* s )
|
||||||
|
{
|
||||||
|
rr->addStats( s );
|
||||||
|
if ( calc.code ) {
|
||||||
|
calc.physAddr1[0] = rr->kills;
|
||||||
|
calc.physAddr1[1] = rr->deaths;
|
||||||
|
calc.physAddr1[2] = rr->hs;
|
||||||
|
calc.physAddr1[3] = rr->tks;
|
||||||
|
calc.physAddr1[4] = rr->shots;
|
||||||
|
calc.physAddr1[5] = rr->hits;
|
||||||
|
calc.physAddr1[6] = rr->damage;
|
||||||
|
|
||||||
|
calc.physAddr1[7] = rr->bDefusions;
|
||||||
|
calc.physAddr1[8] = rr->bDefused;
|
||||||
|
calc.physAddr1[9] = rr->bPlants;
|
||||||
|
calc.physAddr1[10] = rr->bExplosions;
|
||||||
|
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
calc.physAddr2[i] = rr->bodyHits[i];
|
||||||
|
cell result = 0;
|
||||||
|
int err;
|
||||||
|
if ((err = MF_AmxExec(&calc.amx,&result, calc.func ,2,calc.amxAddr1,calc.amxAddr2 )) != AMX_ERR_NONE)
|
||||||
|
LOG_CONSOLE( PLID, "Run time error %d on line %ld (plugin \"%s\")", err,calc.amx.curline,LOCALINFO("csstats_score"));
|
||||||
|
rr->score = result;
|
||||||
|
}
|
||||||
|
else rr->score = rr->kills - rr->deaths;
|
||||||
|
|
||||||
|
|
||||||
|
RankStats* aa = rr->next;
|
||||||
|
while ( aa && (aa->score <= rr->score) ) { // try to nominate
|
||||||
|
rr->goUp();
|
||||||
|
aa->goDown();
|
||||||
|
aa = aa->next; // go to next rank
|
||||||
|
}
|
||||||
|
if ( aa != rr->next )
|
||||||
|
{
|
||||||
|
unlink( rr );
|
||||||
|
put_before( rr, aa );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aa = rr->prev;
|
||||||
|
while ( aa && (aa->score > rr->score) ) { // go down
|
||||||
|
rr->goDown();
|
||||||
|
aa->goUp();
|
||||||
|
aa = aa->prev; // go to prev rank
|
||||||
|
}
|
||||||
|
if ( aa != rr->prev ){
|
||||||
|
unlink( rr );
|
||||||
|
put_after( rr, aa );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::loadRank( const char* filename )
|
||||||
|
{
|
||||||
|
FILE *bfp = fopen( filename , "rb" );
|
||||||
|
|
||||||
|
if ( !bfp ) return;
|
||||||
|
|
||||||
|
short int i = 0;
|
||||||
|
fread(&i, 1 , sizeof(short int) , bfp);
|
||||||
|
|
||||||
|
if (i == RANK_VERSION)
|
||||||
|
{
|
||||||
|
Stats d;
|
||||||
|
char unique[64], name[64];
|
||||||
|
fread(&i , 1, sizeof(short int), bfp);
|
||||||
|
|
||||||
|
while( i )
|
||||||
|
{
|
||||||
|
fread(name , i,sizeof(char) , bfp);
|
||||||
|
fread(&i , 1, sizeof(short int), bfp);
|
||||||
|
fread(unique , i,sizeof(char) , bfp);
|
||||||
|
fread(&d.tks, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.damage, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.deaths, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.kills, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.shots, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.hits, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.hs, 1,sizeof(int), bfp);
|
||||||
|
|
||||||
|
fread(&d.bDefusions, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.bDefused, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.bPlants, 1,sizeof(int), bfp);
|
||||||
|
fread(&d.bExplosions, 1,sizeof(int), bfp);
|
||||||
|
|
||||||
|
fread(d.bodyHits, 1,sizeof(d.bodyHits), bfp);
|
||||||
|
fread(&i , 1, sizeof(short int), bfp);
|
||||||
|
|
||||||
|
RankSystem::RankStats* a = findEntryInRank( unique , name );
|
||||||
|
|
||||||
|
if ( a ) a->updatePosition( &d );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(bfp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RankSystem::saveRank( const char* filename )
|
||||||
|
{
|
||||||
|
FILE *bfp = fopen(filename, "wb");
|
||||||
|
|
||||||
|
if ( !bfp ) return;
|
||||||
|
|
||||||
|
short int i = RANK_VERSION;
|
||||||
|
|
||||||
|
fwrite(&i, 1, sizeof(short int) , bfp);
|
||||||
|
|
||||||
|
RankSystem::iterator a = front();
|
||||||
|
|
||||||
|
while ( a )
|
||||||
|
{
|
||||||
|
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||||
|
{
|
||||||
|
fwrite( &(*a).namelen , 1, sizeof(short int), bfp);
|
||||||
|
fwrite( (*a).name , (*a).namelen , sizeof(char) , bfp);
|
||||||
|
fwrite( &(*a).uniquelen , 1, sizeof(short int), bfp);
|
||||||
|
fwrite( (*a).unique , (*a).uniquelen , sizeof(char) , bfp);
|
||||||
|
fwrite( &(*a).tks, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).damage, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).deaths, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).kills, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).shots, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).hits, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).hs, 1, sizeof(int), bfp);
|
||||||
|
|
||||||
|
fwrite( &(*a).bDefusions, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).bDefused, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).bPlants, 1, sizeof(int), bfp);
|
||||||
|
fwrite( &(*a).bExplosions, 1, sizeof(int), bfp);
|
||||||
|
|
||||||
|
fwrite( (*a).bodyHits, 1, sizeof((*a).bodyHits), bfp);
|
||||||
|
}
|
||||||
|
|
||||||
|
--a;
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
fwrite( &i , 1, sizeof(short int), bfp); // null terminator
|
||||||
|
|
||||||
|
fclose(bfp);
|
||||||
|
}
|
122
dlls/csx/source/CRank.h
Executable file
122
dlls/csx/source/CRank.h
Executable file
@ -0,0 +1,122 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef CRANK_H
|
||||||
|
#define CRANK_H
|
||||||
|
|
||||||
|
#define RANK_VERSION 11
|
||||||
|
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class Stats
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
struct Stats {
|
||||||
|
int hits;
|
||||||
|
int shots;
|
||||||
|
int damage;
|
||||||
|
int hs;
|
||||||
|
int tks;
|
||||||
|
int kills;
|
||||||
|
int deaths;
|
||||||
|
int bodyHits[9]; ////////////////////
|
||||||
|
|
||||||
|
// SiDLuke start
|
||||||
|
int bPlants;
|
||||||
|
int bExplosions;
|
||||||
|
int bDefusions;
|
||||||
|
int bDefused;
|
||||||
|
// SiDLuke end :D
|
||||||
|
|
||||||
|
Stats();
|
||||||
|
void commit(Stats* a);
|
||||||
|
};
|
||||||
|
|
||||||
|
// *****************************************************
|
||||||
|
// class RankSystem
|
||||||
|
// *****************************************************
|
||||||
|
|
||||||
|
class RankSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class RankStats;
|
||||||
|
friend class RankStats;
|
||||||
|
class iterator;
|
||||||
|
|
||||||
|
class RankStats : public Stats {
|
||||||
|
friend class RankSystem;
|
||||||
|
friend class iterator;
|
||||||
|
RankSystem* parent;
|
||||||
|
RankStats* next;
|
||||||
|
RankStats* prev;
|
||||||
|
char* unique;
|
||||||
|
short int uniquelen;
|
||||||
|
char* name;
|
||||||
|
short int namelen;
|
||||||
|
int score;
|
||||||
|
int id;
|
||||||
|
RankStats( const char* uu, const char* nn, RankSystem* pp );
|
||||||
|
~RankStats();
|
||||||
|
void setUnique( const char* nn );
|
||||||
|
inline void goDown() {++id;}
|
||||||
|
inline void goUp() {--id;}
|
||||||
|
inline void addStats(Stats* a) { commit( a ); }
|
||||||
|
public:
|
||||||
|
void setName( const char* nn );
|
||||||
|
inline const char* getName() const { return name ? name : ""; }
|
||||||
|
inline const char* getUnique() const { return unique ? unique : ""; }
|
||||||
|
inline int getPosition() const { return id; }
|
||||||
|
inline void updatePosition( Stats* points ) {
|
||||||
|
parent->updatePos( this , points );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
RankStats* head;
|
||||||
|
RankStats* tail;
|
||||||
|
int rankNum;
|
||||||
|
|
||||||
|
struct scoreCalc{
|
||||||
|
AMX amx;
|
||||||
|
void* code;
|
||||||
|
int func;
|
||||||
|
cell amxAddr1;
|
||||||
|
cell amxAddr2;
|
||||||
|
cell *physAddr1;
|
||||||
|
cell *physAddr2;
|
||||||
|
} calc;
|
||||||
|
|
||||||
|
void put_before( RankStats* a, RankStats* ptr );
|
||||||
|
void put_after( RankStats* a, RankStats* ptr );
|
||||||
|
void unlink( RankStats* ptr );
|
||||||
|
void updatePos( RankStats* r , Stats* s );
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
RankSystem();
|
||||||
|
~RankSystem();
|
||||||
|
|
||||||
|
void saveRank( const char* filename );
|
||||||
|
void loadRank( const char* filename );
|
||||||
|
RankStats* findEntryInRank(const char* unique, const char* name );
|
||||||
|
bool loadCalc(const char* filename, char* error);
|
||||||
|
inline int getRankNum( ) const { return rankNum; }
|
||||||
|
void clear();
|
||||||
|
void unloadCalc();
|
||||||
|
|
||||||
|
class iterator {
|
||||||
|
RankStats* ptr;
|
||||||
|
public:
|
||||||
|
iterator(RankStats* a): ptr(a){}
|
||||||
|
inline iterator& operator--() { ptr = ptr->prev; return *this;}
|
||||||
|
inline iterator& operator++() { ptr = ptr->next; return *this; }
|
||||||
|
inline RankStats& operator*() { return *ptr;}
|
||||||
|
operator bool () { return (ptr != 0); }
|
||||||
|
};
|
||||||
|
|
||||||
|
inline iterator front() { return iterator(head); }
|
||||||
|
inline iterator begin() { return iterator(tail); }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
102
dlls/csx/source/Makefile
Executable file
102
dlls/csx/source/Makefile
Executable file
@ -0,0 +1,102 @@
|
|||||||
|
MODNAME = csx_amxx
|
||||||
|
SRCFILES = amxxmodule.cpp CMisc.cpp CRank.cpp meta_api.cpp rank.cpp usermsg.cpp
|
||||||
|
|
||||||
|
EXTRA_LIBS_LINUX =
|
||||||
|
EXTRA_LIBS_WIN32 =
|
||||||
|
EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux
|
||||||
|
EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32
|
||||||
|
|
||||||
|
EXTRA_INCLUDEDIRS = -Iextra/include -I../amx
|
||||||
|
|
||||||
|
EXTRA_FLAGS = -Dstrcmpi=strcasecmp
|
||||||
|
|
||||||
|
AMXDIR=../amx
|
||||||
|
SDKSRC=../sdk
|
||||||
|
METADIR=../metamod
|
||||||
|
|
||||||
|
OBJDIR_LINUX=obj.linux
|
||||||
|
OBJDIR_WIN32=obj.win32
|
||||||
|
SRCDIR=.
|
||||||
|
|
||||||
|
ifdef windir
|
||||||
|
OS=WIN32
|
||||||
|
else
|
||||||
|
OS=LINUX
|
||||||
|
endif
|
||||||
|
|
||||||
|
CC_LINUX=gcc
|
||||||
|
ifeq "$(OS)" "WIN32"
|
||||||
|
CC_WIN32=gcc
|
||||||
|
LD_WINDLL=dllwrap
|
||||||
|
DEFAULT=win32
|
||||||
|
CLEAN=clean_win32
|
||||||
|
else
|
||||||
|
CC_WIN32=/usr/local/cross-tools/i386-mingw32msvc/bin/gcc
|
||||||
|
LD_WINDLL=/usr/local/cross-tools/bin/i386-mingw32msvc-dllwrap
|
||||||
|
DEFAULT=linux win32
|
||||||
|
CLEAN=clean_both
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
LIBFILE_LINUX = $(MODNAME)_i386.so
|
||||||
|
LIBFILE_WIN32 = $(MODNAME).dll
|
||||||
|
TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
|
||||||
|
TARGET_WIN32 = $(OBJDIR_WIN32)/$(LIBFILE_WIN32)
|
||||||
|
|
||||||
|
FILES_ALL = *.cpp *.h [A-Z]* *.rc
|
||||||
|
ifeq "$(OS)" "LINUX"
|
||||||
|
ASRCFILES := $(shell ls -t $(SRCFILES))
|
||||||
|
else
|
||||||
|
ASRCFILES := $(shell dir /b)
|
||||||
|
endif
|
||||||
|
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
|
||||||
|
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
|
||||||
|
|
||||||
|
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
|
||||||
|
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
|
||||||
|
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
|
||||||
|
|
||||||
|
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
|
||||||
|
CFLAGS=-Wall -Wno-unknown-pragmas
|
||||||
|
ODEF = -DOPT_TYPE=\"optimized\"
|
||||||
|
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
|
||||||
|
|
||||||
|
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
|
||||||
|
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
|
||||||
|
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
|
||||||
|
LINK_WIN32=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
|
||||||
|
|
||||||
|
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
|
||||||
|
$(DO_CC_LINUX)
|
||||||
|
|
||||||
|
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
|
||||||
|
$(DO_CC_WIN32)
|
||||||
|
|
||||||
|
default: $(DEFAULT)
|
||||||
|
|
||||||
|
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
|
||||||
|
$(LINK_LINUX)
|
||||||
|
|
||||||
|
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
|
||||||
|
$(LINK_WIN32)
|
||||||
|
|
||||||
|
$(OBJDIR_LINUX):
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
|
$(OBJDIR_WIN32):
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
|
win32: $(TARGET_WIN32)
|
||||||
|
|
||||||
|
linux: $(TARGET_LINUX)
|
||||||
|
|
||||||
|
clean: $(CLEAN)
|
||||||
|
|
||||||
|
clean_both:
|
||||||
|
-rm -f $(OBJDIR_LINUX)/*
|
||||||
|
-rm -f $(OBJDIR_WIN32)/*
|
||||||
|
|
||||||
|
clean_win32:
|
||||||
|
del /q $(OBJDIR_WIN32)
|
||||||
|
|
||||||
|
|
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`;
|
3047
dlls/csx/source/amxxmodule.cpp
Executable file
3047
dlls/csx/source/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2197
dlls/csx/source/amxxmodule.h
Executable file
2197
dlls/csx/source/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
6
dlls/csx/source/compile.bat
Executable file
6
dlls/csx/source/compile.bat
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
@echo off
|
||||||
|
PATH=D:\gcc\bin;%PATH%
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
pause
|
380
dlls/csx/source/meta_api.cpp
Executable file
380
dlls/csx/source/meta_api.cpp
Executable file
@ -0,0 +1,380 @@
|
|||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "rank.h"
|
||||||
|
|
||||||
|
funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||||
|
funEventCall modMsgs[MAX_REG_MSGS];
|
||||||
|
|
||||||
|
void (*function)(void*);
|
||||||
|
void (*endfunction)(void*);
|
||||||
|
|
||||||
|
CPlayer players[33];
|
||||||
|
|
||||||
|
CPlayer* mPlayer;
|
||||||
|
|
||||||
|
int mPlayerIndex;
|
||||||
|
int mState;
|
||||||
|
|
||||||
|
RankSystem g_rank;
|
||||||
|
|
||||||
|
Grenades g_grenades;
|
||||||
|
|
||||||
|
int iFGrenade;
|
||||||
|
int iFDeath;
|
||||||
|
int iFDamage;
|
||||||
|
|
||||||
|
int iFBPlanted;
|
||||||
|
int iFBDefused;
|
||||||
|
int iFBPlanting;
|
||||||
|
int iFBDefusing;
|
||||||
|
int iFBExplode;
|
||||||
|
|
||||||
|
int g_bombAnnounce;
|
||||||
|
int g_Planter;
|
||||||
|
int g_Defuser;
|
||||||
|
|
||||||
|
bool rankBots;
|
||||||
|
|
||||||
|
int gmsgCurWeapon;
|
||||||
|
int gmsgDeathMsg;
|
||||||
|
int gmsgDamage;
|
||||||
|
int gmsgDamageEnd;
|
||||||
|
int gmsgWeaponList;
|
||||||
|
int gmsgResetHUD;
|
||||||
|
int gmsgAmmoX;
|
||||||
|
int gmsgScoreInfo;
|
||||||
|
int gmsgAmmoPickup;
|
||||||
|
|
||||||
|
int gmsgSendAudio;
|
||||||
|
int gmsgTextMsg;
|
||||||
|
int gmsgBarTime;
|
||||||
|
|
||||||
|
cvar_t init_csstats_maxsize ={"csstats_maxsize","3500", 0 , 3500.0 };
|
||||||
|
cvar_t init_csstats_reset ={"csstats_reset","0"};
|
||||||
|
cvar_t init_csstats_rank ={"csstats_rank","0"};
|
||||||
|
cvar_t *csstats_maxsize;
|
||||||
|
cvar_t *csstats_reset;
|
||||||
|
cvar_t *csstats_rank;
|
||||||
|
|
||||||
|
cvar_t* csstats_rankbots;
|
||||||
|
cvar_t* csstats_pause;
|
||||||
|
cvar_t init_csstats_rankbots ={"csstats_rankbots","1"};
|
||||||
|
cvar_t init_csstats_pause = {"csstats_pause","0"};
|
||||||
|
|
||||||
|
struct sUserMsg {
|
||||||
|
const char* name;
|
||||||
|
int* id;
|
||||||
|
funEventCall func;
|
||||||
|
bool endmsg;
|
||||||
|
} g_user_msg[] = {
|
||||||
|
{ "CurWeapon" , &gmsgCurWeapon , Client_CurWeapon, false },
|
||||||
|
{ "Damage" , &gmsgDamage,Client_Damage, false },
|
||||||
|
{ "Damage" , &gmsgDamageEnd, Client_Damage_End, true },
|
||||||
|
{ "WeaponList" , &gmsgWeaponList, Client_WeaponList, false },
|
||||||
|
{ "ResetHUD" , &gmsgResetHUD,Client_ResetHUD, true },
|
||||||
|
{ "AmmoX" , &gmsgAmmoX, Client_AmmoX , false },
|
||||||
|
{ "ScoreInfo" , &gmsgScoreInfo, Client_ScoreInfo, false },
|
||||||
|
{ "AmmoPickup" , &gmsgAmmoPickup, Client_AmmoPickup , false },
|
||||||
|
|
||||||
|
{ "SendAudio" , &gmsgSendAudio , Client_SendAudio , false },
|
||||||
|
{ "TextMsg" , &gmsgTextMsg , Client_TextMsg , false },
|
||||||
|
{ "BarTime" , &gmsgBarTime , Client_BarTime , false },
|
||||||
|
|
||||||
|
{ 0 , 0,0,false }
|
||||||
|
};
|
||||||
|
|
||||||
|
int RegUserMsg_Post(const char *pszName, int iSize)
|
||||||
|
{
|
||||||
|
for (int i = 0; g_user_msg[ i ].name; ++i )
|
||||||
|
{
|
||||||
|
if ( !*g_user_msg[i].id && strcmp( g_user_msg[ i ].name , pszName ) == 0 )
|
||||||
|
{
|
||||||
|
int id = META_RESULT_ORIG_RET( int );
|
||||||
|
|
||||||
|
*g_user_msg[ i ].id = id;
|
||||||
|
|
||||||
|
if ( g_user_msg[ i ].endmsg )
|
||||||
|
modMsgsEnd[ id ] = g_user_msg[ i ].func;
|
||||||
|
else
|
||||||
|
modMsgs[ id ] = g_user_msg[ i ].func;
|
||||||
|
//break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* get_localinfo( const char* name , const char* def = 0 )
|
||||||
|
{
|
||||||
|
const char* b = LOCALINFO( (char*)name );
|
||||||
|
if (((b==0)||(*b==0)) && def )
|
||||||
|
SET_LOCALINFO((char*)name,(char*)(b = def) );
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
void 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 ){
|
||||||
|
|
||||||
|
rankBots = (int)csstats_rankbots->value ? true:false;
|
||||||
|
|
||||||
|
for( int i = 1; i <= gpGlobals->maxClients; ++i)
|
||||||
|
GET_PLAYER_POINTER_I(i)->Init( i , pEdictList + i );
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayerPreThink_Post( edict_t *pEntity ) {
|
||||||
|
if ( !isModuleActive() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||||
|
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time ){
|
||||||
|
|
||||||
|
if ( !ignoreBots(pEntity) ){
|
||||||
|
pPlayer->clearStats = 0.0f;
|
||||||
|
if (pPlayer->rank)
|
||||||
|
pPlayer->rank->updatePosition( &pPlayer->life );
|
||||||
|
pPlayer->restartStats(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerDeactivate() {
|
||||||
|
int i;
|
||||||
|
for( i = 1;i<=gpGlobals->maxClients; ++i){
|
||||||
|
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||||
|
if (pPlayer->rank) pPlayer->Disconnect();
|
||||||
|
}
|
||||||
|
if ( (g_rank.getRankNum() >= (int)csstats_maxsize->value) || ((int)csstats_reset->value == 1 ) ) {
|
||||||
|
CVAR_SET_FLOAT("csstats_reset",0.0);
|
||||||
|
g_rank.clear(); // clear before save to file
|
||||||
|
}
|
||||||
|
g_rank.saveRank( MF_BuildPathname("%s",get_localinfo("csstats")) );
|
||||||
|
|
||||||
|
// clear custom weapons info
|
||||||
|
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++)
|
||||||
|
weaponData[i].ammoSlot = 0;
|
||||||
|
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ){
|
||||||
|
GET_PLAYER_POINTER(pEntity)->Connect(pszAddress);
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientDisconnect( edict_t *pEntity ) {
|
||||||
|
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||||
|
if (pPlayer->rank) pPlayer->Disconnect();
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientPutInServer_Post( edict_t *pEntity ) {
|
||||||
|
GET_PLAYER_POINTER(pEntity)->PutInServer();
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
|
||||||
|
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||||
|
const char* name = INFOKEY_VALUE(infobuffer,"name");
|
||||||
|
const char* oldname = STRING(pEntity->v.netname);
|
||||||
|
|
||||||
|
if ( pPlayer->rank ){
|
||||||
|
if ( strcmp(oldname,name) != 0 ) {
|
||||||
|
if ((int)csstats_rank->value == 0)
|
||||||
|
pPlayer->rank = g_rank.findEntryInRank( name, name );
|
||||||
|
else
|
||||||
|
pPlayer->rank->setName( name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( pPlayer->IsBot() ) {
|
||||||
|
pPlayer->Connect( "127.0.0.1" );
|
||||||
|
pPlayer->PutInServer();
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) {
|
||||||
|
if (ed){
|
||||||
|
mPlayerIndex = ENTINDEX(ed);
|
||||||
|
mPlayer = GET_PLAYER_POINTER_I(mPlayerIndex);
|
||||||
|
} else {
|
||||||
|
mPlayerIndex = 0;
|
||||||
|
mPlayer = 0;
|
||||||
|
}
|
||||||
|
mState = 0;
|
||||||
|
if ( msg_type < 0 || msg_type >= MAX_REG_MSGS )
|
||||||
|
msg_type = 0;
|
||||||
|
function=modMsgs[msg_type];
|
||||||
|
endfunction=modMsgsEnd[msg_type];
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageEnd_Post(void) {
|
||||||
|
if (endfunction) (*endfunction)(NULL);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteByte_Post(int iValue) {
|
||||||
|
if (function) (*function)((void *)&iValue);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteChar_Post(int iValue) {
|
||||||
|
if (function) (*function)((void *)&iValue);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteShort_Post(int iValue) {
|
||||||
|
if (function) (*function)((void *)&iValue);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteLong_Post(int iValue) {
|
||||||
|
if (function) (*function)((void *)&iValue);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteAngle_Post(float flValue) {
|
||||||
|
if (function) (*function)((void *)&flValue);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteCoord_Post(float flValue) {
|
||||||
|
if (function) (*function)((void *)&flValue);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteString_Post(const char *sz) {
|
||||||
|
if (function) (*function)((void *)sz);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteEntity_Post(int iValue) {
|
||||||
|
if (function) (*function)((void *)&iValue);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StartFrame_Post(){
|
||||||
|
if (g_bombAnnounce){
|
||||||
|
switch (g_bombAnnounce){
|
||||||
|
case BOMB_PLANTING:
|
||||||
|
MF_ExecuteForward( iFBPlanting,g_Planter );
|
||||||
|
break;
|
||||||
|
case BOMB_PLANTED:
|
||||||
|
MF_ExecuteForward( iFBPlanted,g_Planter );
|
||||||
|
break;
|
||||||
|
case BOMB_EXPLODE:
|
||||||
|
MF_ExecuteForward( iFBExplode,g_Planter,g_Defuser );
|
||||||
|
break;
|
||||||
|
case BOMB_DEFUSING:
|
||||||
|
MF_ExecuteForward( iFBDefusing,g_Defuser );
|
||||||
|
break;
|
||||||
|
case BOMB_DEFUSED:
|
||||||
|
MF_ExecuteForward( iFBDefused,g_Defuser );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
g_bombAnnounce = 0;
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetModel_Post(edict_t *e, const char *m){
|
||||||
|
|
||||||
|
if ( !isModuleActive() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( e->v.owner && m[7]=='w' && m[8]=='_' ){
|
||||||
|
int w_id = 0;
|
||||||
|
CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner);
|
||||||
|
switch(m[9]){
|
||||||
|
case 'h':
|
||||||
|
w_id = CSW_HEGRENADE;
|
||||||
|
g_grenades.put(e, 2.0, 4, pPlayer);
|
||||||
|
pPlayer->saveShot(CSW_HEGRENADE);
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
if (m[10]=='l') w_id = CSW_FLASHBANG;
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
if (m[10]=='m') w_id = CSW_SMOKEGRENADE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ( w_id )
|
||||||
|
MF_ExecuteForward( iFGrenade, pPlayer->index, ENTINDEX(e) ,w_id );
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmitSound_Post(edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch) {
|
||||||
|
if (sample[0]=='w'&&sample[1]=='e'&&sample[8]=='k'&&sample[9]=='n'&&sample[14]!='d'){
|
||||||
|
CPlayer*pPlayer = GET_PLAYER_POINTER(entity);
|
||||||
|
pPlayer->saveShot(pPlayer->current);
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *e, TraceResult *ptr) {
|
||||||
|
if (ptr->pHit&&(ptr->pHit->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&&
|
||||||
|
e&&(e->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&&ptr->iHitgroup)
|
||||||
|
GET_PLAYER_POINTER(e)->aiming = ptr->iHitgroup;
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnMetaAttach() {
|
||||||
|
|
||||||
|
CVAR_REGISTER (&init_csstats_maxsize);
|
||||||
|
CVAR_REGISTER (&init_csstats_reset);
|
||||||
|
CVAR_REGISTER (&init_csstats_rank);
|
||||||
|
csstats_maxsize=CVAR_GET_POINTER(init_csstats_maxsize.name);
|
||||||
|
csstats_reset=CVAR_GET_POINTER(init_csstats_reset.name);
|
||||||
|
csstats_rank=CVAR_GET_POINTER(init_csstats_rank.name);
|
||||||
|
|
||||||
|
CVAR_REGISTER (&init_csstats_rankbots);
|
||||||
|
CVAR_REGISTER (&init_csstats_pause);
|
||||||
|
csstats_rankbots = CVAR_GET_POINTER(init_csstats_rankbots.name);
|
||||||
|
csstats_pause = CVAR_GET_POINTER(init_csstats_pause.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnAmxxAttach(){
|
||||||
|
MF_AddNatives(stats_Natives);
|
||||||
|
const char* path = get_localinfo("csstats_score");
|
||||||
|
if ( path && *path )
|
||||||
|
{
|
||||||
|
char error[128];
|
||||||
|
g_rank.loadCalc( MF_BuildPathname("%s",path) , error );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !g_rank.begin() )
|
||||||
|
{
|
||||||
|
g_rank.loadRank( MF_BuildPathname("%s",
|
||||||
|
get_localinfo("csstats") ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnAmxxDetach() {
|
||||||
|
g_grenades.clear();
|
||||||
|
g_rank.clear();
|
||||||
|
g_rank.unloadCalc();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnPluginsLoaded(){
|
||||||
|
iFDeath = MF_RegisterForward("client_death",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||||
|
iFDamage = MF_RegisterForward("client_damage",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||||
|
iFBPlanted = MF_RegisterForward("bomb_planted",ET_IGNORE,FP_CELL,FP_DONE);
|
||||||
|
iFBDefused = MF_RegisterForward("bomb_defused",ET_IGNORE,FP_CELL,FP_DONE);
|
||||||
|
iFBPlanting = MF_RegisterForward("bomb_planting",ET_IGNORE,FP_CELL,FP_DONE);
|
||||||
|
iFBDefusing = MF_RegisterForward("bomb_defusing",ET_IGNORE,FP_CELL,FP_DONE);
|
||||||
|
iFBExplode = MF_RegisterForward("bomb_explode",ET_IGNORE,FP_CELL,FP_CELL,FP_DONE);
|
||||||
|
iFGrenade = MF_RegisterForward("grenade_throw",ET_IGNORE,FP_CELL,FP_CELL,FP_CELL,FP_DONE);
|
||||||
|
}
|
462
dlls/csx/source/moduleconfig.h
Executable file
462
dlls/csx/source/moduleconfig.h
Executable file
@ -0,0 +1,462 @@
|
|||||||
|
// Configuration
|
||||||
|
|
||||||
|
#ifndef __MODULECONFIG_H__
|
||||||
|
#define __MODULECONFIG_H__
|
||||||
|
|
||||||
|
// Module info
|
||||||
|
#define MODULE_NAME "CSX"
|
||||||
|
#define MODULE_VERSION "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__
|
149
dlls/csx/source/msvc/csx.dsp
Executable file
149
dlls/csx/source/msvc/csx.dsp
Executable file
@ -0,0 +1,149 @@
|
|||||||
|
# Microsoft Developer Studio Project File - Name="csx" - Package Owner=<4>
|
||||||
|
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||||
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
|
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||||
|
|
||||||
|
CFG=csx - Win32 Debug
|
||||||
|
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||||
|
!MESSAGE use the Export Makefile command and run
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE NMAKE /f "csx.mak".
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE You can specify a configuration when running NMAKE
|
||||||
|
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE NMAKE /f "csx.mak" CFG="csx - Win32 Debug"
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE Possible choices for configuration are:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE "csx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||||
|
!MESSAGE "csx - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||||
|
!MESSAGE
|
||||||
|
|
||||||
|
# Begin Project
|
||||||
|
# PROP AllowPerConfigDependencies 0
|
||||||
|
# PROP Scc_ProjName ""
|
||||||
|
# PROP Scc_LocalPath ""
|
||||||
|
CPP=cl.exe
|
||||||
|
MTL=midl.exe
|
||||||
|
RSC=rc.exe
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "csx - Win32 Release"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 0
|
||||||
|
# PROP BASE Output_Dir "Release"
|
||||||
|
# PROP BASE Intermediate_Dir "Release"
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 0
|
||||||
|
# PROP Output_Dir "release"
|
||||||
|
# PROP Intermediate_Dir "release"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "csx_EXPORTS" /YX /FD /c
|
||||||
|
# ADD CPP /nologo /Zp4 /MT /W3 /GX /O2 /I "..\..\metamod" /I "..\..\sdk\common" /I "..\..\sdk\engine" /I "..\..\sdk\dlls" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "csx_EXPORTS" /D "JIT" /FR /YX /FD /c
|
||||||
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||||
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"release/csx_amxx.dll"
|
||||||
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "csx - Win32 Debug"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 1
|
||||||
|
# PROP BASE Output_Dir "Debug"
|
||||||
|
# PROP BASE Intermediate_Dir "Debug"
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 1
|
||||||
|
# PROP Output_Dir "debug"
|
||||||
|
# PROP Intermediate_Dir "debug"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "csx_EXPORTS" /YX /FD /GZ /c
|
||||||
|
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\metamod" /I "..\..\sdk\common" /I "..\..\sdk\engine" /I "..\..\sdk\dlls" /I "..\..\hlsdk\sourcecode\pm_shared" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "csx_EXPORTS" /FR /YX /FD /GZ /c
|
||||||
|
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||||
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"debug/csx_amxx.dll" /pdbtype:sept
|
||||||
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# Begin Target
|
||||||
|
|
||||||
|
# Name "csx - Win32 Release"
|
||||||
|
# Name "csx - Win32 Debug"
|
||||||
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\amxxmodule.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\CMisc.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\CRank.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\meta_api.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\rank.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\usermsg.cpp
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Header Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\amxxmodule.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\CMisc.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\CRank.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\moduleconfig.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\rank.h
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Resource Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||||
|
# End Group
|
||||||
|
# End Target
|
||||||
|
# End Project
|
29
dlls/csx/source/msvc/csx.dsw
Executable file
29
dlls/csx/source/msvc/csx.dsw
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||||
|
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Project: "csx"=.\csx.dsp - Package Owner=<4>
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<4>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
Global:
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<3>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
21
dlls/csx/source/msvc/csx.sln
Executable file
21
dlls/csx/source/msvc/csx.sln
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
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
|
||||||
|
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
|
||||||
|
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>
|
397
dlls/csx/source/rank.cpp
Executable file
397
dlls/csx/source/rank.cpp
Executable file
@ -0,0 +1,397 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "rank.h"
|
||||||
|
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_astats(AMX *amx, cell *params) /* 6 param */
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
int attacker = params[2];
|
||||||
|
CHECK_PLAYERRANGE(attacker);
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
if (pPlayer->attackers[attacker].hits){
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||||
|
CPlayer::PlayerWeapon* stats = &pPlayer->attackers[attacker];
|
||||||
|
cpStats[0] = stats->kills;
|
||||||
|
cpStats[1] = stats->deaths;
|
||||||
|
cpStats[2] = stats->hs;
|
||||||
|
cpStats[3] = stats->tks;
|
||||||
|
cpStats[4] = stats->shots;
|
||||||
|
cpStats[5] = stats->hits;
|
||||||
|
cpStats[6] = stats->damage;
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
cpBodyHits[i] = stats->bodyHits[i];
|
||||||
|
if (params[6] && attacker && stats->name )
|
||||||
|
MF_SetAmxString(amx,params[5],stats->name,params[6]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param */
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
int victim = params[2];
|
||||||
|
CHECK_PLAYERRANGE(victim);
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
if (pPlayer->victims[victim].hits){
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||||
|
CPlayer::PlayerWeapon* stats = &pPlayer->victims[victim];
|
||||||
|
cpStats[0] = stats->kills;
|
||||||
|
cpStats[1] = stats->deaths;
|
||||||
|
cpStats[2] = stats->hs;
|
||||||
|
cpStats[3] = stats->tks;
|
||||||
|
cpStats[4] = stats->shots;
|
||||||
|
cpStats[5] = stats->hits;
|
||||||
|
cpStats[6] = stats->damage;
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
cpBodyHits[i] = stats->bodyHits[i];
|
||||||
|
if (params[6] && victim && stats->name)
|
||||||
|
MF_SetAmxString(amx,params[5],stats->name,params[6]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_wrstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end)
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
int weapon = params[2];
|
||||||
|
if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
if (pPlayer->weaponsRnd[weapon].shots){
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||||
|
Stats* stats = &pPlayer->weaponsRnd[weapon];
|
||||||
|
cpStats[0] = stats->kills;
|
||||||
|
cpStats[1] = stats->deaths;
|
||||||
|
cpStats[2] = stats->hs;
|
||||||
|
cpStats[3] = stats->tks;
|
||||||
|
cpStats[4] = stats->shots;
|
||||||
|
cpStats[5] = stats->hits;
|
||||||
|
cpStats[6] = stats->damage;
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
cpBodyHits[i] = stats->bodyHits[i];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_wstats(AMX *amx, cell *params) /* 4 param */
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
int weapon = params[2];
|
||||||
|
if (weapon<0||weapon>=MAX_WEAPONS+MAX_CWEAPONS){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
if (pPlayer->weapons[weapon].shots){
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
cell *cpBodyHits = MF_GetAmxAddr(amx,params[4]);
|
||||||
|
CPlayer::PlayerWeapon* stats = &pPlayer->weapons[weapon];
|
||||||
|
cpStats[0] = stats->kills;
|
||||||
|
cpStats[1] = stats->deaths;
|
||||||
|
cpStats[2] = stats->hs;
|
||||||
|
cpStats[3] = stats->tks;
|
||||||
|
cpStats[4] = stats->shots;
|
||||||
|
cpStats[5] = stats->hits;
|
||||||
|
cpStats[6] = stats->damage;
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
cpBodyHits[i] = stats->bodyHits[i];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 param */
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYER(index);
|
||||||
|
GET_PLAYER_POINTER_I(index)->restartStats();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_rstats(AMX *amx, cell *params) /* 3 param */
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
if (pPlayer->rank){
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
|
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
cpStats[0] = pPlayer->life.kills;
|
||||||
|
cpStats[1] = pPlayer->life.deaths;
|
||||||
|
cpStats[2] = pPlayer->life.hs;
|
||||||
|
cpStats[3] = pPlayer->life.tks;
|
||||||
|
cpStats[4] = pPlayer->life.shots;
|
||||||
|
cpStats[5] = pPlayer->life.hits;
|
||||||
|
cpStats[6] = pPlayer->life.damage;
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
cpBodyHits[i] = pPlayer->life.bodyHits[i];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
if ( pPlayer->rank ){
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
|
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
cpStats[0] = pPlayer->rank->kills;
|
||||||
|
cpStats[1] = pPlayer->rank->deaths;
|
||||||
|
cpStats[2] = pPlayer->rank->hs;
|
||||||
|
cpStats[3] = pPlayer->rank->tks;
|
||||||
|
cpStats[4] = pPlayer->rank->shots;
|
||||||
|
cpStats[5] = pPlayer->rank->hits;
|
||||||
|
cpStats[6] = pPlayer->rank->damage;
|
||||||
|
|
||||||
|
cpStats[7] = pPlayer->rank->getPosition();
|
||||||
|
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
cpBodyHits[i] = pPlayer->rank->bodyHits[i];
|
||||||
|
return pPlayer->rank->getPosition();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param */
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
if ( pPlayer->rank ){
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
|
|
||||||
|
cpStats[0] = pPlayer->rank->bDefusions;
|
||||||
|
cpStats[1] = pPlayer->rank->bDefused;
|
||||||
|
cpStats[2] = pPlayer->rank->bPlants;
|
||||||
|
cpStats[3] = pPlayer->rank->bExplosions;
|
||||||
|
|
||||||
|
return pPlayer->rank->getPosition();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
||||||
|
{
|
||||||
|
|
||||||
|
int index = params[1] + 1;
|
||||||
|
|
||||||
|
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||||
|
if ((*a).getPosition() == index) {
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
|
cell *cpBodyHits = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
cpStats[0] = (*a).kills;
|
||||||
|
cpStats[1] = (*a).deaths;
|
||||||
|
cpStats[2] = (*a).hs;
|
||||||
|
cpStats[3] = (*a).tks;
|
||||||
|
cpStats[4] = (*a).shots;
|
||||||
|
cpStats[5] = (*a).hits;
|
||||||
|
cpStats[6] = (*a).damage;
|
||||||
|
|
||||||
|
cpStats[7] = (*a).getPosition();
|
||||||
|
|
||||||
|
MF_SetAmxString(amx,params[4],(*a).getName(),params[5]);
|
||||||
|
for(int i = 1; i < 8; ++i)
|
||||||
|
cpBodyHits[i] = (*a).bodyHits[i];
|
||||||
|
return --a ? index : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 3 param */
|
||||||
|
{
|
||||||
|
|
||||||
|
int index = params[1] + 1;
|
||||||
|
|
||||||
|
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||||
|
if ((*a).getPosition() == index) {
|
||||||
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
|
|
||||||
|
cpStats[0] = (*a).bDefusions;
|
||||||
|
cpStats[1] = (*a).bDefused;
|
||||||
|
cpStats[2] = (*a).bPlants;
|
||||||
|
cpStats[3] = (*a).bExplosions;
|
||||||
|
|
||||||
|
return --a ? index : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_statsnum(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
return g_rank.getRankNum();
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL register_cwpn(AMX *amx, cell *params){ // name,melee=0,logname
|
||||||
|
int i,iLen;
|
||||||
|
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++){
|
||||||
|
if ( !weaponData[i].used ){
|
||||||
|
|
||||||
|
char* szName = MF_GetAmxString(amx, params[1], 0, &iLen);
|
||||||
|
char *szLog = MF_GetAmxString(amx, params[3], 0, &iLen);
|
||||||
|
|
||||||
|
strcpy(weaponData[i].name,szName);
|
||||||
|
strcpy(weaponData[i].logname,szLog);
|
||||||
|
|
||||||
|
weaponData[i].used = true;
|
||||||
|
weaponData[i].melee = params[2] ? true:false;
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MF_PrintSrvConsole("No More Custom Weapon Slots!\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL custom_wpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
||||||
|
int weapon = params[1];
|
||||||
|
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){ // only for custom weapons
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int att = params[2];
|
||||||
|
CHECK_PLAYERRANGE(att);
|
||||||
|
|
||||||
|
int vic = params[3];
|
||||||
|
CHECK_PLAYERRANGE(vic);
|
||||||
|
|
||||||
|
int dmg = params[4];
|
||||||
|
if ( dmg<1 ){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid damage %d", dmg);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int aim = params[5];
|
||||||
|
if ( aim < 0 || aim > 7 ){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid aim %d", aim);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CPlayer* pAtt = GET_PLAYER_POINTER_I(att);
|
||||||
|
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
|
||||||
|
|
||||||
|
pVic->pEdict->v.dmg_inflictor = NULL;
|
||||||
|
pAtt->saveHit( pVic , weapon , dmg, aim );
|
||||||
|
|
||||||
|
if ( !pAtt ) pAtt = pVic;
|
||||||
|
int TA = 0;
|
||||||
|
if ( (pVic->teamId == pAtt->teamId) && ( pVic != pAtt) )
|
||||||
|
TA = 1;
|
||||||
|
MF_ExecuteForward( iFDamage,pAtt->index, pVic->index, dmg, weapon, aim, TA );
|
||||||
|
|
||||||
|
if ( pVic->IsAlive() )
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
pAtt->saveKill(pVic,weapon,( aim == 1 ) ? 1:0 ,TA);
|
||||||
|
MF_ExecuteForward( iFDeath,pAtt->index, pVic->index, weapon, aim, TA );
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL custom_wpn_shot(AMX *amx, cell *params){ // player,wid
|
||||||
|
int index = params[2];
|
||||||
|
CHECK_PLAYERRANGE(index);
|
||||||
|
|
||||||
|
int weapon = params[1];
|
||||||
|
if ( weapon < MAX_WEAPONS || weapon >= MAX_WEAPONS+MAX_CWEAPONS || !weaponData[weapon].used ){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", weapon);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
pPlayer->saveShot(weapon);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_wpnname(AMX *amx, cell *params){
|
||||||
|
int id = params[1];
|
||||||
|
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return MF_SetAmxString(amx,params[2],weaponData[id].name,params[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_wpnlogname(AMX *amx, cell *params){
|
||||||
|
int id = params[1];
|
||||||
|
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return MF_SetAmxString(amx,params[2],weaponData[id].logname,params[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL is_melee(AMX *amx, cell *params){
|
||||||
|
int id = params[1];
|
||||||
|
if (id<1 || id>=MAX_WEAPONS+MAX_CWEAPONS ){
|
||||||
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( id == 29 )
|
||||||
|
return 1;
|
||||||
|
return weaponData[id].melee ? 1:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_maxweapons(AMX *amx, cell *params){
|
||||||
|
return MAX_WEAPONS+MAX_CWEAPONS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_stats_size(AMX *amx, cell *params){
|
||||||
|
return 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
AMX_NATIVE_INFO stats_Natives[] = {
|
||||||
|
{ "get_stats", get_stats},
|
||||||
|
{ "get_stats2", get_stats2},
|
||||||
|
{ "get_statsnum", get_statsnum},
|
||||||
|
{ "get_user_astats", get_user_astats },
|
||||||
|
{ "get_user_rstats", get_user_rstats },
|
||||||
|
{ "get_user_lstats", get_user_rstats }, // for backward compatibility
|
||||||
|
{ "get_user_stats", get_user_stats },
|
||||||
|
{ "get_user_stats2", get_user_stats2 },
|
||||||
|
{ "get_user_vstats", get_user_vstats },
|
||||||
|
{ "get_user_wrstats", get_user_wrstats}, // DEC-Weapon(Round) Stats
|
||||||
|
{ "get_user_wstats", get_user_wstats},
|
||||||
|
{ "reset_user_wstats", reset_user_wstats },
|
||||||
|
|
||||||
|
// Custom Weapon Support
|
||||||
|
{ "custom_weapon_add", register_cwpn },
|
||||||
|
{ "custom_weapon_dmg", custom_wpn_dmg },
|
||||||
|
{ "custom_weapon_shot", custom_wpn_shot },
|
||||||
|
|
||||||
|
{ "xmod_get_wpnname", get_wpnname },
|
||||||
|
{ "xmod_get_wpnlogname", get_wpnlogname },
|
||||||
|
{ "xmod_is_melee_wpn", is_melee },
|
||||||
|
{ "xmod_get_maxweapons", get_maxweapons },
|
||||||
|
{ "xmod_get_stats_size", get_stats_size },
|
||||||
|
|
||||||
|
//***************************************
|
||||||
|
//{ "get_weaponname", get_wpnname },
|
||||||
|
|
||||||
|
///*******************
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
||||||
|
|
152
dlls/csx/source/rank.h
Executable file
152
dlls/csx/source/rank.h
Executable file
@ -0,0 +1,152 @@
|
|||||||
|
#ifndef RANK_H
|
||||||
|
#define RANK_H
|
||||||
|
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "CMisc.h"
|
||||||
|
#include "CRank.h"
|
||||||
|
|
||||||
|
#define GET_PLAYER_POINTER(e) (&players[ENTINDEX(e)])
|
||||||
|
#define GET_PLAYER_POINTER_I(i) (&players[i])
|
||||||
|
|
||||||
|
extern AMX_NATIVE_INFO stats_Natives[];
|
||||||
|
|
||||||
|
struct weaponsVault {
|
||||||
|
char name[32];
|
||||||
|
char logname[16];
|
||||||
|
short int ammoSlot;
|
||||||
|
bool used;
|
||||||
|
bool melee;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern bool rankBots;
|
||||||
|
extern cvar_t* csstats_rankbots;
|
||||||
|
extern cvar_t* csstats_pause;
|
||||||
|
|
||||||
|
extern int iFGrenade;
|
||||||
|
extern int iFDeath;
|
||||||
|
extern int iFDamage;
|
||||||
|
|
||||||
|
extern int iFBPlanted;
|
||||||
|
extern int iFBDefused;
|
||||||
|
extern int iFBPlanting;
|
||||||
|
extern int iFBDefusing;
|
||||||
|
extern int iFBExplode;
|
||||||
|
|
||||||
|
extern int g_bombAnnounce;
|
||||||
|
extern int g_Planter;
|
||||||
|
extern int g_Defuser;
|
||||||
|
|
||||||
|
#define BOMB_PLANTING 1
|
||||||
|
#define BOMB_PLANTED 2
|
||||||
|
#define BOMB_EXPLODE 3
|
||||||
|
#define BOMB_DEFUSING 4
|
||||||
|
#define BOMB_DEFUSED 5
|
||||||
|
|
||||||
|
extern weaponsVault weaponData[MAX_WEAPONS+MAX_CWEAPONS];
|
||||||
|
|
||||||
|
typedef void (*funEventCall)(void*);
|
||||||
|
extern funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||||
|
extern funEventCall modMsgs[MAX_REG_MSGS];
|
||||||
|
|
||||||
|
extern void (*function)(void*);
|
||||||
|
extern void (*endfunction)(void*);
|
||||||
|
|
||||||
|
extern cvar_t *csstats_maxsize;
|
||||||
|
extern cvar_t* csstats_rank;
|
||||||
|
extern cvar_t* csstats_reset;
|
||||||
|
|
||||||
|
extern Grenades g_grenades;
|
||||||
|
|
||||||
|
extern RankSystem g_rank;
|
||||||
|
|
||||||
|
extern CPlayer players[33];
|
||||||
|
|
||||||
|
extern CPlayer* mPlayer;
|
||||||
|
|
||||||
|
extern int mPlayerIndex;
|
||||||
|
|
||||||
|
extern int mState;
|
||||||
|
|
||||||
|
extern int gmsgCurWeapon;
|
||||||
|
extern int gmsgDamageEnd;
|
||||||
|
extern int gmsgDamage;
|
||||||
|
extern int gmsgWeaponList;
|
||||||
|
extern int gmsgResetHUD;
|
||||||
|
extern int gmsgAmmoX;
|
||||||
|
extern int gmsgScoreInfo;
|
||||||
|
extern int gmsgAmmoPickup;
|
||||||
|
|
||||||
|
extern int gmsgSendAudio;
|
||||||
|
extern int gmsgTextMsg;
|
||||||
|
extern int gmsgBarTime;
|
||||||
|
|
||||||
|
void Client_AmmoX(void*);
|
||||||
|
void Client_CurWeapon(void*);
|
||||||
|
void Client_Damage(void*);
|
||||||
|
void Client_WeaponList(void*);
|
||||||
|
void Client_AmmoPickup(void*);
|
||||||
|
void Client_Damage_End(void*);
|
||||||
|
void Client_ScoreInfo(void*);
|
||||||
|
void Client_ResetHUD(void*);
|
||||||
|
|
||||||
|
void Client_SendAudio(void*);
|
||||||
|
void Client_TextMsg(void*);
|
||||||
|
void Client_BarTime(void*);
|
||||||
|
|
||||||
|
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
||||||
|
bool isModuleActive();
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
206
dlls/csx/source/usermsg.cpp
Executable file
206
dlls/csx/source/usermsg.cpp
Executable file
@ -0,0 +1,206 @@
|
|||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "rank.h"
|
||||||
|
|
||||||
|
weaponsVault weaponData[MAX_WEAPONS+MAX_CWEAPONS];
|
||||||
|
|
||||||
|
int damage;
|
||||||
|
int TA;
|
||||||
|
int weapon;
|
||||||
|
int aim;
|
||||||
|
CPlayer *pAttacker;
|
||||||
|
|
||||||
|
|
||||||
|
void Client_ResetHUD(void* mValue){
|
||||||
|
if ( mPlayer )
|
||||||
|
mPlayer->clearStats = gpGlobals->time + 0.25f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_WeaponList(void* mValue){
|
||||||
|
static int wpnList;
|
||||||
|
static int iSlot;
|
||||||
|
static const char* wpnName;
|
||||||
|
|
||||||
|
switch (mState++) {
|
||||||
|
case 0:
|
||||||
|
wpnName = (const char*)mValue;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
iSlot = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
int iId = *(int*)mValue;
|
||||||
|
if ( (iId < 0 || iId >= MAX_WEAPONS ) || ( wpnList & (1<<iId) ) )
|
||||||
|
break;
|
||||||
|
|
||||||
|
wpnList |= (1<<iId);
|
||||||
|
weaponData[iId].ammoSlot = iSlot;
|
||||||
|
|
||||||
|
if ( strstr( wpnName,"weapon_") )
|
||||||
|
{
|
||||||
|
if ( strcmp(wpnName+7,"hegrenade") == 0 )
|
||||||
|
strcpy(weaponData[iId].name,wpnName+9);
|
||||||
|
else
|
||||||
|
strcpy(weaponData[iId].name,wpnName+7);
|
||||||
|
strcpy(weaponData[iId].logname,weaponData[iId].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_Damage(void* mValue){
|
||||||
|
static int bits;
|
||||||
|
switch (mState++) {
|
||||||
|
case 1:
|
||||||
|
damage = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
bits = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if (!mPlayer || !damage || !*(float*)mValue || bits) break;
|
||||||
|
edict_t *enemy;
|
||||||
|
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
||||||
|
|
||||||
|
if ( FNullEnt( enemy ) )
|
||||||
|
break;
|
||||||
|
aim = 0;
|
||||||
|
weapon = 0;
|
||||||
|
pAttacker = NULL;
|
||||||
|
|
||||||
|
if (enemy->v.flags & (FL_CLIENT | FL_FAKECLIENT) ) {
|
||||||
|
pAttacker = GET_PLAYER_POINTER(enemy);
|
||||||
|
aim = pAttacker->aiming;
|
||||||
|
weapon = pAttacker->current;
|
||||||
|
pAttacker->saveHit( mPlayer , weapon , damage, aim);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if( g_grenades.find(enemy , &pAttacker , &weapon ) )
|
||||||
|
pAttacker->saveHit( mPlayer , weapon , damage, aim );
|
||||||
|
else if ( strcmp("grenade",STRING(enemy->v.classname))==0 ) // ? more checks ?
|
||||||
|
weapon = CSW_C4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_Damage_End(void* mValue){
|
||||||
|
if ( !mPlayer || !damage )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( !pAttacker ) pAttacker = mPlayer;
|
||||||
|
TA = 0;
|
||||||
|
if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) )
|
||||||
|
TA = 1;
|
||||||
|
|
||||||
|
MF_ExecuteForward( iFDamage,pAttacker->index , mPlayer->index , damage, weapon, aim, TA );
|
||||||
|
|
||||||
|
if ( !mPlayer->IsAlive() ){
|
||||||
|
if ( weapon != CSW_C4 )
|
||||||
|
pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TA);
|
||||||
|
MF_ExecuteForward( iFDeath,pAttacker->index, mPlayer->index, weapon, aim, TA );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_CurWeapon(void* mValue){
|
||||||
|
static int iState;
|
||||||
|
static int iId;
|
||||||
|
switch (mState++){
|
||||||
|
case 0:
|
||||||
|
iState = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (!iState) break;
|
||||||
|
iId = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (!mPlayer || !iState ) break;
|
||||||
|
int iClip = *(int*)mValue;
|
||||||
|
if ((iClip > -1) && (iClip < mPlayer->weapons[iId].clip))
|
||||||
|
mPlayer->saveShot(iId);
|
||||||
|
mPlayer->weapons[iId].clip = iClip;
|
||||||
|
mPlayer->current = iId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_AmmoX(void* mValue){
|
||||||
|
static int iAmmo;
|
||||||
|
switch (mState++){
|
||||||
|
case 0:
|
||||||
|
iAmmo = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (!mPlayer ) break;
|
||||||
|
for(int i = 1; i < MAX_WEAPONS ; ++i)
|
||||||
|
if (iAmmo == weaponData[i].ammoSlot)
|
||||||
|
mPlayer->weapons[i].ammo = *(int*)mValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_AmmoPickup(void* mValue){
|
||||||
|
static int iSlot;
|
||||||
|
switch (mState++){
|
||||||
|
case 0:
|
||||||
|
iSlot = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (!mPlayer ) break;
|
||||||
|
for(int i = 1; i < MAX_WEAPONS ; ++i)
|
||||||
|
if (weaponData[i].ammoSlot == iSlot)
|
||||||
|
mPlayer->weapons[i].ammo += *(int*)mValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_ScoreInfo(void* mValue){
|
||||||
|
static int index;
|
||||||
|
switch (mState++){
|
||||||
|
case 0:
|
||||||
|
index = *(int*)mValue;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if ( index > 0 && index <= gpGlobals->maxClients )
|
||||||
|
GET_PLAYER_POINTER_I( index )->teamId = *(int*)mValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_SendAudio(void* mValue){
|
||||||
|
static const char* szText;
|
||||||
|
if ( mState == 1 ){
|
||||||
|
szText = (const char*)mValue;
|
||||||
|
if ( !mPlayer && szText[7]=='B' ) {
|
||||||
|
if ( szText[11]=='P' && g_Planter ){
|
||||||
|
GET_PLAYER_POINTER_I(g_Planter)->saveBPlant();
|
||||||
|
g_bombAnnounce = BOMB_PLANTED;
|
||||||
|
}
|
||||||
|
else if ( szText[11]=='D' && g_Defuser ){
|
||||||
|
GET_PLAYER_POINTER_I(g_Defuser)->saveBDefused();
|
||||||
|
g_bombAnnounce = BOMB_DEFUSED;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mState++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_TextMsg(void* mValue){
|
||||||
|
static const char* szText;
|
||||||
|
if ( !mPlayer && mState==1 ){
|
||||||
|
szText = (const char*)mValue;
|
||||||
|
if ( szText[1]=='T' && szText[8]=='B' && g_Planter ){
|
||||||
|
GET_PLAYER_POINTER_I(g_Planter)->saveBExplode();
|
||||||
|
g_bombAnnounce = BOMB_EXPLODE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mState++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client_BarTime(void* mValue){
|
||||||
|
int iTime = *(int*)mValue;
|
||||||
|
if ( !iTime || !mPlayer->IsAlive() ) return;
|
||||||
|
if ( iTime == 3 ){
|
||||||
|
g_Planter = mPlayerIndex;
|
||||||
|
g_bombAnnounce = BOMB_PLANTING;
|
||||||
|
g_Defuser = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mPlayer->saveBDefusing();
|
||||||
|
g_Defuser = mPlayerIndex;
|
||||||
|
g_bombAnnounce = BOMB_DEFUSING;
|
||||||
|
}
|
||||||
|
}
|
@ -34,10 +34,7 @@
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_player_stamina(AMX *amx, cell *params){ // id,(re)set,min,max
|
static cell AMX_NATIVE_CALL set_player_stamina(AMX *amx, cell *params){ // id,(re)set,min,max
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
if ( params[2] ){ // 0 set , 1 reset
|
if ( params[2] ){ // 0 set , 1 reset
|
||||||
@ -49,12 +46,12 @@ static cell AMX_NATIVE_CALL set_player_stamina(AMX *amx, cell *params){ // id,(r
|
|||||||
|
|
||||||
int min = params[3];
|
int min = params[3];
|
||||||
if ( min<0 || min>100 ){
|
if ( min<0 || min>100 ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid minimum stamina %d", min);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int max = params[4];
|
int max = params[4];
|
||||||
if ( max<min || max>100 ){
|
if ( max<min || max>100 ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid maximum stamina %d", max);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ( pPlayer->ingame ){
|
if ( pPlayer->ingame ){
|
||||||
@ -68,10 +65,7 @@ static cell AMX_NATIVE_CALL set_player_stamina(AMX *amx, cell *params){ // id,(r
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL nade_set_fuse(AMX *amx, cell *params){ // id,(re)set,time,type
|
static cell AMX_NATIVE_CALL nade_set_fuse(AMX *amx, cell *params){ // id,(re)set,time,type
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
if ( params[2] ){ // 0 set , 1 reset
|
if ( params[2] ){ // 0 set , 1 reset
|
||||||
@ -82,7 +76,7 @@ static cell AMX_NATIVE_CALL nade_set_fuse(AMX *amx, cell *params){ // id,(re)set
|
|||||||
|
|
||||||
float fFuse = *(float *)((void *)¶ms[3]);
|
float fFuse = *(float *)((void *)¶ms[3]);
|
||||||
if ( fFuse<0.1 || fFuse>20.0 ){
|
if ( fFuse<0.1 || fFuse>20.0 ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid fuse %f", fFuse);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,30 +91,10 @@ static cell AMX_NATIVE_CALL nade_set_fuse(AMX *amx, cell *params){ // id,(re)set
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL dod_get_wpninfo(AMX *amx, cell *params){ // id
|
|
||||||
int index = params[1];
|
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
|
||||||
|
|
||||||
//weapon_data_t wdata;
|
|
||||||
|
|
||||||
//mm_DispatchThink(pPlayer->pEdict);
|
|
||||||
//mm_GetWeaponData(pPlayer->pEdict,&wdata);
|
|
||||||
|
|
||||||
//MF_PrintSrvConsole("%d \n",wdata.iuser1);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AMX_NATIVE_INFO base_Natives[] = {
|
AMX_NATIVE_INFO base_Natives[] = {
|
||||||
{ "dod_set_stamina", set_player_stamina },
|
{ "dod_set_stamina", set_player_stamina },
|
||||||
{ "dod_set_fuse", nade_set_fuse },
|
{ "dod_set_fuse", nade_set_fuse },
|
||||||
|
|
||||||
{ "dod_get_wpninfo", dod_get_wpninfo },
|
|
||||||
|
|
||||||
///*******************
|
///*******************
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
@ -34,10 +34,7 @@
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_user_class(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL set_user_class(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
int iClass = params[2];
|
int iClass = params[2];
|
||||||
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
@ -59,13 +56,10 @@ static cell AMX_NATIVE_CALL set_user_class(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_user_team(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL set_user_team(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
int iTeam = params[2];
|
int iTeam = params[2];
|
||||||
if ( iTeam<1 || iTeam>3 ){
|
if ( iTeam<1 || iTeam>3 ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid team id %d", iTeam);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,10 +95,7 @@ static cell AMX_NATIVE_CALL set_user_team(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_nextclass(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_nextclass(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if ( pPlayer->ingame ){
|
if ( pPlayer->ingame ){
|
||||||
@ -116,10 +107,7 @@ static cell AMX_NATIVE_CALL get_user_nextclass(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL is_randomclass(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL is_randomclass(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if ( pPlayer->ingame ){
|
if ( pPlayer->ingame ){
|
||||||
@ -130,23 +118,17 @@ static cell AMX_NATIVE_CALL is_randomclass(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_deaths(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_deaths(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->ingame){
|
||||||
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS );
|
return *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS );
|
||||||
}
|
}
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_user_deaths(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL set_user_deaths(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->ingame){
|
||||||
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) = params[2];
|
*( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) = params[2];
|
||||||
@ -166,10 +148,7 @@ static cell AMX_NATIVE_CALL set_user_deaths(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->ingame){
|
||||||
@ -190,12 +169,42 @@ static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL set_user_frags(AMX *amx, cell *params){
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYER(index);
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
|
if (pPlayer->ingame){
|
||||||
|
pPlayer->pEdict->v.frags = (float)params[2];
|
||||||
|
|
||||||
|
if ( params[3]){
|
||||||
|
//ScoreShort message
|
||||||
|
MESSAGE_BEGIN(MSG_ALL,gmsgScoreShort);
|
||||||
|
WRITE_BYTE(pPlayer->index);
|
||||||
|
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_SCORE ) );
|
||||||
|
WRITE_SHORT((int)pPlayer->pEdict->v.frags);
|
||||||
|
WRITE_SHORT( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_DEATHS ) );
|
||||||
|
WRITE_BYTE(1);
|
||||||
|
MESSAGE_END();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_frags(AMX *amx, cell *params){
|
||||||
|
int index = params[1];
|
||||||
|
CHECK_PLAYER(index);
|
||||||
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
|
if (pPlayer->ingame)
|
||||||
|
return (int)pPlayer->pEdict->v.frags;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_user_teamname(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL set_user_teamname(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
@ -213,10 +222,7 @@ static cell AMX_NATIVE_CALL set_user_teamname(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_teamname(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_teamname(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
@ -234,10 +240,7 @@ static cell AMX_NATIVE_CALL get_user_teamname(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL is_weapon_deployed(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL is_weapon_deployed(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->ingame){
|
||||||
if ( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_WDEPLOY) == 1 )
|
if ( *( (int*)pPlayer->pEdict->pvPrivateData + STEAM_PDOFFSET_WDEPLOY) == 1 )
|
||||||
@ -249,10 +252,7 @@ static cell AMX_NATIVE_CALL is_weapon_deployed(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_user_ammo(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL set_user_ammo(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
if ( !pPlayer->ingame )
|
if ( !pPlayer->ingame )
|
||||||
@ -356,10 +356,7 @@ static cell AMX_NATIVE_CALL set_user_ammo(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_ammo(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_ammo(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
if ( !pPlayer->ingame )
|
if ( !pPlayer->ingame )
|
||||||
@ -445,10 +442,7 @@ static cell AMX_NATIVE_CALL get_user_ammo(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL test_pd(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL test_pd(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
int type = params[2];
|
int type = params[2];
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->ingame){
|
||||||
@ -487,6 +481,9 @@ AMX_NATIVE_INFO pd_Natives[] = {
|
|||||||
{ "dod_get_user_ammo", get_user_ammo },
|
{ "dod_get_user_ammo", get_user_ammo },
|
||||||
{ "dod_set_user_ammo", set_user_ammo },
|
{ "dod_set_user_ammo", set_user_ammo },
|
||||||
|
|
||||||
|
{ "dod_get_user_kills", get_user_frags },
|
||||||
|
{ "dod_set_user_kills", set_user_frags },
|
||||||
|
|
||||||
{ "dod_test_pd", test_pd },
|
{ "dod_test_pd", test_pd },
|
||||||
///*******************
|
///*******************
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2281,6 +2296,11 @@ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_
|
|||||||
|
|
||||||
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 ( gpGamedllFuncs ){
|
||||||
|
LOG_ERROR(PLID,"gpGamedllFuncs already set");
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if(now > Plugin_info.loadable) {
|
if(now > Plugin_info.loadable) {
|
||||||
LOG_ERROR(PLID, "Can't load module right now");
|
LOG_ERROR(PLID, "Can't load module right now");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
@ -2439,11 +2459,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 +2476,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 +2549,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 +2585,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 +2598,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);
|
||||||
@ -2629,6 +2656,18 @@ void MF_Log(const char *fmt, ...)
|
|||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_NAME, 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_NAME, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// validate macros
|
// validate macros
|
||||||
@ -2649,11 +2688,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 +2706,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);
|
||||||
|
@ -58,6 +58,49 @@ extern CPlayer* mPlayer;
|
|||||||
|
|
||||||
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName);
|
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName);
|
||||||
|
|
||||||
|
#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))
|
||||||
|
|
||||||
#endif // DODFUN_H
|
#endif // DODFUN_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
// Module info
|
// Module info
|
||||||
#define MODULE_NAME "DoD Fun"
|
#define MODULE_NAME "DoD Fun"
|
||||||
#define MODULE_VERSION "0.1"
|
#define MODULE_VERSION "1.0"
|
||||||
#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 "DODFUN"
|
#define MODULE_LOGTAG "DODFUN"
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
static cell AMX_NATIVE_CALL get_weapon_name(AMX *amx, cell *params){ // from id to name 3 params id, name, len
|
static cell AMX_NATIVE_CALL get_weapon_name(AMX *amx, cell *params){ // from id to name 3 params id, name, len
|
||||||
int id = params[1];
|
int id = params[1];
|
||||||
if (id<0 || id>=DODMAX_WEAPONS){
|
if (id<0 || id>=DODMAX_WEAPONS){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
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]);
|
||||||
@ -67,7 +67,7 @@ static cell AMX_NATIVE_CALL wpnlog_to_id(AMX *amx, cell *params){ // from log to
|
|||||||
static cell AMX_NATIVE_CALL get_weapon_logname(AMX *amx, cell *params){ // from id to log
|
static cell AMX_NATIVE_CALL get_weapon_logname(AMX *amx, cell *params){ // from id to log
|
||||||
int id = params[1];
|
int id = params[1];
|
||||||
if (id<0 || id>=DODMAX_WEAPONS){
|
if (id<0 || id>=DODMAX_WEAPONS){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
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]);
|
||||||
@ -76,7 +76,7 @@ static cell AMX_NATIVE_CALL get_weapon_logname(AMX *amx, cell *params){ // from
|
|||||||
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<0 || id>=DODMAX_WEAPONS){
|
if (id<0 || id>=DODMAX_WEAPONS){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return weaponData[id].melee;
|
return weaponData[id].melee;
|
||||||
@ -97,10 +97,7 @@ static cell AMX_NATIVE_CALL get_team_score(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_score(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_score(AMX *amx, cell *params){
|
||||||
int index = params[1];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
CHECK_PLAYER(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame)
|
if (pPlayer->ingame)
|
||||||
return pPlayer->savedScore;
|
return pPlayer->savedScore;
|
||||||
@ -109,10 +106,7 @@ static cell AMX_NATIVE_CALL get_user_score(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_class(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_class(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame)
|
if (pPlayer->ingame)
|
||||||
return pPlayer->pEdict->v.playerclass;
|
return pPlayer->pEdict->v.playerclass;
|
||||||
@ -121,10 +115,7 @@ static cell AMX_NATIVE_CALL get_user_class(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL user_kill(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL user_kill(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
if (pPlayer->ingame && pPlayer->IsAlive() ){
|
if (pPlayer->ingame && pPlayer->IsAlive() ){
|
||||||
@ -147,7 +138,7 @@ static cell AMX_NATIVE_CALL get_map_info(AMX *amx, cell *params){
|
|||||||
return g_map.detect_axis_paras;
|
return g_map.detect_axis_paras;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid map info id %d", params[1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -155,10 +146,7 @@ static cell AMX_NATIVE_CALL get_map_info(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_pronestate(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_pronestate(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame)
|
if (pPlayer->ingame)
|
||||||
return pPlayer->pEdict->v.iuser3;
|
return pPlayer->pEdict->v.iuser3;
|
||||||
@ -168,10 +156,7 @@ static cell AMX_NATIVE_CALL get_user_pronestate(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_weapon(AMX *amx, cell *params){
|
static cell AMX_NATIVE_CALL get_user_weapon(AMX *amx, cell *params){
|
||||||
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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->ingame){
|
||||||
int wpn = pPlayer->current;
|
int wpn = pPlayer->current;
|
||||||
@ -190,30 +175,31 @@ static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params){ // forward
|
|||||||
#ifdef FORWARD_OLD_SYSTEM
|
#ifdef FORWARD_OLD_SYSTEM
|
||||||
|
|
||||||
int iFunctionIndex;
|
int iFunctionIndex;
|
||||||
|
int err;
|
||||||
switch( params[1] ){
|
switch( params[1] ){
|
||||||
case 0:
|
case 0:
|
||||||
if( MF_AmxFindPublic(amx, "client_damage", &iFunctionIndex) == AMX_ERR_NONE )
|
if( (err=MF_AmxFindPublic(amx, "client_damage", &iFunctionIndex)) == AMX_ERR_NONE )
|
||||||
g_damage_info.put( amx , iFunctionIndex );
|
g_damage_info.put( amx , iFunctionIndex );
|
||||||
else
|
else
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, err, "client_damage not found");
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if( MF_AmxFindPublic(amx, "client_death", &iFunctionIndex) == AMX_ERR_NONE )
|
if( (err=MF_AmxFindPublic(amx, "client_death", &iFunctionIndex)) == AMX_ERR_NONE )
|
||||||
g_death_info.put( amx , iFunctionIndex );
|
g_death_info.put( amx , iFunctionIndex );
|
||||||
else
|
else
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, err, "client_Death not found");
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if( MF_AmxFindPublic(amx, "client_score", &iFunctionIndex) == AMX_ERR_NONE )
|
if( (err=MF_AmxFindPublic(amx, "client_score", &iFunctionIndex)) == AMX_ERR_NONE )
|
||||||
g_score_info.put( amx , iFunctionIndex );
|
g_score_info.put( amx , iFunctionIndex );
|
||||||
else
|
else
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, err, "client_score not found");
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid forward id %d", params[2]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -248,31 +234,25 @@ static cell AMX_NATIVE_CALL register_cwpn(AMX *amx, cell *params){ // name,logna
|
|||||||
static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg,hp=0
|
||||||
int weapon = params[1];
|
int weapon = params[1];
|
||||||
if ( weapon < DODMAX_WEAPONS-DODMAX_CUSTOMWPNS ){ // only for custom weapons
|
if ( weapon < DODMAX_WEAPONS-DODMAX_CUSTOMWPNS ){ // only for custom weapons
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid custom weapon id %d", weapon);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int att = params[2];
|
int att = params[2];
|
||||||
if (att<1||att>gpGlobals->maxClients){
|
CHECK_PLAYER(params[2]);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int vic = params[3];
|
int vic = params[3];
|
||||||
if (vic<1||vic>gpGlobals->maxClients){
|
CHECK_PLAYER(params[3]);
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,21 +286,17 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
|
|||||||
MF_ExecuteForward( iFDeath,pAtt->index, pVic->index, weapon, aim, TA );
|
MF_ExecuteForward( iFDeath,pAtt->index, pVic->index, weapon, aim, TA );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL cwpn_shot(AMX *amx, cell *params){ // player,wid
|
static cell AMX_NATIVE_CALL cwpn_shot(AMX *amx, cell *params){ // player,wid
|
||||||
int index = params[2];
|
int index = params[2];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
CHECK_PLAYER(index);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int weapon = params[1];
|
int weapon = params[1];
|
||||||
if ( weapon < DODMAX_WEAPONS-DODMAX_CUSTOMWPNS ){
|
if ( weapon < DODMAX_WEAPONS-DODMAX_CUSTOMWPNS ){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid custom weapon id %d", weapon);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,10 +324,7 @@ static cell AMX_NATIVE_CALL is_custom(AMX *amx, cell *params){
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL dod_get_user_team(AMX *amx, cell *params){ // player,wid
|
static cell AMX_NATIVE_CALL dod_get_user_team(AMX *amx, cell *params){ // player,wid
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
return pPlayer->pEdict->v.team;
|
return pPlayer->pEdict->v.team;
|
||||||
@ -360,10 +333,7 @@ static cell AMX_NATIVE_CALL dod_get_user_team(AMX *amx, cell *params){ // player
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_team(AMX *amx, cell *params){ // player,wid
|
static cell AMX_NATIVE_CALL get_user_team(AMX *amx, cell *params){ // player,wid
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
int iTeam = pPlayer->pEdict->v.team;
|
int iTeam = pPlayer->pEdict->v.team;
|
||||||
|
@ -35,15 +35,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]);
|
||||||
@ -68,15 +62,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]);
|
||||||
@ -101,13 +89,10 @@ static cell AMX_NATIVE_CALL get_user_vstats(AMX *amx, cell *params) /* 6 param *
|
|||||||
static cell AMX_NATIVE_CALL get_user_wlstats(AMX *amx, cell *params) /* 4 param */ // DEC-Weapon (round) stats (end)
|
static cell AMX_NATIVE_CALL get_user_wlstats(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_PLAYER(index);
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int weapon = params[2];
|
int weapon = params[2];
|
||||||
if (weapon<0||weapon>=DODMAX_WEAPONS){
|
if (weapon<0||weapon>=DODMAX_WEAPONS){
|
||||||
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);
|
||||||
@ -133,13 +118,10 @@ static cell AMX_NATIVE_CALL get_user_wlstats(AMX *amx, cell *params) /* 4 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_PLAYER(index)
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int weapon = params[2];
|
int weapon = params[2];
|
||||||
if (weapon<0||weapon>=DODMAX_WEAPONS){
|
if (weapon<0||weapon>=DODMAX_WEAPONS){
|
||||||
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);
|
||||||
@ -165,13 +147,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_PLAYER(index)
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int weapon = params[2];
|
int weapon = params[2];
|
||||||
if (weapon<0||weapon>=DODMAX_WEAPONS){
|
if (weapon<0||weapon>=DODMAX_WEAPONS){
|
||||||
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);
|
||||||
@ -197,10 +176,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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
pPlayer->restartStats();
|
pPlayer->restartStats();
|
||||||
return 1;
|
return 1;
|
||||||
@ -209,10 +185,7 @@ static cell AMX_NATIVE_CALL reset_user_wstats(AMX *amx, cell *params) /* 6 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_PLAYER(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->ingame ){
|
if ( pPlayer->ingame ){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
@ -237,10 +210,7 @@ static cell AMX_NATIVE_CALL get_user_stats(AMX *amx, cell *params) /* 3 param */
|
|||||||
static cell AMX_NATIVE_CALL get_user_lstats(AMX *amx, cell *params) /* 3 param */
|
static cell AMX_NATIVE_CALL get_user_lstats(AMX *amx, cell *params) /* 3 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;
|
|
||||||
}
|
|
||||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
if (pPlayer->ingame){
|
if (pPlayer->ingame){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
@ -263,10 +233,7 @@ static cell AMX_NATIVE_CALL get_user_lstats(AMX *amx, cell *params) /* 3 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_PLAYER(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->ingame){
|
if (pPlayer->ingame){
|
||||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2281,6 +2296,11 @@ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_
|
|||||||
|
|
||||||
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 ( gpGamedllFuncs ){
|
||||||
|
LOG_ERROR(PLID,"gpGamedllFuncs already set");
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if(now > Plugin_info.loadable) {
|
if(now > Plugin_info.loadable) {
|
||||||
LOG_ERROR(PLID, "Can't load module right now");
|
LOG_ERROR(PLID, "Can't load module right now");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
@ -2439,11 +2459,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 +2476,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 +2549,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 +2585,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 +2598,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);
|
||||||
@ -2629,6 +2656,18 @@ void MF_Log(const char *fmt, ...)
|
|||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_NAME, 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_NAME, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// validate macros
|
// validate macros
|
||||||
@ -2649,11 +2688,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 +2706,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);
|
||||||
|
@ -111,6 +111,54 @@ bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
|||||||
bool isModuleActive();
|
bool isModuleActive();
|
||||||
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName);
|
edict_t *FindEntityByClassname(edict_t *pentStart, const char *szName);
|
||||||
|
|
||||||
|
#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 // DODX_H
|
#endif // DODX_H
|
||||||
|
|
||||||
|
|
||||||
|
@ -151,11 +151,11 @@ void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
|
|||||||
|
|
||||||
void PlayerPreThink_Post( edict_t *pEntity ) {
|
void PlayerPreThink_Post( edict_t *pEntity ) {
|
||||||
if ( !isModuleActive() )
|
if ( !isModuleActive() )
|
||||||
return;
|
RETURN_META(MRES_IGNORED);
|
||||||
|
|
||||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||||
if ( !pPlayer->ingame )
|
if ( !pPlayer->ingame )
|
||||||
return;
|
RETURN_META(MRES_IGNORED);
|
||||||
|
|
||||||
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time){
|
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time){
|
||||||
if ( !ignoreBots(pEntity) ){
|
if ( !ignoreBots(pEntity) ){
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
// Module info
|
// Module info
|
||||||
#define MODULE_NAME "DoDX"
|
#define MODULE_NAME "DoDX"
|
||||||
#define MODULE_VERSION "0.20"
|
#define MODULE_VERSION "1.0"
|
||||||
#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 "DODX"
|
#define MODULE_LOGTAG "DODX"
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
void append(const char *t)
|
void append(const char *t)
|
||||||
{
|
{
|
||||||
Grow(cSize + strlen(t));
|
Grow(cSize + strlen(t) + 1);
|
||||||
strcat(v, t);
|
strcat(v, t);
|
||||||
cSize = strlen(v);
|
cSize = strlen(v);
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (c == '\f' || c == '\n' ||
|
if (c == '\f' || c == '\n' ||
|
||||||
c == '\t' || c == '\r' ||
|
c == '\t' || c == '\r' ||
|
||||||
c == 'v' || c == ' ')
|
c == '\v' || c == ' ')
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -11,17 +11,6 @@ int AmxStringToEngine(AMX *amx, cell param, int &len)
|
|||||||
return ALLOC_STRING(szString);
|
return ALLOC_STRING(szString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EngineError(AMX *amx, char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list p;
|
|
||||||
va_start(p, fmt);
|
|
||||||
char errbuf[512];
|
|
||||||
vsprintf(errbuf, fmt, p);
|
|
||||||
va_end(p);
|
|
||||||
MF_Log("%s (\"%s\", line %d)", errbuf, MF_GetScriptName(MF_FindScriptByAmx(amx)), amx->curline);
|
|
||||||
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClearHooks()
|
void ClearHooks()
|
||||||
{
|
{
|
||||||
register unsigned int i = 0;
|
register unsigned int i = 0;
|
||||||
@ -101,7 +90,7 @@ void OnPluginsLoaded()
|
|||||||
g_pFunctionTable->pfnPlayerPostThink=PlayerPostThink_Post;
|
g_pFunctionTable->pfnPlayerPostThink=PlayerPostThink_Post;
|
||||||
|
|
||||||
g_pFunctionTable->pfnSpawn=NULL; // "pfn_spawn"
|
g_pFunctionTable->pfnSpawn=NULL; // "pfn_spawn"
|
||||||
if (CheckForPublic("pfn_spawn"))
|
//if (CheckForPublic("pfn_spawn")) // JGHG: I commented this if out because we always need the Spawn to precache the rocket mdl used with SetView native
|
||||||
g_pFunctionTable->pfnSpawn=Spawn;
|
g_pFunctionTable->pfnSpawn=Spawn;
|
||||||
|
|
||||||
g_pFunctionTable->pfnClientKill=NULL; // "client_kill"
|
g_pFunctionTable->pfnClientKill=NULL; // "client_kill"
|
||||||
@ -240,7 +229,7 @@ void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
|||||||
Msg.clear();
|
Msg.clear();
|
||||||
register int i = 0, j = 0;
|
register int i = 0, j = 0;
|
||||||
for (i=0; i<256; i++) {
|
for (i=0; i<256; i++) {
|
||||||
for (j=0; j<msgHooks[i].size(); j++)
|
for (j=0; j<(int)msgHooks[i].size(); j++)
|
||||||
if (msgHooks[i].at(j) != -1)
|
if (msgHooks[i].at(j) != -1)
|
||||||
MF_UnregisterSPForward(msgHooks[i].at(j));
|
MF_UnregisterSPForward(msgHooks[i].at(j));
|
||||||
msgHooks[i].clear();
|
msgHooks[i].clear();
|
||||||
|
@ -32,8 +32,6 @@
|
|||||||
* Description: AMX Mod X Module Interface Functions
|
* Description: AMX Mod X Module Interface Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -53,6 +51,9 @@ DLL_FUNCTIONS *g_pFunctionTable;
|
|||||||
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
enginefuncs_t *g_pengfuncsTable;
|
enginefuncs_t *g_pengfuncsTable;
|
||||||
enginefuncs_t *g_pengfuncsTable_Post;
|
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 =
|
||||||
@ -2207,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2224,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2451,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;
|
||||||
@ -2465,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;
|
||||||
@ -2489,6 +2496,11 @@ PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2532,6 +2544,9 @@ 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("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2553,6 +2568,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV);
|
REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV);
|
||||||
REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC);
|
REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC);
|
||||||
REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT);
|
REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT);
|
||||||
|
REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE);
|
||||||
|
|
||||||
// Natives / Forwards
|
// Natives / Forwards
|
||||||
REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES);
|
REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES);
|
||||||
@ -2564,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);
|
||||||
@ -2576,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);
|
||||||
@ -2585,6 +2603,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV);
|
REQFUNC("IsPlayerHLTV", g_fn_IsPlayerHLTV, PFN_IS_PLAYER_HLTV);
|
||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2631,6 +2651,18 @@ void MF_Log(const char *fmt, ...)
|
|||||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
g_fn_Log("[%s] %s", MODULE_NAME, 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_NAME, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// validate macros
|
// validate macros
|
||||||
@ -2651,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);
|
||||||
@ -2666,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);
|
||||||
@ -2679,11 +2715,14 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -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*/);
|
||||||
@ -1944,6 +1948,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1955,7 +1965,7 @@ typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
||||||
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/);
|
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */);
|
||||||
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
||||||
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
||||||
typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
||||||
@ -1963,6 +1973,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -1979,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;
|
||||||
@ -2017,6 +2031,9 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
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_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
|
||||||
@ -2036,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) { }
|
||||||
@ -2050,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) { }
|
||||||
@ -2066,6 +2087,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2083,11 +2106,14 @@ int MF_GetPlayerFlags (int id) { }
|
|||||||
#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
|
||||||
@ -2097,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
|
||||||
@ -2121,6 +2148,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#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_Format g_fn_Format
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
|
@ -8,6 +8,10 @@ int g_CameraCount;
|
|||||||
|
|
||||||
TraceResult g_tr;
|
TraceResult g_tr;
|
||||||
|
|
||||||
|
#define BUFFERSIZE 1023
|
||||||
|
char g_buffer[BUFFERSIZE + 1];
|
||||||
|
|
||||||
|
|
||||||
void UTIL_SetSize(edict_t *pev, const Vector &vecMin, const Vector &vecMax)
|
void UTIL_SetSize(edict_t *pev, const Vector &vecMin, const Vector &vecMax)
|
||||||
{
|
{
|
||||||
SET_SIZE(ENT(pev), vecMin, vecMax);
|
SET_SIZE(ENT(pev), vecMin, vecMax);
|
||||||
@ -101,10 +105,7 @@ static cell AMX_NATIVE_CALL VelocityByAim(AMX *amx, cell *params)
|
|||||||
cell *vRet = MF_GetAmxAddr(amx, params[3]);
|
cell *vRet = MF_GetAmxAddr(amx, params[3]);
|
||||||
Vector vVector = Vector(0, 0, 0);
|
Vector vVector = Vector(0, 0, 0);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -325,8 +326,8 @@ static cell AMX_NATIVE_CALL set_speak(AMX *amx, cell *params) {
|
|||||||
int iIndex = params[1];
|
int iIndex = params[1];
|
||||||
int iNewSpeakFlags = params[2];
|
int iNewSpeakFlags = params[2];
|
||||||
|
|
||||||
if (iIndex> gpGlobals->maxClients || !is_ent_valid(iIndex)) {
|
if (iIndex > gpGlobals->maxClients || !MF_IsPlayerIngame(iIndex)) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", iIndex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,8 +339,8 @@ static cell AMX_NATIVE_CALL set_speak(AMX *amx, cell *params) {
|
|||||||
static cell AMX_NATIVE_CALL get_speak(AMX *amx, cell *params) {
|
static cell AMX_NATIVE_CALL get_speak(AMX *amx, cell *params) {
|
||||||
int iIndex = params[1];
|
int iIndex = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iIndex) || iIndex > gpGlobals->maxClients) {
|
if (iIndex > gpGlobals->maxClients || !MF_IsPlayerIngame(iIndex)) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", iIndex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,10 +366,7 @@ static cell AMX_NATIVE_CALL get_info_keybuffer(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *e = INDEXENT2(iEnt);
|
edict_t *e = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -383,10 +381,7 @@ static cell AMX_NATIVE_CALL drop_to_floor(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *e = INDEXENT2(iEnt);
|
edict_t *e = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -409,15 +404,12 @@ static cell AMX_NATIVE_CALL attach_view(AMX *amx, cell *params)
|
|||||||
int iIndex = params[1];
|
int iIndex = params[1];
|
||||||
int iTargetIndex = params[2];
|
int iTargetIndex = params[2];
|
||||||
|
|
||||||
if (iIndex > gpGlobals->maxClients || !is_ent_valid(iIndex)) {
|
if (iIndex > gpGlobals->maxClients || !MF_IsPlayerIngame(iIndex)) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", iIndex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_ent_valid(iTargetIndex)) {
|
CHECK_ENTITY(iIndex);
|
||||||
EngineError(amx, "Invalid Entity %d", iIndex);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SET_VIEW(INDEXENT2(iIndex), INDEXENT2(iTargetIndex));
|
SET_VIEW(INDEXENT2(iIndex), INDEXENT2(iTargetIndex));
|
||||||
|
|
||||||
@ -431,8 +423,8 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) {
|
|||||||
int iIndex = params[1];
|
int iIndex = params[1];
|
||||||
int iCameraType = params[2];
|
int iCameraType = params[2];
|
||||||
|
|
||||||
if (iIndex > gpGlobals->maxClients || !is_ent_valid(iIndex)) {
|
if (iIndex > gpGlobals->maxClients || !MF_IsPlayerIngame(iIndex)) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", iIndex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -898,6 +890,13 @@ static cell AMX_NATIVE_CALL traceresult(AMX *amx, cell *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// (jghg)
|
||||||
|
static cell AMX_NATIVE_CALL get_string(AMX *amx, cell *params) // (string, returnstring[], length)
|
||||||
|
{
|
||||||
|
snprintf(g_buffer, BUFFERSIZE, "%s", STRING(params[1]));
|
||||||
|
return MF_SetAmxString(amx, params[2], g_buffer, params[3]);
|
||||||
|
}
|
||||||
|
|
||||||
AMX_NATIVE_INFO engine_Natives[] = {
|
AMX_NATIVE_INFO engine_Natives[] = {
|
||||||
{"halflife_time", halflife_time},
|
{"halflife_time", halflife_time},
|
||||||
|
|
||||||
@ -938,6 +937,8 @@ AMX_NATIVE_INFO engine_Natives[] = {
|
|||||||
{"register_think", register_think},
|
{"register_think", register_think},
|
||||||
{"register_touch", register_touch},
|
{"register_touch", register_touch},
|
||||||
|
|
||||||
|
{"get_string", get_string},
|
||||||
|
|
||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
///////////////////
|
///////////////////
|
||||||
};
|
};
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "gpglobals.h"
|
#include "gpglobals.h"
|
||||||
|
|
||||||
//#define CHECK_ENTITY(x) if (x != 0 && (FNullEnt(INDEXENT2(x)) || x < 0 || x > gpGlobals->maxEntities)) { MF_RaiseAmxError(amx,AMX_ERR_NATIVE); return 0; }
|
|
||||||
|
|
||||||
extern DLL_FUNCTIONS *g_pFunctionTable;
|
extern DLL_FUNCTIONS *g_pFunctionTable;
|
||||||
extern DLL_FUNCTIONS *g_pFunctionTable_Post;
|
extern DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
extern enginefuncs_t *g_pengfuncsTable;
|
extern enginefuncs_t *g_pengfuncsTable;
|
||||||
@ -170,8 +168,6 @@ inline edict_t* INDEXENT2( int iEdictNum )
|
|||||||
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EngineError(AMX *amx, char *fmt, ...);
|
|
||||||
|
|
||||||
int Spawn(edict_t *pEntity);
|
int Spawn(edict_t *pEntity);
|
||||||
void ChangeLevel(char* s1, char* s2);
|
void ChangeLevel(char* s1, char* s2);
|
||||||
void PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2);
|
void PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2);
|
||||||
@ -184,7 +180,23 @@ void PlayerPostThink_Post(edict_t *pEntity);
|
|||||||
void pfnTouch(edict_t *pToucher, edict_t *pTouched);
|
void pfnTouch(edict_t *pToucher, edict_t *pTouched);
|
||||||
void Think(edict_t *pent);
|
void Think(edict_t *pent);
|
||||||
|
|
||||||
#define CHECK_ENTITY(x) if (x != 0 && (FNullEnt(INDEXENT2(x)) || x < 0 || x > gpGlobals->maxEntities)) { EngineError(amx, "Invalid entity %d", x); return 0; }
|
#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; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
extern bool g_inKeyValue;
|
extern bool g_inKeyValue;
|
||||||
extern KeyValueData *g_pkvd;
|
extern KeyValueData *g_pkvd;
|
||||||
|
@ -5,14 +5,18 @@ int is_ent_valid(int iEnt)
|
|||||||
if (iEnt < 1 || iEnt > gpGlobals->maxEntities)
|
if (iEnt < 1 || iEnt > gpGlobals->maxEntities)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (iEnt >= 1 && iEnt <= gpGlobals->maxClients)
|
if (iEnt <= gpGlobals->maxClients)
|
||||||
|
{
|
||||||
if (!MF_IsPlayerIngame(iEnt))
|
if (!MF_IsPlayerIngame(iEnt))
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
} else {
|
||||||
|
if (FNullEnt(INDEXENT(iEnt)))
|
||||||
if (FNullEnt(pEnt))
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -26,10 +30,8 @@ static cell AMX_NATIVE_CALL entity_range(AMX *amx, cell *params)
|
|||||||
int idxa = params[1];
|
int idxa = params[1];
|
||||||
int idxb = params[2];
|
int idxb = params[2];
|
||||||
|
|
||||||
if (!is_ent_valid(idxa) || !is_ent_valid(idxb)) {
|
CHECK_ENTITY(idxa);
|
||||||
EngineError(amx, "Invalid Entity");
|
CHECK_ENTITY(idxb);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEntA = INDEXENT2(idxa);
|
edict_t *pEntA = INDEXENT2(idxa);
|
||||||
edict_t *pEntB = INDEXENT2(idxb);
|
edict_t *pEntB = INDEXENT2(idxb);
|
||||||
@ -47,10 +49,7 @@ static cell AMX_NATIVE_CALL call_think(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -65,10 +64,8 @@ static cell AMX_NATIVE_CALL fake_touch(AMX *amx, cell *params)
|
|||||||
int iPtr = params[1];
|
int iPtr = params[1];
|
||||||
int iPtd = params[2];
|
int iPtd = params[2];
|
||||||
|
|
||||||
if (!is_ent_valid(iPtr) || !is_ent_valid(iPtd)) {
|
CHECK_ENTITY(iPtr);
|
||||||
EngineError(amx, "Invalid Entity");
|
CHECK_ENTITY(iPtd);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pToucher = INDEXENT2(iPtr);
|
edict_t *pToucher = INDEXENT2(iPtr);
|
||||||
edict_t *pTouched = INDEXENT2(iPtd);
|
edict_t *pTouched = INDEXENT2(iPtd);
|
||||||
@ -83,10 +80,8 @@ static cell AMX_NATIVE_CALL force_use(AMX *amx, cell *params)
|
|||||||
int iPtr = params[1];
|
int iPtr = params[1];
|
||||||
int iPtd = params[2];
|
int iPtd = params[2];
|
||||||
|
|
||||||
if (!is_ent_valid(iPtr) || !is_ent_valid(iPtd)) {
|
CHECK_ENTITY(iPtr);
|
||||||
EngineError(amx, "Invalid Entity");
|
CHECK_ENTITY(iPtd);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pUser = INDEXENT2(iPtr);
|
edict_t *pUser = INDEXENT2(iPtr);
|
||||||
edict_t *pUsed = INDEXENT2(iPtd);
|
edict_t *pUsed = INDEXENT2(iPtd);
|
||||||
@ -139,10 +134,7 @@ static cell AMX_NATIVE_CALL DispatchKeyValue(AMX *amx, cell *params)
|
|||||||
if (count == 3) {
|
if (count == 3) {
|
||||||
cell *cVal = MF_GetAmxAddr(amx, params[1]);
|
cell *cVal = MF_GetAmxAddr(amx, params[1]);
|
||||||
int iValue = *cVal;
|
int iValue = *cVal;
|
||||||
if (!is_ent_valid(iValue)) {
|
CHECK_ENTITY(iValue);
|
||||||
EngineError(amx, "Invalid Entity %d", iValue);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
edict_t *pEntity = INDEXENT2(iValue);
|
edict_t *pEntity = INDEXENT2(iValue);
|
||||||
KeyValueData kvd;
|
KeyValueData kvd;
|
||||||
int iLength=0;
|
int iLength=0;
|
||||||
@ -172,10 +164,7 @@ static cell AMX_NATIVE_CALL DispatchKeyValue(AMX *amx, cell *params)
|
|||||||
static cell AMX_NATIVE_CALL get_keyvalue(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL get_keyvalue(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
int idx = params[1];
|
int idx = params[1];
|
||||||
if (!is_ent_valid(idx)) {
|
CHECK_ENTITY(idx);
|
||||||
EngineError(amx, "Invalid Entity %d", idx);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
edict_t *pEntity = INDEXENT2(idx);
|
edict_t *pEntity = INDEXENT2(idx);
|
||||||
char *test = INFO_KEY_BUFFER(pEntity);
|
char *test = INFO_KEY_BUFFER(pEntity);
|
||||||
int iLength=0;
|
int iLength=0;
|
||||||
@ -202,10 +191,7 @@ static cell AMX_NATIVE_CALL DispatchSpawn(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -224,10 +210,7 @@ static cell AMX_NATIVE_CALL entity_get_float(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
REAL fVal = 0;
|
REAL fVal = 0;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -358,10 +341,7 @@ static cell AMX_NATIVE_CALL entity_set_float(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
REAL fVal = amx_ctof(params[3]);
|
REAL fVal = amx_ctof(params[3]);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -492,10 +472,7 @@ static cell AMX_NATIVE_CALL entity_get_int(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
int iRetValue = 0;
|
int iRetValue = 0;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -613,7 +590,7 @@ static cell AMX_NATIVE_CALL entity_get_int(AMX *amx, cell *params)
|
|||||||
iRetValue = pEnt->v.deadflag;
|
iRetValue = pEnt->v.deadflag;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
EngineError(amx, "Invalid property %d", iEnt);
|
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid property %d", idx);
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -627,10 +604,7 @@ static cell AMX_NATIVE_CALL entity_set_int(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
int iNewValue = params[3];
|
int iNewValue = params[3];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -762,10 +736,7 @@ static cell AMX_NATIVE_CALL entity_get_vector(AMX *amx, cell *params)
|
|||||||
cell *vRet = MF_GetAmxAddr(amx, params[3]);
|
cell *vRet = MF_GetAmxAddr(amx, params[3]);
|
||||||
Vector vRetValue = Vector(0, 0, 0);
|
Vector vRetValue = Vector(0, 0, 0);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -858,10 +829,7 @@ static cell AMX_NATIVE_CALL entity_set_vector(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
cell *vAmx = MF_GetAmxAddr(amx, params[3]);
|
cell *vAmx = MF_GetAmxAddr(amx, params[3]);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
REAL fX = amx_ctof(vAmx[0]);
|
REAL fX = amx_ctof(vAmx[0]);
|
||||||
REAL fY = amx_ctof(vAmx[1]);
|
REAL fY = amx_ctof(vAmx[1]);
|
||||||
@ -955,10 +923,7 @@ static cell AMX_NATIVE_CALL entity_get_string(AMX *amx, cell *params)
|
|||||||
int iszString = 0;
|
int iszString = 0;
|
||||||
const char *szRet = NULL;
|
const char *szRet = NULL;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -1020,10 +985,7 @@ static cell AMX_NATIVE_CALL entity_set_string(AMX *amx, cell *params)
|
|||||||
int iLen;
|
int iLen;
|
||||||
int iszString = AmxStringToEngine(amx, params[3], iLen);
|
int iszString = AmxStringToEngine(amx, params[3], iLen);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -1082,10 +1044,7 @@ static cell AMX_NATIVE_CALL entity_get_edict(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
edict_t *pRet;
|
edict_t *pRet;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -1141,10 +1100,9 @@ static cell AMX_NATIVE_CALL entity_set_edict(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
int iSetEnt = params[3];
|
int iSetEnt = params[3];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt) || !is_ent_valid(iSetEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
if (iSetEnt != 0)
|
||||||
return 0;
|
CHECK_ENTITY(iSetEnt);
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
edict_t *pSetEnt = INDEXENT2(iSetEnt);
|
edict_t *pSetEnt = INDEXENT2(iSetEnt);
|
||||||
@ -1198,10 +1156,7 @@ static cell AMX_NATIVE_CALL entity_get_byte(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
int iRetValue = 0;
|
int iRetValue = 0;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -1239,10 +1194,7 @@ static cell AMX_NATIVE_CALL entity_set_byte(AMX *amx, cell *params)
|
|||||||
int idx = params[2];
|
int idx = params[2];
|
||||||
int iNewValue = params[3];
|
int iNewValue = params[3];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(iNewValue > 255)
|
if(iNewValue > 255)
|
||||||
iNewValue = 255;
|
iNewValue = 255;
|
||||||
@ -1254,22 +1206,22 @@ static cell AMX_NATIVE_CALL entity_set_byte(AMX *amx, cell *params)
|
|||||||
switch (idx)
|
switch (idx)
|
||||||
{
|
{
|
||||||
case controller1:
|
case controller1:
|
||||||
pEnt->v.controller[1] = iNewValue;
|
pEnt->v.controller[0] = iNewValue;
|
||||||
break;
|
break;
|
||||||
case controller2:
|
case controller2:
|
||||||
pEnt->v.controller[2] = iNewValue;
|
pEnt->v.controller[1] = iNewValue;
|
||||||
break;
|
break;
|
||||||
case controller3:
|
case controller3:
|
||||||
pEnt->v.controller[3] = iNewValue;
|
pEnt->v.controller[2] = iNewValue;
|
||||||
break;
|
break;
|
||||||
case controller4:
|
case controller4:
|
||||||
pEnt->v.controller[4] = iNewValue;
|
pEnt->v.controller[3] = iNewValue;
|
||||||
break;
|
break;
|
||||||
case blending1:
|
case blending1:
|
||||||
pEnt->v.blending[1] = iNewValue;
|
pEnt->v.blending[0] = iNewValue;
|
||||||
break;
|
break;
|
||||||
case blending2:
|
case blending2:
|
||||||
pEnt->v.blending[2] = iNewValue;
|
pEnt->v.blending[1] = iNewValue;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
@ -1283,10 +1235,7 @@ static cell AMX_NATIVE_CALL entity_set_origin(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
cell *vVector = MF_GetAmxAddr(amx, params[2]);
|
cell *vVector = MF_GetAmxAddr(amx, params[2]);
|
||||||
@ -1305,10 +1254,7 @@ static cell AMX_NATIVE_CALL entity_set_model(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
int iLen;
|
int iLen;
|
||||||
@ -1327,10 +1273,7 @@ static cell AMX_NATIVE_CALL entity_set_size(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
CHECK_ENTITY(iEnt);
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
|
|
||||||
@ -1411,10 +1354,7 @@ static cell AMX_NATIVE_CALL find_sphere_class(AMX *amx, cell *params) // find_sp
|
|||||||
|
|
||||||
vec3_t vecOrigin;
|
vec3_t vecOrigin;
|
||||||
if (params[1] > 0) {
|
if (params[1] > 0) {
|
||||||
if (!is_ent_valid(params[1])) {
|
CHECK_ENTITY(params[1]);
|
||||||
EngineError(amx, "Invalid Entity %d", params[1]);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t* pEntity = INDEXENT2(params[1]);
|
edict_t* pEntity = INDEXENT2(params[1]);
|
||||||
vecOrigin = pEntity->v.origin;
|
vecOrigin = pEntity->v.origin;
|
||||||
@ -1522,10 +1462,7 @@ static cell AMX_NATIVE_CALL find_ent_by_owner(AMX *amx, cell *params) // native
|
|||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
int oEnt = params[3];
|
int oEnt = params[3];
|
||||||
// Check index to start searching at, 0 must be possible for iEnt.
|
// Check index to start searching at, 0 must be possible for iEnt.
|
||||||
if (!is_ent_valid(oEnt)) {
|
CHECK_ENTITY(oEnt);
|
||||||
EngineError(amx, "Invalid Entity");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t *pEnt = INDEXENT2(iEnt);
|
edict_t *pEnt = INDEXENT2(iEnt);
|
||||||
edict_t *entOwner = INDEXENT2(oEnt);
|
edict_t *entOwner = INDEXENT2(oEnt);
|
||||||
@ -1560,10 +1497,7 @@ static cell AMX_NATIVE_CALL get_grenade_id(AMX *amx, cell *params) /* 4 param *
|
|||||||
int index = params[1];
|
int index = params[1];
|
||||||
char* szModel;
|
char* szModel;
|
||||||
|
|
||||||
if (!is_ent_valid(index)) {
|
CHECK_ENTITY(index);
|
||||||
EngineError(amx, "Invalid Entity %d", index);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edict_t* pentFind = INDEXENT2(params[4]);
|
edict_t* pentFind = INDEXENT2(params[4]);
|
||||||
edict_t* pentOwner = INDEXENT2(index);
|
edict_t* pentOwner = INDEXENT2(index);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user