Compare commits
1 Commits
amxmodx-0.
...
amxmodx-0.
Author | SHA1 | Date | |
---|---|---|---|
62e6b1c859 |
@ -300,11 +300,6 @@ int CForwardMngr::registerSPForward(int func, AMX *amx, int numParams, const For
|
|||||||
pForward->Set(func, amx, numParams, paramTypes);
|
pForward->Set(func, amx, numParams, paramTypes);
|
||||||
m_SPForwards.push_back(pForward);
|
m_SPForwards.push_back(pForward);
|
||||||
}
|
}
|
||||||
if (pForward->getFuncsNum() == 0)
|
|
||||||
{
|
|
||||||
unregisterSPForward(retVal);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,10 +309,9 @@ int CForwardMngr::registerSPForward(const char *funcName, AMX *amx, int numParam
|
|||||||
CSPForward *pForward;
|
CSPForward *pForward;
|
||||||
if (m_FreeSPForwards.size())
|
if (m_FreeSPForwards.size())
|
||||||
{
|
{
|
||||||
retVal = m_FreeSPForwards.back();
|
pForward = m_SPForwards[m_FreeSPForwards.back()];
|
||||||
m_FreeSPForwards.pop_back();
|
m_FreeSPForwards.pop_back();
|
||||||
pForward = m_SPForwards[retVal>>1]; // >>1 because unregisterSPForward pushes the id which contains the sp flag
|
pForward->Set(funcName, amx, numParams, paramTypes);
|
||||||
pForward->Set(funcName, amx, numParams, paramTypes);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -351,12 +345,6 @@ int CForwardMngr::getParamsNum(int id) const
|
|||||||
m_Forwards[id >> 1]->getParamsNum();
|
m_Forwards[id >> 1]->getParamsNum();
|
||||||
}
|
}
|
||||||
|
|
||||||
ForwardParam CForwardMngr::getParamType(int id, int paramNum) const
|
|
||||||
{
|
|
||||||
return (id & 1) ? m_SPForwards[id >> 1]->getParamType(paramNum) :
|
|
||||||
m_Forwards[id >> 1]->getParamType(paramNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CForwardMngr::clear()
|
void CForwardMngr::clear()
|
||||||
{
|
{
|
||||||
for (ForwardVec::iterator iter = m_Forwards.begin(); iter != m_Forwards.end(); ++iter)
|
for (ForwardVec::iterator iter = m_Forwards.begin(); iter != m_Forwards.end(); ++iter)
|
||||||
@ -459,7 +447,7 @@ cell executeForwards(int id, ...)
|
|||||||
va_start(argptr, id);
|
va_start(argptr, id);
|
||||||
for (int i = 0; i < paramsNum && i < FORWARD_MAX_PARAMS; ++i)
|
for (int i = 0; i < paramsNum && i < FORWARD_MAX_PARAMS; ++i)
|
||||||
{
|
{
|
||||||
if (g_forwards.getParamType(id, i) == FP_FLOAT)
|
if (params[i] == FP_FLOAT)
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
@ -108,12 +108,6 @@ public:
|
|||||||
{
|
{
|
||||||
return m_Funcs.size();
|
return m_Funcs.size();
|
||||||
}
|
}
|
||||||
ForwardParam getParamType(int paramId) const
|
|
||||||
{
|
|
||||||
if (paramId < 0 || paramId >= m_NumParams)
|
|
||||||
return FP_DONE;
|
|
||||||
return m_ParamTypes[paramId];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Single plugin forward
|
// Single plugin forward
|
||||||
@ -139,12 +133,6 @@ public:
|
|||||||
{
|
{
|
||||||
return (m_HasFunc) ? 1 : 0;
|
return (m_HasFunc) ? 1 : 0;
|
||||||
}
|
}
|
||||||
ForwardParam getParamType(int paramId) const
|
|
||||||
{
|
|
||||||
if (paramId < 0 || paramId >= m_NumParams)
|
|
||||||
return FP_DONE;
|
|
||||||
return m_ParamTypes[paramId];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CForwardMngr
|
class CForwardMngr
|
||||||
@ -182,7 +170,6 @@ public:
|
|||||||
bool isSPForward(int id) const; // check whether forward is single plugin
|
bool isSPForward(int id) const; // check whether forward is single plugin
|
||||||
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;
|
|
||||||
cell prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type); // prepare array
|
cell prepareArray(void *ptr, unsigned int size, ForwardArrayElemType type); // prepare array
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
{ \
|
{ \
|
||||||
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()); \
|
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)); \
|
||||||
return outbuf; \
|
return outbuf; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ void CLangMngr::CLang::MergeDefinitions(CQueue<sKeyDef*> &vec)
|
|||||||
entry->SetKey(key);
|
entry->SetKey(key);
|
||||||
entry->SetCache(false);
|
entry->SetCache(false);
|
||||||
} else {
|
} else {
|
||||||
//AMXXLOG_Log("[AMXX] Language key %s[%s] defined twice", m_LMan->GetKey(key), m_LanguageName);
|
AMXXLOG_Log("[AMXX] Language key %s[%s] defined twice", m_LMan->GetKey(key), m_LanguageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete vec.front();
|
delete vec.front();
|
||||||
@ -506,22 +506,140 @@ int CLangMngr::GetKeyEntry(String &key)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_PTR(ptr, start, bufsize) if ((ptr) - (start) >= (bufsize)) { \
|
const char *CLangMngr::Format(const char *src, ...)
|
||||||
AMXXLOG_Log("[AMXX] Buffer overflow in formatting (line %d, \"%s\")", amx->curline, g_plugins.findPluginFast(amx)->getName()); \
|
|
||||||
outbuf[0] = 0; \
|
|
||||||
len = 0; \
|
|
||||||
return outbuf; }
|
|
||||||
#define CHECK_OUTPTR(offset) CHECK_PTR(outptr+offset, outbuf, sizeof(outbuf))
|
|
||||||
#define ZEROTERM(buf) buf[(sizeof(buf)/sizeof(buf[0]))-1]=0;
|
|
||||||
char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|
||||||
{
|
{
|
||||||
// number of parameters ( for NEXT_PARAM macro )
|
va_list argptr;
|
||||||
int paramCount = *params / sizeof(cell);
|
va_start(argptr, src);
|
||||||
// the output buffer
|
|
||||||
static char outbuf[4096];
|
static char outbuf[4096];
|
||||||
char *outptr = outbuf;
|
char *outptr = outbuf;
|
||||||
cell *src = get_amxaddr(amx, params[parm++]);
|
enum State
|
||||||
|
{
|
||||||
|
S_Normal,
|
||||||
|
S_PercentSign,
|
||||||
|
};
|
||||||
|
|
||||||
|
State curState = S_Normal;
|
||||||
|
while (*src)
|
||||||
|
{
|
||||||
|
if (*src == '%' && curState == S_Normal)
|
||||||
|
curState = S_PercentSign;
|
||||||
|
else if (curState == S_PercentSign)
|
||||||
|
{
|
||||||
|
switch (*src)
|
||||||
|
{
|
||||||
|
case 's':
|
||||||
|
{
|
||||||
|
char *tmpArg = va_arg(argptr, char*);
|
||||||
|
while (*tmpArg)
|
||||||
|
*outptr++ = *tmpArg++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'f':
|
||||||
|
case 'g':
|
||||||
|
{
|
||||||
|
char format[16];
|
||||||
|
format[0] = '%';
|
||||||
|
char *ptr = format+1;
|
||||||
|
while (!isalpha(*ptr++ = *src++))
|
||||||
|
/*nothing*/;
|
||||||
|
--src;
|
||||||
|
*ptr = 0;
|
||||||
|
sprintf(outptr, format, va_arg(argptr, double));
|
||||||
|
outptr += strlen(outptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'L':
|
||||||
|
{
|
||||||
|
char *langName = va_arg(argptr, char*);
|
||||||
|
const char *cpLangName=NULL;
|
||||||
|
// Handle player ids (1-32) and server language
|
||||||
|
if ((int)langName == LANG_PLAYER)
|
||||||
|
{
|
||||||
|
langName = (char*)m_CurGlobId;
|
||||||
|
}
|
||||||
|
if ((int)langName == LANG_SERVER)
|
||||||
|
{
|
||||||
|
cpLangName = g_vault.get("server_language");
|
||||||
|
} else if ((int)langName >= 1 && (int)langName <= 32) {
|
||||||
|
if ((int)CVAR_GET_FLOAT("amx_client_languages"))
|
||||||
|
{
|
||||||
|
cpLangName = g_vault.get("server_language");
|
||||||
|
} else {
|
||||||
|
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I((int)langName)->pEdict, "lang");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cpLangName = langName;
|
||||||
|
}
|
||||||
|
if (!cpLangName || strlen(cpLangName) < 1)
|
||||||
|
cpLangName = "en";
|
||||||
|
char *key = va_arg(argptr, char*);
|
||||||
|
const char *def = GetDef(cpLangName, key);
|
||||||
|
while (*def)
|
||||||
|
{
|
||||||
|
switch (*def)
|
||||||
|
{
|
||||||
|
case INSERT_NUMBER:
|
||||||
|
{
|
||||||
|
sprintf(outptr, "%d", va_arg(argptr, int));
|
||||||
|
outptr += strlen(outptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case INSERT_STRING:
|
||||||
|
{
|
||||||
|
char *tmpArg = va_arg(argptr, char*);
|
||||||
|
while (*tmpArg)
|
||||||
|
*outptr++ = *tmpArg++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case INSERT_FLOAT:
|
||||||
|
{
|
||||||
|
double tmpArg = va_arg(argptr, double);
|
||||||
|
sprintf(outptr, "%f", tmpArg);
|
||||||
|
outptr += strlen(outptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case INSERT_NEWLINE:
|
||||||
|
*outptr++ = '\n';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*outptr++ = *def;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'd':
|
||||||
|
{
|
||||||
|
char format[16];
|
||||||
|
format[0] = '%';
|
||||||
|
char *ptr = format+1;
|
||||||
|
while (!isalpha(*ptr++ = *src++))
|
||||||
|
/*nothing*/;
|
||||||
|
--src;
|
||||||
|
*ptr = 0;
|
||||||
|
sprintf(outptr, format, va_arg(argptr, int));
|
||||||
|
outptr += strlen(outptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
*outptr++ = '%';
|
||||||
|
*outptr++ = *src;
|
||||||
|
}
|
||||||
|
curState = S_Normal;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*outptr++ = *src;
|
||||||
|
++src;
|
||||||
|
}
|
||||||
|
*outptr++ = 0;
|
||||||
|
return outbuf;
|
||||||
|
}
|
||||||
|
|
||||||
|
char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
||||||
|
{
|
||||||
|
int paramCount = *params / sizeof(cell);
|
||||||
|
static char outbuf[4096];
|
||||||
|
cell *src = get_amxaddr(amx, params[parm++]);
|
||||||
|
char *outptr = outbuf;
|
||||||
enum State
|
enum State
|
||||||
{
|
{
|
||||||
S_Normal,
|
S_Normal,
|
||||||
@ -560,14 +678,14 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(*pAmxLangName)->pEdict, "lang");
|
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(*pAmxLangName)->pEdict, "lang");
|
||||||
}
|
}
|
||||||
} else { // Language Name
|
} else { // Language Name
|
||||||
int tmplen = 0;
|
int len = 0;
|
||||||
cpLangName = get_amxstring(amx, langName, 2, tmplen);
|
cpLangName = get_amxstring(amx, langName, 2, len);
|
||||||
}
|
}
|
||||||
if (!cpLangName || strlen(cpLangName) < 1)
|
if (!cpLangName || strlen(cpLangName) < 1)
|
||||||
cpLangName = "en";
|
cpLangName = "en";
|
||||||
int tmplen = 0;
|
int len = 0;
|
||||||
NEXT_PARAM();
|
NEXT_PARAM();
|
||||||
char *key = get_amxstring(amx, params[parm++], 1, tmplen);
|
char *key = get_amxstring(amx, params[parm++], 1, len);
|
||||||
const char *def = GetDef(cpLangName, key);
|
const char *def = GetDef(cpLangName, key);
|
||||||
if (def == NULL)
|
if (def == NULL)
|
||||||
{
|
{
|
||||||
@ -581,8 +699,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
}
|
}
|
||||||
if (!def)
|
if (!def)
|
||||||
{
|
{
|
||||||
static char buf[512];
|
static char buf[255];
|
||||||
CHECK_PTR((char*)(buf+17+strlen(key)), buf, sizeof(buf));
|
|
||||||
sprintf(buf, "ML_LNOTFOUND: %s", key);
|
sprintf(buf, "ML_LNOTFOUND: %s", key);
|
||||||
def = buf;
|
def = buf;
|
||||||
}
|
}
|
||||||
@ -592,28 +709,24 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
if (*def == '%')
|
if (*def == '%')
|
||||||
{
|
{
|
||||||
++def;
|
++def;
|
||||||
char format[32];
|
char format[16];
|
||||||
format[0] = '%';
|
format[0] = '%';
|
||||||
char *ptr = format+1;
|
char *ptr = format+1;
|
||||||
while (ptr-format<sizeof(format) && !isalpha(*ptr++ = *def++))
|
while (!isalpha(*ptr++ = *def++))
|
||||||
/*nothing*/;
|
/*nothing*/;
|
||||||
ZEROTERM(format);
|
|
||||||
|
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
switch ( *(ptr-1) )
|
switch ( *(ptr-1) )
|
||||||
{
|
{
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
char tmpString[4096];
|
char tmpString[256];
|
||||||
char *tmpPtr = tmpString;
|
char *tmpPtr = tmpString;
|
||||||
NEXT_PARAM();
|
NEXT_PARAM();
|
||||||
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
||||||
while (tmpPtr-tmpString < sizeof(tmpString) && *tmpCell)
|
while (*tmpCell)
|
||||||
*tmpPtr++ = *tmpCell++;
|
*tmpPtr++ = *tmpCell++;
|
||||||
|
|
||||||
*tmpPtr = 0;
|
*tmpPtr = 0;
|
||||||
sprintf(outptr, format, tmpString);
|
sprintf(outptr, format, tmpString);
|
||||||
ZEROTERM(outbuf);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'g':
|
case 'g':
|
||||||
@ -621,7 +734,6 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
{
|
{
|
||||||
NEXT_PARAM();
|
NEXT_PARAM();
|
||||||
sprintf(outptr, format, *(REAL*)get_amxaddr(amx, params[parm++]));
|
sprintf(outptr, format, *(REAL*)get_amxaddr(amx, params[parm++]));
|
||||||
ZEROTERM(outbuf);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'i':
|
case 'i':
|
||||||
@ -629,13 +741,12 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
{
|
{
|
||||||
NEXT_PARAM();
|
NEXT_PARAM();
|
||||||
sprintf(outptr, format, (int)*get_amxaddr(amx, params[parm++]));
|
sprintf(outptr, format, (int)*get_amxaddr(amx, params[parm++]));
|
||||||
ZEROTERM(outbuf);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
CHECK_OUTPTR(strlen(format)+1);
|
*outptr++ = '%';
|
||||||
strcpy(outptr, format);
|
*outptr++ = *(ptr-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -647,19 +758,15 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
switch (*def)
|
switch (*def)
|
||||||
{
|
{
|
||||||
case 'n':
|
case 'n':
|
||||||
CHECK_OUTPTR(1);
|
|
||||||
*outptr++ = '\n';
|
*outptr++ = '\n';
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
CHECK_OUTPTR(1);
|
|
||||||
*outptr++ = '\t';
|
*outptr++ = '\t';
|
||||||
break;
|
break;
|
||||||
case '^':
|
case '^':
|
||||||
CHECK_OUTPTR(1);
|
|
||||||
*outptr++ = '^';
|
*outptr++ = '^';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CHECK_OUTPTR(2);
|
|
||||||
*outptr++ = '^';
|
*outptr++ = '^';
|
||||||
*outptr++ = *def;
|
*outptr++ = *def;
|
||||||
break;
|
break;
|
||||||
@ -667,38 +774,33 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
++def;
|
++def;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
CHECK_OUTPTR(1);
|
|
||||||
*outptr++ = *def++;
|
*outptr++ = *def++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char tmpString[4096];
|
char tmpString[256];
|
||||||
char *tmpPtr = tmpString;
|
char *tmpPtr = tmpString;
|
||||||
int tmpLen = 0;
|
int tmpLen =0;
|
||||||
char format[32];
|
char format[16];
|
||||||
format[0] = '%';
|
format[0] = '%';
|
||||||
char *ptr = format+1;
|
char *ptr = format+1;
|
||||||
if (*src != '%')
|
if (*src != '%')
|
||||||
{
|
{
|
||||||
while (*src != 0 && ptr-format<sizeof(format) && !isalpha(*ptr++ = *src++))
|
while (!isalpha(*ptr++ = *src++))
|
||||||
/*nothing*/;
|
/*nothing*/;
|
||||||
*ptr = 0;
|
|
||||||
ZEROTERM(format);
|
|
||||||
--src;
|
--src;
|
||||||
|
*ptr = 0;
|
||||||
switch ( *(ptr-1) )
|
switch ( *(ptr-1) )
|
||||||
{
|
{
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
NEXT_PARAM();
|
NEXT_PARAM();
|
||||||
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
||||||
while (tmpPtr-tmpString<sizeof(tmpString) && *tmpCell)
|
while (*tmpCell)
|
||||||
*tmpPtr++ = *tmpCell++;
|
*tmpPtr++ = *tmpCell++;
|
||||||
*tmpPtr = 0;
|
*tmpPtr = 0;
|
||||||
sprintf(outptr, format, tmpString);
|
sprintf(outptr, format, tmpString);
|
||||||
ZEROTERM(outbuf);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'g':
|
case 'g':
|
||||||
@ -717,28 +819,25 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
CHECK_OUTPTR(strlen(format)+1);
|
*outptr++ = '%';
|
||||||
strcpy(outptr, format);
|
*outptr++ = *(ptr-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outptr += strlen(outptr);
|
|
||||||
} else {
|
} else {
|
||||||
CHECK_OUTPTR(1);
|
|
||||||
*outptr++ = '%';
|
*outptr++ = '%';
|
||||||
|
*outptr++ = '%';
|
||||||
|
src++;
|
||||||
}
|
}
|
||||||
|
outptr += strlen(outptr);
|
||||||
}
|
}
|
||||||
curState = S_Normal;
|
curState = S_Normal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
CHECK_OUTPTR(1);
|
|
||||||
*outptr++ = *src;
|
*outptr++ = *src;
|
||||||
}
|
|
||||||
++src;
|
++src;
|
||||||
}
|
}
|
||||||
len = outptr - outbuf;
|
len = outptr - outbuf;
|
||||||
CHECK_OUTPTR(1);
|
|
||||||
*outptr++ = 0;
|
*outptr++ = 0;
|
||||||
return outbuf;
|
return outbuf;
|
||||||
}
|
}
|
||||||
@ -839,7 +938,7 @@ int CLangMngr::MergeDefinitionFile(const char *file)
|
|||||||
language[0] = buf[1];
|
language[0] = buf[1];
|
||||||
language[1] = buf[2];
|
language[1] = buf[2];
|
||||||
language[2] = 0;
|
language[2] = 0;
|
||||||
} else {
|
} else if (buf.size() > 4) {
|
||||||
if (!multiline)
|
if (!multiline)
|
||||||
{
|
{
|
||||||
pos = buf.find('=');
|
pos = buf.find('=');
|
||||||
|
@ -60,7 +60,7 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
|
|||||||
|
|
||||||
// Find now folder
|
// Find now folder
|
||||||
char pluginName[256], line[256], error[256];
|
char pluginName[256], line[256], error[256];
|
||||||
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins");
|
const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
|
||||||
|
|
||||||
|
|
||||||
while ( fp.getline(line , 255 ) )
|
while ( fp.getline(line , 255 ) )
|
||||||
|
@ -61,11 +61,14 @@ void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags,
|
|||||||
|
|
||||||
if (iParamsLen)
|
if (iParamsLen)
|
||||||
{
|
{
|
||||||
|
// also add a cell to the back with the value 0
|
||||||
m_iParamLen = iParamsLen + 1;
|
m_iParamLen = iParamsLen + 1;
|
||||||
m_pParams = new cell[m_iParamLen];
|
m_pParams = new cell[m_iParamLen];
|
||||||
memcpy(m_pParams, pParams, sizeof(cell)*iParamsLen);
|
memcpy(m_pParams, pParams, sizeof(cell)*iParamsLen);
|
||||||
m_pParams[iParamsLen] = 0;
|
m_pParams[iParamsLen] = 0;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_iParamLen = 0;
|
m_iParamLen = 0;
|
||||||
m_pParams = NULL;
|
m_pParams = NULL;
|
||||||
}
|
}
|
||||||
@ -75,10 +78,7 @@ void CTaskMngr::CTask::clear()
|
|||||||
{
|
{
|
||||||
m_bFree = true;
|
m_bFree = true;
|
||||||
if (m_pParams)
|
if (m_pParams)
|
||||||
{
|
|
||||||
delete [] m_pParams;
|
delete [] m_pParams;
|
||||||
m_pParams = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CTaskMngr::CTask::isFree() const
|
bool CTaskMngr::CTask::isFree() const
|
||||||
@ -114,12 +114,28 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
|||||||
|
|
||||||
if (execute)
|
if (execute)
|
||||||
{
|
{
|
||||||
if (m_iParamLen) // call with parameters
|
if (m_pPlugin->isExecutable(m_iFunc))
|
||||||
{
|
{
|
||||||
cell arr = prepareCellArray(m_pParams, m_iParamLen);
|
int err;
|
||||||
executeForwards(m_iFunc, arr, m_iId);
|
if (m_iParamLen) // call with parameters
|
||||||
} else {
|
{
|
||||||
executeForwards(m_iFunc, m_iId);
|
cell amx_addr, *phys_addr;
|
||||||
|
if (amx_Allot(m_pPlugin->getAMX(), m_iParamLen, &amx_addr, &phys_addr) != AMX_ERR_NONE)
|
||||||
|
AMXXLOG_Log("[AMXX] Failed to allocate AMX memory (task \"%d\") (plugin \"%s\")", m_iId, m_pPlugin->getName());
|
||||||
|
else
|
||||||
|
{
|
||||||
|
copy_amxmemory(phys_addr, m_pParams, m_iParamLen);
|
||||||
|
if ((err = amx_Exec(m_pPlugin->getAMX(), NULL, m_iFunc, 2, amx_addr, m_iId)) != AMX_ERR_NONE)
|
||||||
|
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (task \"%d\") (plugin \"%s\")", err, m_pPlugin->getAMX()->curline, m_iId, m_pPlugin->getName());
|
||||||
|
|
||||||
|
amx_Release(m_pPlugin->getAMX(), amx_addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((err = amx_Exec(m_pPlugin->getAMX(), NULL, m_iFunc, 1, m_iId)) != AMX_ERR_NONE)
|
||||||
|
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (task \"%d\") (plugin \"%s\")", err, m_pPlugin->getAMX()->curline, m_iId, m_pPlugin->getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set new exec time OR remove the task if needed
|
// set new exec time OR remove the task if needed
|
||||||
@ -129,8 +145,6 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unregisterSPForward(m_iFunc);
|
|
||||||
m_iFunc = 0;
|
|
||||||
m_bFree = true;
|
m_bFree = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,19 +54,19 @@ private:
|
|||||||
// execution
|
// execution
|
||||||
float m_fNextExecTime;
|
float m_fNextExecTime;
|
||||||
public:
|
public:
|
||||||
void set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags, int iId, float fBase, int iParamsLen, const cell *pParams, int iRepeat, float fCurrentTime);
|
inline void set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags, int iId, float fBase, int iParamsLen, const cell *pParams, int iRepeat, float fCurrentTime);
|
||||||
void clear();
|
inline void clear();
|
||||||
bool isFree() const;
|
inline bool isFree() const;
|
||||||
|
|
||||||
CPluginMngr::CPlugin *getPlugin() const;
|
inline CPluginMngr::CPlugin *getPlugin() const;
|
||||||
int getTaskId() const;
|
inline int getTaskId() const;
|
||||||
|
|
||||||
void executeIfRequired(float fCurrentTime, float fTimeLimit, float fTimeLeft); // also removes the task if needed
|
inline void executeIfRequired(float fCurrentTime, float fTimeLimit, float fTimeLeft); // also removes the task if needed
|
||||||
|
|
||||||
void changeBase(float fNewBase);
|
inline void changeBase(float fNewBase);
|
||||||
void resetNextExecTime(float fCurrentTime);
|
inline void resetNextExecTime(float fCurrentTime);
|
||||||
|
|
||||||
bool shouldRepeat();
|
inline bool shouldRepeat();
|
||||||
|
|
||||||
CTask();
|
CTask();
|
||||||
~CTask();
|
~CTask();
|
||||||
|
Binary file not shown.
@ -13,11 +13,9 @@
|
|||||||
# proc=ix86 - assumed not amd64
|
# proc=ix86 - assumed not amd64
|
||||||
# clean - clean the specifications above
|
# clean - clean the specifications above
|
||||||
|
|
||||||
$PROJECT = "amxmodx_mm";
|
$PROJECT = "amxx_mm";
|
||||||
$sdk = "../hlsdk/SourceCode";
|
$sdk = "../hlsdk/SourceCode";
|
||||||
$mm = "../metamod/metamod";
|
$mm = "../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
$ccf = "cc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("meta_api.cpp", "CFile.cpp", "CVault.cpp", "vault.cpp", "float.cpp", "file.cpp", "modules.cpp", "CMisc.cpp", "CTask.cpp", "string.cpp", "amxmodx.cpp", "CEvent.cpp", "CCmd.cpp", "CLogEvent.cpp", "srvcmd.cpp", "strptime.cpp", "amxcore.cpp", "amxtime.cpp", "power.cpp", "amxxlog.cpp", "fakemeta.cpp", "MMGR/MMGR.cpp", "amxxfile.cpp", "CLang.cpp", "md5.cpp", "emsg.cpp", "CForward.cpp", "CPlugin.cpp", "CModule.cpp", "CMenu.cpp", "util.cpp");
|
@CPP_SOURCE_FILES = ("meta_api.cpp", "CFile.cpp", "CVault.cpp", "vault.cpp", "float.cpp", "file.cpp", "modules.cpp", "CMisc.cpp", "CTask.cpp", "string.cpp", "amxmodx.cpp", "CEvent.cpp", "CCmd.cpp", "CLogEvent.cpp", "srvcmd.cpp", "strptime.cpp", "amxcore.cpp", "amxtime.cpp", "power.cpp", "amxxlog.cpp", "fakemeta.cpp", "MMGR/MMGR.cpp", "amxxfile.cpp", "CLang.cpp", "md5.cpp", "emsg.cpp", "CForward.cpp", "CPlugin.cpp", "CModule.cpp", "CMenu.cpp", "util.cpp");
|
||||||
|
|
||||||
@ -61,15 +59,16 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
push(@CPP_SOURCE_FILES, "amx.cpp");
|
`ln -s amx.cpp amx.c`;
|
||||||
|
push(@C_SOURCE_FILES, "amx.c");
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
} else {
|
} else {
|
||||||
if ($OPTIONS{"amd64"})
|
if ($OPTIONS{"amd64"})
|
||||||
{
|
{
|
||||||
`ln -s amx.cpp amx.c`;
|
`cp amx.cpp amx.c`;
|
||||||
push(@C_SOURCE_FILES, "amx.c");
|
push(@C_SOURCE_FILES, "amx.c");
|
||||||
} else {
|
} else {
|
||||||
push(@CPP_SOURCE_FILES, "amx.cpp");
|
push(@CPP_SOURCE_FILES, "amx.cpp");
|
||||||
@ -101,7 +100,7 @@ if ($OPTIONS{"amd64"})
|
|||||||
|
|
||||||
if ($OPTIONS{"jit"})
|
if ($OPTIONS{"jit"})
|
||||||
{
|
{
|
||||||
$cflags .= " -DJIT";
|
$cflags .= "-DJIT";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($OPTIONS{"debug"})
|
if ($OPTIONS{"debug"})
|
||||||
@ -181,11 +180,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -203,11 +202,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.c/\.o/;
|
$ofile =~ s/\.c/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$ccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -219,6 +218,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -Lzlib/ -shared -ldl -lstdc++ @LINK -lm -lz -o $outdir/$bin";
|
$gcc = "gcc $cflags -Lzlib/ -shared -ldl -lm @LINK -lz -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
* Version: $Id$
|
* Version: $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// not used
|
#include <stdio.h>
|
||||||
#define AMX_NODYNALOAD
|
#define AMX_NODYNALOAD
|
||||||
|
|
||||||
// bad bad workaround but we have to prevent a compiler crash :/
|
// bad bad workaround but we have to prevent a compiler crash :/
|
||||||
@ -51,30 +51,27 @@
|
|||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined __LCC__ || defined __GNUC__
|
#if defined __LCC__ || defined __linux__
|
||||||
#include <wchar.h> /* for wcslen() */
|
#include <wchar.h> /* for wcslen() */
|
||||||
#endif
|
#endif
|
||||||
#if (defined _Windows && !defined AMX_NODYNALOAD) || (defined JIT && !defined __linux__)
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// this file does not include amxmodx.h, so we have to include the memory manager here
|
// this file does not include amxmodx.h so we have to include the mem mngr here
|
||||||
#ifdef MEMORY_TEST
|
#ifdef MEMORY_TEST
|
||||||
#include "mmgr/mmgr.h"
|
#include "mmgr/mmgr.h"
|
||||||
#endif // MEMORY_TEST
|
#endif //MEMORY_TEST
|
||||||
|
|
||||||
#include "amx.h"
|
#include "amx.h"
|
||||||
|
|
||||||
#ifdef JIT
|
#ifdef JIT
|
||||||
# ifdef __WIN32__
|
# ifdef __WIN32__
|
||||||
# include <windows.h> // DWORD, VirtualProtect, ...
|
# include <windows.h>
|
||||||
# elif defined __linux__
|
# elif defined __linux__
|
||||||
# include <sys/mman.h> // mprotect, PROT_*
|
# include <sys/mman.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
# else
|
# else
|
||||||
// :TODO:
|
// :TODO:
|
||||||
# endif
|
# endif
|
||||||
#endif // JIT
|
#endif //JIT
|
||||||
|
|
||||||
/* When one or more of the AMX_funcname macris are defined, we want
|
/* When one or more of the AMX_funcname macris are defined, we want
|
||||||
* to compile only those functions. However, when none of these macros
|
* to compile only those functions. However, when none of these macros
|
||||||
@ -538,16 +535,19 @@ static int amx_BrowseRelocate(AMX *amx)
|
|||||||
if (debug)
|
if (debug)
|
||||||
amx->flags|=AMX_FLAG_DEBUG;
|
amx->flags|=AMX_FLAG_DEBUG;
|
||||||
|
|
||||||
#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);
|
||||||
#if !defined JIT
|
#if !defined JIT
|
||||||
amx->sysreq_d=(sizeof(AMX_NATIVE)<=sizeof(cell)) ? opcode_list[OP_SYSREQ_D] : 0;
|
/* to use direct system requests, a function pointer must fit in a cell;
|
||||||
|
* because the native function's address will be stored as the parameter
|
||||||
|
* of SYSREQ.D
|
||||||
|
*/
|
||||||
|
amx->sysreq_d= (sizeof(AMX_NATIVE)<=sizeof(cell)) ? opcode_list[OP_SYSREQ_D] : 0;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/* ANSI C
|
/* ANSI C
|
||||||
* to use direct system requests, a function pointer must fit in a cell;
|
* to use direct system requests, a function pointer must fit in a cell;
|
||||||
* because the native function's address will be stored as the parameter
|
* see the comment above
|
||||||
* of SYSREQ.D
|
|
||||||
*/
|
*/
|
||||||
amx->sysreq_d= (sizeof(AMX_NATIVE)<=sizeof(cell)) ? OP_SYSREQ_D : 0;
|
amx->sysreq_d= (sizeof(AMX_NATIVE)<=sizeof(cell)) ? OP_SYSREQ_D : 0;
|
||||||
#endif
|
#endif
|
||||||
@ -1049,16 +1049,19 @@ int AMXAPI amx_Init(AMX *amx,void *program)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* #if defined __WIN32 __ */
|
#else /* #if defined __WIN32 __ */
|
||||||
// DOS32 has no imposed limits on its segments.
|
|
||||||
#if defined __BORLANDC__ || defined __WATCOMC__
|
|
||||||
#pragma argsused
|
|
||||||
#endif
|
|
||||||
int memoryFullAccess( void* addr, int len ) { return 1; }
|
|
||||||
|
|
||||||
#if defined __BORLANDC__ || defined __WATCOMC__
|
// TODO: Add cases for Linux, Unix, OS/2, ...
|
||||||
#pragma argsused
|
|
||||||
#endif
|
// DOS32 has no imposed limits on its segments.
|
||||||
int memorySetAccess( void* addr, int len, int access ) { return 1; }
|
#if defined __BORLANDC__ || defined __WATCOMC__
|
||||||
|
#pragma argsused
|
||||||
|
#endif
|
||||||
|
int memoryFullAccess( void* addr, int len ) { return 1; }
|
||||||
|
|
||||||
|
#if defined __BORLANDC__ || defined __WATCOMC__
|
||||||
|
#pragma argsused
|
||||||
|
#endif
|
||||||
|
int memorySetAccess( void* addr, int len, int access ) { return 1; }
|
||||||
|
|
||||||
#endif /* #if defined __WIN32 __ */
|
#endif /* #if defined __WIN32 __ */
|
||||||
|
|
||||||
@ -1100,7 +1103,7 @@ int AMXAPI amx_InitJIT(AMX *amx, void *reloc_table, void *native_code)
|
|||||||
*(cell *)((char*)native_code + hdr->dat + hdr->stp - sizeof(cell)) = 0;
|
*(cell *)((char*)native_code + hdr->dat + hdr->stp - sizeof(cell)) = 0;
|
||||||
amx->stk = amx->stp;
|
amx->stk = amx->stp;
|
||||||
|
|
||||||
memorySetAccess( (void*)asm_runJIT, 20000, mac );
|
memorySetAccess( asm_runJIT, 20000, mac );
|
||||||
return AMX_ERR_NONE;
|
return AMX_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1570,7 +1573,8 @@ static AMX_NATIVE findfunction(const char *name, AMX_NATIVE_INFO *list, int numb
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *no_function; // PM: Nice hack ;)
|
const char *no_function;
|
||||||
|
|
||||||
int AMXAPI amx_Register(AMX *amx, AMX_NATIVE_INFO *list, int number)
|
int AMXAPI amx_Register(AMX *amx, AMX_NATIVE_INFO *list, int number)
|
||||||
{
|
{
|
||||||
AMX_FUNCSTUB *func;
|
AMX_FUNCSTUB *func;
|
||||||
@ -1590,11 +1594,15 @@ int AMXAPI amx_Register(AMX *amx, AMX_NATIVE_INFO *list, int number)
|
|||||||
if (func->address==0) {
|
if (func->address==0) {
|
||||||
/* this function is not yet located */
|
/* this function is not yet located */
|
||||||
funcptr=(list!=NULL) ? findfunction(GETENTRYNAME(hdr,func),list,number) : NULL;
|
funcptr=(list!=NULL) ? findfunction(GETENTRYNAME(hdr,func),list,number) : NULL;
|
||||||
|
/* on 64-bit architectures with, only the lower 32-bits of the address
|
||||||
|
* can be stored; hopefully, all addresses can be assumed to have the
|
||||||
|
* same value for the upper 32-bits
|
||||||
|
*/
|
||||||
if (funcptr!=NULL)
|
if (funcptr!=NULL)
|
||||||
func->address=(ucell)funcptr;
|
func->address=(ucell)funcptr;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
no_function = GETENTRYNAME(hdr,func);
|
no_function = GETENTRYNAME(hdr,func);
|
||||||
err=AMX_ERR_NOTFOUND;
|
err=AMX_ERR_NOTFOUND;
|
||||||
}
|
}
|
||||||
} /* if */
|
} /* if */
|
||||||
@ -1626,7 +1634,7 @@ AMX_NATIVE_INFO * AMXAPI amx_NativeInfo(const char *name, AMX_NATIVE func)
|
|||||||
#define CHKSTACK() if (stk>amx->stp) return AMX_ERR_STACKLOW
|
#define CHKSTACK() if (stk>amx->stp) return AMX_ERR_STACKLOW
|
||||||
#define CHKHEAP() if (hea<amx->hlw) return AMX_ERR_HEAPLOW
|
#define CHKHEAP() if (hea<amx->hlw) return AMX_ERR_HEAPLOW
|
||||||
|
|
||||||
#if defined __GNUC__ && !defined ASM32 && !defined JIT
|
#if defined __GNUC__ && !defined ASM32
|
||||||
/* GNU C version uses the "labels as values" extension to create
|
/* GNU C version uses the "labels as values" extension to create
|
||||||
* fast "indirect threaded" interpreter.
|
* fast "indirect threaded" interpreter.
|
||||||
*/
|
*/
|
||||||
@ -2737,7 +2745,7 @@ static void *amx_opcodelist_nodebug[] = {
|
|||||||
|
|
||||||
#if defined ASM32 || defined JIT
|
#if defined ASM32 || defined JIT
|
||||||
extern "C" void *amx_opcodelist[];
|
extern "C" void *amx_opcodelist[];
|
||||||
extern "C" void *amx_opcodelist_nodebug[];
|
extern "C" void *amx_opcodelist_nodebug[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
int AMXAPI amx_Exec(AMX *amx, cell *retval, int index, int numparams, ...)
|
||||||
@ -4031,7 +4039,7 @@ static long utf8_lowmark[5] = { 0x80, 0x800, 0x10000, 0x200000, 0x4000000 };
|
|||||||
*/
|
*/
|
||||||
if (result<utf8_lowmark[followup])
|
if (result<utf8_lowmark[followup])
|
||||||
goto error;
|
goto error;
|
||||||
if ((result>=0xd800 && result<=0xdfff) || result==0xfffe || result==0xffff)
|
if (result>=0xd800 && result<=0xdfff || result==0xfffe || result==0xffff)
|
||||||
goto error;
|
goto error;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
|
@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined __linux__
|
#if defined __linux__
|
||||||
#include <sclinux.h>
|
#include "sclinux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef AMX_H_INCLUDED
|
#ifndef AMX_H_INCLUDED
|
||||||
#define AMX_H_INCLUDED
|
#define AMX_H_INCLUDED
|
||||||
|
|
||||||
|
//#define JIT
|
||||||
|
|
||||||
#if defined __LCC__ || defined __DMC__ || defined __linux__
|
#if defined __LCC__ || defined __DMC__ || defined __linux__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||||
@ -335,7 +337,6 @@ uint32_t * AMXAPI amx_Align32(uint32_t *v);
|
|||||||
#if defined _I64_MAX || defined HAVE_I64
|
#if defined _I64_MAX || defined HAVE_I64
|
||||||
uint64_t * AMXAPI amx_Align64(uint64_t *v);
|
uint64_t * AMXAPI amx_Align64(uint64_t *v);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SMALL_CELL_SIZE==32
|
#if SMALL_CELL_SIZE==32
|
||||||
#define amx_AlignCell amx_Align32
|
#define amx_AlignCell amx_Align32
|
||||||
#elif SMALL_CELL_SIZE==64
|
#elif SMALL_CELL_SIZE==64
|
||||||
@ -343,7 +344,6 @@ uint32_t * AMXAPI amx_Align32(uint32_t *v);
|
|||||||
#else
|
#else
|
||||||
#error Unsupported cell size
|
#error Unsupported cell size
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int AMXAPI amx_Allot(AMX *amx, int cells, cell *amx_addr, cell **phys_addr);
|
int AMXAPI amx_Allot(AMX *amx, int cells, cell *amx_addr, cell **phys_addr);
|
||||||
int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, cell *params);
|
int AMXAPI amx_Callback(AMX *amx, cell index, cell *result, cell *params);
|
||||||
int AMXAPI amx_Cleanup(AMX *amx);
|
int AMXAPI amx_Cleanup(AMX *amx);
|
||||||
|
@ -1676,14 +1676,7 @@ static cell AMX_NATIVE_CALL set_task(AMX *amx, cell *params) /* 2 param */
|
|||||||
|
|
||||||
char* stemp = get_amxstring(amx,params[2],1, a );
|
char* stemp = get_amxstring(amx,params[2],1, a );
|
||||||
|
|
||||||
if (params[5])
|
if (amx_FindPublic(amx, stemp , &iFunc) != AMX_ERR_NONE){
|
||||||
{
|
|
||||||
iFunc = registerSPForwardByName(amx, stemp, FP_ARRAY, FP_CELL, FP_DONE);
|
|
||||||
} else {
|
|
||||||
iFunc = registerSPForwardByName(amx, stemp, FP_CELL, FP_DONE);
|
|
||||||
}
|
|
||||||
if (iFunc == -1)
|
|
||||||
{
|
|
||||||
AMXXLOG_Log("[AMXX] Function is not present (function \"%s\") (plugin \"%s\")",stemp,plugin->getName() );
|
AMXXLOG_Log("[AMXX] Function is not present (function \"%s\") (plugin \"%s\")",stemp,plugin->getName() );
|
||||||
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1696,7 +1689,10 @@ static cell AMX_NATIVE_CALL set_task(AMX *amx, cell *params) /* 2 param */
|
|||||||
|
|
||||||
char* temp = get_amxstring(amx,params[6],0,a);
|
char* temp = get_amxstring(amx,params[6],0,a);
|
||||||
|
|
||||||
g_tasksMngr.registerTask( plugin , iFunc , UTIL_ReadFlags(temp), params[3], base , params[5] , get_amxaddr(amx,params[4]) , params[7] );
|
g_tasksMngr.registerTask( plugin ,
|
||||||
|
iFunc , UTIL_ReadFlags(temp), params[3], base ,
|
||||||
|
params[5] ,
|
||||||
|
get_amxaddr(amx,params[4]) , params[7] );
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -2635,7 +2631,7 @@ static cell register_dictionary(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
int result = g_langMngr.MergeDefinitionFile(build_pathname("%s/lang/%s",
|
int result = g_langMngr.MergeDefinitionFile(build_pathname("%s/lang/%s",
|
||||||
get_localinfo("amxx_datadir", "addons/amxmodx/data"), get_amxstring(amx, params[1], 1, len)));
|
get_localinfo("amxx_datadir", "addons/amxx/data"), get_amxstring(amx, params[1], 1, len)));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +270,6 @@ CAmxxReader::Error CAmxxReader::GetSection(void *buffer)
|
|||||||
// AMXXLOG_Log("|||| First Bytes: %d %d %d %d", tempBuffer[0], tempBuffer[1], tempBuffer[2], tempBuffer[3]);
|
// AMXXLOG_Log("|||| First Bytes: %d %d %d %d", tempBuffer[0], tempBuffer[1], tempBuffer[2], tempBuffer[3]);
|
||||||
int result = uncompress((Bytef *)buffer, &destLen,
|
int result = uncompress((Bytef *)buffer, &destLen,
|
||||||
(Bytef *)tempBuffer, m_SectionLength);
|
(Bytef *)tempBuffer, m_SectionLength);
|
||||||
delete [] tempBuffer;
|
|
||||||
// AMXXLOG_Log("|||| Result: %d, m_SectionLength=%d, destLen=%d", result, m_SectionLength, destLen);
|
// AMXXLOG_Log("|||| Result: %d, m_SectionLength=%d, destLen=%d", result, m_SectionLength, destLen);
|
||||||
if (result != Z_OK)
|
if (result != Z_OK)
|
||||||
{
|
{
|
||||||
|
@ -181,18 +181,9 @@ void CLog::Log(const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
pF = fopen(build_pathname("%s/L%02d%02d.log", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday), "a+");
|
pF = fopen(build_pathname("%s/L%02d%02d.log", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday), "a+");
|
||||||
}
|
}
|
||||||
if (pF)
|
fprintf(pF, "L %s: %s\n", date, msg);
|
||||||
{
|
|
||||||
fprintf(pF, "L %s: %s\n", date, msg);
|
|
||||||
fclose(pF);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ALERT(at_logged, "[AMXX] Unexpected fatal logging error (couldn't open %s for a+). AMXX Logging disabled for this map.\n", m_LogFile.c_str());
|
|
||||||
m_LogType = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
fclose(pF);
|
||||||
// print on server console
|
// print on server console
|
||||||
print_srvconsole("L %s: %s\n", date, msg);
|
print_srvconsole("L %s: %s\n", date, msg);
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@
|
|||||||
prev_mres = mres; \
|
prev_mres = mres; \
|
||||||
if (mres == MRES_UNSET) \
|
if (mres == MRES_UNSET) \
|
||||||
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
||||||
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnName); \
|
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnArgs); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
/* Set meta result to the highest value */ \
|
/* Set meta result to the highest value */ \
|
||||||
@ -353,7 +353,7 @@
|
|||||||
prev_mres = mres; \
|
prev_mres = mres; \
|
||||||
if (mres == MRES_UNSET) \
|
if (mres == MRES_UNSET) \
|
||||||
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
||||||
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnName); \
|
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnArgs); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
/* Set meta result to the highest value */ \
|
/* Set meta result to the highest value */ \
|
||||||
@ -379,7 +379,7 @@
|
|||||||
prev_mres = mres; \
|
prev_mres = mres; \
|
||||||
if (mres == MRES_UNSET) \
|
if (mres == MRES_UNSET) \
|
||||||
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
||||||
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnName); \
|
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnArgs); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
/* Set meta result to the highest value */ \
|
/* Set meta result to the highest value */ \
|
||||||
@ -412,10 +412,7 @@
|
|||||||
prev_mres = mres; \
|
prev_mres = mres; \
|
||||||
if (mres == MRES_UNSET) \
|
if (mres == MRES_UNSET) \
|
||||||
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has not set meta result in \"%s\"", \
|
||||||
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnName); \
|
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnArgs); \
|
||||||
if (mres == MRES_SUPERCEDE) \
|
|
||||||
AMXXLOG_Log("[AMXX] Module \"%s\" (\"%s\") has set meta result in \"%s\" to supercede", \
|
|
||||||
(*iter).GetInfo()->name, (*iter).GetPath(), #pfnName); \
|
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
/* Set meta result to the highest value */ \
|
/* Set meta result to the highest value */ \
|
||||||
@ -2703,7 +2700,7 @@ int CFakeMeta::GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *int
|
|||||||
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy( pNewFunctionTable, &g_NewDllFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
memcpy( pNewFunctionTable, &g_NewDllFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
AddCorePlugin();
|
AddCorePlugin();
|
||||||
@ -2738,7 +2735,7 @@ int CFakeMeta::GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable, int
|
|||||||
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy( pNewFunctionTable, &g_NewDllFunctionTable_Post, sizeof( NEW_DLL_FUNCTIONS ) );
|
memcpy( pNewFunctionTable, &g_NewDllFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
|
||||||
// Make sure there is a core plugin
|
// Make sure there is a core plugin
|
||||||
AddCorePlugin();
|
AddCorePlugin();
|
||||||
|
@ -37,19 +37,6 @@
|
|||||||
|
|
||||||
#define PI 3.1415926535897932384626433832795
|
#define PI 3.1415926535897932384626433832795
|
||||||
|
|
||||||
static REAL FromRadians(REAL angle, int radix)
|
|
||||||
{
|
|
||||||
switch (radix)
|
|
||||||
{
|
|
||||||
case 1: /* degrees, sexagesimal system (technically: degrees/minutes/seconds) */
|
|
||||||
return (REAL)(angle / PI * 180.0);
|
|
||||||
case 2: /* grades, centesimal system */
|
|
||||||
return (REAL)(angle / PI * 200.0);
|
|
||||||
default: /* assume already radian */
|
|
||||||
return angle;
|
|
||||||
} /* switch */
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined __BORLANDC__ || defined __WATCOMC__
|
#if defined __BORLANDC__ || defined __WATCOMC__
|
||||||
#pragma argsused
|
#pragma argsused
|
||||||
#endif
|
#endif
|
||||||
@ -370,7 +357,6 @@ static cell AMX_NATIVE_CALL n_floatatan(AMX *amx, cell *params)
|
|||||||
REAL fA = amx_ctof(params[1]);
|
REAL fA = amx_ctof(params[1]);
|
||||||
fA = ToRadians(fA, params[2]);
|
fA = ToRadians(fA, params[2]);
|
||||||
fA = atan(fA);
|
fA = atan(fA);
|
||||||
fA = FromRadians(fA, params[2]);
|
|
||||||
return amx_ftoc(fA);
|
return amx_ftoc(fA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,8 +371,8 @@ static cell AMX_NATIVE_CALL n_floatacos(AMX *amx, cell *params)
|
|||||||
* params[2] = radix
|
* params[2] = radix
|
||||||
*/
|
*/
|
||||||
REAL fA = amx_ctof(params[1]);
|
REAL fA = amx_ctof(params[1]);
|
||||||
|
fA = ToRadians(fA, params[2]);
|
||||||
fA = acos(fA);
|
fA = acos(fA);
|
||||||
fA = FromRadians(fA, params[2]);
|
|
||||||
return amx_ftoc(fA);
|
return amx_ftoc(fA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,8 +387,8 @@ static cell AMX_NATIVE_CALL n_floatasin(AMX *amx, cell *params)
|
|||||||
* params[2] = radix
|
* params[2] = radix
|
||||||
*/
|
*/
|
||||||
REAL fA = amx_ctof(params[1]);
|
REAL fA = amx_ctof(params[1]);
|
||||||
|
fA = ToRadians(fA, params[2]);
|
||||||
fA = asin(fA);
|
fA = asin(fA);
|
||||||
fA = FromRadians(fA, params[2]);
|
|
||||||
return amx_ftoc(fA);
|
return amx_ftoc(fA);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,7 +407,6 @@ static cell AMX_NATIVE_CALL n_floatatan2(AMX *amx, cell *params)
|
|||||||
REAL fB = amx_ctof(params[2]);
|
REAL fB = amx_ctof(params[2]);
|
||||||
REAL fC;
|
REAL fC;
|
||||||
fC = atan2(fA, fB);
|
fC = atan2(fA, fB);
|
||||||
fC = FromRadians(fC, params[3]);
|
|
||||||
return amx_ftoc(fC);
|
return amx_ftoc(fC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,8 +128,8 @@ int FF_ChangeLevel = -1;
|
|||||||
// fake metamod api
|
// fake metamod api
|
||||||
CFakeMeta g_FakeMeta;
|
CFakeMeta g_FakeMeta;
|
||||||
|
|
||||||
// Precache stuff from force consistency calls
|
// Precache stuff from force consistency calls
|
||||||
// or check for pointed files won't be done
|
// or check for pointed files won't be done
|
||||||
int C_PrecacheModel(char *s) {
|
int C_PrecacheModel(char *s) {
|
||||||
if ( !g_forcedmodules ){
|
if ( !g_forcedmodules ){
|
||||||
g_forcedmodules = true;
|
g_forcedmodules = true;
|
||||||
@ -157,8 +157,8 @@ int C_PrecacheSound(char *s) {
|
|||||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// On InconsistentFile call forward function from plugins
|
// On InconsistentFile call forward function from plugins
|
||||||
int C_InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message )
|
int C_InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message )
|
||||||
{
|
{
|
||||||
if (FF_InconsistentFile < 0)
|
if (FF_InconsistentFile < 0)
|
||||||
RETURN_META_VALUE(MRES_IGNORED, FALSE);
|
RETURN_META_VALUE(MRES_IGNORED, FALSE);
|
||||||
@ -190,12 +190,12 @@ const char* get_localinfo( const char* name , const char* def )
|
|||||||
{
|
{
|
||||||
const char* b = LOCALINFO( (char*)name );
|
const char* b = LOCALINFO( (char*)name );
|
||||||
if ( b == 0 || *b == 0 )
|
if ( b == 0 || *b == 0 )
|
||||||
SET_LOCALINFO((char*)name,(char*)(b = def) );
|
SET_LOCALINFO((char*)name,(char*)(b = def) );
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Very first point at map load
|
// Very first point at map load
|
||||||
// Load AMX modules for new native functions
|
// Load AMX modules for new native functions
|
||||||
// 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 ) {
|
||||||
@ -214,31 +214,31 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
|
|
||||||
g_log.MapChange();
|
g_log.MapChange();
|
||||||
|
|
||||||
// ###### Initialize task manager
|
// ###### Initialize task manager
|
||||||
g_tasksMngr.registerTimers( &gpGlobals->time, &mp_timelimit->value, &g_game_timeleft );
|
g_tasksMngr.registerTimers( &gpGlobals->time, &mp_timelimit->value, &g_game_timeleft );
|
||||||
|
|
||||||
// ###### Load lang
|
// ###### Load lang
|
||||||
g_langMngr.LoadCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxmodx/data")));
|
g_langMngr.LoadCache(build_pathname("%s/dictionary.cache", get_localinfo("amxx_datadir", "addons/amxx/data")));
|
||||||
g_langMngr.Load(build_pathname("%s/languages.dat", get_localinfo("amxmodx_datadir", "addons/amxmodx/data")));
|
g_langMngr.Load(build_pathname("%s/languages.dat", get_localinfo("amxx_datadir", "addons/amxx/data")));
|
||||||
// ###### Initialize commands prefixes
|
// ###### Initialize commands prefixes
|
||||||
g_commands.registerPrefix( "amx" );
|
g_commands.registerPrefix( "amx" );
|
||||||
g_commands.registerPrefix( "amxx" );
|
g_commands.registerPrefix( "amxx" );
|
||||||
g_commands.registerPrefix( "say" );
|
g_commands.registerPrefix( "say" );
|
||||||
g_commands.registerPrefix( "admin_" );
|
g_commands.registerPrefix( "admin_" );
|
||||||
g_commands.registerPrefix( "sm_" );
|
g_commands.registerPrefix( "sm_" );
|
||||||
g_commands.registerPrefix( "cm_" );
|
g_commands.registerPrefix( "cm_" );
|
||||||
|
|
||||||
// make sure localinfos are set
|
// make sure localinfos are set
|
||||||
get_localinfo("amxx_basedir", "addons/amxmodx");
|
get_localinfo("amxx_basedir", "addons/amxx");
|
||||||
get_localinfo("amxx_pluginsdir", "addons/amxmodx/plugins");
|
get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
|
||||||
get_localinfo("amxx_modulesdir", "addons/amxmodx/modules");
|
get_localinfo("amxx_modulesdir", "addons/amxx/modules");
|
||||||
get_localinfo("amxx_configsdir", "addons/amxmodx/configs");
|
get_localinfo("amxx_configsdir", "addons/amxx/configs");
|
||||||
get_localinfo("amxx_customdir", "addons/amxmodx/custom");
|
get_localinfo("amxx_customdir", "addons/amxx/custom");
|
||||||
|
|
||||||
// ###### Load modules
|
// ###### Load modules
|
||||||
loadModules(get_localinfo("amxx_modules", "addons/amxmodx/configs/modules.ini"));
|
loadModules(get_localinfo("amxx_modules", "addons/amxx/configs/modules.ini"));
|
||||||
attachModules();
|
attachModules();
|
||||||
int loaded = countModules(CountModules_Running); // Call after attachModules so all modules don't have pending stat
|
int loaded = countModules(CountModules_Running); // Call after attachModules so all modules don't have pending stat
|
||||||
// Set some info about amx version and modules
|
// Set some info about amx version and modules
|
||||||
CVAR_SET_STRING(init_amxmodx_version.name, AMX_VERSION);
|
CVAR_SET_STRING(init_amxmodx_version.name, AMX_VERSION);
|
||||||
char buffer[32];
|
char buffer[32];
|
||||||
@ -246,7 +246,7 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
CVAR_SET_STRING(init_amxmodx_modules.name, buffer);
|
CVAR_SET_STRING(init_amxmodx_modules.name, buffer);
|
||||||
|
|
||||||
// ###### Load Vault
|
// ###### Load Vault
|
||||||
g_vault.setSource( build_pathname("%s", get_localinfo("amxx_vault", "addons/amxmodx/configs/vault.ini")) );
|
g_vault.setSource( build_pathname("%s", get_localinfo("amxx_vault", "addons/amxx/configs/vault.ini")) );
|
||||||
g_vault.loadVault( );
|
g_vault.loadVault( );
|
||||||
if (strlen(g_vault.get("server_language")) < 1)
|
if (strlen(g_vault.get("server_language")) < 1)
|
||||||
{
|
{
|
||||||
@ -268,11 +268,11 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
memset(g_players[0].flags,-1,sizeof(g_players[0].flags));
|
memset(g_players[0].flags,-1,sizeof(g_players[0].flags));
|
||||||
|
|
||||||
// ###### Load AMX scripts
|
// ###### Load AMX scripts
|
||||||
g_plugins.loadPluginsFromFile( get_localinfo("amxx_plugins", "addons/amxmodx/configs/plugins.ini") );
|
g_plugins.loadPluginsFromFile( get_localinfo("amxx_plugins", "addons/amxx/configs/plugins.ini") );
|
||||||
|
|
||||||
// Register forwards
|
// Register forwards
|
||||||
FF_PluginInit = registerForward("plugin_init", ET_IGNORE, FP_DONE);
|
FF_PluginInit = registerForward("plugin_init", ET_IGNORE, FP_DONE);
|
||||||
FF_ClientCommand = registerForward("client_command", ET_STOP, FP_CELL, FP_DONE);
|
FF_ClientCommand = registerForward("client_command", ET_IGNORE, FP_CELL, FP_DONE);
|
||||||
FF_ClientConnect = registerForward("client_connect", ET_IGNORE, FP_CELL, FP_DONE);
|
FF_ClientConnect = registerForward("client_connect", ET_IGNORE, FP_CELL, FP_DONE);
|
||||||
FF_ClientDisconnect = registerForward("client_disconnect", ET_IGNORE, FP_CELL, FP_DONE);
|
FF_ClientDisconnect = registerForward("client_disconnect", ET_IGNORE, FP_CELL, FP_DONE);
|
||||||
FF_ClientInfoChanged = registerForward("client_infochanged", ET_IGNORE, FP_CELL, FP_DONE);
|
FF_ClientInfoChanged = registerForward("client_infochanged", ET_IGNORE, FP_CELL, FP_DONE);
|
||||||
@ -292,7 +292,7 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
executeForwards(FF_PluginPrecache);
|
executeForwards(FF_PluginPrecache);
|
||||||
g_dontprecache = true;
|
g_dontprecache = true;
|
||||||
|
|
||||||
for(CList<ForceObject>::iterator a = g_forcegeneric.begin(); a ; ++a){
|
for(CList<ForceObject>::iterator a = g_forcegeneric.begin(); a ; ++a){
|
||||||
PRECACHE_GENERIC((char*)(*a).getFilename());
|
PRECACHE_GENERIC((char*)(*a).getFilename());
|
||||||
ENGINE_FORCE_UNMODIFIED((*a).getForceType(),
|
ENGINE_FORCE_UNMODIFIED((*a).getForceType(),
|
||||||
(*a).getMin(),(*a).getMax(),(*a).getFilename());
|
(*a).getMin(),(*a).getMax(),(*a).getFilename());
|
||||||
@ -358,24 +358,24 @@ int C_RegUserMsg_Post(const char *pszName, int iSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Much more later after precache. All is precached, server
|
Much more later after precache. All is precached, server
|
||||||
will be flaged as ready to use so call
|
will be flaged as ready to use so call
|
||||||
plugin_init forward function from plugins
|
plugin_init forward function from plugins
|
||||||
*/
|
*/
|
||||||
void C_ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ){
|
void C_ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ){
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
for (int i = 0; g_user_msg[ i ].name; ++i )
|
for (int i = 0; g_user_msg[ i ].name; ++i )
|
||||||
{
|
{
|
||||||
if ( (*g_user_msg[ i ].id == 0) &&
|
if ( (*g_user_msg[ i ].id == 0) &&
|
||||||
(id = GET_USER_MSG_ID(PLID, g_user_msg[ i ].name , NULL ))!=0)
|
(id = GET_USER_MSG_ID(PLID, g_user_msg[ i ].name , NULL ))!=0)
|
||||||
{
|
{
|
||||||
*g_user_msg[ i ].id = id;
|
*g_user_msg[ i ].id = id;
|
||||||
|
|
||||||
if ( !g_user_msg[ i ].cstrike || g_bmod_cstrike )
|
if ( !g_user_msg[ i ].cstrike || g_bmod_cstrike )
|
||||||
{
|
{
|
||||||
if ( g_user_msg[ i ].endmsg )
|
if ( g_user_msg[ i ].endmsg )
|
||||||
modMsgsEnd[ id ] = g_user_msg[ i ].func;
|
modMsgsEnd[ id ] = g_user_msg[ i ].func;
|
||||||
else
|
else
|
||||||
modMsgs[ id ] = g_user_msg[ i ].func;
|
modMsgs[ id ] = g_user_msg[ i ].func;
|
||||||
}
|
}
|
||||||
@ -391,17 +391,17 @@ void C_ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax )
|
|||||||
|
|
||||||
for(int i = 1; i <= gpGlobals->maxClients; ++i) {
|
for(int i = 1; i <= gpGlobals->maxClients; ++i) {
|
||||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||||
pPlayer->Init( pEdictList + i , i );
|
pPlayer->Init( pEdictList + i , i );
|
||||||
}
|
}
|
||||||
|
|
||||||
executeForwards(FF_PluginInit);
|
executeForwards(FF_PluginInit);
|
||||||
executeForwards(FF_PluginCfg);
|
executeForwards(FF_PluginCfg);
|
||||||
|
|
||||||
// ###### Save lang
|
// ###### Save lang
|
||||||
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/amxx/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/amxx/data")));
|
||||||
|
|
||||||
// Correct time in Counter-Strike and other mods (except DOD)
|
// Correct time in Counter-Strike and other mods (except DOD)
|
||||||
if ( !g_bmod_dod) g_game_timeleft = 0;
|
if ( !g_bmod_dod) g_game_timeleft = 0;
|
||||||
|
|
||||||
g_task_time = gpGlobals->time;
|
g_task_time = gpGlobals->time;
|
||||||
@ -416,8 +416,8 @@ void C_ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax )
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call plugin_end forward function from plugins.
|
// Call plugin_end forward function from plugins.
|
||||||
void C_ServerDeactivate() {
|
void C_ServerDeactivate() {
|
||||||
|
|
||||||
for(int i = 1; i <= gpGlobals->maxClients; ++i){
|
for(int i = 1; i <= gpGlobals->maxClients; ++i){
|
||||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||||
@ -458,8 +458,8 @@ void C_ServerDeactivate_Post() {
|
|||||||
g_vault.clear();
|
g_vault.clear();
|
||||||
g_xvars.clear();
|
g_xvars.clear();
|
||||||
g_plugins.clear();
|
g_plugins.clear();
|
||||||
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/amxx/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/amxx/data")));
|
||||||
g_langMngr.Clear();
|
g_langMngr.Clear();
|
||||||
// last memreport
|
// last memreport
|
||||||
#ifdef MEMORY_TEST
|
#ifdef MEMORY_TEST
|
||||||
@ -473,14 +473,14 @@ void C_ServerDeactivate_Post() {
|
|||||||
tm *curTime = localtime(&td);
|
tm *curTime = localtime(&td);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")), 0700);
|
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxx")), 0700);
|
||||||
#else
|
#else
|
||||||
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")));
|
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxx")));
|
||||||
#endif
|
#endif
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxmodx"), curTime->tm_mon + 1, curTime->tm_mday, i);
|
sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxx"), curTime->tm_mon + 1, curTime->tm_mday, i);
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
mkdir(build_pathname("%s", g_log_dir.c_str()), 0700);
|
mkdir(build_pathname("%s", g_log_dir.c_str()), 0700);
|
||||||
if (mkdir(build_pathname(buffer), 0700) < 0)
|
if (mkdir(build_pathname(buffer), 0700) < 0)
|
||||||
@ -528,7 +528,7 @@ BOOL C_ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *ps
|
|||||||
if ( a )
|
if ( a )
|
||||||
{
|
{
|
||||||
CPlayer** aa = new CPlayer*(pPlayer);
|
CPlayer** aa = new CPlayer*(pPlayer);
|
||||||
if ( aa ) g_auth.put( aa );
|
if ( aa ) g_auth.put( aa );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -738,14 +738,14 @@ void C_StartFrame_Post( void ) {
|
|||||||
tm *curTime = localtime(&td);
|
tm *curTime = localtime(&td);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")), 0700);
|
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxx")), 0700);
|
||||||
#else
|
#else
|
||||||
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxmodx")));
|
mkdir(build_pathname("%s/memreports", get_localinfo("amxx_basedir", "addons/amxx")));
|
||||||
#endif
|
#endif
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxmodx"), curTime->tm_mon + 1, curTime->tm_mday, i);
|
sprintf(buffer, "%s/memreports/D%02d%02d%03d", get_localinfo("amxx_basedir", "addons/amxx"), curTime->tm_mon + 1, curTime->tm_mday, i);
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
mkdir(build_pathname("%s", g_log_dir.c_str()), 0700);
|
mkdir(build_pathname("%s", g_log_dir.c_str()), 0700);
|
||||||
if (mkdir(build_pathname(buffer), 0700) < 0)
|
if (mkdir(build_pathname(buffer), 0700) < 0)
|
||||||
@ -1023,8 +1023,8 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
|
|||||||
gMetaFunctionTable.pfnGetEntityAPI2_Post = GetEntityAPI2_Post;
|
gMetaFunctionTable.pfnGetEntityAPI2_Post = GetEntityAPI2_Post;
|
||||||
gMetaFunctionTable.pfnGetEngineFunctions = GetEngineFunctions;
|
gMetaFunctionTable.pfnGetEngineFunctions = GetEngineFunctions;
|
||||||
gMetaFunctionTable.pfnGetEngineFunctions_Post = GetEngineFunctions_Post;
|
gMetaFunctionTable.pfnGetEngineFunctions_Post = GetEngineFunctions_Post;
|
||||||
gMetaFunctionTable.pfnGetNewDLLFunctions = GetNewDLLFunctions;
|
//gMetaFunctionTable.pfnGetNewDLLFunctions = GetNewDLLFunctions;
|
||||||
gMetaFunctionTable.pfnGetNewDLLFunctions_Post = GetNewDLLFunctions_Post;
|
//gMetaFunctionTable.pfnGetNewDLLFunctions_Post = GetNewDLLFunctions_Post;
|
||||||
|
|
||||||
memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
|
memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS));
|
||||||
gpGamedllFuncs=pGamedllFuncs;
|
gpGamedllFuncs=pGamedllFuncs;
|
||||||
@ -1050,7 +1050,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
|
|||||||
|
|
||||||
// ###### Load custom path configuration
|
// ###### Load custom path configuration
|
||||||
Vault amx_config;
|
Vault amx_config;
|
||||||
amx_config.setSource(build_pathname("%s", get_localinfo("amxx_cfg", "addons/amxmodx/configs/core.ini")));
|
amx_config.setSource(build_pathname("%s", get_localinfo("amxx_cfg", "addons/amxx/configs/core.ini")));
|
||||||
|
|
||||||
if ( amx_config.loadVault() ){
|
if ( amx_config.loadVault() ){
|
||||||
Vault::iterator a = amx_config.begin();
|
Vault::iterator a = amx_config.begin();
|
||||||
@ -1062,11 +1062,11 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ###### Initialize logging here
|
// ###### Initialize logging here
|
||||||
g_log_dir.assign(get_localinfo("amxx_logs", "addons/amxmodx/logs"));
|
g_log_dir.assign(get_localinfo("amxx_logs", "addons/amxx/logs"));
|
||||||
|
|
||||||
// ###### Now attach metamod modules
|
// ###### Now attach metamod modules
|
||||||
// This will also call modules Meta_Query and Meta_Attach functions
|
// This will also call modules Meta_Query and Meta_Attach functions
|
||||||
attachMetaModModules(now, get_localinfo("amxx_modules", "addons/amxmodx/configs/modules.ini") );
|
attachMetaModModules(now, get_localinfo("amxx_modules", "addons/amxx/configs/modules.ini") );
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@ -1281,7 +1281,7 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int
|
|||||||
/*
|
/*
|
||||||
if(*interfaceVersion!=ENGINE_INTERFACE_VERSION) {
|
if(*interfaceVersion!=ENGINE_INTERFACE_VERSION) {
|
||||||
LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
|
LOG_ERROR(PLID, "GetEngineFunctions_Post version mismatch; requested=%d ours=%d", *interfaceVersion, ENGINE_INTERFACE_VERSION);
|
||||||
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &meta_engfuncs_post, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &meta_engfuncs_post, sizeof(enginefuncs_t));
|
||||||
|
@ -384,7 +384,7 @@ int loadModules(const char* filename)
|
|||||||
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
if (!isalnum(*moduleName) || !validFile(moduleName) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxmodx/modules"), line);
|
char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
|
||||||
|
|
||||||
CList<CModule>::iterator a = g_modules.find( pathname );
|
CList<CModule>::iterator a = g_modules.find( pathname );
|
||||||
|
|
||||||
@ -703,14 +703,6 @@ char *MNF_FormatAmxString(AMX *amx, cell *params, int startParam, int *pLen)
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MNF_GetPlayerFlags(int id)
|
|
||||||
{
|
|
||||||
if (id < 1 || id > gpGlobals->maxClients)
|
|
||||||
return 0;
|
|
||||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(id);
|
|
||||||
return (pPlayer->flags[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MNF_CopyAmxMemory(cell * dest, const cell * src, int len)
|
void MNF_CopyAmxMemory(cell * dest, const cell * src, int len)
|
||||||
{
|
{
|
||||||
memcpy((void*)dest, (const void *)src, (size_t)len*sizeof(cell));
|
memcpy((void*)dest, (const void *)src, (size_t)len*sizeof(cell));
|
||||||
@ -918,7 +910,6 @@ void *Module_ReqFnptr(const char *funcName)
|
|||||||
REGISTER_FUNC("PrepareCharArray", prepareCharArray)
|
REGISTER_FUNC("PrepareCharArray", prepareCharArray)
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
REGISTER_FUNC("GetPlayerFlags", MNF_GetPlayerFlags)
|
|
||||||
REGISTER_FUNC("IsPlayerValid", MNF_IsPlayerValid)
|
REGISTER_FUNC("IsPlayerValid", MNF_IsPlayerValid)
|
||||||
REGISTER_FUNC("GetPlayerName", MNF_GetPlayerName)
|
REGISTER_FUNC("GetPlayerName", MNF_GetPlayerName)
|
||||||
REGISTER_FUNC("GetPlayerIP", MNF_GetPlayerIP)
|
REGISTER_FUNC("GetPlayerIP", MNF_GetPlayerIP)
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||||
OutputFile="debug/amxmodx_mm.dll"
|
OutputFile="debug/amxx_mm.dll"
|
||||||
Version="0.1"
|
Version="0.1"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
@ -112,8 +112,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib"
|
||||||
OutputFile="release/amxmodx_mm.dll"
|
OutputFile="release/amxx_mm.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
@ -179,8 +179,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib"
|
||||||
OutputFile="memtestdebug/amxmodx_mm.dll"
|
OutputFile="memtestdebug/amxx_mm.dll"
|
||||||
Version="0.1"
|
Version="0.1"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
@ -249,8 +249,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib"
|
||||||
OutputFile="memtestrelease/amxmodx_mm.dll"
|
OutputFile="memtestrelease/amxx_mm.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
@ -316,8 +316,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib"
|
||||||
OutputFile="jitdebug/amxmodx_mm.dll"
|
OutputFile="jitdebug/amxx_mm.dll"
|
||||||
Version="0.1"
|
Version="0.1"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
@ -387,7 +387,7 @@
|
|||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||||
OutputFile="jitrelease/amxmodx_mm.dll"
|
OutputFile="jitrelease/amxx_mm.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
@ -454,8 +454,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib"
|
||||||
OutputFile="jitmemtestrelease/amxmodx_mm.dll"
|
OutputFile="jitmemtestrelease/amxx_mm.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
@ -525,8 +525,8 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib"
|
||||||
OutputFile="MaximalSpeed/amxmodx_mm.dll"
|
OutputFile="MaximalSpeed/amxx_mm.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
AdditionalLibraryDirectories="..\extra\lib_win32"
|
AdditionalLibraryDirectories="..\extra\lib_win32"
|
||||||
|
@ -2479,7 +2479,6 @@ 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_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2531,7 +2530,6 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME);
|
REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME);
|
||||||
REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT);
|
REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT);
|
||||||
REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT);
|
REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT);
|
||||||
REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME);
|
|
||||||
|
|
||||||
// String / mem in amx scripts support
|
// String / mem in amx scripts support
|
||||||
REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING);
|
REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING);
|
||||||
@ -2578,7 +2576,6 @@ 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);
|
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -1934,7 +1926,6 @@ typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/);
|
||||||
typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/);
|
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_GET_PLAYER_CURWEAPON) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_CURWEAPON) (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*/);
|
||||||
@ -2018,7 +2009,6 @@ extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
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;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2067,7 +2057,6 @@ cell amx_ftoc (float x) { }
|
|||||||
int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
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) { }
|
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2122,7 +2111,6 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
#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
|
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,5 +2155,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -165,13 +165,8 @@ void amx_command(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_srvconsole( "%d modules, %d correct\n",modules,running);
|
print_srvconsole( "%d modules, %d correct\n",modules,running);
|
||||||
} else if (!strcmp(cmd, "jit")) {
|
}
|
||||||
#ifdef JIT
|
else if (!strcmp(cmd, "gpl"))
|
||||||
print_srvconsole("Using the JIT.\n");
|
|
||||||
#else
|
|
||||||
print_srvconsole("Not using the JIT.\n");
|
|
||||||
#endif
|
|
||||||
} else if (!strcmp(cmd, "gpl"))
|
|
||||||
{
|
{
|
||||||
print_srvconsole("AMX Mod X\n");
|
print_srvconsole("AMX Mod X\n");
|
||||||
print_srvconsole("\n");
|
print_srvconsole("\n");
|
||||||
|
@ -79,15 +79,12 @@ void UTIL_ShowMenu( edict_t* pEdict, int slots, int time, char *menu, int mlen )
|
|||||||
/* warning - don't pass here const string */
|
/* warning - don't pass here const string */
|
||||||
void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name)
|
void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name)
|
||||||
{
|
{
|
||||||
if (!gmsgMOTD)
|
if (!gmsgServerName)
|
||||||
return; // :TODO: Maybe output a warning log?
|
return; // :TODO: Maybe output a warning log?
|
||||||
|
|
||||||
if (gmsgServerName)
|
MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
|
||||||
{
|
WRITE_STRING(name);
|
||||||
MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
|
MESSAGE_END();
|
||||||
WRITE_STRING(name);
|
|
||||||
MESSAGE_END();
|
|
||||||
}
|
|
||||||
|
|
||||||
char *n = motd;
|
char *n = motd;
|
||||||
char c = 0;
|
char c = 0;
|
||||||
@ -107,12 +104,9 @@ void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name)
|
|||||||
motd = n;
|
motd = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gmsgServerName)
|
MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
|
||||||
{
|
WRITE_STRING( hostname->string );
|
||||||
MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
|
MESSAGE_END();
|
||||||
WRITE_STRING( hostname->string );
|
|
||||||
MESSAGE_END();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UTIL_IntToString(int value, char *output)
|
void UTIL_IntToString(int value, char *output)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
; Configuration file for AMX Mod X
|
; Configuration file for AMX Mod X
|
||||||
amxx_logdir addons/amxmodx/logs
|
amxx_logdir addons/amxx/logs
|
||||||
amxx_configsdir addons/amxmodx/configs
|
amxx_configsdir addons/amxx/configs
|
||||||
amxx_datadir addons/amxmodx/data
|
amxx_datadir addons/amxx/data
|
||||||
amxx_modules addons/amxmodx/configs/modules.ini
|
amxx_modules addons/amxx/configs/modules.ini
|
||||||
amxx_plugins addons/amxmodx/configs/plugins.ini
|
amxx_plugins addons/amxx/configs/plugins.ini
|
||||||
amxx_pluginsdir addons/amxmodx/plugins
|
amxx_pluginsdir addons/amxx/plugins
|
||||||
amxx_modulesdir addons/amxmodx/modules
|
amxx_modulesdir addons/amxx/modules
|
||||||
amxx_vault addons/amxmodx/data/vault.ini
|
amxx_vault addons/amxx/data/vault.ini
|
||||||
|
|
||||||
; Logging mode
|
; Logging mode
|
||||||
; 0 - no logging
|
; 0 - no logging
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
; Configuration file for AMX Mod X
|
; Configuration file for AMX Mod X
|
||||||
amxx_logdir addons/amxmodx/logs
|
amxx_logdir addons/amxx/logs
|
||||||
amxx_configsdir addons/amxmodx/configs
|
amxx_configsdir addons/amxx/configs
|
||||||
amxx_datadir addons/amxmodx/data
|
amxx_datadir addons/amxx/data
|
||||||
amxx_modules addons/amxmodx/configs/modules.ini
|
amxx_modules addons/amxx/configs/modules.ini
|
||||||
amxx_plugins addons/amxmodx/configs/plugins.ini
|
amxx_plugins addons/amxx/configs/plugins.ini
|
||||||
amxx_pluginsdir addons/amxmodx/plugins
|
amxx_pluginsdir addons/amxx/plugins
|
||||||
amxx_modulesdir addons/amxmodx/modules
|
amxx_modulesdir addons/amxx/modules
|
||||||
amxx_vault addons/amxmodx/data/vault.ini
|
amxx_vault addons/amxx/data/vault.ini
|
||||||
csstats_score addons/amxmodx/data/csstats.amxx
|
csstats_score addons/amxx/data/csstats.amxx
|
||||||
csstats addons/amxmodx/data/csstats.dat
|
csstats addons/amxx/data/csstats.dat
|
||||||
|
|
||||||
; Logging mode
|
; Logging mode
|
||||||
; 0 - no logging
|
; 0 - no logging
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
; Configuration file for AMX Mod X
|
; Configuration file for AMX Mod X
|
||||||
amxx_logdir addons/amxmodx/logs
|
amxx_logdir addons/amxx/logs
|
||||||
amxx_configsdir addons/amxmodx/configs
|
amxx_configsdir addons/amxx/configs
|
||||||
amxx_datadir addons/amxmodx/data
|
amxx_datadir addons/amxx/data
|
||||||
amxx_modules addons/amxmodx/configs/modules.ini
|
amxx_modules addons/amxx/configs/modules.ini
|
||||||
amxx_plugins addons/amxmodx/configs/plugins.ini
|
amxx_plugins addons/amxx/configs/plugins.ini
|
||||||
amxx_pluginsdir addons/amxmodx/plugins
|
amxx_pluginsdir addons/amxx/plugins
|
||||||
amxx_modulesdir addons/amxmodx/modules
|
amxx_modulesdir addons/amxx/modules
|
||||||
amxx_vault addons/amxmodx/data/vault.ini
|
amxx_vault addons/amxx/data/vault.ini
|
||||||
|
|
||||||
; Logging mode
|
; Logging mode
|
||||||
; 0 - no logging
|
; 0 - no logging
|
||||||
@ -15,5 +15,5 @@ amxx_vault addons/amxmodx/data/vault.ini
|
|||||||
; 3 - HL Logs
|
; 3 - HL Logs
|
||||||
amx_logging 1
|
amx_logging 1
|
||||||
|
|
||||||
dodstats_score addons/amxmodx/data/dodstats.amxx
|
dodstats_score addons/amxx/data/dodstats.amxx
|
||||||
dodstats addons/amxmodx/data/dodstats.dat
|
dodstats addons/amxx/data/dodstats.dat
|
@ -10,38 +10,29 @@
|
|||||||
"pausable" "0" "1" "u"
|
"pausable" "0" "1" "u"
|
||||||
"sv_voiceenable" "0" "1" "u"
|
"sv_voiceenable" "0" "1" "u"
|
||||||
"mp_chattime" "0" "1" "3" "u"
|
"mp_chattime" "0" "1" "3" "u"
|
||||||
|
"mp_logmessages" "0" "1" "u"
|
||||||
"mp_friendlyfire" "0" "1" "u"
|
"mp_friendlyfire" "0" "1" "u"
|
||||||
"mp_allowspectators" "0" "1" "u"
|
"mp_allowspectators" "0" "1" "u"
|
||||||
"mp_flashlight" "0" "1" "u"
|
|
||||||
"mp_deathmsg" "0" "1" "u"
|
"mp_deathmsg" "0" "1" "u"
|
||||||
"mp_fadetoblack" "0" "1" "u"
|
"mp_fadetoblack" "0" "1" "u"
|
||||||
"mp_tkpenalty" "0" "3" "6" "u"
|
"mp_tkpenalty" "-1" "3" "6" "u"
|
||||||
"mp_spawnbazookas" "0" "1" "u"
|
"mp_limitallies30cal" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliesgarand" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitalliesbar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliescarbine" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitalliescarbine" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliesthompson" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitalliesgarand" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliesgreasegun" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitalliesgreasegun" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliesspring" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitalliesspring" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliesbar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitalliesthompson" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitallies30cal" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitaxisfg42" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliesbazooka" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitaxisfg42s" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitalliesmortar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitaxiskar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitaxisk43" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitaxisk43" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
|
"mp_limitaxiskar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
|
"mp_limitaxismg34" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
|
"mp_limitaxismg42" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitaxismp40" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitaxismp40" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitaxismp44" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitaxismp44" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitaxisscopedkar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitaxisscopedkar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitaxisfg42" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitaxisfg42s" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitaxismg34" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitaxismg42" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_combinemglimits" "0" "1" "u"
|
|
||||||
"mp_limitaxispschreck" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitaxismortar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitbritlight" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
"mp_limitbritassault" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitbritassault" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitbritsniper" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitbritlight" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitbritmg" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitbritmg" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitbritpiat" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
"mp_limitbritsniper" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
||||||
"mp_limitbritmortar" "-1" "1" "2" "3" "4" "5" "6" "0" "u"
|
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
; Configuration file for AMX Mod X
|
; Configuration file for AMX Mod X
|
||||||
amxx_logdir addons/amxmodx/logs
|
amxx_logdir addons/amxx/logs
|
||||||
amxx_configsdir addons/amxmodx/configs
|
amxx_configsdir addons/amxx/configs
|
||||||
amxx_datadir addons/amxmodx/data
|
amxx_datadir addons/amxx/data
|
||||||
amxx_modules addons/amxmodx/configs/modules.ini
|
amxx_modules addons/amxx/configs/modules.ini
|
||||||
amxx_plugins addons/amxmodx/configs/plugins.ini
|
amxx_plugins addons/amxx/configs/plugins.ini
|
||||||
amxx_pluginsdir addons/amxmodx/plugins
|
amxx_pluginsdir addons/amxx/plugins
|
||||||
amxx_modulesdir addons/amxmodx/modules
|
amxx_modulesdir addons/amxx/modules
|
||||||
amxx_vault addons/amxmodx/data/vault.ini
|
amxx_vault addons/amxx/data/vault.ini
|
||||||
tfcstats_score addons/amxmodx/data/tfcstats.amxx
|
tfcstats_score addons/amxx/data/tfcstats.amxx
|
||||||
tfcstats addons/amxmodx/data/tfcstats.dat
|
tfcstats addons/amxx/data/tfcstats.dat
|
||||||
|
|
||||||
; Logging mode
|
; Logging mode
|
||||||
; 0 - no logging
|
; 0 - no logging
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
; Configuration file for AMX Mod X
|
; Configuration file for AMX Mod X
|
||||||
amxx_logdir addons/amxmodx/logs
|
amxx_logdir addons/amxx/logs
|
||||||
amxx_configsdir addons/amxmodx/configs
|
amxx_configsdir addons/amxx/configs
|
||||||
amxx_datadir addons/amxmodx/data
|
amxx_datadir addons/amxx/data
|
||||||
amxx_modules addons/amxmodx/configs/modules.inia
|
amxx_modules addons/amxx/configs/modules.inia
|
||||||
mxx_plugins addons/amxmodx/configs/plugins.ini
|
mxx_plugins addons/amxx/configs/plugins.ini
|
||||||
amxx_pluginsdir addons/amxmodx/plugins
|
amxx_pluginsdir addons/amxx/plugins
|
||||||
amxx_modulesdir addons/amxmodx/modules
|
amxx_modulesdir addons/amxx/modules
|
||||||
amxx_vault addons/amxmodx/data/vault.ini
|
amxx_vault addons/amxx/data/vault.ini
|
||||||
tsstats_score addons/amxmodx/data/tsstats.amxx
|
tsstats_score addons/amxx/data/tsstats.amxx
|
||||||
tsstats addons/amxmodx/data/tsstats.dat
|
tsstats addons/amxx/data/tsstats.dat
|
||||||
|
|
||||||
; Logging mode
|
; Logging mode
|
||||||
; 0 - no logging
|
; 0 - no logging
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "csstats_amxx";
|
$PROJECT = "csstats_amxx";
|
||||||
$sdk = "../../../hlsdk/SourceCode";
|
$sdk = "../../../hlsdk/SourceCode";
|
||||||
$mm = "../../../metamod/metamod";
|
$mm = "../../../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CMisc.cpp", "usermsg.cpp", "meta_api.cpp", "rank.cpp", "CRank.cpp");
|
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CMisc.cpp", "usermsg.cpp", "meta_api.cpp", "rank.cpp", "CRank.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -289,7 +289,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","addons/amxx/data/csstats.amxx");
|
||||||
if ( path && *path )
|
if ( path && *path )
|
||||||
{
|
{
|
||||||
char error[128];
|
char error[128];
|
||||||
@ -299,7 +299,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","addons/amxx/data/csstats.dat") ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "cstrike_amxx";
|
$PROJECT = "cstrike_amxx";
|
||||||
$sdk = "../hlsdk/SourceCode";
|
$sdk = "../hlsdk/SourceCode";
|
||||||
$mm = "../metamod/metamod";
|
$mm = "../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("CstrikePlayer.cpp", "cstrike.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("CstrikePlayer.cpp", "cstrike.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -265,9 +257,9 @@ void FN_META_QUERY(void);
|
|||||||
void FN_META_ATTACH(void);
|
void FN_META_ATTACH(void);
|
||||||
#endif // FN_META_ATTACH
|
#endif // FN_META_ATTACH
|
||||||
|
|
||||||
#ifdef FN_META_DETACH
|
#ifdef FN_META_DETTACH
|
||||||
void FN_META_DETACH(void);
|
void FN_META_DETTACH(void);
|
||||||
#endif // FN_META_DETACH
|
#endif // FN_META_DETTACH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1877,9 +1869,9 @@ void FN_AMXX_QUERY(void);
|
|||||||
void FN_AMXX_ATTACH(void);
|
void FN_AMXX_ATTACH(void);
|
||||||
#endif // FN_AMXX_ATTACH
|
#endif // FN_AMXX_ATTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_DETACH
|
#ifdef FN_AMXX_DETTACH
|
||||||
void FN_AMXX_DETACH(void);
|
void FN_AMXX_DETTACH(void);
|
||||||
#endif // FN_AMXX_DETACH
|
#endif // FN_AMXX_DETTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_PLUGINSLOADED
|
#ifdef FN_AMXX_PLUGINSLOADED
|
||||||
void FN_AMXX_PLUGINSLOADED(void);
|
void FN_AMXX_PLUGINSLOADED(void);
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "dodfun_amxx";
|
$PROJECT = "dodfun_amxx";
|
||||||
$sdk = "../../../hlsdk/SourceCode";
|
$sdk = "../../../hlsdk/SourceCode";
|
||||||
$mm = "../../../metamod/metamod";
|
$mm = "../../../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("CMisc.cpp", "NPD.cpp", "NBase.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("CMisc.cpp", "NPD.cpp", "NBase.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "dodx_amxx";
|
$PROJECT = "dodx_amxx";
|
||||||
$sdk = "../../../hlsdk/SourceCode";
|
$sdk = "../../../hlsdk/SourceCode";
|
||||||
$mm = "../../../metamod/metamod";
|
$mm = "../../../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -372,7 +372,7 @@ void OnAmxxAttach() {
|
|||||||
MF_AddNatives( stats_Natives );
|
MF_AddNatives( stats_Natives );
|
||||||
MF_AddNatives( base_Natives );
|
MF_AddNatives( base_Natives );
|
||||||
|
|
||||||
const char* path = get_localinfo("dodstats_score","addons/amxmodx/data/dodstats.amxx");
|
const char* path = get_localinfo("dodstats_score","addons/amxx/data/dodstats.amxx");
|
||||||
if ( path && *path ) {
|
if ( path && *path ) {
|
||||||
char error[128];
|
char error[128];
|
||||||
g_rank.loadCalc( MF_BuildPathname("%s",path) , error );
|
g_rank.loadCalc( MF_BuildPathname("%s",path) , error );
|
||||||
@ -380,7 +380,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("dodstats","addons/amxmodx/data/dodstats.dat") ) );
|
get_localinfo("dodstats","addons/amxx/data/dodstats.dat") ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
g_map.Init();
|
g_map.Init();
|
||||||
|
@ -136,4 +136,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif //_INCLUDE_CSTRING_H
|
#endif //_INCLUDE_CSTRING_H
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "engine_amxx";
|
$PROJECT = "engine_amxx";
|
||||||
$sdk = "../hlsdk/SourceCode";
|
$sdk = "../hlsdk/SourceCode";
|
||||||
$mm = "../metamod/metamod";
|
$mm = "../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "forwards.cpp", "messages.cpp", "entity.cpp", "globals.cpp", "amxxapi.cpp", "engine.cpp");
|
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "forwards.cpp", "messages.cpp", "entity.cpp", "globals.cpp", "amxxapi.cpp", "engine.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -173,6 +172,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -11,38 +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 OnAmxxDetach()
|
|
||||||
{
|
|
||||||
register unsigned int i = 0;
|
|
||||||
for (i=0; i<256; i++) {
|
|
||||||
msgHooks[i].clear();
|
|
||||||
msgBlocks[i] = 0;
|
|
||||||
}
|
|
||||||
for (i=0; i<Msg.size(); i++)
|
|
||||||
delete Msg[i];
|
|
||||||
for (i=0; i<Touches.size(); i++)
|
|
||||||
delete Touches[i];
|
|
||||||
for (i=0; i<Impulses.size(); i++)
|
|
||||||
delete Impulses[i];
|
|
||||||
for (i=0; i<Thinks.size(); i++)
|
|
||||||
delete Thinks[i];
|
|
||||||
Msg.clear();
|
|
||||||
Touches.clear();
|
|
||||||
Impulses.clear();
|
|
||||||
Thinks.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnAmxxAttach()
|
void OnAmxxAttach()
|
||||||
{
|
{
|
||||||
pfnTouchForward = 0;
|
pfnTouchForward = 0;
|
||||||
@ -214,6 +182,16 @@ void ServerDeactivate()
|
|||||||
memset(glinfo.szRealLights, 0x0, 128);
|
memset(glinfo.szRealLights, 0x0, 128);
|
||||||
glinfo.bLights = false;
|
glinfo.bLights = false;
|
||||||
glinfo.fNextLights = 0;
|
glinfo.fNextLights = 0;
|
||||||
|
Msg.clear();
|
||||||
|
register int i = 0;
|
||||||
|
for (i=0; i<256; i++) {
|
||||||
|
msgHooks[i] = 0;
|
||||||
|
msgBlocks[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Touches.clear();
|
||||||
|
Impulses.clear();
|
||||||
|
Thinks.clear();
|
||||||
|
|
||||||
// Reset all forwarding function tables (so that forwards won't be called before plugins are initialized)
|
// Reset all forwarding function tables (so that forwards won't be called before plugins are initialized)
|
||||||
g_pFunctionTable->pfnAddToFullPack=NULL;
|
g_pFunctionTable->pfnAddToFullPack=NULL;
|
||||||
@ -238,7 +216,7 @@ void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
|||||||
Msg.clear();
|
Msg.clear();
|
||||||
register int i = 0;
|
register int i = 0;
|
||||||
for (i=0; i<256; i++) {
|
for (i=0; i<256; i++) {
|
||||||
msgHooks[i].clear();
|
msgHooks[i] = 0;
|
||||||
msgBlocks[i] = 0;
|
msgBlocks[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2539,7 +2539,6 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME);
|
REQFUNC("FindAmxScriptByName", g_fn_FindAmxScriptByName, PFN_FIND_AMXSCRIPT_BYNAME);
|
||||||
REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT);
|
REQFUNC("LoadAmxScript", g_fn_LoadAmxScript, PFN_LOAD_AMXSCRIPT);
|
||||||
REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT);
|
REQFUNC("UnloadAmxScript", g_fn_UnloadAmxScript, PFN_UNLOAD_AMXSCRIPT);
|
||||||
REQFUNC("GetAmxScriptName", g_fn_GetAmxScriptName, PFN_GET_AMXSCRIPTNAME);
|
|
||||||
|
|
||||||
// String / mem in amx scripts support
|
// String / mem in amx scripts support
|
||||||
REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING);
|
REQFUNC("SetAmxString", g_fn_SetAmxString, PFN_SET_AMXSTRING);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -265,9 +257,9 @@ void FN_META_QUERY(void);
|
|||||||
void FN_META_ATTACH(void);
|
void FN_META_ATTACH(void);
|
||||||
#endif // FN_META_ATTACH
|
#endif // FN_META_ATTACH
|
||||||
|
|
||||||
#ifdef FN_META_DETACH
|
#ifdef FN_META_DETTACH
|
||||||
void FN_META_DETACH(void);
|
void FN_META_DETTACH(void);
|
||||||
#endif // FN_META_DETACH
|
#endif // FN_META_DETTACH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1877,9 +1869,9 @@ void FN_AMXX_QUERY(void);
|
|||||||
void FN_AMXX_ATTACH(void);
|
void FN_AMXX_ATTACH(void);
|
||||||
#endif // FN_AMXX_ATTACH
|
#endif // FN_AMXX_ATTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_DETACH
|
#ifdef FN_AMXX_DETTACH
|
||||||
void FN_AMXX_DETACH(void);
|
void FN_AMXX_DETTACH(void);
|
||||||
#endif // FN_AMXX_DETACH
|
#endif // FN_AMXX_DETTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_PLUGINSLOADED
|
#ifdef FN_AMXX_PLUGINSLOADED
|
||||||
void FN_AMXX_PLUGINSLOADED(void);
|
void FN_AMXX_PLUGINSLOADED(void);
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -100,7 +100,7 @@ static cell AMX_NATIVE_CALL VelocityByAim(AMX *amx, cell *params)
|
|||||||
Vector vVector = Vector(0, 0, 0);
|
Vector vVector = Vector(0, 0, 0);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ static cell AMX_NATIVE_CALL set_speak(AMX *amx, cell *params) {
|
|||||||
int iNewSpeakFlags = params[2];
|
int iNewSpeakFlags = params[2];
|
||||||
|
|
||||||
if (iIndex> 32 || !is_ent_valid(iIndex)) {
|
if (iIndex> 32 || !is_ent_valid(iIndex)) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ 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 > 32) {
|
if (!is_ent_valid(iIndex) || iIndex > 32) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,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)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,7 +382,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)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,12 +408,12 @@ static cell AMX_NATIVE_CALL attach_view(AMX *amx, cell *params)
|
|||||||
int iTargetIndex = params[2];
|
int iTargetIndex = params[2];
|
||||||
|
|
||||||
if (iIndex > 32 || !is_ent_valid(iIndex)) {
|
if (iIndex > 32 || !is_ent_valid(iIndex)) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_ent_valid(iTargetIndex)) {
|
if (!is_ent_valid(iTargetIndex)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iIndex);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,7 +430,7 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) {
|
|||||||
int iCameraType = params[2];
|
int iCameraType = params[2];
|
||||||
|
|
||||||
if (iIndex > 32 || !is_ent_valid(iIndex)) {
|
if (iIndex > 32 || !is_ent_valid(iIndex)) {
|
||||||
EngineError(amx, "Invalid player %d", iIndex);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,11 +896,36 @@ static cell AMX_NATIVE_CALL traceresult(AMX *amx, cell *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//(mahnsawce)
|
||||||
|
static cell AMX_NATIVE_CALL take_damage(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int indexa = params[1];
|
||||||
|
int indexb = params[2];
|
||||||
|
int indexc = params[3];
|
||||||
|
if (!is_ent_valid(indexa) || !is_ent_valid(indexb) || !is_ent_valid(indexc)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
REAL fnDamage = amx_ctof(params[4]);
|
||||||
|
int inType = params[5];
|
||||||
|
edict_t* pEntitya = INDEXENT2(indexa);
|
||||||
|
edict_t* pEntityb = INDEXENT2(indexb);
|
||||||
|
edict_t* pEntityc = INDEXENT2(indexc);
|
||||||
|
CBaseEntity *pCEntity = NULL;
|
||||||
|
pCEntity = CBaseEntity::Instance(INDEXENT2(indexa));
|
||||||
|
pCEntity->TakeDamage(VARS(pEntityb),VARS(pEntityc),fnDamage,inType);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AMX_NATIVE_INFO engine_Natives[] = {
|
AMX_NATIVE_INFO engine_Natives[] = {
|
||||||
{"halflife_time", halflife_time},
|
{"halflife_time", halflife_time},
|
||||||
|
|
||||||
//These are mostly from original VexD
|
//These are mostly from original VexD
|
||||||
|
|
||||||
|
// TODO: Backwards compatibility: VelocityByAim->velocity_by_aim
|
||||||
|
// RadiusDamage->radius_damage
|
||||||
|
// PointContents->point_contents
|
||||||
{"velocity_by_aim", VelocityByAim},
|
{"velocity_by_aim", VelocityByAim},
|
||||||
{"radius_damage", RadiusDamage},
|
{"radius_damage", RadiusDamage},
|
||||||
{"point_contents", PointContents},
|
{"point_contents", PointContents},
|
||||||
@ -912,6 +937,7 @@ AMX_NATIVE_INFO engine_Natives[] = {
|
|||||||
{"trace_line", trace_line},
|
{"trace_line", trace_line},
|
||||||
{"trace_hull", trace_hull},
|
{"trace_hull", trace_hull},
|
||||||
{"traceresult", traceresult},
|
{"traceresult", traceresult},
|
||||||
|
{"take_damage", take_damage},
|
||||||
|
|
||||||
{"set_speak", set_speak},
|
{"set_speak", set_speak},
|
||||||
{"get_speak", get_speak},
|
{"get_speak", get_speak},
|
||||||
|
@ -7,6 +7,11 @@
|
|||||||
#include <sdk_util.h>
|
#include <sdk_util.h>
|
||||||
#include "CVector.h"
|
#include "CVector.h"
|
||||||
#include "CString.h"
|
#include "CString.h"
|
||||||
|
#ifndef CBASEPLAYER_H
|
||||||
|
#define CBASEPLAYER_H
|
||||||
|
#include <cbase.h>
|
||||||
|
#include <player.h>
|
||||||
|
#endif
|
||||||
#include "amxxmodule.h"
|
#include "amxxmodule.h"
|
||||||
#include <usercmd.h>
|
#include <usercmd.h>
|
||||||
#include "messages.h"
|
#include "messages.h"
|
||||||
@ -172,22 +177,7 @@ inline edict_t* INDEXENT2( int iEdictNum )
|
|||||||
else
|
else
|
||||||
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
||||||
}
|
}
|
||||||
|
#define CHECK_ENTITY(x) if (x != 0 && (FNullEnt(INDEXENT2(x)) || x < 0 || x > gpGlobals->maxEntities)) { MF_RaiseAmxError(amx,AMX_ERR_NATIVE); return 0; }
|
||||||
void EngineError(AMX *amx, char *fmt, ...);
|
|
||||||
|
|
||||||
int Spawn(edict_t *pEntity);
|
|
||||||
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 KeyValue(edict_t *pEntity, KeyValueData *pkvd);
|
|
||||||
void StartFrame();
|
|
||||||
void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int random_seed);
|
|
||||||
void ClientKill(edict_t *pEntity);
|
|
||||||
void PlayerPreThink(edict_t *pEntity);
|
|
||||||
void PlayerPostThink_Post(edict_t *pEntity);
|
|
||||||
void pfnTouch(edict_t *pToucher, edict_t *pTouched);
|
|
||||||
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; }
|
|
||||||
|
|
||||||
extern bool g_inKeyValue;
|
extern bool g_inKeyValue;
|
||||||
extern KeyValueData *g_pkvd;
|
extern KeyValueData *g_pkvd;
|
||||||
@ -201,4 +191,3 @@ extern CVector<EntClass *> Thinks;
|
|||||||
extern CVector<Touch *> Touches;
|
extern CVector<Touch *> Touches;
|
||||||
|
|
||||||
#endif //_ENGINE_INCLUDE_H
|
#endif //_ENGINE_INCLUDE_H
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
MinimalRebuild="TRUE"
|
MinimalRebuild="TRUE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="5"
|
RuntimeLibrary="5"
|
||||||
StructMemberAlignment="3"
|
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="FALSE"
|
Detect64BitPortabilityProblems="FALSE"
|
||||||
@ -71,7 +70,6 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS"
|
||||||
RuntimeLibrary="4"
|
RuntimeLibrary="4"
|
||||||
StructMemberAlignment="3"
|
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="FALSE"
|
Detect64BitPortabilityProblems="FALSE"
|
||||||
|
@ -27,7 +27,7 @@ static cell AMX_NATIVE_CALL entity_range(AMX *amx, cell *params)
|
|||||||
int idxb = params[2];
|
int idxb = params[2];
|
||||||
|
|
||||||
if (!is_ent_valid(idxa) || !is_ent_valid(idxb)) {
|
if (!is_ent_valid(idxa) || !is_ent_valid(idxb)) {
|
||||||
EngineError(amx, "Invalid Entity");
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +48,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)) {
|
if (is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ static cell AMX_NATIVE_CALL fake_touch(AMX *amx, cell *params)
|
|||||||
int iPtd = params[2];
|
int iPtd = params[2];
|
||||||
|
|
||||||
if (!is_ent_valid(iPtr) || !is_ent_valid(iPtd)) {
|
if (!is_ent_valid(iPtr) || !is_ent_valid(iPtd)) {
|
||||||
EngineError(amx, "Invalid Entity");
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ static cell AMX_NATIVE_CALL force_use(AMX *amx, cell *params)
|
|||||||
int iPtd = params[2];
|
int iPtd = params[2];
|
||||||
|
|
||||||
if (!is_ent_valid(iPtr) || !is_ent_valid(iPtd)) {
|
if (!is_ent_valid(iPtr) || !is_ent_valid(iPtd)) {
|
||||||
EngineError(amx, "Invalid Entity");
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ static cell AMX_NATIVE_CALL DispatchKeyValue(AMX *amx, cell *params)
|
|||||||
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)) {
|
if (!is_ent_valid(iValue)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iValue);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
edict_t *pEntity = INDEXENT2(iValue);
|
edict_t *pEntity = INDEXENT2(iValue);
|
||||||
@ -173,7 +173,7 @@ static cell AMX_NATIVE_CALL get_keyvalue(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int idx = params[1];
|
int idx = params[1];
|
||||||
if (!is_ent_valid(idx)) {
|
if (!is_ent_valid(idx)) {
|
||||||
EngineError(amx, "Invalid Entity %d", idx);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
edict_t *pEntity = INDEXENT2(idx);
|
edict_t *pEntity = INDEXENT2(idx);
|
||||||
@ -203,7 +203,7 @@ static cell AMX_NATIVE_CALL DispatchSpawn(AMX *amx, cell *params)
|
|||||||
int iEnt = params[1];
|
int iEnt = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ static cell AMX_NATIVE_CALL entity_get_float(AMX *amx, cell *params)
|
|||||||
REAL fVal = 0;
|
REAL fVal = 0;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,7 +359,7 @@ static cell AMX_NATIVE_CALL entity_set_float(AMX *amx, cell *params)
|
|||||||
REAL fVal = amx_ctof(params[3]);
|
REAL fVal = amx_ctof(params[3]);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ static cell AMX_NATIVE_CALL entity_get_int(AMX *amx, cell *params)
|
|||||||
int iRetValue = 0;
|
int iRetValue = 0;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -613,7 +613,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_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -628,7 +628,7 @@ static cell AMX_NATIVE_CALL entity_set_int(AMX *amx, cell *params)
|
|||||||
int iNewValue = params[3];
|
int iNewValue = params[3];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,7 +763,7 @@ static cell AMX_NATIVE_CALL entity_get_vector(AMX *amx, cell *params)
|
|||||||
Vector vRetValue = Vector(0, 0, 0);
|
Vector vRetValue = Vector(0, 0, 0);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -859,7 +859,7 @@ static cell AMX_NATIVE_CALL entity_set_vector(AMX *amx, cell *params)
|
|||||||
cell *vAmx = MF_GetAmxAddr(amx, params[3]);
|
cell *vAmx = MF_GetAmxAddr(amx, params[3]);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -956,7 +956,7 @@ static cell AMX_NATIVE_CALL entity_get_string(AMX *amx, cell *params)
|
|||||||
const char *szRet = NULL;
|
const char *szRet = NULL;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1021,7 +1021,7 @@ static cell AMX_NATIVE_CALL entity_set_string(AMX *amx, cell *params)
|
|||||||
int iszString = AmxStringToEngine(amx, params[3], iLen);
|
int iszString = AmxStringToEngine(amx, params[3], iLen);
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1083,7 +1083,7 @@ static cell AMX_NATIVE_CALL entity_get_edict(AMX *amx, cell *params)
|
|||||||
edict_t *pRet;
|
edict_t *pRet;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1142,7 +1142,7 @@ static cell AMX_NATIVE_CALL entity_set_edict(AMX *amx, cell *params)
|
|||||||
int iSetEnt = params[3];
|
int iSetEnt = params[3];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt) || !is_ent_valid(iSetEnt)) {
|
if (!is_ent_valid(iEnt) || !is_ent_valid(iSetEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1199,7 +1199,7 @@ static cell AMX_NATIVE_CALL entity_get_byte(AMX *amx, cell *params)
|
|||||||
int iRetValue = 0;
|
int iRetValue = 0;
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1240,7 +1240,7 @@ static cell AMX_NATIVE_CALL entity_set_byte(AMX *amx, cell *params)
|
|||||||
int iNewValue = params[3];
|
int iNewValue = params[3];
|
||||||
|
|
||||||
if (!is_ent_valid(iEnt)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1284,7 +1284,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)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1306,7 +1306,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)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1328,7 +1328,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)) {
|
if (!is_ent_valid(iEnt)) {
|
||||||
EngineError(amx, "Invalid Entity %d", iEnt);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1351,6 +1351,167 @@ static cell AMX_NATIVE_CALL entity_set_size(AMX *amx, cell *params)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************
|
||||||
|
Offset control natives
|
||||||
|
***********************/
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_offset_short(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return *((short *)pEnt->pvPrivateData + off);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL set_offset_short(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
*((short *)pEnt->pvPrivateData + off) = (short)params[3];
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_offset_char(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char r = *((char *)pEnt->pvPrivateData + off);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL set_offset_char(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char data = params[3];
|
||||||
|
*((char *)pEnt->pvPrivateData + off) = data;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_offset_int(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return *((int *)pEnt->pvPrivateData + off);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL set_offset_int(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
*((int *)pEnt->pvPrivateData + off) = params[3];
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_offset_float(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
REAL fRet = (REAL)(*((REAL*)pEnt->pvPrivateData + off));
|
||||||
|
|
||||||
|
return amx_ftoc(fRet);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL set_offset_float(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int idx = params[1];
|
||||||
|
int off = params[2];
|
||||||
|
|
||||||
|
if (!is_ent_valid(idx)) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
edict_t *pEnt = INDEXENT2(idx);
|
||||||
|
#ifdef __linux__
|
||||||
|
off += params[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
REAL fVal = amx_ctof(params[3]);
|
||||||
|
*((float *)pEnt->pvPrivateData + off) = fVal;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_entity_pointer(AMX *amx, cell *params) // get_entity_pointer(index, pointer[], len); = 3 params
|
static cell AMX_NATIVE_CALL get_entity_pointer(AMX *amx, cell *params) // get_entity_pointer(index, pointer[], len); = 3 params
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@ -1365,7 +1526,7 @@ static cell AMX_NATIVE_CALL find_ent_in_sphere(AMX *amx, cell *params)
|
|||||||
int idx = params[1];
|
int idx = params[1];
|
||||||
|
|
||||||
if (!is_ent_valid(idx)) {
|
if (!is_ent_valid(idx)) {
|
||||||
EngineError(amx, "Invalid Entity %d", idx);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1417,7 +1578,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])) {
|
if (!is_ent_valid(params[1])) {
|
||||||
EngineError(amx, "Invalid Entity %d", params[1]);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1528,7 +1689,7 @@ static cell AMX_NATIVE_CALL find_ent_by_owner(AMX *amx, cell *params) // native
|
|||||||
int oEnt = params[3];
|
int oEnt = params[3];
|
||||||
// Check index to start searching at, 0 must be possible.
|
// Check index to start searching at, 0 must be possible.
|
||||||
if (!is_ent_valid(iEnt) || !is_ent_valid(oEnt)) {
|
if (!is_ent_valid(iEnt) || !is_ent_valid(oEnt)) {
|
||||||
EngineError(amx, "Invalid Entity");
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1566,7 +1727,7 @@ static cell AMX_NATIVE_CALL get_grenade_id(AMX *amx, cell *params) /* 4 param *
|
|||||||
char* szModel;
|
char* szModel;
|
||||||
|
|
||||||
if (!is_ent_valid(index)) {
|
if (!is_ent_valid(index)) {
|
||||||
EngineError(amx, "Invalid Entity %d", index);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1619,6 +1780,16 @@ AMX_NATIVE_INFO ent_Natives[] = {
|
|||||||
{"fake_touch", fake_touch},
|
{"fake_touch", fake_touch},
|
||||||
{"force_use", force_use},
|
{"force_use", force_use},
|
||||||
|
|
||||||
|
{"get_offset_short", get_offset_short},
|
||||||
|
{"set_offset_short", set_offset_short},
|
||||||
|
{"get_offset_char", get_offset_char},
|
||||||
|
{"set_offset_char", set_offset_char},
|
||||||
|
{"get_offset", get_offset_int},
|
||||||
|
{"set_offset", set_offset_int},
|
||||||
|
{"get_offset_int", get_offset_int},
|
||||||
|
{"set_offset_int", set_offset_int},
|
||||||
|
{"get_offset_float", get_offset_float},
|
||||||
|
{"set_offset_float", set_offset_float},
|
||||||
{"get_entity_pointer", get_entity_pointer},
|
{"get_entity_pointer", get_entity_pointer},
|
||||||
|
|
||||||
{"find_ent_in_sphere", find_ent_in_sphere},
|
{"find_ent_in_sphere", find_ent_in_sphere},
|
||||||
@ -1635,4 +1806,3 @@ AMX_NATIVE_INFO ent_Natives[] = {
|
|||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
///////////////////
|
///////////////////
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ int fstrcmp(const char *s1, const char *s2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Spawn(edict_t *pEntity) {
|
int Spawn(edict_t *pEntity) {
|
||||||
if (SpawnForward != -1) {
|
if (SpawnForward) {
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
int id = ENTINDEX(pEntity);
|
int id = ENTINDEX(pEntity);
|
||||||
retVal = MF_ExecuteForward(SpawnForward, id);
|
retVal = MF_ExecuteForward(SpawnForward, id);
|
||||||
@ -49,7 +49,7 @@ int Spawn(edict_t *pEntity) {
|
|||||||
|
|
||||||
void ChangeLevel(char* s1, char* s2)
|
void ChangeLevel(char* s1, char* s2)
|
||||||
{
|
{
|
||||||
if (ChangelevelForward != -1) {
|
if (ChangelevelForward) {
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
char *map = s1;
|
char *map = s1;
|
||||||
retVal = MF_ExecuteForward(ChangelevelForward, map);
|
retVal = MF_ExecuteForward(ChangelevelForward, map);
|
||||||
@ -61,7 +61,7 @@ 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)
|
||||||
{
|
{
|
||||||
if (PlaybackForward != -1) {
|
if (PlaybackForward) {
|
||||||
edict_t *e = (edict_t *)pInvoker;
|
edict_t *e = (edict_t *)pInvoker;
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
static cell cOrigin[3];
|
static cell cOrigin[3];
|
||||||
@ -90,14 +90,16 @@ void KeyValue(edict_t *pEntity, KeyValueData *pkvd)
|
|||||||
g_inKeyValue=true;
|
g_inKeyValue=true;
|
||||||
g_pkvd=pkvd;
|
g_pkvd=pkvd;
|
||||||
int index = ENTINDEX(pEntity);
|
int index = ENTINDEX(pEntity);
|
||||||
if (DispatchKeyForward != -1) {
|
if (DispatchKeyForward) {
|
||||||
retVal = MF_ExecuteForward(DispatchKeyForward, index);
|
retVal = MF_ExecuteForward(DispatchKeyForward, index);
|
||||||
g_inKeyValue=false;
|
g_inKeyValue=false;
|
||||||
if (retVal)
|
if (retVal > 0)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
|
else
|
||||||
|
RETURN_META(MRES_HANDLED);
|
||||||
}
|
}
|
||||||
g_inKeyValue=false;
|
g_inKeyValue=false;
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_HANDLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartFrame()
|
void StartFrame()
|
||||||
@ -109,9 +111,9 @@ void StartFrame()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StartFrameForward != -1)
|
if (StartFrameForward)
|
||||||
MF_ExecuteForward(StartFrameForward);
|
MF_ExecuteForward(StartFrameForward);
|
||||||
else if (VexdServerForward != -1)
|
else if (VexdServerForward)
|
||||||
MF_ExecuteForward(VexdServerForward);
|
MF_ExecuteForward(VexdServerForward);
|
||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
@ -123,25 +125,20 @@ void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int
|
|||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
edict_t *pEntity = (edict_t *)player;
|
edict_t *pEntity = (edict_t *)player;
|
||||||
struct usercmd_s *g_cmd = (struct usercmd_s *)_cmd;
|
struct usercmd_s *g_cmd = (struct usercmd_s *)_cmd;
|
||||||
META_RES res = MRES_IGNORED;
|
|
||||||
int origImpulse = g_cmd->impulse; // incase a plugin alters it
|
|
||||||
for (i=0; i<Impulses.size(); i++)
|
for (i=0; i<Impulses.size(); i++)
|
||||||
{
|
{
|
||||||
if (Impulses[i]->Check == g_cmd->impulse)
|
if (Impulses[i]->Check == g_cmd->impulse)
|
||||||
{
|
{
|
||||||
retVal = MF_ExecuteForward(Impulses[i]->Forward, ENTINDEX(pEntity));
|
retVal = MF_ExecuteForward(Impulses[i]->Forward, ENTINDEX(pEntity));
|
||||||
if (retVal & 2 /*PLUGIN_HANDLED_MAIN*/)
|
if (retVal)
|
||||||
{
|
|
||||||
g_cmd->impulse=0;
|
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
}
|
else
|
||||||
else if (retVal)
|
RETURN_META(MRES_IGNORED);
|
||||||
res = MRES_SUPERCEDE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CmdStartForward != -1) {
|
if (CmdStartForward) {
|
||||||
incmd = true;
|
incmd = true;
|
||||||
retVal = MF_ExecuteForward(CmdStartForward, ENTINDEX(pEntity), origImpulse);
|
retVal = MF_ExecuteForward(CmdStartForward, ENTINDEX(pEntity), g_cmd->impulse);
|
||||||
incmd = false;
|
incmd = false;
|
||||||
if (retVal) {
|
if (retVal) {
|
||||||
g_cmd->impulse = 0;
|
g_cmd->impulse = 0;
|
||||||
@ -149,14 +146,14 @@ void CmdStart(const edict_t *player, const struct usercmd_s *_cmd, unsigned int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_META(res);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientKill(edict_t *pEntity)
|
void ClientKill(edict_t *pEntity)
|
||||||
{
|
{
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
|
|
||||||
if (ClientKillForward != -1) {
|
if (ClientKillForward) {
|
||||||
retVal = MF_ExecuteForward(ClientKillForward, ENTINDEX(pEntity));
|
retVal = MF_ExecuteForward(ClientKillForward, ENTINDEX(pEntity));
|
||||||
if (retVal)
|
if (retVal)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
@ -170,7 +167,6 @@ void PlayerPreThink(edict_t *pEntity)
|
|||||||
MF_ExecuteForward(PlayerPreThinkForward, ENTINDEX(pEntity));
|
MF_ExecuteForward(PlayerPreThinkForward, ENTINDEX(pEntity));
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerPostThink_Post(edict_t *pEntity)
|
void PlayerPostThink_Post(edict_t *pEntity)
|
||||||
{
|
{
|
||||||
if(plinfo[ENTINDEX(pEntity)].pViewEnt) {
|
if(plinfo[ENTINDEX(pEntity)].pViewEnt) {
|
||||||
@ -210,7 +206,7 @@ void PlayerPostThink_Post(edict_t *pEntity)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PlayerPostThinkForward != -1)
|
if (PlayerPostThinkForward)
|
||||||
{
|
{
|
||||||
if (MF_ExecuteForward(PlayerPostThinkForward, ENTINDEX(pEntity)))
|
if (MF_ExecuteForward(PlayerPostThinkForward, ENTINDEX(pEntity)))
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
@ -225,7 +221,6 @@ void pfnTouch(edict_t *pToucher, edict_t *pTouched)
|
|||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
const char *ptrClass = STRING(pToucher->v.classname);
|
const char *ptrClass = STRING(pToucher->v.classname);
|
||||||
const char *ptdClass = STRING(pTouched->v.classname);
|
const char *ptdClass = STRING(pTouched->v.classname);
|
||||||
META_RES res=MRES_IGNORED;
|
|
||||||
for (i=0; i<Touches.size(); i++)
|
for (i=0; i<Touches.size(); i++)
|
||||||
{
|
{
|
||||||
if (Touches[i]->Toucher == 0)
|
if (Touches[i]->Toucher == 0)
|
||||||
@ -233,68 +228,61 @@ void pfnTouch(edict_t *pToucher, edict_t *pTouched)
|
|||||||
if (Touches[i]->Touched == 0)
|
if (Touches[i]->Touched == 0)
|
||||||
{
|
{
|
||||||
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
||||||
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
|
if (retVal)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
else if (retVal)
|
else
|
||||||
res=MRES_SUPERCEDE;
|
RETURN_META(MRES_IGNORED);
|
||||||
} else if (fstrcmp(Touches[i]->Touched, ptdClass)) {
|
} else if (fstrcmp(Touches[i]->Touched, ptdClass)) {
|
||||||
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
||||||
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
|
if (retVal)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
else if (retVal)
|
else
|
||||||
res=MRES_SUPERCEDE;
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
} else if (fstrcmp(Touches[i]->Toucher, ptrClass)) {
|
} else if (fstrcmp(Touches[i]->Toucher, ptrClass)) {
|
||||||
if (Touches[i]->Touched == 0)
|
if (Touches[i]->Touched == 0)
|
||||||
{
|
{
|
||||||
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
||||||
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
|
if (retVal)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
else if (retVal)
|
else
|
||||||
res=MRES_SUPERCEDE;
|
RETURN_META(MRES_IGNORED);
|
||||||
} else if (fstrcmp(Touches[i]->Touched, ptdClass)) {
|
} else if (fstrcmp(Touches[i]->Touched, ptdClass)) {
|
||||||
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
retVal = MF_ExecuteForward(Touches[i]->Forward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
||||||
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
|
if (retVal)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
else if (retVal)
|
else
|
||||||
res=MRES_SUPERCEDE;
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Execute pfnTouch forwards */
|
/* Execute pfnTouch forwards */
|
||||||
if (pfnTouchForward != -1) {
|
if (pfnTouchForward) {
|
||||||
retVal = MF_ExecuteForward(pfnTouchForward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
retVal = MF_ExecuteForward(pfnTouchForward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
||||||
if (retVal)
|
if (retVal)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
} else if (VexdTouchForward != -1) {
|
} else if (VexdTouchForward) {
|
||||||
retVal = MF_ExecuteForward(VexdTouchForward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
retVal = MF_ExecuteForward(VexdTouchForward, ENTINDEX(pToucher), ENTINDEX(pTouched));
|
||||||
if (retVal)
|
if (retVal)
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_META(res);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Think(edict_t *pent)
|
void Think(edict_t *pent)
|
||||||
{
|
{
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
const char *cls = STRING(pent->v.classname);
|
const char *cls = STRING(pent->v.classname);
|
||||||
META_RES res=MRES_IGNORED;
|
|
||||||
int retVal=0;
|
|
||||||
for (i=0; i<Thinks.size(); i++)
|
for (i=0; i<Thinks.size(); i++)
|
||||||
{
|
{
|
||||||
if (fstrcmp(cls, Thinks[i]->Class))
|
if (fstrcmp(cls, Thinks[i]->Class))
|
||||||
{
|
{
|
||||||
retVal=MF_ExecuteForward(Thinks[i]->Forward, ENTINDEX(pent));
|
MF_ExecuteForward(Thinks[i]->Forward, ENTINDEX(pent));
|
||||||
if (retVal & 2/*PLUGIN_HANDLED_MAIN*/)
|
RETURN_META(MRES_IGNORED);
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
|
||||||
else if (retVal)
|
|
||||||
res=MRES_SUPERCEDE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
retVal=MF_ExecuteForward(pfnThinkForward, ENTINDEX(pent));
|
MF_ExecuteForward(pfnThinkForward, ENTINDEX(pent));
|
||||||
if (retVal)
|
|
||||||
res=MRES_SUPERCEDE;
|
|
||||||
|
|
||||||
RETURN_META(res);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
CVector<argMsg*> Msg;
|
CVector<argMsg*> Msg;
|
||||||
CVector<int> msgHooks[256];
|
int msgHooks[256] = {0};
|
||||||
//int msgHooks[256] = {0};
|
|
||||||
int msgBlocks[256] = {0};
|
int msgBlocks[256] = {0};
|
||||||
int msgDest;
|
int msgDest;
|
||||||
int msgType;
|
int msgType;
|
||||||
@ -95,7 +94,7 @@ void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
|
|||||||
if (msgBlocks[msg_type]) {
|
if (msgBlocks[msg_type]) {
|
||||||
inblock = true;
|
inblock = true;
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
} else if (msgHooks[msg_type].size()) {
|
} else if (msgHooks[msg_type]) {
|
||||||
inhook = true;
|
inhook = true;
|
||||||
msgCount = 0;
|
msgCount = 0;
|
||||||
msgDest = msg_dest;
|
msgDest = msg_dest;
|
||||||
@ -270,7 +269,7 @@ void WriteEntity(int iValue)
|
|||||||
|
|
||||||
void MessageEnd(void)
|
void MessageEnd(void)
|
||||||
{
|
{
|
||||||
int mres = 0, mresB = 0;
|
int mres = 0;
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
if (inblock) {
|
if (inblock) {
|
||||||
inblock = false;
|
inblock = false;
|
||||||
@ -278,12 +277,7 @@ void MessageEnd(void)
|
|||||||
msgBlocks[msgType] = BLOCK_NOT;
|
msgBlocks[msgType] = BLOCK_NOT;
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
} else if (inhook) {
|
} else if (inhook) {
|
||||||
for (i=0; i<msgHooks[msgType].size(); i++)
|
mres = MF_ExecuteForward(msgHooks[msgType], msgType, msgDest, ENTINDEX(msgpEntity));
|
||||||
{
|
|
||||||
mresB = MF_ExecuteForward(msgHooks[msgType].at(i), msgType, msgDest, ENTINDEX(msgpEntity));
|
|
||||||
if (mresB > mres)
|
|
||||||
mres = mresB;
|
|
||||||
}
|
|
||||||
inhook = false;
|
inhook = false;
|
||||||
if (mres & 1)
|
if (mres & 1)
|
||||||
{
|
{
|
||||||
@ -308,13 +302,9 @@ static cell AMX_NATIVE_CALL register_message(AMX *amx, cell *params)
|
|||||||
int len;
|
int len;
|
||||||
if (params[1]>0 && params[1] < 256) {
|
if (params[1]>0 && params[1] < 256) {
|
||||||
int id = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
int id = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
||||||
if (id != -1)
|
// MF_Log("Registering message %d with result %d", params[1], id);
|
||||||
{
|
msgHooks[params[1]] = id;
|
||||||
msgHooks[params[1]].push_back(id);
|
return id;
|
||||||
return id;
|
|
||||||
} else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -387,8 +377,7 @@ static cell AMX_NATIVE_CALL set_msg_arg_int(AMX *amx, cell *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Msg[argn]->type = params[2];
|
Msg[argn]->iData = params[2];
|
||||||
Msg[argn]->iData = params[3];
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
extern AMX_NATIVE_INFO msg_Natives[];
|
extern AMX_NATIVE_INFO msg_Natives[];
|
||||||
extern CVector<argMsg*> Msg;
|
extern CVector<argMsg*> Msg;
|
||||||
extern CVector<int> msgHooks[256];
|
extern int msgHooks[256];
|
||||||
extern int msgBlocks[256];
|
extern int msgBlocks[256];
|
||||||
|
|
||||||
#endif //_MSGS_INCLUDE_H
|
#endif //_MSGS_INCLUDE_H
|
||||||
|
@ -54,12 +54,12 @@
|
|||||||
// (wd) are Will Day's notes
|
// (wd) are Will Day's notes
|
||||||
// - GetEntityAPI2 functions
|
// - GetEntityAPI2 functions
|
||||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||||
//#define FN_DispatchSpawn Spawn /* pfnSpawn() */
|
#define FN_DispatchSpawn Spawn /* pfnSpawn() */
|
||||||
//#define FN_DispatchThink Think /* pfnThink() */
|
#define FN_DispatchThink Think /* pfnThink() */
|
||||||
// #define FN_DispatchUse Use /* pfnUse() */
|
// #define FN_DispatchUse Use /* pfnUse() */
|
||||||
//#define FN_DispatchTouch pfnTouch /* pfnTouch() */
|
#define FN_DispatchTouch pfnTouch /* pfnTouch() */
|
||||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||||
//#define FN_DispatchKeyValue KeyValue /* pfnKeyValue() */
|
#define FN_DispatchKeyValue KeyValue /* pfnKeyValue() */
|
||||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||||
@ -70,15 +70,15 @@
|
|||||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||||
#define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
#define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||||
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||||
//#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
#define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||||
#define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
#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_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||||
//#define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
#define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||||
//#define FN_StartFrame StartFrame /* pfnStartFrame() */
|
#define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||||
@ -96,7 +96,7 @@
|
|||||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (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_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||||
//#define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
#define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||||
@ -129,7 +129,7 @@
|
|||||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||||
//#define FN_PlayerPostThink_Post PlayerPostThink_Post
|
#define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||||
// #define FN_StartFrame_Post StartFrame_Post
|
// #define FN_StartFrame_Post StartFrame_Post
|
||||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||||
@ -280,7 +280,7 @@
|
|||||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||||
// #define FN_PrecacheEvent PrecacheEvent
|
// #define FN_PrecacheEvent PrecacheEvent
|
||||||
//#define FN_PlaybackEvent PlaybackEvent
|
#define FN_PlaybackEvent PlaybackEvent
|
||||||
// #define FN_SetFatPVS SetFatPVS
|
// #define FN_SetFatPVS SetFatPVS
|
||||||
// #define FN_SetFatPAS SetFatPAS
|
// #define FN_SetFatPAS SetFatPAS
|
||||||
// #define FN_CheckVisibility CheckVisibility
|
// #define FN_CheckVisibility CheckVisibility
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "fakemeta_amxx";
|
$PROJECT = "fakemeta_amxx";
|
||||||
$sdk = "../../hlsdk/SourceCode";
|
$sdk = "../../hlsdk/SourceCode";
|
||||||
$mm = "../../metamod/metamod";
|
$mm = "../../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("dllfunc.cpp", "fakemeta_amxx.cpp", "forward.cpp", "pdata.cpp", "pev.cpp", "engfunc.cpp", "sdk/amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("dllfunc.cpp", "fakemeta_amxx.cpp", "forward.cpp", "pdata.cpp", "pev.cpp", "engfunc.cpp", "sdk/amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -140,11 +139,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -166,7 +165,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -178,6 +177,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -32,7 +32,7 @@ native set_pdata_float(_index,_Offset,Float:_Value,_linuxdiff=5);
|
|||||||
native register_forward(_forwardType,_function[],_post=0);
|
native register_forward(_forwardType,_function[],_post=0);
|
||||||
|
|
||||||
/* Returns data for metamod */
|
/* Returns data for metamod */
|
||||||
native forward_return(type,{Float,_}:...);
|
native forward_return(type,{Float:_}...);
|
||||||
|
|
||||||
native engfunc(type,{Float,_}:...);
|
native engfunc(type,{Float,_}:...);
|
||||||
native dllfunc(type,{Float,_}:...);
|
native dllfunc(type,{Float,_}:...);
|
@ -1,10 +1,10 @@
|
|||||||
/* Fake meta constants
|
/* Fake meta constants
|
||||||
* This file is provided as-is (no warrenties)
|
* This file is provided as-is (no warrenties)
|
||||||
*/
|
*/
|
||||||
#if defined _fakemeta_const_included
|
#if defined _fakemeta_included
|
||||||
#endinput
|
#endinput
|
||||||
#endif
|
#endif
|
||||||
#define _fakemeta_const_included
|
#define _fakemeta_included
|
||||||
|
|
||||||
// For forward_return
|
// For forward_return
|
||||||
#define FMV_STRING 1
|
#define FMV_STRING 1
|
||||||
@ -12,17 +12,14 @@
|
|||||||
#define FMV_CELL 3
|
#define FMV_CELL 3
|
||||||
|
|
||||||
|
|
||||||
/* The actual return value of the function, use these instead of PLUGIN_HANDLED etc when
|
// The actual return value of the function
|
||||||
* returning from registered forwards.
|
|
||||||
*/
|
|
||||||
#define FMRES_HANDLED 2
|
#define FMRES_HANDLED 2
|
||||||
#define FMRES_SUPERCEDE 4
|
#define FMRES_SUPERCEDE 4
|
||||||
#define FMRES_IGNORED 1
|
#define FMRES_IGNORED 1
|
||||||
#define FMRES_OVERRIDE 3
|
#define FMRES_OVERRIDE 3
|
||||||
|
|
||||||
|
|
||||||
/* Used with engfunc()
|
|
||||||
*/
|
|
||||||
enum {
|
enum {
|
||||||
EngFunc_PrecacheModel, // int ) (char* s);
|
EngFunc_PrecacheModel, // int ) (char* s);
|
||||||
EngFunc_PrecacheSound, // int ) (char* s);
|
EngFunc_PrecacheSound, // int ) (char* s);
|
||||||
@ -102,8 +99,6 @@ enum {
|
|||||||
EngFunc_SetClientKeyValue // void ) (int clientIndex, char *infobuffer, char *key, char *value);
|
EngFunc_SetClientKeyValue // void ) (int clientIndex, char *infobuffer, char *key, char *value);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Used with dllfunc()
|
|
||||||
*/
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
DLLFunc_GameInit, // void) ( void );
|
DLLFunc_GameInit, // void) ( void );
|
||||||
@ -148,157 +143,154 @@ enum
|
|||||||
DLLFunc_GetHullBounds, // int) ( int hullnumber, float *mins, float *maxs );
|
DLLFunc_GetHullBounds, // int) ( int hullnumber, float *mins, float *maxs );
|
||||||
|
|
||||||
// Create baselines for certain "unplaced" items.
|
// Create baselines for certain "unplaced" items.
|
||||||
DLLFunc_CreateInstancedBaseline, // void ) ( void );
|
DLLFunc_CreateInstancedBaselines, // void ) ( void );
|
||||||
DLLFunc_pfnAllowLagCompensation, // int )( void );
|
DLLFunc_pfnAllowLagCompensation, // int )( void );
|
||||||
// I know this does not fit with DLLFUNC(), but I dont want another native just for it.
|
// I know this does not fit with DLLFUNC(), but I dont want another native just for it.
|
||||||
MetaFunc_CallGameEntity // bool (plid_t plid, const char *entStr,entvars_t *pev);
|
MetaFunc_CallGameEntity // bool (plid_t plid, const char *entStr,entvars_t *pev);
|
||||||
};
|
};
|
||||||
enum {
|
enum {
|
||||||
pev_string_start = 0,
|
pev_string_start = 0,
|
||||||
pev_classname,
|
classname,
|
||||||
pev_globalname,
|
globalname,
|
||||||
pev_model,
|
model,
|
||||||
pev_target,
|
target,
|
||||||
pev_targetname,
|
targetname,
|
||||||
pev_netname,
|
netname,
|
||||||
pev_message,
|
message,
|
||||||
pev_noise,
|
noise,
|
||||||
pev_noise1,
|
noise1,
|
||||||
pev_noise2,
|
noise2,
|
||||||
pev_noise3,
|
noise3,
|
||||||
pev_string_end,
|
pev_string_end,
|
||||||
pev_edict_start,
|
pev_edict_start,
|
||||||
pev_chain,
|
chain,
|
||||||
pev_dmg_inflictor,
|
dmg_inflictor,
|
||||||
pev_enemy,
|
enemy,
|
||||||
pev_aiment,
|
aiment,
|
||||||
pev_owner,
|
owner,
|
||||||
pev_groundentity,
|
groundentity,
|
||||||
pev_euser1,
|
euser1,
|
||||||
pev_euser2,
|
euser2,
|
||||||
pev_euser3,
|
euser3,
|
||||||
pev_euser4,
|
euser4,
|
||||||
pev_edict_end,
|
pev_edict_end,
|
||||||
pev_float_start,
|
pev_float_start,
|
||||||
pev_impacttime,
|
impacttime,
|
||||||
pev_starttime,
|
starttime,
|
||||||
pev_idealpitch,
|
idealpitch,
|
||||||
pev_pitch_speed,
|
pitch_speed,
|
||||||
pev_yaw_speed,
|
yaw_speed,
|
||||||
pev_ltime,
|
ltime,
|
||||||
pev_nextthink,
|
nextthink,
|
||||||
pev_gravity,
|
gravity,
|
||||||
pev_friction,
|
friction,
|
||||||
pev_frame,
|
frame,
|
||||||
pev_animtime,
|
animtime,
|
||||||
pev_framerate,
|
framerate,
|
||||||
pev_scale,
|
scale,
|
||||||
pev_renderamt,
|
renderamt,
|
||||||
pev_health,
|
health,
|
||||||
pev_frags,
|
frags,
|
||||||
pev_takedamage,
|
takedamage,
|
||||||
pev_max_health,
|
max_health,
|
||||||
pev_teleport_time,
|
teleport_time,
|
||||||
pev_armortype,
|
armortype,
|
||||||
pev_armorvalue,
|
armorvalue,
|
||||||
pev_dmg_take,
|
dmg_take,
|
||||||
pev_dmg_save,
|
dmg_save,
|
||||||
pev_dmg,
|
dmg,
|
||||||
pev_dmgtime,
|
dmgtime,
|
||||||
pev_speed,
|
speed,
|
||||||
pev_air_finished,
|
air_finished,
|
||||||
pev_pain_finished,
|
pain_finished,
|
||||||
pev_radsuit_finished,
|
radsuit_finished,
|
||||||
pev_maxspeed,
|
maxspeed,
|
||||||
pev_fov,
|
fov,
|
||||||
pev_flFallVelocity,
|
flFallVelocity,
|
||||||
pev_fuser1,
|
fuser1,
|
||||||
pev_fuser2,
|
fuser2,
|
||||||
pev_fuser3,
|
fuser3,
|
||||||
pev_fuser4,
|
fuser4,
|
||||||
pev_float_end,
|
pev_float_end,
|
||||||
pev_int_start,
|
pev_int_start,
|
||||||
pev_fixangle,
|
fixangle,
|
||||||
pev_modelindex,
|
modelindex,
|
||||||
pev_viewmodel,
|
viewmodel,
|
||||||
pev_weaponmodel,
|
weaponmodel,
|
||||||
pev_movetype,
|
movetype,
|
||||||
pev_solid,
|
solid,
|
||||||
pev_skin,
|
skin,
|
||||||
pev_body,
|
body,
|
||||||
pev_effects,
|
effects,
|
||||||
pev_light_level,
|
light_level,
|
||||||
pev_sequence,
|
sequence,
|
||||||
pev_gaitsequence,
|
gaitsequence,
|
||||||
pev_rendermode,
|
rendermode,
|
||||||
pev_renderfx,
|
renderfx,
|
||||||
pev_weapons,
|
weapons,
|
||||||
pev_deadflag,
|
deadflag,
|
||||||
pev_button,
|
button,
|
||||||
pev_impulse,
|
impulse,
|
||||||
pev_spawnflags,
|
spawnflags,
|
||||||
pev_flags,
|
flags,
|
||||||
pev_colormap,
|
colormap,
|
||||||
pev_team,
|
team,
|
||||||
pev_waterlevel,
|
waterlevel,
|
||||||
pev_watertype,
|
watertype,
|
||||||
pev_playerclass,
|
playerclass,
|
||||||
pev_weaponanim,
|
weaponanim,
|
||||||
pev_pushmsec,
|
pushmsec,
|
||||||
pev_bInDuck,
|
bInDuck,
|
||||||
pev_flTimeStepSound,
|
flTimeStepSound,
|
||||||
pev_flSwimTime,
|
flSwimTime,
|
||||||
pev_flDuckTime,
|
flDuckTime,
|
||||||
pev_iStepLeft,
|
iStepLeft,
|
||||||
pev_gamestate,
|
gamestate,
|
||||||
pev_oldbuttons,
|
oldbuttons,
|
||||||
pev_groupinfo,
|
groupinfo,
|
||||||
pev_iuser1,
|
iuser1,
|
||||||
pev_iuser2,
|
iuser2,
|
||||||
pev_iuser3,
|
iuser3,
|
||||||
pev_iuser4,
|
iuser4,
|
||||||
pev_int_end,
|
pev_int_end,
|
||||||
pev_byte_start,
|
pev_byte_start,
|
||||||
pev_controller_0,
|
controller_0,
|
||||||
pev_controller_1,
|
controller_1,
|
||||||
pev_controller_2,
|
controller_2,
|
||||||
pev_controller_3,
|
controller_3,
|
||||||
pev_blending_0,
|
blending_0,
|
||||||
pev_blending_1,
|
blending_1,
|
||||||
pev_byte_end,
|
pev_byte_end,
|
||||||
pev_bytearray_start,
|
pev_bytearray_start,
|
||||||
pev_controller,
|
controller,
|
||||||
pev_blending,
|
blending,
|
||||||
pev_bytearray_end,
|
pev_bytearray_end,
|
||||||
pev_vecarray_start,
|
pev_vecarray_start,
|
||||||
pev_origin,
|
origin,
|
||||||
pev_oldorigin,
|
oldorigin,
|
||||||
pev_velocity,
|
velocity,
|
||||||
pev_basevelocity,
|
basevelocity,
|
||||||
pev_clbasevelocity,
|
clbasevelocity,
|
||||||
pev_movedir,
|
movedir,
|
||||||
pev_angles,
|
angles,
|
||||||
pev_avelocity,
|
avelocity,
|
||||||
pev_v_angle,
|
v_angle,
|
||||||
pev_endpos,
|
endpos,
|
||||||
pev_startpos,
|
startpos,
|
||||||
pev_absmin,
|
absmin,
|
||||||
pev_absmax,
|
absmax,
|
||||||
pev_mins,
|
mins,
|
||||||
pev_maxs,
|
maxs,
|
||||||
pev_size,
|
size,
|
||||||
pev_rendercolor,
|
rendercolor,
|
||||||
pev_view_ofs,
|
view_ofs,
|
||||||
pev_vuser1,
|
vuser1,
|
||||||
pev_vuser2,
|
vuser2,
|
||||||
pev_vuser3,
|
vuser3,
|
||||||
pev_vuser4,
|
vuser4,
|
||||||
pev_punchangle,
|
punchangle,
|
||||||
pev_vecarray_end
|
pev_vecarray_end
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Used with register_forward()
|
|
||||||
*/
|
|
||||||
enum {
|
enum {
|
||||||
FM_PrecacheModel = 1, // done
|
FM_PrecacheModel = 1, // done
|
||||||
FM_PrecacheSound, // done
|
FM_PrecacheSound, // done
|
||||||
@ -432,6 +424,6 @@ enum {
|
|||||||
// Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise
|
// Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise
|
||||||
|
|
||||||
// Create baselines for certain "unplaced" items.
|
// Create baselines for certain "unplaced" items.
|
||||||
FM_CreateInstancedBaseline, // done
|
FM_CreateInstancedBaselines, // done
|
||||||
FM_AllowLagCompensation, // done
|
FM_AllowLagCompensation, // done
|
||||||
};
|
};
|
@ -240,22 +240,11 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
#ifdef USE_METAMOD
|
#ifdef USE_METAMOD
|
||||||
void UTIL_LogPrintf( char *fmt, ... );
|
void UTIL_LogPrintf( char *fmt, ... );
|
||||||
void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage);
|
|
||||||
short FixedSigned16( float value, float scale );
|
|
||||||
unsigned short FixedUnsigned16( float value, float scale );
|
|
||||||
|
|
||||||
#ifdef FN_META_QUERY
|
#ifdef FN_META_QUERY
|
||||||
void FN_META_QUERY(void);
|
void FN_META_QUERY(void);
|
||||||
@ -1955,7 +1944,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1951,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2002,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2095,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2146,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "fun_amxx";
|
$PROJECT = "fun_amxx";
|
||||||
$sdk = "../hlsdk/SourceCode";
|
$sdk = "../hlsdk/SourceCode";
|
||||||
$mm = "../metamod/metamod";
|
$mm = "../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("fun.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("fun.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -265,9 +257,9 @@ void FN_META_QUERY(void);
|
|||||||
void FN_META_ATTACH(void);
|
void FN_META_ATTACH(void);
|
||||||
#endif // FN_META_ATTACH
|
#endif // FN_META_ATTACH
|
||||||
|
|
||||||
#ifdef FN_META_DETACH
|
#ifdef FN_META_DETTACH
|
||||||
void FN_META_DETACH(void);
|
void FN_META_DETTACH(void);
|
||||||
#endif // FN_META_DETACH
|
#endif // FN_META_DETTACH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1877,9 +1869,9 @@ void FN_AMXX_QUERY(void);
|
|||||||
void FN_AMXX_ATTACH(void);
|
void FN_AMXX_ATTACH(void);
|
||||||
#endif // FN_AMXX_ATTACH
|
#endif // FN_AMXX_ATTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_DETACH
|
#ifdef FN_AMXX_DETTACH
|
||||||
void FN_AMXX_DETACH(void);
|
void FN_AMXX_DETTACH(void);
|
||||||
#endif // FN_AMXX_DETACH
|
#endif // FN_AMXX_DETTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_PLUGINSLOADED
|
#ifdef FN_AMXX_PLUGINSLOADED
|
||||||
void FN_AMXX_PLUGINSLOADED(void);
|
void FN_AMXX_PLUGINSLOADED(void);
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
136
dlls/fun/fun.cpp
136
dlls/fun/fun.cpp
@ -70,22 +70,9 @@
|
|||||||
// ######## Utils:
|
// ######## Utils:
|
||||||
void FUNUTIL_ResetPlayer(int index)
|
void FUNUTIL_ResetPlayer(int index)
|
||||||
{
|
{
|
||||||
g_zones_toHit[index] = (1<<HITGROUP_GENERIC) |
|
// Reset hitzones
|
||||||
(1<<HITGROUP_HEAD) |
|
memset(g_bodyhits[index], 0xFF, sizeof(char)*33);
|
||||||
(1<<HITGROUP_CHEST) |
|
|
||||||
(1<<HITGROUP_STOMACH) |
|
|
||||||
(1<<HITGROUP_LEFTARM) |
|
|
||||||
(1<<HITGROUP_RIGHTARM)|
|
|
||||||
(1<<HITGROUP_LEFTLEG) |
|
|
||||||
(1<<HITGROUP_RIGHTLEG);
|
|
||||||
g_zones_getHit[index] = (1<<HITGROUP_GENERIC) |
|
|
||||||
(1<<HITGROUP_HEAD) |
|
|
||||||
(1<<HITGROUP_CHEST) |
|
|
||||||
(1<<HITGROUP_STOMACH) |
|
|
||||||
(1<<HITGROUP_LEFTARM) |
|
|
||||||
(1<<HITGROUP_RIGHTARM)|
|
|
||||||
(1<<HITGROUP_LEFTLEG) |
|
|
||||||
(1<<HITGROUP_RIGHTLEG);
|
|
||||||
// Reset silent slippers
|
// Reset silent slippers
|
||||||
g_silent[index] = false;
|
g_silent[index] = false;
|
||||||
}
|
}
|
||||||
@ -538,6 +525,27 @@ static cell AMX_NATIVE_CALL get_user_gravity(AMX *amx, cell *params) // Float:ge
|
|||||||
return amx_ftoc(pPlayer->v.gravity);
|
return amx_ftoc(pPlayer->v.gravity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*static cell AMX_NATIVE_CALL set_hitzones(AMX *amx, cell *params) // set_hitzones(body = 255) = 1 argument
|
||||||
|
{
|
||||||
|
// Sets "hitable" zones.
|
||||||
|
// params[1] = body hitzones
|
||||||
|
|
||||||
|
//native set_user_hitzones(index=0,target=0,body=255);
|
||||||
|
//set_user_hitzones(id, 0, 0) // Makes ID not able to shoot EVERYONE - id can shoot on 0 (all) at 0
|
||||||
|
//set_user_hitzones(0, id, 0) // Makes EVERYONE not able to shoot ID - 0 (all) can shoot id at 0
|
||||||
|
|
||||||
|
g_body = params[1];
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/*static cell AMX_NATIVE_CALL get_hitzones(AMX *amx, cell *params) // get_hitzones() = 0 arguments
|
||||||
|
{
|
||||||
|
// Gets hitzones.
|
||||||
|
return g_body;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/*
|
||||||
static cell AMX_NATIVE_CALL set_user_hitzones(AMX *amx, cell *params) // set_user_hitzones(index = 0, target = 0, body = 255); = 3 arguments
|
static cell AMX_NATIVE_CALL set_user_hitzones(AMX *amx, cell *params) // set_user_hitzones(index = 0, target = 0, body = 255); = 3 arguments
|
||||||
{
|
{
|
||||||
// Sets user hitzones.
|
// Sets user hitzones.
|
||||||
@ -581,7 +589,77 @@ static cell AMX_NATIVE_CALL set_user_hitzones(AMX *amx, cell *params) // set_use
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL set_user_hitzones(AMX *amx, cell *params) // set_user_hitzones(index = 0, target = 0, body = 255); = 3 arguments
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
if (index < 0 || index > gpGlobals->maxClients){
|
||||||
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int target = params[2];
|
||||||
|
|
||||||
|
if (target < 0 || target > gpGlobals->maxClients){
|
||||||
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int bodyhits = params[3];
|
||||||
|
|
||||||
|
if (index) {
|
||||||
|
//player_t* pPlayer = GET_PLAYER_POINTER_I(index);
|
||||||
|
|
||||||
|
if (true) { // pPlayer->ingame (we have no in-game check yet)
|
||||||
|
//pPlayer->CountCheat(FUN_HITZONE);
|
||||||
|
|
||||||
|
if (target) {
|
||||||
|
g_bodyhits[index][target] = bodyhits; // pPlayer->bodyhits[target] = bodyhits;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(int i = 1; i <= gpGlobals->maxClients; ++i)
|
||||||
|
g_bodyhits[index][i] = bodyhits; // pPlayer->bodyhits[i] = bodyhits;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//player_t* pPlayer;
|
||||||
|
|
||||||
|
for(int i = 1; i <= gpGlobals->maxClients; ++i){
|
||||||
|
//pPlayer = GET_PLAYER_POINTER_I(i);
|
||||||
|
//pPlayer->CountCheat(FUN_HITZONE);
|
||||||
|
|
||||||
|
if (target) {
|
||||||
|
//pPlayer->bodyhits[target] = bodyhits;
|
||||||
|
g_bodyhits[index][target] = bodyhits;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(int i = 1; i <= gpGlobals->maxClients; ++i)
|
||||||
|
g_bodyhits[index][i] = bodyhits; // pPlayer->bodyhits[i] = bodyhits;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL get_user_hitzones(AMX *amx, cell *params) // get_user_hitzones(index, target); = 2 arguments
|
||||||
|
{
|
||||||
|
int index = params[1];
|
||||||
|
if (index < 1 || index > gpGlobals->maxClients) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int target = params[2];
|
||||||
|
if (target < 1 || target > gpGlobals->maxClients) {
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
//return GET_PLAYER_POINTER_I(index)->bodyhits[target];
|
||||||
|
return g_bodyhits[index][target];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
static cell AMX_NATIVE_CALL get_user_hitzones(AMX *amx, cell *params) // get_user_hitzones(index, target); = 2 arguments
|
static cell AMX_NATIVE_CALL get_user_hitzones(AMX *amx, cell *params) // get_user_hitzones(index, target); = 2 arguments
|
||||||
{
|
{
|
||||||
// Gets user hitzones.
|
// Gets user hitzones.
|
||||||
@ -614,6 +692,7 @@ static cell AMX_NATIVE_CALL get_user_hitzones(AMX *amx, cell *params) // get_use
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL set_user_noclip(AMX *amx, cell *params) // set_user_noclip(index, noclip = 0); = 2 arguments
|
static cell AMX_NATIVE_CALL set_user_noclip(AMX *amx, cell *params) // set_user_noclip(index, noclip = 0); = 2 arguments
|
||||||
{
|
{
|
||||||
@ -792,7 +871,7 @@ void PlayerPreThink(edict_t *pEntity)
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ClientConnect(edict_t *pPlayer, const char *pszName, const char *pszAddress, char szRejectReason[128])
|
int FN_ClientConnect(edict_t *pPlayer, const char *pszName, const char *pszAddress, char szRejectReason[128])
|
||||||
{
|
{
|
||||||
// Reset stuff:
|
// Reset stuff:
|
||||||
FUNUTIL_ResetPlayer(ENTINDEX(pPlayer));
|
FUNUTIL_ResetPlayer(ENTINDEX(pPlayer));
|
||||||
@ -800,30 +879,29 @@ int ClientConnect(edict_t *pPlayer, const char *pszName, const char *pszAddress,
|
|||||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) {
|
void FN_TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *e, TraceResult *ptr) {
|
||||||
TRACE_LINE(v1, v2, fNoMonsters, pentToSkip, ptr); // pentToSkip gotta be the one that is shooting, so filter it
|
TRACE_LINE(v1, v2, fNoMonsters, e, ptr);
|
||||||
|
|
||||||
int hitIndex = ENTINDEX(ptr->pHit);
|
if (ptr->pHit&&(ptr->pHit->v.flags& (FL_CLIENT | FL_FAKECLIENT) )&&e&&(e->v.flags & (FL_CLIENT | FL_FAKECLIENT) )) {
|
||||||
if (hitIndex >= 1 && hitIndex <= gpGlobals->maxClients) {
|
//player_t* pPlayer = GET_PLAYER_POINTER(e);
|
||||||
if ( !(
|
|
||||||
g_zones_getHit[hitIndex] & (1 << ptr->iHitgroup) // can ptr->pHit get hit in ptr->iHitgroup at all?
|
if ( !(g_bodyhits[ENTINDEX(e)][ENTINDEX(ptr->pHit)]&(1<<ptr->iHitgroup)) ) // if ( !(pPlayer->bodyhits[ENTINDEX(ptr->pHit)]&(1<<ptr->iHitgroup)) )
|
||||||
&& g_zones_toHit[hitIndex] & (1 << ptr->iHitgroup) ) // can pentToSkip hit other people in that hit zone?
|
ptr->flFraction = 1.0;
|
||||||
) {
|
|
||||||
ptr->flFraction = 1.0; // set to not hit anything (1.0 = shot doesn't hit anything)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnAmxxAttach()
|
void FN_AMXX_ATTACH()
|
||||||
{
|
{
|
||||||
MF_AddNatives(fun_Exports);
|
MF_AddNatives(fun_Exports);
|
||||||
|
|
||||||
// Reset stuff - hopefully this should
|
// Reset stuff - hopefully this should
|
||||||
for (int i = 1; i <= 32; i++) {
|
for (int i = 1; i <= 32; i++) {
|
||||||
// Reset all hitzones
|
// Reset all hitzones
|
||||||
FUNUTIL_ResetPlayer(i);
|
memset(g_bodyhits[i], 0xFF, sizeof(char)*33);
|
||||||
|
// Reset all silent slippers
|
||||||
|
g_silent[i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,9 +51,9 @@
|
|||||||
// Fun-specific defines above
|
// Fun-specific defines above
|
||||||
|
|
||||||
// The stuff below might end up in a class soon
|
// The stuff below might end up in a class soon
|
||||||
int g_zones_toHit[33]; // where can people hit other people?
|
//int g_zones_toHit[33]; // where can people hit other people?
|
||||||
int g_zones_getHit[33]; // where can people get hit by other people?
|
//int g_zones_getHit[33]; // where can people get hit by other people?
|
||||||
//char g_bodyhits[33][33];
|
char g_bodyhits[33][33];
|
||||||
bool g_silent[33]; // used for set_user_footsteps()
|
bool g_silent[33]; // used for set_user_footsteps()
|
||||||
//int g_ResetHUD;
|
//int g_ResetHUD;
|
||||||
bool g_ResetHUDbool;
|
bool g_ResetHUDbool;
|
||||||
|
@ -16,8 +16,6 @@ $PROJECT = "geoip_amxx";
|
|||||||
$sdk = "../../hlsdk/SourceCode";
|
$sdk = "../../hlsdk/SourceCode";
|
||||||
$mm = "../../metamod/metamod";
|
$mm = "../../metamod/metamod";
|
||||||
$geoip = "geolib/libGeoIP";
|
$geoip = "geolib/libGeoIP";
|
||||||
$gccf = "gcc";
|
|
||||||
$ccf = "cc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("geoip_amxx.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("geoip_amxx.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -48,7 +46,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -137,11 +135,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -159,11 +157,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.c/\.o/;
|
$ofile =~ s/\.c/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$ccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -175,6 +173,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -265,9 +257,9 @@ void FN_META_QUERY(void);
|
|||||||
void FN_META_ATTACH(void);
|
void FN_META_ATTACH(void);
|
||||||
#endif // FN_META_ATTACH
|
#endif // FN_META_ATTACH
|
||||||
|
|
||||||
#ifdef FN_META_DETACH
|
#ifdef FN_META_DETTACH
|
||||||
void FN_META_DETACH(void);
|
void FN_META_DETTACH(void);
|
||||||
#endif // FN_META_DETACH
|
#endif // FN_META_DETTACH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1877,9 +1869,9 @@ void FN_AMXX_QUERY(void);
|
|||||||
void FN_AMXX_ATTACH(void);
|
void FN_AMXX_ATTACH(void);
|
||||||
#endif // FN_AMXX_ATTACH
|
#endif // FN_AMXX_ATTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_DETACH
|
#ifdef FN_AMXX_DETTACH
|
||||||
void FN_AMXX_DETACH(void);
|
void FN_AMXX_DETTACH(void);
|
||||||
#endif // FN_AMXX_DETACH
|
#endif // FN_AMXX_DETTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_PLUGINSLOADED
|
#ifdef FN_AMXX_PLUGINSLOADED
|
||||||
void FN_AMXX_PLUGINSLOADED(void);
|
void FN_AMXX_PLUGINSLOADED(void);
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -265,9 +257,9 @@ void FN_META_QUERY(void);
|
|||||||
void FN_META_ATTACH(void);
|
void FN_META_ATTACH(void);
|
||||||
#endif // FN_META_ATTACH
|
#endif // FN_META_ATTACH
|
||||||
|
|
||||||
#ifdef FN_META_DETACH
|
#ifdef FN_META_DETTACH
|
||||||
void FN_META_DETACH(void);
|
void FN_META_DETTACH(void);
|
||||||
#endif // FN_META_DETACH
|
#endif // FN_META_DETTACH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1877,9 +1869,9 @@ void FN_AMXX_QUERY(void);
|
|||||||
void FN_AMXX_ATTACH(void);
|
void FN_AMXX_ATTACH(void);
|
||||||
#endif // FN_AMXX_ATTACH
|
#endif // FN_AMXX_ATTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_DETACH
|
#ifdef FN_AMXX_DETTACH
|
||||||
void FN_AMXX_DETACH(void);
|
void FN_AMXX_DETTACH(void);
|
||||||
#endif // FN_AMXX_DETACH
|
#endif // FN_AMXX_DETTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_PLUGINSLOADED
|
#ifdef FN_AMXX_PLUGINSLOADED
|
||||||
void FN_AMXX_PLUGINSLOADED(void);
|
void FN_AMXX_PLUGINSLOADED(void);
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "ns_amxx";
|
$PROJECT = "ns_amxx";
|
||||||
$sdk = "../../../hlsdk/SourceCode";
|
$sdk = "../../../hlsdk/SourceCode";
|
||||||
$mm = "../../../metamod/metamod";
|
$mm = "../../../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CPlayer.cpp", "CSpawn.cpp", "NMisc.cpp", "NPData.cpp", "hookedfunctions.cpp");
|
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CPlayer.cpp", "CSpawn.cpp", "NMisc.cpp", "NPData.cpp", "hookedfunctions.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -299,30 +299,6 @@ static cell AMX_NATIVE_CALL ns_set_fov(AMX *amx, cell *params)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static cell AMX_NATIVE_CALL ns_giveitem(AMX *amx, cell *params)
|
|
||||||
{
|
|
||||||
int index=params[1];
|
|
||||||
int len;
|
|
||||||
char *classname = MF_GetAmxString(amx,params[2],0,&len);
|
|
||||||
if (index<1 || index>gpGlobals->maxClients)
|
|
||||||
return 0;
|
|
||||||
edict_t *player=INDEXENT2(index);
|
|
||||||
if (player->v.deadflag > 0)
|
|
||||||
return 0;
|
|
||||||
edict_t *object=CREATE_NAMED_ENTITY(ALLOC_STRING(classname)); //create
|
|
||||||
if (!object)
|
|
||||||
{
|
|
||||||
MF_Log("Error creating entity `%s`",classname);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
SET_ORIGIN(object,player->v.origin); // move to player
|
|
||||||
gpGamedllFuncs->dllapi_table->pfnSpawn(object); // emulate spawn
|
|
||||||
object->v.flags |= FL_ONGROUND; // make it think it's touched the ground
|
|
||||||
gpGamedllFuncs->dllapi_table->pfnThink(object); //
|
|
||||||
gpGamedllFuncs->dllapi_table->pfnTouch(player,object); // give it to the player
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
AMX_NATIVE_INFO ns_misc_natives[] = {
|
AMX_NATIVE_INFO ns_misc_natives[] = {
|
||||||
///////////////////
|
///////////////////
|
||||||
{ "ns_get_build", ns_get_build },
|
{ "ns_get_build", ns_get_build },
|
||||||
@ -355,8 +331,6 @@ AMX_NATIVE_INFO ns_misc_natives[] = {
|
|||||||
|
|
||||||
{ "ns_set_fov", ns_set_fov },
|
{ "ns_set_fov", ns_set_fov },
|
||||||
|
|
||||||
{ "ns_give_item", ns_giveitem },
|
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
|
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -265,9 +257,9 @@ void FN_META_QUERY(void);
|
|||||||
void FN_META_ATTACH(void);
|
void FN_META_ATTACH(void);
|
||||||
#endif // FN_META_ATTACH
|
#endif // FN_META_ATTACH
|
||||||
|
|
||||||
#ifdef FN_META_DETACH
|
#ifdef FN_META_DETTACH
|
||||||
void FN_META_DETACH(void);
|
void FN_META_DETTACH(void);
|
||||||
#endif // FN_META_DETACH
|
#endif // FN_META_DETTACH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1877,9 +1869,9 @@ void FN_AMXX_QUERY(void);
|
|||||||
void FN_AMXX_ATTACH(void);
|
void FN_AMXX_ATTACH(void);
|
||||||
#endif // FN_AMXX_ATTACH
|
#endif // FN_AMXX_ATTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_DETACH
|
#ifdef FN_AMXX_DETTACH
|
||||||
void FN_AMXX_DETACH(void);
|
void FN_AMXX_DETTACH(void);
|
||||||
#endif // FN_AMXX_DETACH
|
#endif // FN_AMXX_DETTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_PLUGINSLOADED
|
#ifdef FN_AMXX_PLUGINSLOADED
|
||||||
void FN_AMXX_PLUGINSLOADED(void);
|
void FN_AMXX_PLUGINSLOADED(void);
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -37,10 +37,10 @@ void OnPluginsLoaded()
|
|||||||
if ((mapname[0]=='c' || mapname[0]=='C') && (mapname[1]=='o' || mapname[0]=='O') && mapname[2]=='_')
|
if ((mapname[0]=='c' || mapname[0]=='C') && (mapname[1]=='o' || mapname[0]=='O') && mapname[2]=='_')
|
||||||
iscombat=TRUE;
|
iscombat=TRUE;
|
||||||
|
|
||||||
ChangeclassForward = MF_RegisterForward("client_changeclass", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
ChangeclassForward = MF_RegisterForward("client_changeclass", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL);
|
||||||
// No sense in this if it's combat..
|
// No sense in this if it's combat..
|
||||||
if (!iscombat)
|
if (!iscombat)
|
||||||
BuiltForward = MF_RegisterForward("client_built", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
BuiltForward = MF_RegisterForward("client_built", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
176
dlls/ns/ns/include/ns.inc
Executable file
176
dlls/ns/ns/include/ns.inc
Executable file
@ -0,0 +1,176 @@
|
|||||||
|
/* NS module functions
|
||||||
|
* -
|
||||||
|
* (c) 2004, Steve Dudenhoeffer
|
||||||
|
* This file is provided as is (no warranties).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined NS_INC
|
||||||
|
#endinput
|
||||||
|
#endif
|
||||||
|
#define NS_INC
|
||||||
|
|
||||||
|
|
||||||
|
#include <ns_const>
|
||||||
|
|
||||||
|
|
||||||
|
/* Called whenever the client's class is changed. The classes given match get_class() output */
|
||||||
|
forward client_changeclass(id,newclass,oldclass);
|
||||||
|
|
||||||
|
/* Called whenever the client build's a structure. If type is 1, it's a marine structure, if type is 2, it's alien. */
|
||||||
|
forward client_built(idPlayer,idStructure,type,impulse);
|
||||||
|
|
||||||
|
/* Returns if the map's combat or not. */
|
||||||
|
native ns_is_combat();
|
||||||
|
|
||||||
|
/* Sends a popup to a player. Set target to 0 to send to everybody. Message length is 188 characters. The last parameter, if set to 1, will only display when the player has cl_autohelp set to 1. */
|
||||||
|
native ns_popup(target,szMsg[180],ah=0)
|
||||||
|
|
||||||
|
/* Sets a player model. Omit the second parameter to return to default.
|
||||||
|
Note: This does *not* change back on death, team switch, gestations, etc. */
|
||||||
|
native ns_set_player_model(id,szModel[]="");
|
||||||
|
|
||||||
|
/* Sets a player's skin. Omit second parameter to return to default.
|
||||||
|
Note: This does *not* change back on death, team switch, gestations, etc. */
|
||||||
|
native ns_set_player_skin(id,skin=-1);
|
||||||
|
|
||||||
|
/* Sets a player's body. Omit second parameter to return to default.
|
||||||
|
Note: This does *not* change back on death, team switch, gestations, etc. */
|
||||||
|
native ns_set_player_body(id,body=-1);
|
||||||
|
|
||||||
|
/* Sets a player's speedchange. Omit the second parameter to return to default */
|
||||||
|
native ns_set_speedchange(id,speedchange=0);
|
||||||
|
|
||||||
|
/* Returns a player's current speedchange. */
|
||||||
|
native ns_get_speedchange(id);
|
||||||
|
|
||||||
|
/* Returns a player's max speed before the speed change is factored in. */
|
||||||
|
native ns_get_maxspeed(id);
|
||||||
|
|
||||||
|
/* Returns whether or not this mask is set from the entity's iuser4 field. Use the "mask" enum for reference. */
|
||||||
|
native ns_get_mask(id,mask);
|
||||||
|
|
||||||
|
/* Sets or removes the mask from the entity's iuser4 field. Set "value" to 1 to turn the mask on, 0 to turn it off. */
|
||||||
|
native ns_set_mask(id,mask,value);
|
||||||
|
|
||||||
|
/* Returns built/unbuilt structures.
|
||||||
|
If:
|
||||||
|
builtOnly is 1 (default):
|
||||||
|
Only fully built structures are counted.
|
||||||
|
builtOnly is 0:
|
||||||
|
Any structure meeting the classname is counted.
|
||||||
|
|
||||||
|
Number is 0 (default):
|
||||||
|
The total number of matching structures is returned.
|
||||||
|
Number is any other value:
|
||||||
|
The index of the #th matching structure is returned.
|
||||||
|
*/
|
||||||
|
native ns_get_build(classname[],builtOnly=1,Number=0);
|
||||||
|
|
||||||
|
/* Returns if the player has the weapon or not in their pev->weapons field.
|
||||||
|
set "setweapon" to 0 to turn the bit off, set to 1 to turn it on. Or omit it to just return the value. */
|
||||||
|
native ns_has_weapon(id,NSWeapon:weapon,setweapon=-1);
|
||||||
|
|
||||||
|
/* Gets spawn point for specified team (type).
|
||||||
|
If:
|
||||||
|
Team is equal to 0:
|
||||||
|
Ready room spawns are returned.
|
||||||
|
Team is greater than 0:
|
||||||
|
Spawns for the team are returned.
|
||||||
|
|
||||||
|
Number is equal to 0:
|
||||||
|
Total number of spawns is returned.
|
||||||
|
Number is greater than 0:
|
||||||
|
The location of the specified spawn is returned.
|
||||||
|
*/
|
||||||
|
native ns_get_spawn(team,number=0,Float:ret[3]);
|
||||||
|
|
||||||
|
/* Configures display of the custom menus. This display is _very_ similar to set_hudmessage() */
|
||||||
|
native ns_set_menu(id,r=NSMENU_R,g=NSMENU_G,b=NSMENU_B,Float:x=NSMENU_X,Float:y=NSMENU_Y, effects=0, Float:fadeintime=0.0, Float:fadeouttime=0.0,channel1=NSMENU_CHAN1,channel2=NSMENU_CHAN2);
|
||||||
|
|
||||||
|
/* Displays a custom menu. It will execute command(id,keys) when the menu is pressed. */
|
||||||
|
native ns_show_menu(id,szCommand[],szText[],keys,time);
|
||||||
|
|
||||||
|
/* Returns the class of the player. Look in the classes enum in ns_const.inc for the value's meaning. */
|
||||||
|
native ns_get_class(id);
|
||||||
|
|
||||||
|
/* Returns a player's percentage of JP fuel */
|
||||||
|
native Float:ns_get_jpfuel(id);
|
||||||
|
|
||||||
|
/* Sets a player's percentage of JP fuel */
|
||||||
|
native ns_set_jpfuel(id,Float:fuel);
|
||||||
|
|
||||||
|
/* Returns a player's percentage of adrenaline (alien) */
|
||||||
|
native Float:ns_get_energy(id);
|
||||||
|
|
||||||
|
/* Sets a player's percentage of adrenaline */
|
||||||
|
native ns_set_energy(id,Float:energy);
|
||||||
|
|
||||||
|
/* Returns a player's resources. (alien only) */
|
||||||
|
native Float:ns_get_res(id);
|
||||||
|
|
||||||
|
/* Sets a player's resources. (alien only) */
|
||||||
|
native ns_set_res(id,Float:res);
|
||||||
|
|
||||||
|
/* Returns a player's experience (combat only) */
|
||||||
|
native Float:ns_get_exp(id);
|
||||||
|
|
||||||
|
/* Sets a player's experience (combat only) */
|
||||||
|
native ns_set_exp(id,Float:exp);
|
||||||
|
|
||||||
|
/* Gets a player's point spent value in combat */
|
||||||
|
native ns_get_points(id);
|
||||||
|
|
||||||
|
/* Sets a player's point spent value in combat */
|
||||||
|
native ns_set_points(id,points);
|
||||||
|
|
||||||
|
/* Gets a weapon's damage (use the weapon index, not the player) */
|
||||||
|
native Float:ns_get_weap_dmg(idWeapon);
|
||||||
|
|
||||||
|
/* Sets a weapon's damage (use the weapon index, not the player) */
|
||||||
|
native ns_set_weap_dmg(idWeapon,Float:damage);
|
||||||
|
|
||||||
|
/* Gets a weapon's range (use the weapon index, not the player) */
|
||||||
|
native Float:ns_get_weap_range(idWeapon);
|
||||||
|
|
||||||
|
/* Sets a weapon's range (use the weapon index, not the player) */
|
||||||
|
native ns_set_weap_range(idWeapon,Float:range);
|
||||||
|
|
||||||
|
/* Gets a weapon's clip ammo (use the weapon index, not the player) */
|
||||||
|
native ns_get_weap_clip(idWeapon);
|
||||||
|
|
||||||
|
/* Sets a weapon's clip ammo (use the weapon index, not the player) */
|
||||||
|
native ns_set_weap_clip(idWeapon,clipsize);
|
||||||
|
|
||||||
|
/* Gets the player's weapon reserve for the specified type of weapon.
|
||||||
|
Look in ns_const.inc for the weapon enum. */
|
||||||
|
native ns_get_weap_reserve(id,weapon);
|
||||||
|
|
||||||
|
/* Sets the player's weapon reserve for the specified type of weapon.
|
||||||
|
Look in ns_const.inc for the weapon enum. */
|
||||||
|
native ns_set_weap_reserve(id,weapon,ammo);
|
||||||
|
|
||||||
|
/* Gets a player's score. Note: score from level is automatically factored into the scoreboard display in combat. */
|
||||||
|
native ns_get_score(idPlayer);
|
||||||
|
|
||||||
|
/* Sets a player's score. Note: score from level is automatically factored into the scoreboard display in combat. */
|
||||||
|
native ns_set_score(idPlayer,score);
|
||||||
|
|
||||||
|
/* Gets a player's death count. */
|
||||||
|
native ns_get_deaths(idPlayer);
|
||||||
|
|
||||||
|
/* Sets a player's death count. */
|
||||||
|
native ns_set_deaths(idPlayer,numdeaths);
|
||||||
|
|
||||||
|
/* Gets a player's icon value (from the scoreboard) is a bitmask. Use enum "icons" for values. Returns -1 for unauthed */
|
||||||
|
native ns_get_icon(idPlayer);
|
||||||
|
|
||||||
|
/* Sets a player's icon value. */
|
||||||
|
native ns_set_icon(idPlayer,iconvalue);
|
||||||
|
|
||||||
|
/* Gets the trait type tied to the hive. Look at the hivetrait enum for the values. */
|
||||||
|
native ns_get_hive_trait(idHive);
|
||||||
|
|
||||||
|
/* Sets the trait type tied to the hive. Look at the hivetrait enum for the values. */
|
||||||
|
native ns_set_hive_trait(idHive,trait);
|
||||||
|
|
||||||
|
native ns_set_fov(idPlayer,Float:_fov=0.0);
|
139
dlls/ns/ns/include/ns_const.inc
Executable file
139
dlls/ns/ns/include/ns_const.inc
Executable file
@ -0,0 +1,139 @@
|
|||||||
|
/* NS module constants
|
||||||
|
* -
|
||||||
|
* (c) 2004, Steve Dudenhoeffer
|
||||||
|
* This file is provided as is (no warranties).
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if defined NS_CONST_INC
|
||||||
|
#endinput
|
||||||
|
#endif
|
||||||
|
#define NS_CONST_INC
|
||||||
|
|
||||||
|
// These values are customizable (for the custom menus)
|
||||||
|
// If your menu uses the default menu scheme, then it will use this.
|
||||||
|
#define NSMENU_X 0.2
|
||||||
|
#define NSMENU_Y 0.1
|
||||||
|
#define NSMENU_R 255
|
||||||
|
#define NSMENU_G 200
|
||||||
|
#define NSMENU_B 100
|
||||||
|
|
||||||
|
#define NSMENU_CHAN1 2
|
||||||
|
#define NSMENU_CHAN2 3
|
||||||
|
|
||||||
|
enum masks
|
||||||
|
{
|
||||||
|
MASK_NONE = 0,
|
||||||
|
MASK_SIGHTED = 1,
|
||||||
|
MASK_DETECTED = 2,
|
||||||
|
MASK_BUILDABLE = 4,
|
||||||
|
MASK_BASEBUILD0 = 8, // Base build slot #0
|
||||||
|
MASK_WEAPONS1 = 8, // Marine weapons 1
|
||||||
|
MASK_CARAPACE = 8, // Alien carapace
|
||||||
|
MASK_WEAPONS2 = 16, // Marines weapons 2
|
||||||
|
MASK_REGENERATION = 16, // Alien regeneration
|
||||||
|
MASK_BASEBUILD1 = 16, // Base build slot #1
|
||||||
|
MASK_WEAPONS3 = 32, // Marine weapons 3
|
||||||
|
MASK_REDEMPTION = 32, // Alien redemption
|
||||||
|
MASK_BASEBUILD2 = 32, // Base build slot #2
|
||||||
|
MASK_ARMOR1 = 64, // Marine armor 1
|
||||||
|
MASK_CELERITY = 64, // Alien celerity
|
||||||
|
MASK_BASEBUILD3 = 64, // Base build slot #3
|
||||||
|
MASK_ARMOR2 = 128, // Marine armor 2
|
||||||
|
MASK_ADRENALINE = 128, // Alien adrenaline
|
||||||
|
MASK_BASEBUILD4 = 128, // Base build slot #4
|
||||||
|
MASK_ARMOR3 = 256, // Marine armor 3
|
||||||
|
MASK_SILENCE = 256, // Alien silence
|
||||||
|
MASK_BASEBUILD5 = 256, // Base build slot #5
|
||||||
|
MASK_JETPACK = 512, // Marine jetpacks
|
||||||
|
MASK_CLOAKING = 512, // Alien cloaking
|
||||||
|
MASK_BASEBUILD6 = 512, // Base build slot #6
|
||||||
|
MASK_FOCUS = 1024, // Alien focus
|
||||||
|
MASK_MOTION = 1024, // Marine motion tracking
|
||||||
|
MASK_BASEBUILD7 = 1024, // Base build slot #7
|
||||||
|
MASK_SCENTOFFEAR = 2048, // Alien scent of fear
|
||||||
|
MASK_DEFENSE2 = 4096, // Defense level 2
|
||||||
|
MASK_DEFENSE3 = 8192, // Defense level 3
|
||||||
|
MASK_ELECTRICITY = 8192, // Electricy
|
||||||
|
MASK_MOVEMENT2 = 16384, // Movement level 2,
|
||||||
|
MASK_MOVEMENT3 = 32768, // Movement level 3
|
||||||
|
MASK_HEAVYARMOR = 32768, // Marine heavy armor
|
||||||
|
MASK_SENSORY2 = 65536, // Sensory level 2
|
||||||
|
MASK_SENSORY3 = 131072, // Sensory level 3
|
||||||
|
MASK_ALIEN_MOVEMENT = 262144, // Onos is charging
|
||||||
|
MASK_WALLSTICKING = 524288, // Flag for wall-sticking
|
||||||
|
MASK_PRIMALSCREAM = 1048576, // Alien is in range of active primal scream
|
||||||
|
MASK_UMBRA = 2097152, // In umbra
|
||||||
|
MASK_DIGESTING = 4194304, // When set on a visible player, player is digesting. When set on invisible player, player is being digested
|
||||||
|
MASK_RECYCLING = 8388608, // Building is recycling
|
||||||
|
MASK_TOPDOWN = 16777216, // Commander view
|
||||||
|
MASK_PLAYER_STUNNED = 33554432, // Player has been stunned by stomp
|
||||||
|
MASK_ENSNARED = 67108864, // Webbed
|
||||||
|
MASK_ALIEN_EMBRYO = 268435456, // Gestating
|
||||||
|
MASK_SELECTABLE = 536870912, // ???
|
||||||
|
MASK_PARASITED = 1073741824, // Parasite flag
|
||||||
|
MASK_SENSORY_NEARBY = 2147483648 // Sensory chamber in range
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
enum classes
|
||||||
|
{
|
||||||
|
CLASS_UNKNOWN = 0,
|
||||||
|
CLASS_SKULK,
|
||||||
|
CLASS_GORGE,
|
||||||
|
CLASS_LERK,
|
||||||
|
CLASS_FADE,
|
||||||
|
CLASS_ONOS,
|
||||||
|
CLASS_MARINE,
|
||||||
|
CLASS_JETPACK,
|
||||||
|
CLASS_HEAVY,
|
||||||
|
CLASS_COMMANDER,
|
||||||
|
CLASS_GESTATE,
|
||||||
|
CLASS_DEAD,
|
||||||
|
CLASS_NOTEAM
|
||||||
|
}
|
||||||
|
|
||||||
|
enum weapons
|
||||||
|
{
|
||||||
|
WEAPON_NONE = 0,
|
||||||
|
WEAPON_CLAWS,
|
||||||
|
WEAPON_SPIT,
|
||||||
|
WEAPON_SPORES,
|
||||||
|
WEAPON_SPIKE,
|
||||||
|
WEAPON_BITE,
|
||||||
|
WEAPON_BITE2,
|
||||||
|
WEAPON_SWIPE,
|
||||||
|
WEAPON_WEBSPINNER,
|
||||||
|
WEAPON_METABOLIZE,
|
||||||
|
WEAPON_PARASITE,
|
||||||
|
WEAPON_BLINK,
|
||||||
|
WEAPON_DIVINEWIND,
|
||||||
|
WEAPON_KNIFE,
|
||||||
|
WEAPON_PISTOL,
|
||||||
|
WEAPON_LMG,
|
||||||
|
WEAPON_SHOTGUN,
|
||||||
|
WEAPON_HMG,
|
||||||
|
WEAPON_WELDER,
|
||||||
|
WEAPON_MINE,
|
||||||
|
WEAPON_GRENADE_GUN,
|
||||||
|
WEAPON_LEAP,
|
||||||
|
WEAPON_CHARGE,
|
||||||
|
WEAPON_UMBRA,
|
||||||
|
WEAPON_PRIMALSCREAM,
|
||||||
|
WEAPON_BILEBOMB,
|
||||||
|
WEAPON_ACIDROCKET,
|
||||||
|
WEAPON_HEALINGSPRAY,
|
||||||
|
WEAPON_GRENADE,
|
||||||
|
WEAPON_STOMP,
|
||||||
|
WEAPON_DEVOUR,
|
||||||
|
WEAPON_MAX
|
||||||
|
}
|
||||||
|
|
||||||
|
enum hivetraits
|
||||||
|
{
|
||||||
|
HIVETRAIT_NONE = 0,
|
||||||
|
HIVETRAIT_DC = 92,
|
||||||
|
HIVETRAIT_SC = 93,
|
||||||
|
HIVETRAIT_MC = 94
|
||||||
|
}
|
@ -16,7 +16,6 @@ $PROJECT = "pgsql_amxx";
|
|||||||
$sdk = "../hlsdk/SourceCode";
|
$sdk = "../hlsdk/SourceCode";
|
||||||
$mm = "../metamod/metamod";
|
$mm = "../metamod/metamod";
|
||||||
$pg = "postgresql-7.4.3/src";
|
$pg = "postgresql-7.4.3/src";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("pgsql.cpp", "pgsql_amx.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("pgsql.cpp", "pgsql_amx.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -47,7 +46,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -136,7 +135,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -174,6 +173,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags $inc -shared -ldl -lm @LINK -lpq -lz -lcrypt -o $outdir/$bin";
|
$gcc = "gcc $cflags $inc -shared -ldl -lm @LINK -lpq -lz -lcrypt -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -265,9 +257,9 @@ void FN_META_QUERY(void);
|
|||||||
void FN_META_ATTACH(void);
|
void FN_META_ATTACH(void);
|
||||||
#endif // FN_META_ATTACH
|
#endif // FN_META_ATTACH
|
||||||
|
|
||||||
#ifdef FN_META_DETACH
|
#ifdef FN_META_DETTACH
|
||||||
void FN_META_DETACH(void);
|
void FN_META_DETTACH(void);
|
||||||
#endif // FN_META_DETACH
|
#endif // FN_META_DETTACH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1877,9 +1869,9 @@ void FN_AMXX_QUERY(void);
|
|||||||
void FN_AMXX_ATTACH(void);
|
void FN_AMXX_ATTACH(void);
|
||||||
#endif // FN_AMXX_ATTACH
|
#endif // FN_AMXX_ATTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_DETACH
|
#ifdef FN_AMXX_DETTACH
|
||||||
void FN_AMXX_DETACH(void);
|
void FN_AMXX_DETTACH(void);
|
||||||
#endif // FN_AMXX_DETACH
|
#endif // FN_AMXX_DETTACH
|
||||||
|
|
||||||
#ifdef FN_AMXX_PLUGINSLOADED
|
#ifdef FN_AMXX_PLUGINSLOADED
|
||||||
void FN_AMXX_PLUGINSLOADED(void);
|
void FN_AMXX_PLUGINSLOADED(void);
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
Binary file not shown.
@ -31,21 +31,26 @@
|
|||||||
* version.
|
* version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include "pgsql_amx.h"
|
#include "pgsql_amx.h"
|
||||||
#include "amxxmodule.h"
|
#include "amxxmodule.h"
|
||||||
|
|
||||||
CVector<SQLResult*> Results;
|
CVector<SQLResult*> Results;
|
||||||
CVector<SQL*> DBList;
|
CVector<SQL*> DBList;
|
||||||
|
|
||||||
void SqlError(AMX *amx, const char *fmt, ...)
|
int sql_exists(const char* host,const char* user,const char* pass,const char* dbase) {
|
||||||
{
|
unsigned int i = 0;
|
||||||
va_list p;
|
int id = 0;
|
||||||
va_start(p,fmt);
|
for (i=0; i<=DBList.size(); i++) {
|
||||||
static char buf[512];
|
id++;
|
||||||
vsprintf(buf, fmt, p);
|
if ((DBList[i]->Host.compare(host) == 0) &&
|
||||||
va_end(p);
|
(DBList[i]->Username.compare(user) == 0) &&
|
||||||
MF_Log("SQL Error: %s (plugin \"%s\" line %d)", buf, MF_GetScriptName(MF_FindScriptByAmx(amx)), amx->curline); \
|
(DBList[i]->Password.compare(pass) == 0) &&
|
||||||
|
(DBList[i]->Database.compare(dbase) == 0) &&
|
||||||
|
(!DBList[i]->isFree)) {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ///////////////////////////////
|
// ///////////////////////////////
|
||||||
@ -64,11 +69,14 @@ static cell AMX_NATIVE_CALL sql_connect(AMX *amx, cell *params) // 6 param
|
|||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
if (!strlen(host) || !strlen(user) || !strlen(dbname)) {
|
if (!strlen(host) || !strlen(user) || !strlen(dbname)) {
|
||||||
SqlError(amx, "Could not connect");
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int id = -1;
|
int id = sql_exists(host,user,pass,dbname);
|
||||||
|
|
||||||
|
if (id > 0)
|
||||||
|
return id;
|
||||||
|
|
||||||
SQL *c=NULL;
|
SQL *c=NULL;
|
||||||
|
|
||||||
@ -105,7 +113,7 @@ static cell AMX_NATIVE_CALL sql_error(AMX *amx, cell *params) // 3 params
|
|||||||
unsigned int id = params[1]-1;
|
unsigned int id = params[1]-1;
|
||||||
if (id >= DBList.size() || DBList[id]->isFree)
|
if (id >= DBList.size() || DBList[id]->isFree)
|
||||||
{
|
{
|
||||||
SqlError(amx, "Invalid DB handle: %d", id);
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +143,8 @@ static cell AMX_NATIVE_CALL sql_query(AMX *amx, cell *params) // 2 params
|
|||||||
unsigned int id = params[1]-1;
|
unsigned int id = params[1]-1;
|
||||||
|
|
||||||
if (id >= DBList.size() || DBList[id]->isFree) {
|
if (id >= DBList.size() || DBList[id]->isFree) {
|
||||||
SqlError(amx, "Invalid database handle %d", id);
|
MF_Log("Invalid Database Handle %d", id);
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,14 +165,10 @@ static cell AMX_NATIVE_CALL sql_nextrow(AMX *amx, cell *params) // 1 param
|
|||||||
{
|
{
|
||||||
unsigned int id = params[1]-1;
|
unsigned int id = params[1]-1;
|
||||||
|
|
||||||
if (id == -1)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id >= Results.size() || Results[id]->isFree)
|
if (id >= Results.size() || Results[id]->isFree)
|
||||||
{
|
{
|
||||||
SqlError(amx, "Invalid result handle %d", id);
|
MF_Log("Invalid result handle %d", id);
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,11 +183,10 @@ static cell AMX_NATIVE_CALL sql_nextrow(AMX *amx, cell *params) // 1 param
|
|||||||
// - close connection
|
// - close connection
|
||||||
static cell AMX_NATIVE_CALL sql_close(AMX *amx, cell *params) // 1 param
|
static cell AMX_NATIVE_CALL sql_close(AMX *amx, cell *params) // 1 param
|
||||||
{
|
{
|
||||||
cell *addr = MF_GetAmxAddr(amx, params[1]);
|
unsigned int id = params[1]-1;
|
||||||
unsigned int id = (*addr)-1;
|
|
||||||
|
|
||||||
if (id >= DBList.size() || DBList[id]->isFree) {
|
if (id >= DBList.size() || DBList[id]->isFree) {
|
||||||
SqlError(amx, "Invalid database handle %d", id);
|
MF_Log("Invalid Database Handle %d", id);
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,8 +194,6 @@ static cell AMX_NATIVE_CALL sql_close(AMX *amx, cell *params) // 1 param
|
|||||||
|
|
||||||
sql->Disconnect();
|
sql->Disconnect();
|
||||||
|
|
||||||
*addr = 0;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +207,8 @@ static cell AMX_NATIVE_CALL sql_getfield(AMX *amx, cell *params) // 2-4 params
|
|||||||
|
|
||||||
if (id >= Results.size() || Results[id]->isFree)
|
if (id >= Results.size() || Results[id]->isFree)
|
||||||
{
|
{
|
||||||
SqlError(amx, "Invalid result handle %d", id);
|
MF_Log("Invalid result handle %d", id);
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +252,8 @@ static cell AMX_NATIVE_CALL sql_getresult(AMX *amx, cell *params) // 4 params
|
|||||||
|
|
||||||
if (id >= Results.size() || Results[id]->isFree)
|
if (id >= Results.size() || Results[id]->isFree)
|
||||||
{
|
{
|
||||||
SqlError(amx, "Invalid result handle %d", id);
|
MF_Log("Invalid result handle %d", id);
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,15 +291,12 @@ static cell AMX_NATIVE_CALL sql_getresult(AMX *amx, cell *params) // 4 params
|
|||||||
|
|
||||||
static cell AMX_NATIVE_CALL sql_free_result(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL sql_free_result(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
cell *addr = MF_GetAmxAddr(amx, params[1]);
|
unsigned int id = params[1]-1;
|
||||||
unsigned int id = (*addr)-1;
|
|
||||||
|
|
||||||
if (id == -1)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (id >= Results.size() || Results[id]->isFree)
|
if (id >= Results.size() || Results[id]->isFree)
|
||||||
{
|
{
|
||||||
SqlError(amx, "Invalid result handle %d", id);
|
MF_Log("Invalid result handle %d", id);
|
||||||
|
MF_RaiseAmxError(amx, AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,8 +304,6 @@ static cell AMX_NATIVE_CALL sql_free_result(AMX *amx, cell *params)
|
|||||||
|
|
||||||
Result->FreeResult();
|
Result->FreeResult();
|
||||||
|
|
||||||
*addr = 0;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,9 +311,6 @@ static cell AMX_NATIVE_CALL sql_num_rows(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
unsigned int id = params[1]-1;
|
unsigned int id = params[1]-1;
|
||||||
|
|
||||||
if (id == -1)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (id >= Results.size() || Results[id]->isFree)
|
if (id >= Results.size() || Results[id]->isFree)
|
||||||
{
|
{
|
||||||
MF_Log("Invalid result handle %d", id);
|
MF_Log("Invalid result handle %d", id);
|
||||||
|
@ -26,9 +26,6 @@ SQLResult::SQLResult()
|
|||||||
{
|
{
|
||||||
isFree = true;
|
isFree = true;
|
||||||
RowCount = 0;
|
RowCount = 0;
|
||||||
Fields.clear();
|
|
||||||
res = NULL;
|
|
||||||
row = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SQLResult::~SQLResult()
|
SQLResult::~SQLResult()
|
||||||
@ -109,6 +106,14 @@ int SQL::Query(const char *query)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SQLResult *p = new SQLResult;
|
||||||
|
int ret = p->Query(this, query);
|
||||||
|
|
||||||
|
if (ret < 1)
|
||||||
|
{
|
||||||
|
delete p;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
int id = -1;
|
int id = -1;
|
||||||
@ -121,33 +126,13 @@ int SQL::Query(const char *query)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (id < 0) {
|
if (id < 0) {
|
||||||
|
Results.push_back(p);
|
||||||
SQLResult *p = new SQLResult;
|
return Results.size();
|
||||||
int ret = p->Query(this, query);
|
|
||||||
|
|
||||||
if (ret != 0)
|
|
||||||
{
|
|
||||||
delete p;
|
|
||||||
if (ret == -1)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
Results.push_back(p);
|
|
||||||
return Results.size();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
SQLResult *r = Results[id];
|
SQLResult *r = Results[id];
|
||||||
int ret = Results[id]->Query(this, query);
|
Results[id] = p;
|
||||||
if (ret != 0)
|
delete r;
|
||||||
{
|
return (id + 1);
|
||||||
if (ret == -1)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
return (id + 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +154,7 @@ int SQLResult::Query(SQL *cn, const char *query)
|
|||||||
RowCount = PQntuples(res);
|
RowCount = PQntuples(res);
|
||||||
|
|
||||||
if (RowCount < 1)
|
if (RowCount < 1)
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
const char *fld;
|
const char *fld;
|
||||||
@ -179,7 +164,7 @@ int SQLResult::Query(SQL *cn, const char *query)
|
|||||||
Fields.push_back(fld);
|
Fields.push_back(fld);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SQLResult::Nextrow()
|
bool SQLResult::Nextrow()
|
||||||
@ -204,9 +189,6 @@ void SQLResult::FreeResult()
|
|||||||
|
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
Fields.clear();
|
Fields.clear();
|
||||||
res = 0;
|
|
||||||
row = 0;
|
|
||||||
isFree = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *SQLResult::GetField(unsigned int field)
|
const char *SQLResult::GetField(unsigned int field)
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
OutputFile=".\Release/pgsql_amxx.dll"
|
OutputFile=".\Release/pgsql_amxx.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
IgnoreDefaultLibraryNames="LIBCMT, LIBC"
|
|
||||||
ModuleDefinitionFile=""
|
ModuleDefinitionFile=""
|
||||||
ProgramDatabaseFile=".\Release/pgsql.pdb"
|
ProgramDatabaseFile=".\Release/pgsql.pdb"
|
||||||
ImportLibrary=".\Release/pgsql.lib"
|
ImportLibrary=".\Release/pgsql.lib"
|
||||||
@ -90,7 +89,7 @@
|
|||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PGSQL_EXPORTS"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PGSQL_EXPORTS"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="2"
|
||||||
PrecompiledHeaderFile=".\Debug/pgsql.pch"
|
PrecompiledHeaderFile=".\Debug/pgsql.pch"
|
||||||
AssemblerListingLocation=".\Debug/"
|
AssemblerListingLocation=".\Debug/"
|
||||||
@ -104,7 +103,7 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="wsock32.lib lib\libpq.lib"
|
AdditionalDependencies="wsock32.lib libpq.lib"
|
||||||
OutputFile="Debug/pgsql_amxx.dll"
|
OutputFile="Debug/pgsql_amxx.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "sockets_amxx";
|
$PROJECT = "sockets_amxx";
|
||||||
$sdk = "../hlsdk/SourceCode";
|
$sdk = "../hlsdk/SourceCode";
|
||||||
$mm = "../metamod/metamod";
|
$mm = "../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("sockets.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("sockets.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "tfcx_amxx";
|
$PROJECT = "tfcx_amxx";
|
||||||
$sdk = "../../../hlsdk/SourceCode";
|
$sdk = "../../../hlsdk/SourceCode";
|
||||||
$mm = "../../../metamod/metamod";
|
$mm = "../../../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -326,7 +326,7 @@ void OnAmxxAttach() {
|
|||||||
MF_AddNatives( stats_Natives );
|
MF_AddNatives( stats_Natives );
|
||||||
MF_AddNatives( base_Natives );
|
MF_AddNatives( base_Natives );
|
||||||
|
|
||||||
const char* path = get_localinfo("tfcstats_score","addons/amxmodx/data/tfcstats.amxx");
|
const char* path = get_localinfo("tfcstats_score","addons/amxx/data/tfcstats.amxx");
|
||||||
if ( path && *path )
|
if ( path && *path )
|
||||||
{
|
{
|
||||||
char error[128];
|
char error[128];
|
||||||
@ -334,7 +334,7 @@ void OnAmxxAttach() {
|
|||||||
}
|
}
|
||||||
if ( !g_rank.begin() )
|
if ( !g_rank.begin() )
|
||||||
{
|
{
|
||||||
g_rank.loadRank( MF_BuildPathname("%s",get_localinfo("tfcstats","addons/amxmodx/data/tfcstats.dat") ) );
|
g_rank.loadRank( MF_BuildPathname("%s",get_localinfo("tfcstats","addons/amxx/data/tfcstats.dat") ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// set default PrivateData offsets
|
// set default PrivateData offsets
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
$PROJECT = "tsx_amxx";
|
$PROJECT = "tsx_amxx";
|
||||||
$sdk = "../../../hlsdk/SourceCode";
|
$sdk = "../../../hlsdk/SourceCode";
|
||||||
$mm = "../../../metamod/metamod";
|
$mm = "../../../metamod/metamod";
|
||||||
$gccf = "gcc";
|
|
||||||
|
|
||||||
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
@CPP_SOURCE_FILES = ("CMisc.cpp", "CRank.cpp", "NBase.cpp", "NRank.cpp", "Utils.cpp", "moduleconfig.cpp", "usermsg.cpp", "amxxmodule.cpp");
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `$gccf --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,11 +134,11 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -161,7 +160,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
$ofile_time = (stat($ofile))[9];
|
$ofile_time = (stat($file))[9];
|
||||||
if ($file_time > $ofile_time)
|
if ($file_time > $ofile_time)
|
||||||
{
|
{
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
@ -173,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -2477,8 +2477,6 @@ 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;
|
|
||||||
|
|
||||||
// *** 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)
|
||||||
@ -2522,7 +2520,6 @@ 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("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2543,7 +2540,6 @@ 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);
|
||||||
|
@ -240,14 +240,6 @@ enum {
|
|||||||
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined AMX_NO_ALIGN
|
|
||||||
#if defined __linux__
|
|
||||||
#pragma pack() /* reset default packing */
|
|
||||||
#else
|
|
||||||
#pragma pack(pop) /* reset previous packing */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// ***** declare functions *****
|
// ***** declare functions *****
|
||||||
|
|
||||||
@ -1955,7 +1947,6 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
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_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*/);
|
||||||
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*/);
|
||||||
@ -1963,7 +1954,6 @@ typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*params*/);
|
||||||
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*/);
|
|
||||||
|
|
||||||
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;
|
||||||
@ -2015,8 +2005,6 @@ extern PFN_CELL_TO_REAL g_fn_CellToReal;
|
|||||||
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2110,10 +2098,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
#define MF_AmxFindNative g_fn_AmxFindNative
|
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
@ -2163,5 +2149,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -295,7 +295,7 @@ void OnAmxxAttach() {
|
|||||||
MF_AddNatives( stats_Natives );
|
MF_AddNatives( stats_Natives );
|
||||||
MF_AddNatives( base_Natives );
|
MF_AddNatives( base_Natives );
|
||||||
|
|
||||||
const char* path = get_localinfo("tsstats_score","addons/amxmodx/data/tsstats.amxx");
|
const char* path = get_localinfo("tsstats_score","addons/amxx/data/tsstats.amxx");
|
||||||
if ( path && *path )
|
if ( path && *path )
|
||||||
{
|
{
|
||||||
char error[128];
|
char error[128];
|
||||||
@ -303,7 +303,7 @@ void OnAmxxAttach() {
|
|||||||
}
|
}
|
||||||
if ( !g_rank.begin() )
|
if ( !g_rank.begin() )
|
||||||
{
|
{
|
||||||
g_rank.loadRank( MF_BuildPathname("%s",get_localinfo("tsstats","addons/amxmodx/data/tsstats.dat") ) );
|
g_rank.loadRank( MF_BuildPathname("%s",get_localinfo("tsstats","addons/amxx/data/tsstats.dat") ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,12 @@ public plugin_init() {
|
|||||||
|
|
||||||
#if defined USING_SQL
|
#if defined USING_SQL
|
||||||
register_srvcmd("amx_sqladmins","adminSql")
|
register_srvcmd("amx_sqladmins","adminSql")
|
||||||
register_cvar("amx_sql_table","admins")
|
|
||||||
#endif
|
|
||||||
register_cvar("amx_sql_host","127.0.0.1")
|
register_cvar("amx_sql_host","127.0.0.1")
|
||||||
register_cvar("amx_sql_user","root")
|
register_cvar("amx_sql_user","root")
|
||||||
register_cvar("amx_sql_pass","")
|
register_cvar("amx_sql_pass","")
|
||||||
register_cvar("amx_sql_db","amx")
|
register_cvar("amx_sql_db","amx")
|
||||||
|
register_cvar("amx_sql_table","admins")
|
||||||
|
#endif
|
||||||
|
|
||||||
register_concmd("amx_reloadadmins","cmdReload",ADMIN_CFG)
|
register_concmd("amx_reloadadmins","cmdReload",ADMIN_CFG)
|
||||||
|
|
||||||
@ -95,9 +95,8 @@ public plugin_init() {
|
|||||||
new configsDir[64]
|
new configsDir[64]
|
||||||
get_configsdir(configsDir, 63)
|
get_configsdir(configsDir, 63)
|
||||||
server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file
|
server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file
|
||||||
server_cmd("exec %s/sql.cfg", configsDir)
|
|
||||||
#if defined USING_SQL
|
#if defined USING_SQL
|
||||||
server_cmd("amx_sqladmins")
|
server_cmd("exec %s/sql.cfg;amx_sqladmins", configsDir)
|
||||||
#else
|
#else
|
||||||
format(configsDir, 63, "%s/users.ini", configsDir)
|
format(configsDir, 63, "%s/users.ini", configsDir)
|
||||||
loadSettings(configsDir) // Load admins accounts
|
loadSettings(configsDir) // Load admins accounts
|
||||||
@ -157,20 +156,19 @@ public adminSql() {
|
|||||||
|
|
||||||
dbi_query(sql,"CREATE TABLE IF NOT EXISTS `%s` ( `auth` VARCHAR( 32 ) NOT NULL, `password` VARCHAR( 32 ) NOT NULL, `access` VARCHAR( 32 ) NOT NULL, `flags` VARCHAR( 32 ) NOT NULL ) COMMENT = 'AMX Mod X Admins'",table)
|
dbi_query(sql,"CREATE TABLE IF NOT EXISTS `%s` ( `auth` VARCHAR( 32 ) NOT NULL, `password` VARCHAR( 32 ) NOT NULL, `access` VARCHAR( 32 ) NOT NULL, `flags` VARCHAR( 32 ) NOT NULL ) COMMENT = 'AMX Mod X Admins'",table)
|
||||||
|
|
||||||
|
|
||||||
new Result:Res = dbi_query(sql,"SELECT `auth`,`password`,`access`,`flags` FROM `%s`",table)
|
new Result:Res = dbi_query(sql,"SELECT `auth`,`password`,`access`,`flags` FROM `%s`",table)
|
||||||
|
|
||||||
if (Res == RESULT_FAILED) {
|
if (Res == RESULT_FAILED) {
|
||||||
dbi_error(sql,error,127)
|
dbi_error(sql,error,127)
|
||||||
server_print("[AMXX] %L",LANG_SERVER,"SQL_CANT_LOAD_ADMINS",error)
|
server_print("[AMXX] %L",LANG_SERVER,"SQL_CANT_LOAD_ADMINS",error)
|
||||||
dbi_free_result(Res)
|
dbi_free_result(Res)
|
||||||
dbi_close(sql)
|
dbi_close(Sql)
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
else if (Res == RESULT_NONE) {
|
else if (Res == RESULT_NONE) {
|
||||||
server_print("[AMXX] %L",LANG_SERVER,"NO_ADMINS")
|
server_print("[AMXX] %L",LANG_SERVER,"NO_ADMINS")
|
||||||
dbi_free_result(Res)
|
dbi_free_result(Res)
|
||||||
dbi_close(sql)
|
dbi_close(Sql)
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,8 +155,8 @@ public cmdSay(id,level,cid) {
|
|||||||
get_user_authid(id,authid,31)
|
get_user_authid(id,authid,31)
|
||||||
get_user_name(id,name,31)
|
get_user_name(id,name,31)
|
||||||
userid = get_user_userid(id)
|
userid = get_user_userid(id)
|
||||||
client_print(0,print_chat,"(ALL) %s : %s",name,message)
|
client_print(0,print_chat,"%L",LANG_PLAYER,"PRINT_LANG",name,message)
|
||||||
console_print(id,"(ALL) %s : %s",name,message)
|
console_print(id,"%L",id,"PRINT_LANG",name,message)
|
||||||
log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name,userid,authid,message)
|
log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name,userid,authid,message)
|
||||||
log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")",name,userid,authid,message)
|
log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")",name,userid,authid,message)
|
||||||
return PLUGIN_HANDLED
|
return PLUGIN_HANDLED
|
||||||
|
BIN
plugins/amxxsc
BIN
plugins/amxxsc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user