1 Commits

Author SHA1 Message Date
3d6bd966ec Tagged 0.10 2006-07-20 06:03:41 +00:00
67 changed files with 645 additions and 2759 deletions

View File

@ -44,9 +44,6 @@ EventsMngr::ClEvent::ClEvent(CPluginMngr::CPlugin* plugin, int func, int flags)
m_Func = func; m_Func = func;
// flags // flags
m_FlagAlive = true;
m_FlagDead = true;
m_FlagWorld = (flags & 1) ? true : false; // flag a m_FlagWorld = (flags & 1) ? true : false; // flag a
m_FlagPlayer = (flags & 2) ? true : false; // flag b m_FlagPlayer = (flags & 2) ? true : false; // flag b
m_FlagOnce = (flags & 4) ? true : false; // flag c m_FlagOnce = (flags & 4) ? true : false; // flag c
@ -58,54 +55,11 @@ EventsMngr::ClEvent::ClEvent(CPluginMngr::CPlugin* plugin, int func, int flags)
m_Stamp = 0.0f; m_Stamp = 0.0f;
m_Done = false; m_Done = false;
m_Conditions = NULL;
} }
EventsMngr::ClEvent::~ClEvent() EventsMngr::ClEvent::~ClEvent()
{ {
cond_t *tmp1 = m_Conditions;
cond_t *tmp2 = NULL;
while (tmp1)
{
tmp2 = tmp1->next;
delete tmp1;
tmp1 = tmp2;
}
m_Conditions = NULL;
}
void EventsMngr::NextParam()
{
const int INITIAL_PARSEVAULT_SIZE = 32;
if (m_ParsePos < m_ParseVaultSize)
return;
MsgDataEntry *tmp = NULL;
int tmpSize = 0;
if (m_ParseVault)
{
// copy to tmp
tmp = new MsgDataEntry[m_ParseVaultSize];
memcpy(tmp, m_ParseVault, m_ParseVaultSize * sizeof(MsgDataEntry));
tmpSize = m_ParseVaultSize;
delete [] m_ParseVault;
m_ParseVault = NULL;
}
if (m_ParseVaultSize > 0)
m_ParseVaultSize *= 2;
else
m_ParseVaultSize = INITIAL_PARSEVAULT_SIZE;
m_ParseVault = new MsgDataEntry[m_ParseVaultSize];
if (tmp)
{
memcpy(m_ParseVault, tmp, tmpSize * sizeof(MsgDataEntry));
delete [] tmp;
tmp = NULL;
}
} }
int EventsMngr::ClEvent::getFunction() int EventsMngr::ClEvent::getFunction()
@ -115,20 +69,12 @@ int EventsMngr::ClEvent::getFunction()
EventsMngr::EventsMngr() EventsMngr::EventsMngr()
{ {
m_ParseVault = NULL;
m_ParseVaultSize = 0;
clearEvents(); clearEvents();
} }
EventsMngr::~EventsMngr() EventsMngr::~EventsMngr()
{ {
clearEvents(); clearEvents();
// delete parsevault
if (m_ParseVault)
{
delete [] m_ParseVault;
m_ParseVault = NULL;
}
} }
@ -160,34 +106,23 @@ void EventsMngr::ClEvent::registerFilter(char *filter)
if (!*value) if (!*value)
return; return;
cond_t *tmpCond = new cond_t; CondMapPair pair;
if (!tmpCond)
return;
// type character // type character
tmpCond->type = *value; pair.second.type = *value;
// set a null here so param id can be recognized, and save it // set a null here so param id can be recognized later
*value++ = 0; *value++ = 0;
tmpCond->paramId = atoi(filter);
// rest of line // rest of line
tmpCond->sValue.set(value); pair.second.sValue = value;
tmpCond->fValue = atof(value); pair.second.fValue = atof(value);
tmpCond->iValue = atoi(value); pair.second.iValue = atoi(value);
tmpCond->next = NULL; // param id
pair.first = atoi(filter);
if (m_Conditions) m_Conditions.insert(pair);
{
cond_t *tmp = m_Conditions;
while (tmp->next)
tmp = tmp->next;
tmp->next = tmpCond;
}
else
m_Conditions = tmpCond;
} }
EventsMngr::ClEvent* EventsMngr::registerEvent(CPluginMngr::CPlugin* plugin, int func, int flags, int msgid) EventsMngr::ClEvent* EventsMngr::registerEvent(CPluginMngr::CPlugin* plugin, int func, int flags, int msgid)
@ -200,7 +135,7 @@ EventsMngr::ClEvent* EventsMngr::registerEvent(CPluginMngr::CPlugin* plugin, int
if (!event) if (!event)
return NULL; return NULL;
m_Events[msgid].put(event); m_Events[msgid].push_back(event);
return event; return event;
} }
@ -214,38 +149,37 @@ void EventsMngr::parserInit(int msg_type, float* timer, CPlayer* pPlayer, int in
m_Timer = timer; m_Timer = timer;
// don't parse if nothing to do // don't parse if nothing to do
if (!m_Events[msg_type].size()) if (m_Events[msg_type].empty())
return; return;
for(ClEventVecIter iter = m_Events[msg_type].begin(); iter; ++iter) for(ClEventVecIter iter = m_Events[msg_type].begin(); iter != m_Events[msg_type].end(); ++iter)
{ {
if ((*iter).m_Done) if ((*iter)->m_Done)
continue; continue;
if (!(*iter)->m_Plugin->isExecutable((*iter)->m_Func))
if (!(*iter).m_Plugin->isExecutable((*iter).m_Func))
{ {
(*iter).m_Done = true; (*iter)->m_Done = true;
continue; continue;
} }
if (pPlayer) if (pPlayer)
{ {
if (!(*iter).m_FlagPlayer || (pPlayer->IsAlive() ? !(*iter).m_FlagAlive : !(*iter).m_FlagDead ) ) if (!(*iter)->m_FlagPlayer || (pPlayer->IsAlive() ? !(*iter)->m_FlagAlive : !(*iter)->m_FlagDead ) )
{ {
(*iter).m_Done = true; (*iter)->m_Done = true;
continue; continue;
} }
} }
else if (!(*iter).m_FlagWorld) else if (!(*iter)->m_FlagWorld)
{ {
(*iter).m_Done = true; (*iter)->m_Done = true;
continue; continue;
} }
if ((*iter).m_FlagOnce && (*iter).m_Stamp == (float)(*timer)) if ((*iter)->m_FlagOnce && (*iter)->m_Stamp == (float)(*timer))
{ {
(*iter).m_Done = true; (*iter)->m_Done = true;
continue; continue;
} }
m_ParseNotDone = true; m_ParseNotDone = true;
@ -253,8 +187,13 @@ void EventsMngr::parserInit(int msg_type, float* timer, CPlayer* pPlayer, int in
if (m_ParseNotDone) if (m_ParseNotDone)
{ {
// we don't clear it (performance)
if (m_ParseVault.size() < 1)
{
m_ParseVault.reserve(32); // 32 as default
m_ParseVault.push_back(MsgDataVault());
}
m_ParsePos = 0; m_ParsePos = 0;
NextParam();
m_ParseVault[m_ParsePos].type = MSG_INTEGER; m_ParseVault[m_ParsePos].type = MSG_INTEGER;
m_ParseVault[m_ParsePos].iValue = index; m_ParseVault[m_ParsePos].iValue = index;
} }
@ -267,42 +206,45 @@ void EventsMngr::parseValue(int iValue)
if (!m_ParseNotDone || !m_ParseFun) if (!m_ParseNotDone || !m_ParseFun)
return; return;
// grow if needed // grow if needed
++m_ParsePos; if (m_ParseVault.size() <= static_cast<size_t>(++m_ParsePos))
NextParam(); {
MsgDataVault tmp;
m_ParseVault.push_back(tmp);
}
m_ParseVault[m_ParsePos].type = MSG_INTEGER; m_ParseVault[m_ParsePos].type = MSG_INTEGER;
m_ParseVault[m_ParsePos].iValue = iValue; m_ParseVault[m_ParsePos].iValue = iValue;
// loop through the registered funcs, and decide whether they have to be called or not // loop through the registered funcs, and decide whether they have to be called
// if they shouldnt, their m_Done is set to true bool skip;
for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter)
{ {
if ((*iter).m_Done) if ((*iter)->m_Done)
continue; // already skipped; don't bother with parsing continue;
// loop through conditions skip = false;
bool execute; ClEvent::CondMapIter condIter = (*iter)->m_Conditions.find(m_ParsePos);
for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next) if (condIter == (*iter)->m_Conditions.end())
continue;
do
{ {
if (condIter->paramId == m_ParsePos) switch(condIter->second.type)
{ {
execute = false; case '=': if (condIter->second.iValue == iValue) skip=true; break;
switch(condIter->type) case '!': if (condIter->second.iValue != iValue) skip=true; break;
{ case '&': if (iValue & condIter->second.iValue) skip=true; break;
case '=': if (condIter->iValue == iValue) execute=true; break; case '<': if (iValue < condIter->second.iValue) skip=true; break;
case '!': if (condIter->iValue != iValue) execute=true; break; case '>': if (iValue > condIter->second.iValue) skip=true; break;
case '&': if (iValue & condIter->iValue) execute=true; break;
case '<': if (iValue < condIter->iValue) execute=true; break;
case '>': if (iValue > condIter->iValue) execute=true; break;
}
if (execute)
continue;
(*iter).m_Done = true; // don't execute
break;
} }
} if (skip)
break;
} while ( ++condIter != (*iter)->m_Conditions.end() );
if (skip)
continue;
(*iter)->m_Done = true;
} }
} }
@ -312,40 +254,44 @@ void EventsMngr::parseValue(float fValue)
if (!m_ParseNotDone || !m_ParseFun) if (!m_ParseNotDone || !m_ParseFun)
return; return;
// grow if needed // grow if needed
++m_ParsePos; if (m_ParseVault.size() <= static_cast<size_t>(++m_ParsePos))
NextParam(); {
MsgDataVault tmp;
m_ParseVault.push_back(tmp);
}
m_ParseVault[m_ParsePos].type = MSG_FLOAT; m_ParseVault[m_ParsePos].type = MSG_FLOAT;
m_ParseVault[m_ParsePos].fValue = fValue; m_ParseVault[m_ParsePos].fValue = fValue;
// loop through the registered funcs, and decide whether they have to be called or not // loop through the registered funcs, and decide whether they have to be called
// if they shouldnt, their m_Done is set to true bool skip;
for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter)
{ {
if ((*iter).m_Done) if ((*iter)->m_Done)
continue; // already skipped; don't bother with parsing continue;
// loop through conditions skip = false;
for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next) ClEvent::CondMapIter condIter = (*iter)->m_Conditions.find(m_ParsePos);
if (condIter == (*iter)->m_Conditions.end())
continue;
do
{ {
if (condIter->paramId == m_ParsePos) switch(condIter->second.type)
{ {
bool execute = false; case '=': if (condIter->second.fValue == fValue) skip=true; break;
switch(condIter->type) case '!': if (condIter->second.fValue != fValue) skip=true; break;
{ case '<': if (fValue < condIter->second.fValue) skip=true; break;
case '=': if (condIter->fValue == fValue) execute=true; break; case '>': if (fValue > condIter->second.fValue) skip=true; break;
case '!': if (condIter->fValue != fValue) execute=true; break;
case '<': if (fValue < condIter->fValue) execute=true; break;
case '>': if (fValue > condIter->fValue) execute=true; break;
}
if (execute)
continue;
(*iter).m_Done = true; // don't execute
break;
} }
} if (skip)
break;
} while ( ++condIter != (*iter)->m_Conditions.end() );
if (skip)
continue;
(*iter)->m_Done = true;
} }
} }
@ -356,37 +302,42 @@ void EventsMngr::parseValue(const char *sz)
return; return;
// grow if needed // grow if needed
++m_ParsePos; if (m_ParseVault.size() <= static_cast<size_t>(++m_ParsePos))
NextParam(); {
MsgDataVault tmp;
m_ParseVault.push_back(tmp);
}
m_ParseVault[m_ParsePos].type = MSG_STRING; m_ParseVault[m_ParsePos].type = MSG_STRING;
m_ParseVault[m_ParsePos].sValue = sz; m_ParseVault[m_ParsePos].sValue = sz;
// loop through the registered funcs, and decide whether they have to be called or not // loop through the registered funcs, and decide whether they have to be called
// if they shouldnt, their m_Done is set to true bool skip;
for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter)
{ {
if ((*iter).m_Done) if ((*iter)->m_Done)
continue; // already skipped; don't bother with parsing continue;
// loop through conditions skip = false;
for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next) ClEvent::CondMapIter condIter = (*iter)->m_Conditions.find(m_ParsePos);
if (condIter == (*iter)->m_Conditions.end())
continue;
do
{ {
if (condIter->paramId == m_ParsePos) switch(condIter->second.type)
{ {
bool execute = false; case '=': if (!strcmp(sz, condIter->second.sValue.c_str())) skip=true; break;
switch(condIter->type) case '!': if (!strstr(sz, condIter->second.sValue.c_str())) skip=true; break;
{ case '&': if (strstr(sz, condIter->second.sValue.c_str())) skip=true; break;
case '=': if (!strcmp(sz, condIter->sValue.str())) execute=true; break;
case '!': if (strcmp(sz, condIter->sValue.str())) execute=true; break;
case '&': if (strstr(sz, condIter->sValue.str())) execute=true; break;
}
if (execute)
continue;
(*iter).m_Done = true; // don't execute
break;
} }
} if (skip)
break;
} while ( ++condIter != (*iter)->m_Conditions.end() );
if (skip)
continue;
(*iter)->m_Done = true;
} }
} }
@ -403,20 +354,20 @@ void EventsMngr::executeEvents()
try try
{ {
#endif // #ifdef ENABLEEXEPTIONS #endif // #ifdef ENABLEEXEPTIONS
for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter)
{ {
if ( (*iter).m_Done ) if ( (*iter)->m_Done )
{ {
(*iter).m_Done = false; (*iter)->m_Done = false;
continue; continue;
} }
(*iter).m_Stamp = (float)*m_Timer; (*iter)->m_Stamp = *m_Timer;
if ((err = amx_Exec((*iter).m_Plugin->getAMX(), NULL, (*iter).m_Func, 1, m_ParseVaultSize ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE) if ((err = amx_Exec((*iter)->m_Plugin->getAMX(), NULL, (*iter)->m_Func, 1, m_ParseVault.size() ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE)
{ {
UTIL_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err, UTIL_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err,
(*iter).m_Plugin->getAMX()->curline, (*iter).m_Plugin->getName()); (*iter)->m_Plugin->getAMX()->curline, (*iter)->m_Plugin->getName());
} }
} }
@ -427,8 +378,6 @@ void EventsMngr::executeEvents()
UTIL_Log( "[AMXX] fatal error at event execution"); UTIL_Log( "[AMXX] fatal error at event execution");
} }
#endif // #ifdef ENABLEEXEPTIONS #endif // #ifdef ENABLEEXEPTIONS
m_ParseFun = NULL;
} }
int EventsMngr::getArgNum() int EventsMngr::getArgNum()
@ -492,6 +441,11 @@ void EventsMngr::clearEvents(void)
{ {
for (int i = 0; i < MAX_AMX_REG_MSG; ++i) for (int i = 0; i < MAX_AMX_REG_MSG; ++i)
{ {
for (ClEventVecIter iter = m_Events[i].begin(); iter != m_Events[i].end(); ++iter)
{
if (*iter)
delete *iter;
}
m_Events[i].clear(); m_Events[i].clear();
} }
} }

View File

@ -32,6 +32,10 @@
#ifndef __CEVENTS_H__ #ifndef __CEVENTS_H__
#define __CEVENTS_H__ #define __CEVENTS_H__
#include <vector>
#include <map>
#include <string>
#define MAX_AMX_REG_MSG MAX_REG_MSGS+16 #define MAX_AMX_REG_MSG MAX_REG_MSGS+16
enum { enum {
@ -86,48 +90,46 @@ public:
// conditions // conditions
struct cond_t struct cond_t
{ {
int paramId; // the message parameter id std::string sValue; // value
float fValue;
String sValue; // value (string) int iValue;
float fValue; // value (float) int type;
int iValue; // value (int)
int type; // type (can be int, float, string)
cond_t *next;
}; };
cond_t *m_Conditions; typedef std::pair<int, cond_t> CondMapPair;
typedef std::map<int, cond_t> CondMap;
typedef CondMap::iterator CondMapIter;
CondMap m_Conditions;
public:
// constructors & destructors // constructors & destructors
ClEvent(CPluginMngr::CPlugin* plugin, int func, int flags); ClEvent(CPluginMngr::CPlugin* plugin, int func, int flags);
~ClEvent(); ~ClEvent();
public:
inline CPluginMngr::CPlugin* getPlugin(); inline CPluginMngr::CPlugin* getPlugin();
inline int getFunction(); inline int getFunction();
void registerFilter(char* filter); // add a condition void registerFilter(char* filter); // add a condition
}; };
private: private:
struct MsgDataEntry struct MsgDataVault
{ {
float fValue; float fValue;
int iValue; int iValue;
const char* sValue; const char* sValue;
MsgParamType type; MsgParamType type;
}; };
MsgDataEntry *m_ParseVault; typedef std::vector<MsgDataVault> MsgDataVaultVec;
int m_ParseVaultSize; typedef MsgDataVaultVec::iterator MsgDataVaultVecIter;
void NextParam(); // make sure a new parameter can be added MsgDataVaultVec m_ParseVault;
typedef CList<ClEvent> ClEventVec; typedef std::vector<ClEvent*> ClEventVec;
typedef ClEventVec::iterator ClEventVecIter; typedef ClEventVec::iterator ClEventVecIter;
ClEventVec m_Events[MAX_AMX_REG_MSG]; ClEventVec m_Events[MAX_AMX_REG_MSG];
ClEventVec *m_ParseFun; // current Event vector ClEventVec *m_ParseFun; // current Event vector
bool m_ParseNotDone; bool m_ParseNotDone;
int m_ParsePos; // is args. num. - 1 int m_ParsePos; // is -1 less then args. num.
float* m_Timer; float* m_Timer;
ClEvent* getValidEvent(ClEvent* a ); ClEvent* getValidEvent(ClEvent* a );

View File

@ -29,7 +29,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc-2.95 CC_LINUX=gcc
ifeq "$(OS)" "WIN32" ifeq "$(OS)" "WIN32"
CC_WIN32=gcc CC_WIN32=gcc
LD_WINDLL=dllwrap LD_WINDLL=dllwrap
@ -61,7 +61,7 @@ OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o) OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -O2 -march=i686 -ffast-math -funroll-loops \ CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG -malign-jumps=2 -malign-functions=2 -s -DNDEBUG
@ -72,7 +72,7 @@ CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $< DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $< DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ LINK_LINUX=$(CC_LINUX) $(CFLAGS) -lstdc++ -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@ LINK_WIN32=$(LD_WINDLL) -mwindows --def $(MODNAME).def --add-stdcall-alias $(OBJ_WIN32) $(OBJC_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c $(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c

View File

@ -10,8 +10,10 @@
* including commercial applications, and to alter it and redistribute it * including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions: * freely, subject to the following restrictions:
* *
* PM: Whole file changed
*/ */
#if defined __linux__ #define LINUX
#if defined LINUX
#include <sclinux.h> #include <sclinux.h>
#endif #endif
#ifndef __AMX_H #ifndef __AMX_H
@ -20,7 +22,7 @@
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got /* The ISO C99 defines the int16_t and int_32t types. If the compiler got
* here, these types are probably undefined. * here, these types are probably undefined.
*/ */
#if defined __LCC__ || defined __linux__ #if defined __LCC__ || defined LINUX
#include <stdint.h> #include <stdint.h>
#else #else
typedef short int int16_t; typedef short int int16_t;
@ -107,7 +109,7 @@ typedef int (AMXAPI *AMX_DEBUG)(struct tagAMX *amx);
#define PACKED #define PACKED
#endif #endif
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined __linux__ #if defined LINUX
#pragma pack(1) /* structures must be packed (byte-aligned) */ #pragma pack(1) /* structures must be packed (byte-aligned) */
#else #else
#pragma pack(push) #pragma pack(push)
@ -296,7 +298,7 @@ int AMXAPI amx_SetUserData(AMX *amx, long tag, void *ptr);
char * AMXAPI amx_StrError(int errnum); char * AMXAPI amx_StrError(int errnum);
int AMXAPI amx_StrLen(cell *cstring, int *length); int AMXAPI amx_StrLen(cell *cstring, int *length);
#if !defined AMX_NO_ALIGN #if !defined AMX_NO_ALIGN
#if defined __linux__ #if defined LINUX
#pragma pack() /* reset default packing */ #pragma pack() /* reset default packing */
#else #else
#pragma pack(pop) /* reset previous packing */ #pragma pack(pop) /* reset previous packing */

View File

@ -33,7 +33,7 @@
#include <meta_api.h> #include <meta_api.h>
#include <time.h> #include <time.h>
#include "amxmod.h" #include "amxmod.h"
#include <string>
static cell AMX_NATIVE_CALL get_xvar_id(AMX *amx, cell *params) static cell AMX_NATIVE_CALL get_xvar_id(AMX *amx, cell *params)
{ {
@ -401,6 +401,11 @@ static cell AMX_NATIVE_CALL get_user_userid(AMX *amx, cell *params) /* 1 param *
return pPlayer->initialized ? GETPLAYERUSERID(pPlayer->pEdict) : -1; return pPlayer->initialized ? GETPLAYERUSERID(pPlayer->pEdict) : -1;
} }
static cell AMX_NATIVE_CALL get_user_wonid(AMX *amx, cell *params) //1 param
{
return 0;
}
static cell AMX_NATIVE_CALL get_user_authid(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL get_user_authid(AMX *amx, cell *params) /* 3 param */
{ {
@ -1014,95 +1019,6 @@ static cell AMX_NATIVE_CALL set_cvar_string(AMX *amx, cell *params) /* 2 param *
return 1; return 1;
} }
static cell AMX_NATIVE_CALL message_begin(AMX *amx, cell *params) /* 4 param */
{
int numparam = *params/sizeof(cell);
Vector vecOrigin;
cell *cpOrigin;
switch (params[1]){
case MSG_BROADCAST:
case MSG_ALL:
case MSG_SPEC:
MESSAGE_BEGIN( params[1], params[2],NULL );
break;
case MSG_PVS: case MSG_PAS:
if (numparam < 3) {
amx_RaiseError(amx,AMX_ERR_NATIVE);
return 0;
}
cpOrigin = get_amxaddr(amx,params[3]);
vecOrigin.x = *cpOrigin;
vecOrigin.y = *(cpOrigin+1);
vecOrigin.z = *(cpOrigin+2);
MESSAGE_BEGIN( params[1], params[2] , vecOrigin );
break;
case MSG_ONE:
if (numparam < 4) {
amx_RaiseError(amx,AMX_ERR_NATIVE);
return 0;
}
MESSAGE_BEGIN( MSG_ONE, params[2], NULL, INDEXENT(params[4]) );
break;
}
return 1;
}
static cell AMX_NATIVE_CALL message_end(AMX *amx, cell *params)
{
MESSAGE_END();
return 1;
}
static cell AMX_NATIVE_CALL write_byte(AMX *amx, cell *params) /* 1 param */
{
WRITE_BYTE( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_char(AMX *amx, cell *params) /* 1 param */
{
WRITE_CHAR( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_short(AMX *amx, cell *params) /* 1 param */
{
WRITE_SHORT( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_long(AMX *amx, cell *params) /* 1 param */
{
WRITE_LONG( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_entity(AMX *amx, cell *params) /* 1 param */
{
WRITE_ENTITY( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_angle(AMX *amx, cell *params) /* 1 param */
{
WRITE_ANGLE( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_coord(AMX *amx, cell *params) /* 1 param */
{
WRITE_COORD( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_string(AMX *amx, cell *params) /* 1 param */
{
int a;
WRITE_STRING( get_amxstring(amx,params[1],3,a) );
return 1;
}
static cell AMX_NATIVE_CALL log_message(AMX *amx, cell *params) /* 1 param */ static cell AMX_NATIVE_CALL log_message(AMX *amx, cell *params) /* 1 param */
{ {
int len; int len;
@ -2093,46 +2009,23 @@ static cell AMX_NATIVE_CALL get_modulesnum(AMX *amx, cell *params)
return static_cast<cell>(g_modules.size()); return static_cast<cell>(g_modules.size());
} }
// native get_module(id, name[], nameLen, author[], authorLen, version[], versionLen, &status); // native get_module(id, name[], nameLen, author[], authorLen, version[], versionLen);
static cell AMX_NATIVE_CALL get_module(AMX *amx, cell *params) static cell AMX_NATIVE_CALL get_module(AMX *amx, cell *params)
{ {
CList<CModule>::iterator moduleIter; CList<CModule>::iterator moduleIter;
// find the module
int i = params[1]; int i = params[1];
for (moduleIter = g_modules.begin(); moduleIter && i; ++moduleIter) for (moduleIter = g_modules.begin(); moduleIter && i; ++moduleIter)
--i; --i;
if (i != 0 || !moduleIter) if (i != 0 || !moduleIter)
return -1; // not found return -1;
// set name, author, version
module_info_s *info = (*moduleIter).getInfo(); module_info_s *info = (*moduleIter).getInfo();
set_amxstring(amx, params[2], info->name, params[3]); set_amxstring(amx, params[2], info->name, params[3]);
set_amxstring(amx, params[4], info->author, params[5]); set_amxstring(amx, params[4], info->author, params[5]);
set_amxstring(amx, params[6], info->version, params[7]); set_amxstring(amx, params[6], info->version, params[7]);
return params[1];
// compatibility problem possible
int numParams = params[0] / sizeof(cell);
if (numParams < 8)
{
CPluginMngr::CPlugin *curPlugin = g_plugins.findPluginFast(amx);
UTIL_Log("[AMXX] get_module: call to a previous version (plugin \"%s\", line %d)", curPlugin->getName(), amx->curline);
amx_RaiseError(amx, AMX_ERR_NATIVE);
}
// set status
cell *addr;
if (amx_GetAddr(amx, params[8], &addr) != AMX_ERR_NONE)
{
CPluginMngr::CPlugin *curPlugin = g_plugins.findPluginFast(amx);
UTIL_Log("[AMXX] get_module: invalid reference (plugin \"%s\", line %d)", curPlugin->getName(), amx->curline);
amx_RaiseError(amx, AMX_ERR_NATIVE);
}
*addr = (cell)(*moduleIter).getStatusValue();
return params[1];
} }
// native log_amx(const msg[], ...); // native log_amx(const msg[], ...);
@ -2140,7 +2033,6 @@ static cell AMX_NATIVE_CALL log_amx(AMX *amx, cell *params)
{ {
CPluginMngr::CPlugin *plugin = g_plugins.findPluginFast(amx); CPluginMngr::CPlugin *plugin = g_plugins.findPluginFast(amx);
int len; int len;
UTIL_Log("[%s] %s", plugin->getName(), format_amxstring(amx, params, 1, len)); UTIL_Log("[%s] %s", plugin->getName(), format_amxstring(amx, params, 1, len));
return 0; return 0;
} }
@ -2469,6 +2361,7 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
{ "get_user_userid", get_user_userid }, { "get_user_userid", get_user_userid },
{ "get_user_weapon", get_user_weapon}, { "get_user_weapon", get_user_weapon},
{ "get_user_weapons", get_user_weapons}, { "get_user_weapons", get_user_weapons},
{ "get_user_wonid", get_user_wonid},
{ "get_weaponname", get_weaponname}, { "get_weaponname", get_weaponname},
{ "get_xvar_float", get_xvar_num }, { "get_xvar_float", get_xvar_num },
{ "get_xvar_id", get_xvar_id }, { "get_xvar_id", get_xvar_id },
@ -2548,15 +2441,5 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
{ "callfunc_push_float", callfunc_push_byval }, { "callfunc_push_float", callfunc_push_byval },
{ "callfunc_push_intrf", callfunc_push_byref }, { "callfunc_push_intrf", callfunc_push_byref },
{ "callfunc_push_floatrf", callfunc_push_byref }, { "callfunc_push_floatrf", callfunc_push_byref },
{ "message_begin", message_begin },
{ "message_end", message_end },
{ "write_angle", write_angle },
{ "write_byte", write_byte },
{ "write_char", write_char },
{ "write_coord", write_coord },
{ "write_entity", write_entity },
{ "write_long", write_long },
{ "write_short", write_short },
{ "write_string", write_string },
{ NULL, NULL } { NULL, NULL }
}; };

View File

@ -46,7 +46,7 @@
#include "CMenu.h" #include "CMenu.h"
#include "CEvent.h" #include "CEvent.h"
#define AMX_VERSION "0.15" #define AMX_VERSION "0.1"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -212,20 +212,15 @@ int Spawn( edict_t *pent ) {
hostname = CVAR_GET_POINTER("hostname"); hostname = CVAR_GET_POINTER("hostname");
mp_timelimit = CVAR_GET_POINTER("mp_timelimit"); mp_timelimit = CVAR_GET_POINTER("mp_timelimit");
// we need to initialize logging in Meta_Attach, but we have to create a new logfile each map, // ###### Initialize logging
// so we clear g_log_dir in ServerDeactivate_Post to know we should create one... g_log_dir.set( get_localinfo("amx_logdir" , "addons/amxx/logs" ) );
if (g_log_dir.empty()) UTIL_MakeNewLogFile();
{
g_log_dir.set("addons/amxx/logs"); // :TODO: maybe not do this through String as an optimalization ( a #define or const char * ?)
UTIL_MakeNewLogFile();
}
// ###### 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 );
// ###### Initialize commands prefixes // ###### Initialize commands prefixes
g_commands.registerPrefix( "amx" ); g_commands.registerPrefix( "amx" );
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_" );
@ -233,7 +228,8 @@ int Spawn( edict_t *pent ) {
Vault amx_config; Vault amx_config;
// ###### Load custom path configuration // ###### Load custom path configuration
amx_config.setSource(build_pathname("%s", "addons/amxx/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();
@ -244,8 +240,11 @@ int Spawn( edict_t *pent ) {
amx_config.clear(); amx_config.clear();
} }
// ###### Make sure basedir is set
get_localinfo("amxx_basedir" , "addons/amxx" );
// ###### Load modules // ###### Load modules
int loaded = loadModules( "addons/amxx/modules.ini" ); int loaded = loadModules( get_localinfo("amxx_modules" , "addons/amxx/modules.ini" ) );
attachModules(); attachModules();
// Set some info about amx version and modules // Set some info about amx version and modules
if ( loaded ){ if ( loaded ){
@ -261,7 +260,8 @@ int Spawn( edict_t *pent ) {
} }
// ###### Load Vault // ###### Load Vault
g_vault.setSource( build_pathname("%s", "addons/amxx/configs/vault.ini" ) ); g_vault.setSource( build_pathname("%s",
get_localinfo("amxx_vault" , "addons/amxx/configs/vault.ini" ) ) );
g_vault.loadVault( ); g_vault.loadVault( );
@ -275,7 +275,8 @@ int Spawn( edict_t *pent ) {
memset(g_players[0].flags,-1,sizeof(g_players[0].flags)); memset(g_players[0].flags,-1,sizeof(g_players[0].flags));
// ###### Load AMX scripts // ###### Load AMX scripts
g_plugins.loadPluginsFromFile( "addons/amxx/plugins.ini" ); // :TODO: Where the hell should this be!?!?! g_plugins.loadPluginsFromFile(
get_localinfo("amxx_plugins" , "addons/amxx/plugins.ini" ) );
// ###### Call precache forward function // ###### Call precache forward function
g_dontprecache = false; g_dontprecache = false;
@ -439,7 +440,6 @@ void ServerDeactivate_Post() {
g_xvars.clear(); g_xvars.clear();
g_plugins.clear(); g_plugins.clear();
g_log_dir.clear();
UTIL_Log("Log file closed."); UTIL_Log("Log file closed.");
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
@ -973,12 +973,9 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
a = &gameDir[i]; a = &gameDir[i];
g_mod_name.set(a); g_mod_name.set(a);
// ###### Initialize logging here
g_log_dir.set("addons/amxx/logs"); // :TODO: maybe not do this through String as an optimalization ( a #define or const char * ?)
UTIL_MakeNewLogFile();
// ###### Now attach metamod modules // ###### Now attach metamod modules
attachMetaModModules( "addons/amxx/modules.ini" ); attachMetaModModules( get_localinfo("amxx_modules" ,
"addons/amxx/modules.ini" ) );
return(TRUE); return(TRUE);
} }
@ -1007,7 +1004,8 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
dettachModules(); dettachModules();
// ###### Now dettach metamod modules // ###### Now dettach metamod modules
dettachMetaModModules( "addons/amxx/modules.ini" ); dettachMetaModModules( get_localinfo("amxx_modules" ,
"addons/amxx/modules.ini" ) );
return(TRUE); return(TRUE);
} }

View File

@ -1,752 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="amxmod_mm"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\release"
IntermediateDirectory=".\release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\metamod\metamod,..\..\hlsdk\sourcecode\common,..\..\hlsdk\sourcecode\engine,..\..\hlsdk\sourcecode\dlls,..\..\hlsdk\sourcecode\pm_shared,..\extra\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;amxmod_mm_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\release/amxmod_mm.pch"
AssemblerListingLocation=".\release/"
ObjectFile=".\release/"
ProgramDataBaseFileName=".\release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"
CommandLine="copy &quot;$(TargetPath)&quot; D:\SIERRA\Half-Life\cstrike\addons\amx\dlls
"
Outputs="$(TargetName)"/>
<Tool
Name="VCLinkerTool"
OutputFile="release/amx_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\extra\lib_win32"
ModuleDefinitionFile=".\amxmod_mm.def"
ProgramDatabaseFile=".\release/amx_mm.pdb"
ImportLibrary=".\release/amx_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\release/amxmod_mm.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\debug"
IntermediateDirectory=".\debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\metamod\metamod,..\...\hlsdk\sourcecode\common,..\...\hlsdk\sourcecode\engine,..\...\hlsdk\sourcecode\dlls,..\...\hlsdk\sourcecode\pm_shared,..\extra\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;amxmod_mm_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
StructMemberAlignment="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\debug/amxmod_mm.pch"
AssemblerListingLocation=".\debug/"
ObjectFile=".\debug/"
ProgramDataBaseFileName=".\debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"
CommandLine="copy &quot;$(TargetPath)&quot; D:\SIERRA\Half-Life\cstrike\addons\amx\dlls
"
Outputs="$(TargetName)"/>
<Tool
Name="VCLinkerTool"
OutputFile="debug/amx_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\extra\lib_win32"
ModuleDefinitionFile=".\amxmod_mm.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\debug/amx_mm.pdb"
ImportLibrary=".\debug/amx_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\debug/amxmod_mm.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\amx.c">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\amxcore.c">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\amxmod.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\amxtime.c">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CCmd.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CEvent.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CFile.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CForward.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CLogEvent.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CMenu.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CMisc.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CModule.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CPlugin.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CString.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CTask.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\CVault.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\emsg.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\file.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\float.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\meta_api.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\modules.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\power.c">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\srvcmd.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\string.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\strptime.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\util.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\vault.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmod_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\amxmod.h">
</File>
<File
RelativePath="..\CCmd.h">
</File>
<File
RelativePath="..\CEvent.h">
</File>
<File
RelativePath="..\CFile.h">
</File>
<File
RelativePath="..\CForward.h">
</File>
<File
RelativePath="..\CList.h">
</File>
<File
RelativePath="..\CLogEvent.h">
</File>
<File
RelativePath="..\CMenu.h">
</File>
<File
RelativePath="..\CMisc.h">
</File>
<File
RelativePath="..\CModule.h">
</File>
<File
RelativePath="..\CPlugin.h">
</File>
<File
RelativePath="..\CString.h">
</File>
<File
RelativePath="..\CTask.h">
</File>
<File
RelativePath="..\CVault.h">
</File>
<File
RelativePath="..\modules.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Binary file not shown.

View File

@ -272,7 +272,7 @@ void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1,
g_fakecmd.fake = false; g_fakecmd.fake = false;
} }
String g_UTIL_LogFile; std::string g_UTIL_LogFile;
void UTIL_MakeNewLogFile() void UTIL_MakeNewLogFile()
{ {
@ -292,8 +292,8 @@ void UTIL_MakeNewLogFile()
int i = 0; int i = 0;
while (true) while (true)
{ {
g_UTIL_LogFile.set(build_pathname("%s/L%02d%02d%03d.log", g_log_dir.str(), curTime->tm_mon + 1, curTime->tm_mday, i)); g_UTIL_LogFile = build_pathname("%s/L%02d%02d%03d.log", g_log_dir.str(), curTime->tm_mon + 1, curTime->tm_mday, i);
FILE *pTmpFile = fopen(g_UTIL_LogFile.str(), "r"); // open for reading to check whether the file exists FILE *pTmpFile = fopen(g_UTIL_LogFile.c_str(), "r"); // open for reading to check whether the file exists
if (!pTmpFile) if (!pTmpFile)
break; break;
fclose(pTmpFile); fclose(pTmpFile);
@ -322,7 +322,7 @@ void UTIL_Log(const char *fmt, ...)
strftime(date, 31, "%m/%d/%Y - %H:%M:%S", curTime); strftime(date, 31, "%m/%d/%Y - %H:%M:%S", curTime);
// log msg now // log msg now
FILE *pF = fopen(g_UTIL_LogFile.str(), "a+"); FILE *pF = fopen(g_UTIL_LogFile.c_str(), "a+");
if (!pF) if (!pF)
return; // don't try to create a new logfile to prevent recursion crashes if there is an unforseen error return; // don't try to create a new logfile to prevent recursion crashes if there is an unforseen error

View File

@ -1,9 +1,8 @@
; AMX Mod X Modules; You can specify both linux & win32 modules here ; AMX Mod X Modules; You can specify both linux & win32 modules here
; Fun - This has extra functions ; Fun - This has extra functions
fun_amx.dll fun_amx.dll
fun_amx_i386.so fun_amx_i386.so
; Engine - This has engine functions core to half-life ; Engine - This has engine functions core to half-life
engine_amx.dll engine_amx.dll
engine_amx_i386.so engine_amx_i386.so

View File

@ -30,7 +30,7 @@
; Account flags: ; Account flags:
; a - disconnect player on invalid password ; a - disconnect player on invalid password
; b - clan tag ; b - clan tag
; c - this is steamid/wonid ; c - this is steamid
; d - this is ip ; d - this is ip
; e - password is not checked (only name/ip/steamid needed) ; e - password is not checked (only name/ip/steamid needed)

View File

@ -11,10 +11,22 @@
CCstrikePlayer::CCstrikePlayer() CCstrikePlayer::CCstrikePlayer()
{ {
//SetOnline(false);
SetModelled(false); SetModelled(false);
//SetTime(0.0);
SetInspectModel(false); SetInspectModel(false);
} }
/*bool CCstrikePlayer::GetOnline()
{
return online;
}
bool CCstrikePlayer::SetOnline(bool onlineIn)
{
return online = onlineIn;
}*/
bool CCstrikePlayer::GetModelled() bool CCstrikePlayer::GetModelled()
{ {
return modelled; return modelled;
@ -33,11 +45,22 @@ const char* CCstrikePlayer::GetModel()
return model; return model;
} }
void CCstrikePlayer::SetModel(const char* modelIn) const char* CCstrikePlayer::SetModel(const char* modelIn)
{ {
strcpy(model, modelIn); //SetTime(0.0);
return strcpy(model, modelIn);
} }
/*float CCstrikePlayer::GetTime()
{
return time;
}
void CCstrikePlayer::SetTime(float timeIn)
{
time = timeIn;
}
*/
bool CCstrikePlayer::GetInspectModel() bool CCstrikePlayer::GetInspectModel()
{ {
return inspectModel; return inspectModel;

View File

@ -10,17 +10,22 @@ class CCstrikePlayer
public: public:
CCstrikePlayer(); CCstrikePlayer();
/*bool GetOnline();
bool SetOnline(bool onlineIn);*/
bool GetModelled(); bool GetModelled();
bool SetModelled(bool modelledIn); bool SetModelled(bool modelledIn);
//float GetTime();
//void SetTime(float timeIn);
const char* GetModel(); const char* GetModel();
void SetModel(const char* modelIn); const char* SetModel(const char* modelIn);
bool GetInspectModel(); bool GetInspectModel();
void SetInspectModel(bool inspectModelIn); void SetInspectModel(bool inspectModelIn);
private: private:
bool inspectModel; bool online, inspectModel;
bool modelled; bool modelled;
char model[32]; char model[32];
//float time;
}; };
#endif // !defined(INCLUDED_CCSTRIKEPLAYER) #endif // !defined(INCLUDED_CCSTRIKEPLAYER)

View File

@ -1,4 +1,4 @@
MODNAME = cstrike_amx MODNAME = cstrike_mm
SRCFILES = cstrike.cpp CstrikePlayer.cpp SRCFILES = cstrike.cpp CstrikePlayer.cpp
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
@ -6,12 +6,12 @@ EXTRA_LIBS_WIN32 =
EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux
EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32 EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32
EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx EXTRA_INCLUDEDIRS = -Iextra/include
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
SDKTOP=../hlsdk SDKTOP=../hlsdk
METADIR=../metamodx METADIR=../metamod/metamod
SDKSRC=$(SDKTOP)/SourceCode SDKSRC=$(SDKTOP)/SourceCode
@ -25,7 +25,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc-2.95 CC_LINUX=gcc
ifeq "$(OS)" "WIN32" ifeq "$(OS)" "WIN32"
CC_WIN32=gcc CC_WIN32=gcc
LD_WINDLL=dllwrap LD_WINDLL=dllwrap
@ -57,9 +57,9 @@ OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o) OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \ CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG -malign-jumps=2 -malign-functions=2 -s -DNDEBUG -lstdc++
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas CFLAGS=-Wall -Wno-unknown-pragmas

View File

@ -175,15 +175,6 @@ static cell AMX_NATIVE_CALL cs_set_user_deaths(AMX *amx, cell *params) // cs_set
// Set deaths // Set deaths
*((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS) = params[2]; *((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS) = params[2];
// Update scoreboard here..?
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL));
WRITE_BYTE(params[1]);
WRITE_SHORT(pPlayer->v.frags);
WRITE_SHORT(params[2]);
WRITE_SHORT(0); // dunno what this parameter is (doesn't seem to be vip)
WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_TEAM));
MESSAGE_END();
return 1; return 1;
} }
@ -428,7 +419,7 @@ static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_us
return 0; return 0;
} }
if ( *((int *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP ) if ((int)((int *)pPlayer->pvPrivateData + OFFSET_VIP) == PLAYER_IS_VIP)
return 1; return 1;
return 0; return 0;
@ -457,9 +448,9 @@ static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_us
} }
if (params[2]) if (params[2])
*((int *)pPlayer->pvPrivateData + OFFSET_VIP) |= PLAYER_IS_VIP; *((int *)pPlayer->pvPrivateData + OFFSET_VIP) = PLAYER_IS_VIP;
else else
*((int *)pPlayer->pvPrivateData + OFFSET_VIP) &= ~PLAYER_IS_VIP; *((int *)pPlayer->pvPrivateData + OFFSET_VIP) = PLAYER_IS_NOT_VIP;
return 1; return 1;
} }

View File

@ -53,10 +53,10 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"Release/cstrike_amxx.dll"
# Begin Special Build Tool # Begin Special Build Tool
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PostBuild_Cmds=echo Copying dll... copy Release\cstrike.dll K:\S\cstrike\addons\amxx\modules\cstrike_amx.dll echo Copying inc... copy ..\plugins\include\cstrike.inc K:\S\cstrike\addons\amxx\scripting\include\ PostBuild_Cmds=echo Copying dll... copy Release\cstrike_amxx.dll K:\S\cstrike\addons\amx\dlls echo Copying inc... copy cstrike_amxx.inc K:\S\cstrike\addons\amx\examples\include
# End Special Build Tool # End Special Build Tool
!ELSEIF "$(CFG)" == "cstrike - Win32 Debug" !ELSEIF "$(CFG)" == "cstrike - Win32 Debug"
@ -125,7 +125,7 @@ SOURCE=.\CstrikePlayer.h
# End Group # End Group
# Begin Source File # Begin Source File
SOURCE=..\plugins\include\cstrike.inc SOURCE=.\cstrike_amxx.inc
# End Source File # End Source File
# End Target # End Target
# End Project # End Project

View File

@ -1,5 +1,4 @@
//#define __cswonbuild__ // comment when compiling for STEAM //#define __cswonbuild__ // comment when compiling for STEAM
//#define CS_WON_BUILD
/* AMX Mod X /* AMX Mod X
* Counter-Strike Module * Counter-Strike Module
@ -67,11 +66,11 @@ pfnmodule_engine_g* g_engModuleFunc;
#define NAME "Counter-Strike" #define NAME "Counter-Strike"
#define AUTHOR "AMX Mod X Dev Team" #define AUTHOR "AMX Mod X Dev Team"
#if defined __cswonbuild__ #if defined CS_WON_BUILD
#define VERSION "0.15 WON" // change both these versions #define VERSION "0.1 WON" // change both these versions
#else #else
#define VERSION "0.15 STEAM" // change both these versions #define VERSION "0.1" // change both these versions
#endif // defined __cswonbuild__ #endif // defined CS_WON_BUILD
#define URL "http://www.amxmodx.org" #define URL "http://www.amxmodx.org"
#define LOGTAG "AMXCS" #define LOGTAG "AMXCS"
#define DATE __DATE__ #define DATE __DATE__
@ -115,8 +114,7 @@ pfnmodule_engine_g* g_engModuleFunc;
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET // same as STEAM #define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET // same as STEAM
#define OFFSET_SILENCER_FIREMODE 70 + EXTRAOFFSET // differs -4 from STEAM #define OFFSET_SILENCER_FIREMODE 70 + EXTRAOFFSET // differs -4 from STEAM
// "hostage_entity" entities // "hostage_entity" entities
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET // NOT YET CHECKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! find out before build //#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET // NOT YET CHECKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! find out before build
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET // same as STEAM
#define OFFSET_HOSTAGEID 487 + EXTRAOFFSET // same as STEAM #define OFFSET_HOSTAGEID 487 + EXTRAOFFSET // same as STEAM
#else // from here STEAM build looks for offsets #else // from here STEAM build looks for offsets
// "player" entities // "player" entities
@ -211,7 +209,8 @@ pfnmodule_engine_g* g_engModuleFunc;
#define FAMAS_AUTOMATIC 0 #define FAMAS_AUTOMATIC 0
#define FAMAS_BURSTMODE 16 #define FAMAS_BURSTMODE 16
#define PLAYER_IS_VIP (1<<8) #define PLAYER_IS_NOT_VIP 0
#define PLAYER_IS_VIP 256
#define TEAM_T 1 #define TEAM_T 1
#define TEAM_CT 2 #define TEAM_CT 2

View File

@ -1,217 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="cstrike"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/cstrike.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="Debug/cstrike_amxx_debug.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\cstrike.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/cstrike_amxx_debug.pdb"
ImportLibrary=".\Debug/cstrike_amxx_debug.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/cstrike.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1053"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;CSTRIKE_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/cstrike.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="Release/cstrike_amxx.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\cstrike.def"
ProgramDatabaseFile=".\Release/cstrike_amxx.pdb"
ImportLibrary=".\Release/cstrike_amxx.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/cstrike.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="echo Copying dll...
copy Release\cstrike_amxx.dll K:\S\cstrike\addons\amx\dlls
echo Copying inc...
copy cstrike_amxx.inc K:\S\cstrike\addons\amx\examples\include
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1053"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="cstrike.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="cstrike.def">
</File>
<File
RelativePath="CstrikePlayer.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;CSTRIKE_EXPORTS;$(NoInherit)"
BrowseInformation="1"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="cstrike.h">
</File>
<File
RelativePath="CstrikePlayer.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="cstrike_amxx.inc">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,4 +1,4 @@
MODNAME = engine_amx MODNAME = engine_mm
SRCFILES = meta_api.cpp SRCFILES = meta_api.cpp
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
@ -6,12 +6,12 @@ EXTRA_LIBS_WIN32 =
EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux
EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32 EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32
EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx EXTRA_INCLUDEDIRS = -Iextra/include
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
SDKTOP=../hlsdk SDKTOP=../hlsdk
METADIR=../metamodx METADIR=../metamod/metamod
SDKSRC=$(SDKTOP)/SourceCode SDKSRC=$(SDKTOP)/SourceCode
@ -57,9 +57,9 @@ OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o) OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \ CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG -malign-jumps=2 -malign-functions=2 -s -DNDEBUG -lstdc++
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS) INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/pm_shared -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
CFLAGS=-Wall -Wno-unknown-pragmas CFLAGS=-Wall -Wno-unknown-pragmas

View File

@ -32,12 +32,16 @@
* version. * version.
*/ */
#define VERSION "0.15" #define VERSION "0.1"
#include <string>
using namespace std;
plugin_info_t Plugin_info = { plugin_info_t Plugin_info = {
META_INTERFACE_VERSION, // ifvers META_INTERFACE_VERSION, // ifvers
"ENGINE", // name "Engine", // name
VERSION, // version VERSION, // version
__DATE__, // date __DATE__, // date
"AMX Mod X Dev Team", // author "AMX Mod X Dev Team", // author
@ -49,7 +53,7 @@ plugin_info_t Plugin_info = {
}; };
module_info_s module_info = { module_info_s module_info = {
"ENGINE", // name "Engine", // name
"AMX Mod X Dev Team", // author "AMX Mod X Dev Team", // author
VERSION, // version VERSION, // version
AMX_INTERFACE_VERSION, AMX_INTERFACE_VERSION,
@ -111,8 +115,6 @@ int thread_fork(void *arg);
#define AMS_OFFSET 0.01 #define AMS_OFFSET 0.01
#define GETINFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
#define SPEAK_NORMAL 0 #define SPEAK_NORMAL 0
#define SPEAK_MUTED 1 #define SPEAK_MUTED 1
#define SPEAK_ALL 2 #define SPEAK_ALL 2
@ -129,52 +131,6 @@ int thread_fork(void *arg);
#define BLOCK_ONCE 1 #define BLOCK_ONCE 1
#define BLOCK_SET 2 #define BLOCK_SET 2
//jghg
enum globals {
// Edict
GL_trace_ent = 0,
// Float
GL_coop,
GL_deathmatch,
GL_force_retouch,
GL_found_secrets,
GL_frametime,
GL_serverflags,
GL_teamplay,
GL_time,
GL_trace_allsolid,
GL_trace_fraction,
GL_trace_inopen,
GL_trace_inwater,
GL_trace_plane_dist,
GL_trace_startsolid,
// Int
GL_cdAudioTrack,
GL_maxClients,
GL_maxEntities,
GL_msg_entity,
GL_trace_flags,
GL_trace_hitgroup,
// String
GL_pStringBase,
GL_mapname,
GL_startspot,
// Vector
GL_trace_endpos,
GL_trace_plane_normal,
GL_v_forward,
GL_v_right,
GL_v_up,
GL_vecLandmarkOffset,
// Void (not supported)
GL_pSaveData
};
enum { enum {
gamestate, gamestate,
oldbuttons, oldbuttons,
@ -356,7 +312,6 @@ enum {
arg_entity, arg_entity,
}; };
//by BAILOPAN
class argStack { class argStack {
public: public:
argStack(argStack *p=NULL) //initialize with link to previous argStack(argStack *p=NULL) //initialize with link to previous
@ -374,7 +329,6 @@ public:
writeangle = 0.0; writeangle = 0.0;
writecoord = 0.0; writecoord = 0.0;
writeentity = 0; writeentity = 0;
writestring = NULL;
} }
argStack* arg() argStack* arg()
@ -390,13 +344,6 @@ public:
return next; return next;
} }
~argStack()
{
if (writestring != NULL) {
delete [] writestring;
}
}
void put(int arg_type, int i) void put(int arg_type, int i)
{ {
argtype = arg_type; argtype = arg_type;
@ -440,9 +387,7 @@ public:
switch (argtype) switch (argtype)
{ {
case arg_string: case arg_string:
delete [] writestring; writestring.append((char *)sz);
writestring = new char[strlen(sz)+1];
strcpy(writestring, sz);
break; break;
} }
} }
@ -470,7 +415,7 @@ public:
WRITE_COORD(writecoord); WRITE_COORD(writecoord);
break; break;
case arg_string: case arg_string:
WRITE_STRING(writestring); WRITE_STRING(writestring.c_str());
break; break;
case arg_entity: case arg_entity:
WRITE_ENTITY(writeentity); WRITE_ENTITY(writeentity);
@ -521,7 +466,7 @@ public:
switch (argtype) switch (argtype)
{ {
case arg_string: case arg_string:
return strlen(writestring); return (writestring.length());
break; break;
} }
return 0; return 0;
@ -532,7 +477,7 @@ public:
switch (argtype) switch (argtype)
{ {
case arg_string: case arg_string:
return (const char*)writestring; return writestring.c_str();
break; break;
} }
@ -726,20 +671,6 @@ public:
} }
} }
void destroy()
{
argStack *p;
while (next != NULL) {
p = next->link();
delete next;
next = p;
}
if (p != NULL) {
delete p;
p = NULL;
}
}
private: private:
int argtype; int argtype;
int writebyte; int writebyte;
@ -748,7 +679,7 @@ private:
int writelong; int writelong;
float writeangle; float writeangle;
float writecoord; float writecoord;
char *writestring; std::string writestring;
int writeentity; int writeentity;
argStack *next; argStack *next;
}; };
@ -828,9 +759,16 @@ public:
void Destroy() void Destroy()
{ {
CHeadArg->destroy(); argStack *p;
delete CHeadArg;
CHeadArg = NULL; p = CHeadArg->link();
while (p) {
argStack *n = p->link();
delete p;
p = n;
}
argcount = 0;
} }
bool Set(int n, int arg_type, int data) bool Set(int n, int arg_type, int data)

View File

@ -1,187 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="engine"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/engine.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="release/engine_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\engine.def"
ProgramDatabaseFile=".\Release/engine_mm.pdb"
ImportLibrary=".\Release/engine_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/engine.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/engine.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Debug/engine.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\engine.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/engine.pdb"
ImportLibrary=".\Debug/engine.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/engine.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="engine.h">
</File>
<File
RelativePath="meta_api.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;ENGINE_EXPORTS;$(NoInherit)"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;ENGINE_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath="engine.def">
</File>
<File
RelativePath="engine.inc">
</File>
</Filter>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -42,47 +42,16 @@
#include <limits.h> #include <limits.h>
#include "engine.h" #include "engine.h"
extern "C" void destroy(MessageInfo* p) {
delete p;
}
GlobalInfo GlInfo; GlobalInfo GlInfo;
MessageInfo *msgd = NULL; MessageInfo *msgd;
bool isMsgHooked[MAX_MESSAGES]; bool isMsgHooked[MAX_MESSAGES];
int inHookProcess; int inHookProcess;
edict_t *valid_ent(int ent);
edict_t *valid_player(int ent);
void UTIL_SetSize(edict_t *pev, const Vector &vecMin, const Vector &vecMax) cvar_t amxxe_version = {"amxxe_version", VERSION, FCVAR_SERVER, 0};
{
SET_SIZE(ENT(pev), vecMin, vecMax);
}
edict_t *valid_player(int ent)
{
if (ent < 1 || ent > gpGlobals->maxClients) {
return NULL;
}
edict_t *e = INDEXENT(ent);
if (FNullEnt(e)) {
return NULL;
}
return e;
}
edict_t *valid_ent(int ent)
{
if (ent < 1 || ent > gpGlobals->maxEntities) {
return NULL;
}
edict_t *e = INDEXENT(ent);
if (FNullEnt(e)) {
return NULL;
}
return e;
}
//from OLO //from OLO
char* get_amxstring(AMX *amx,cell amx_addr,int id, int& len) char* get_amxstring(AMX *amx,cell amx_addr,int id, int& len)
@ -219,7 +188,7 @@ static cell AMX_NATIVE_CALL get_msg_arg_int(AMX *amx, cell *params)
int argn = params[1]; int argn = params[1];
if (inHookProcess && msgd!=NULL) { if (inHookProcess && msgd!=NULL) {
if (argn <= msgd->args() && argn > 0) { if (argn < msgd->args() && argn > 0) {
return msgd->RetArg_Int(argn); return msgd->RetArg_Int(argn);
} else { } else {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
@ -242,7 +211,7 @@ static cell AMX_NATIVE_CALL get_msg_arg_float(AMX *amx, cell *params)
float retVal; float retVal;
if (inHookProcess && msgd!=NULL) { if (inHookProcess && msgd!=NULL) {
if (argn <= msgd->args() && argn > 0) { if (argn < msgd->args() && argn > 0) {
retVal = msgd->RetArg_Float(argn); retVal = msgd->RetArg_Float(argn);
return *(cell*)((void *)&retVal); return *(cell*)((void *)&retVal);
} else { } else {
@ -264,20 +233,16 @@ static cell AMX_NATIVE_CALL get_msg_arg_string(AMX *amx, cell *params)
int argn = params[1]; int argn = params[1];
int iLen = 0; int iLen = 0;
char *szValue = '\0'; char *szValue = '\0';
char *szRetr;
if (inHookProcess && msgd!=NULL) { if (inHookProcess && msgd!=NULL) {
if (argn <= msgd->args() && argn > 0) { if (argn < msgd->args() && argn > 0) {
iLen = msgd->RetArg_Strlen(argn); iLen = msgd->RetArg_Strlen(argn);
szValue = new char[iLen+1]; szValue = new char[iLen+1];
szRetr = (char *)msgd->RetArg_String(argn); strcpy(szValue, msgd->RetArg_String(argn));
if (szRetr != NULL) { if (strlen(szValue)) {
strcpy(szValue, szRetr); return SET_AMXSTRING(amx, params[2], szValue, params[3]);
if (strlen(szValue)) { } else {
return SET_AMXSTRING(amx, params[2], szValue, params[3]); return SET_AMXSTRING(amx, params[2], "", params[3]);
} else {
return SET_AMXSTRING(amx, params[2], "", params[3]);
}
} }
} else { } else {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE); AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
@ -299,7 +264,7 @@ static cell AMX_NATIVE_CALL set_msg_arg_string(AMX *amx, cell *params)
char *szData = AMX_GET_STRING(amx, params[2], iLen); char *szData = AMX_GET_STRING(amx, params[2], iLen);
if (inHookProcess && msgd!=NULL) { if (inHookProcess && msgd!=NULL) {
if (argn <= msgd->args() && argn > 0) { if (argn < msgd->args() && argn > 0) {
if (msgd->Set(argn, arg_string, szData)) { if (msgd->Set(argn, arg_string, szData)) {
return 1; return 1;
} else { } else {
@ -324,7 +289,7 @@ static cell AMX_NATIVE_CALL set_msg_arg_float(AMX *amx, cell *params)
int argtype = params[2]; int argtype = params[2];
if (inHookProcess && msgd!=NULL) { if (inHookProcess && msgd!=NULL) {
if (argn <= msgd->args() && argn > 0) { if (argn < msgd->args() && argn > 0) {
if (msgd->Set(argn, argtype, params[3])) { if (msgd->Set(argn, argtype, params[3])) {
return 1; return 1;
} else { } else {
@ -350,7 +315,7 @@ static cell AMX_NATIVE_CALL set_msg_arg_int(AMX *amx, cell *params)
int iData = params[3]; int iData = params[3];
if (inHookProcess && msgd!=NULL) { if (inHookProcess && msgd!=NULL) {
if (argn <= msgd->args() && argn > 0) { if (argn < msgd->args() && argn > 0) {
if (msgd->Set(argn, argtype, iData)) { if (msgd->Set(argn, argtype, iData)) {
return 1; return 1;
} else { } else {
@ -459,6 +424,100 @@ static cell AMX_NATIVE_CALL get_offset_short(AMX *amx, cell *params)
} }
////////////////////////////////////////////
//THESE ARE FROM amxmod.cpp!!!
////////////////////////////////////////////
static cell AMX_NATIVE_CALL message_begin(AMX *amx, cell *params) /* 4 param */
{
int numparam = *params/sizeof(cell);
Vector vecOrigin;
cell *cpOrigin;
switch (params[1]){
case MSG_BROADCAST:
case MSG_ALL:
case MSG_SPEC:
MESSAGE_BEGIN( params[1], params[2],NULL );
break;
case MSG_PVS: case MSG_PAS:
if (numparam < 3) {
AMX_RAISEERROR(amx,AMX_ERR_NATIVE);
return 0;
}
cpOrigin = get_amxaddr(amx,params[3]);
vecOrigin.x = *cpOrigin;
vecOrigin.y = *(cpOrigin+1);
vecOrigin.z = *(cpOrigin+2);
MESSAGE_BEGIN( params[1], params[2] , vecOrigin );
break;
case MSG_ONE:
if (numparam < 4) {
AMX_RAISEERROR(amx,AMX_ERR_NATIVE);
return 0;
}
MESSAGE_BEGIN( MSG_ONE, params[2], NULL, INDEXENT(params[4]) );
break;
}
return 1;
}
static cell AMX_NATIVE_CALL message_end(AMX *amx, cell *params)
{
MESSAGE_END();
return 1;
}
static cell AMX_NATIVE_CALL write_byte(AMX *amx, cell *params) /* 1 param */
{
WRITE_BYTE( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_char(AMX *amx, cell *params) /* 1 param */
{
WRITE_CHAR( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_short(AMX *amx, cell *params) /* 1 param */
{
WRITE_SHORT( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_long(AMX *amx, cell *params) /* 1 param */
{
WRITE_LONG( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_entity(AMX *amx, cell *params) /* 1 param */
{
WRITE_ENTITY( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_angle(AMX *amx, cell *params) /* 1 param */
{
WRITE_ANGLE( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_coord(AMX *amx, cell *params) /* 1 param */
{
WRITE_COORD( params[1] );
return 1;
}
static cell AMX_NATIVE_CALL write_string(AMX *amx, cell *params) /* 1 param */
{
int a;
WRITE_STRING( get_amxstring(amx,params[1],3,a) );
return 1;
}
////////////////////////////////////////////
////////////////////////////////////////////
//(BAILOPAN) //(BAILOPAN)
//Gets a pvPrivateData offset for a player (player, offset, float=0) //Gets a pvPrivateData offset for a player (player, offset, float=0)
static cell AMX_NATIVE_CALL get_offset(AMX *amx, cell *params) static cell AMX_NATIVE_CALL get_offset(AMX *amx, cell *params)
@ -1571,22 +1630,22 @@ static cell AMX_NATIVE_CALL entity_get_byte(AMX *amx, cell *params) {
switch(iValueSet) { switch(iValueSet) {
case controller1: case controller1:
iRetValue = pEntity->v.controller[0];
break;
case controller2:
iRetValue = pEntity->v.controller[1]; iRetValue = pEntity->v.controller[1];
break; break;
case controller3: case controller2:
iRetValue = pEntity->v.controller[2]; iRetValue = pEntity->v.controller[2];
break; break;
case controller4: case controller3:
iRetValue = pEntity->v.controller[3]; iRetValue = pEntity->v.controller[3];
break; break;
case controller4:
iRetValue = pEntity->v.controller[4];
break;
case blending1: case blending1:
iRetValue = pEntity->v.blending[0]; iRetValue = pEntity->v.blending[1];
break; break;
case blending2: case blending2:
iRetValue = pEntity->v.blending[1]; iRetValue = pEntity->v.blending[2];
break; break;
default: default:
return 0; return 0;
@ -1771,14 +1830,17 @@ static cell AMX_NATIVE_CALL create_entity(AMX *amx, cell *params) {
} }
//ej ref'd by jghg //ej ref'd by jghg
static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param */ static cell AMX_NATIVE_CALL find_entity(AMX *amx, cell *params) /* 3 param */
{ {
edict_t *pEnt = INDEXENT(params[1]); edict_t *pSearch_after_ent = INDEXENT(params[1]);
char* sCatagory = NULL;
int len; int len;
char* sValue = GET_AMXSTRING(amx, params[2], 1, len); char* sValue = GET_AMXSTRING(amx, params[3], 1, len);
edict_t *pEnt = FIND_ENTITY_BY_STRING(pSearch_after_ent, "classname", sValue);
pEnt = FIND_ENTITY_BY_STRING(pEnt, "classname", sValue);
if(pEnt) // This even needed? if(pEnt) // This even needed?
return ENTINDEX(pEnt); return ENTINDEX(pEnt);
@ -2335,8 +2397,8 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) {
SET_MODEL(pNewCamera, "models/rpgrocket.mdl"); SET_MODEL(pNewCamera, "models/rpgrocket.mdl");
SET_SIZE(pNewCamera, Vector(0, 0, 0), Vector(0, 0, 0)); SET_SIZE(pNewCamera, Vector(0, 0, 0), Vector(0, 0, 0));
pNewCamera->v.movetype = MOVETYPE_NOCLIP; pNewCamera->v.movetype = MOVETYPE_FLY;
pNewCamera->v.solid = SOLID_NOT; pNewCamera->v.solid = SOLID_BBOX;
pNewCamera->v.takedamage = DAMAGE_NO; pNewCamera->v.takedamage = DAMAGE_NO;
pNewCamera->v.gravity = 0; pNewCamera->v.gravity = 0;
pNewCamera->v.owner = pPlayer; pNewCamera->v.owner = pPlayer;
@ -2364,8 +2426,8 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) {
SET_MODEL(pNewCamera, "models/rpgrocket.mdl"); SET_MODEL(pNewCamera, "models/rpgrocket.mdl");
SET_SIZE(pNewCamera, Vector(0, 0, 0), Vector(0, 0, 0)); SET_SIZE(pNewCamera, Vector(0, 0, 0), Vector(0, 0, 0));
pNewCamera->v.movetype = MOVETYPE_NOCLIP; pNewCamera->v.movetype = MOVETYPE_FLY;
pNewCamera->v.solid = SOLID_NOT; pNewCamera->v.solid = SOLID_BBOX;
pNewCamera->v.takedamage = DAMAGE_NO; pNewCamera->v.takedamage = DAMAGE_NO;
pNewCamera->v.gravity = 0; pNewCamera->v.gravity = 0;
pNewCamera->v.owner = pPlayer; pNewCamera->v.owner = pPlayer;
@ -2393,8 +2455,8 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) {
SET_MODEL(pNewCamera, "models/rpgrocket.mdl"); SET_MODEL(pNewCamera, "models/rpgrocket.mdl");
SET_SIZE(pNewCamera, Vector(0, 0, 0), Vector(0, 0, 0)); SET_SIZE(pNewCamera, Vector(0, 0, 0), Vector(0, 0, 0));
pNewCamera->v.movetype = MOVETYPE_NOCLIP; pNewCamera->v.movetype = MOVETYPE_FLY;
pNewCamera->v.solid = SOLID_NOT; pNewCamera->v.solid = SOLID_BBOX;
pNewCamera->v.takedamage = DAMAGE_NO; pNewCamera->v.takedamage = DAMAGE_NO;
pNewCamera->v.gravity = 0; pNewCamera->v.gravity = 0;
pNewCamera->v.owner = pPlayer; pNewCamera->v.owner = pPlayer;
@ -2443,254 +2505,6 @@ static cell AMX_NATIVE_CALL precache_generic(AMX *amx, cell *params)
return 1; return 1;
} }
//ported from jghg2
static cell AMX_NATIVE_CALL drop_to_floor(AMX *amx, cell *params)
{
int iEnt = params[1];
edict_t* e = valid_ent(iEnt);
if (e!=NULL) {
return DROP_TO_FLOOR(e);
}
return -1;
}
static cell AMX_NATIVE_CALL get_info_keybuffer(AMX *amx, cell *params)
{
int iEnt = params[1];
edict_t *e = valid_ent(iEnt);
if (e!=NULL) {
char *info = GETINFOKEYBUFFER(e);
return SET_AMXSTRING(amx, params[2], info, params[3]);
} else {
return 0;
}
}
static cell AMX_NATIVE_CALL force_use(AMX *amx, cell *params)
{
int pev = params[1];
int ent = params[2];
edict_t *pPlayer = valid_player(pev);
edict_t *pEntity = valid_ent(ent);
MDLL_Use(pEntity, pPlayer);
return 1;
}
static cell AMX_NATIVE_CALL get_global_float(AMX *amx, cell *params)
{
int global = params[1];
float returnValue;
switch (params[1]) {
case GL_coop:
returnValue = gpGlobals->coop;
break;
case GL_deathmatch:
returnValue = gpGlobals->deathmatch;
break;
case GL_force_retouch:
returnValue = gpGlobals->force_retouch;
break;
case GL_found_secrets:
returnValue = gpGlobals->found_secrets;
break;
case GL_frametime:
returnValue = gpGlobals->frametime;
break;
case GL_serverflags:
returnValue = gpGlobals->serverflags;
break;
case GL_teamplay:
returnValue = gpGlobals->teamplay;
break;
case GL_time:
returnValue = gpGlobals->time;
break;
case GL_trace_allsolid:
returnValue = gpGlobals->trace_allsolid;
break;
case GL_trace_fraction:
returnValue = gpGlobals->trace_fraction;
break;
case GL_trace_inopen:
returnValue = gpGlobals->trace_inopen;
break;
case GL_trace_inwater:
returnValue = gpGlobals->trace_inwater;
break;
case GL_trace_plane_dist:
returnValue = gpGlobals->trace_plane_dist;
break;
case GL_trace_startsolid:
returnValue = gpGlobals->trace_startsolid;
break;
default:
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
return *(cell*)((void *)&returnValue);
}
static cell AMX_NATIVE_CALL get_global_int(AMX *amx, cell *params)
{
int returnValue = 0;
switch (params[1]) {
case GL_cdAudioTrack:
returnValue = gpGlobals->cdAudioTrack;
break;
case GL_maxClients:
returnValue = gpGlobals->maxClients;
break;
case GL_maxEntities:
returnValue = gpGlobals->maxEntities;
break;
case GL_msg_entity:
returnValue = gpGlobals->msg_entity;
break;
case GL_trace_flags:
returnValue = gpGlobals->trace_flags;
break;
case GL_trace_hitgroup:
returnValue = gpGlobals->trace_hitgroup;
break;
default:
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
return returnValue;
}
static cell AMX_NATIVE_CALL get_global_string(AMX *amx, cell *params)
{
string_t* returnValue;
switch(params[1]) {
case GL_pStringBase: // const char *, so no string_t
return SET_AMXSTRING(amx, params[2], gpGlobals->pStringBase, params[3]);
// The rest are string_t:s...
case GL_mapname:
returnValue = &(gpGlobals->mapname);
break;
case GL_startspot:
returnValue = &(gpGlobals->startspot);
break;
default:
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
return SET_AMXSTRING(amx, params[2], STRING(*returnValue), params[3]);
}
static cell AMX_NATIVE_CALL get_global_vector(AMX *amx, cell *params) // globals_get_vector(variable, Float:vector[3]); = 2 params
{
cell *returnVector = GET_AMXADDR(amx, params[2]);
vec3_t fetchedVector;
switch (params[1]) {
case GL_trace_endpos:
fetchedVector = gpGlobals->trace_endpos;
break;
case GL_trace_plane_normal:
fetchedVector = gpGlobals->trace_plane_normal;
break;
case GL_v_forward:
fetchedVector = gpGlobals->v_forward;
break;
case GL_v_right:
fetchedVector = gpGlobals->v_right;
break;
case GL_v_up:
fetchedVector = gpGlobals->v_up;
break;
case GL_vecLandmarkOffset:
fetchedVector = gpGlobals->vecLandmarkOffset;
break;
default:
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
returnVector[0] = *(cell*)((void *)&fetchedVector.x);
returnVector[1] = *(cell*)((void *)&fetchedVector.y);
returnVector[2] = *(cell*)((void *)&fetchedVector.z);
return 1;
}
static cell AMX_NATIVE_CALL get_global_edict(AMX *amx, cell *params) // globals_get_edict(variable); = 1 param
{
edict_t* pReturnEntity;
switch (params[1]) {
case GL_trace_ent:
pReturnEntity = gpGlobals->trace_ent;
break;
default:
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
// Will crash if ENTINDEX() is called on bad pointer?
if(!FNullEnt(pReturnEntity))
return ENTINDEX(pReturnEntity);
return 0;
}
static cell AMX_NATIVE_CALL precache_event(AMX *amx, cell *params)
{
int len;
char *szEvent = FORMAT_AMXSTRING(amx, params, 2, len);
PRECACHE_EVENT(params[1], (char *)STRING(ALLOC_STRING(szEvent)));
return 1;
}
static cell AMX_NATIVE_CALL get_decal_index(AMX *amx, cell *params)
{
int len;
char *szDecal = GET_AMXSTRING(amx, params[1], 0, len);
return DECAL_INDEX(szDecal);
}
static cell AMX_NATIVE_CALL set_size(AMX *amx, cell *params)
{
int ent = params[1];
edict_t *e = valid_ent(ent);
if (e == NULL) {
return 0;
}
cell *cMin = GET_AMXADDR(amx, params[2]);
float x1 = *(float *)((void *)&cMin[0]);
float y1 = *(float *)((void *)&cMin[1]);
float z1 = *(float *)((void *)&cMin[2]);
Vector vMin = Vector(x1, y1, z1);
cell *cMax = GET_AMXADDR(amx, params[3]);
float x2 = *(float *)((void *)&cMax[0]);
float y2 = *(float *)((void *)&cMax[1]);
float z2 = *(float *)((void *)&cMax[2]);
Vector vMax = Vector(x2, y2, z2);
UTIL_SetSize(e, vMin, vMax);
return 1;
}
/******************************************** /********************************************
METAMOD HOOKED FUNCTIONS METAMOD HOOKED FUNCTIONS
*****************************************/ *****************************************/
@ -2875,7 +2689,7 @@ BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress
//(vexd) //(vexd)
void GameInit(void) { void GameInit(void) {
CVAR_REGISTER(&amxxe_version);
} }
// make sure that if we currently have an edited light value, to use it. // make sure that if we currently have an edited light value, to use it.
@ -2945,7 +2759,7 @@ void MessageEnd(void) {
msgd->SendMsg(); msgd->SendMsg();
RETURN_META(MRES_SUPERCEDE); RETURN_META(MRES_SUPERCEDE);
} }
delete msgd; destroy(msgd);
msgd = NULL; msgd = NULL;
} }
@ -3049,7 +2863,6 @@ void WriteEntity(int iValue) {
} }
void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ){ void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ){
PRECACHE_MODEL("models/rpgrocket.mdl");
AMX* amx; AMX* amx;
void* code; void* code;
const char* filename; const char* filename;
@ -3108,7 +2921,7 @@ void ServerDeactivate() {
} }
if (msgd != NULL) { if (msgd != NULL) {
delete msgd; destroy(msgd);
msgd = NULL; msgd = NULL;
} }
@ -3350,8 +3163,7 @@ AMX_NATIVE_INFO Engine_Natives[] = {
{"create_entity", create_entity}, {"create_entity", create_entity},
{"remove_entity", remove_entity}, {"remove_entity", remove_entity},
{"find_ent_by_class", find_ent_by_class}, {"find_entity", find_entity},
{"find_ent_by_classname", find_ent_by_class}, // just in case anyone likes typing the whole thing
{"find_ent_by_owner", find_ent_by_owner}, {"find_ent_by_owner", find_ent_by_owner},
{"find_ent_by_target", find_ent_by_target}, {"find_ent_by_target", find_ent_by_target},
{"find_ent_by_tname", find_ent_by_tname}, {"find_ent_by_tname", find_ent_by_tname},
@ -3376,19 +3188,17 @@ AMX_NATIVE_INFO Engine_Natives[] = {
{"get_msg_arg_string", get_msg_arg_string}, {"get_msg_arg_string", get_msg_arg_string},
{"get_msg_args", get_msg_args}, {"get_msg_args", get_msg_args},
{"get_msg_argtype", get_msg_argtype}, {"get_msg_argtype", get_msg_argtype},
{"message_begin", message_begin},
{"message_end", message_end},
{"write_angle", write_angle},
{"write_byte", write_byte},
{"write_char", write_char},
{"write_coord", write_coord},
{"write_entity", write_entity},
{"write_long", write_long},
{"write_short", write_short},
{"write_string", write_string},
{"is_valid_ent", is_valid_ent}, {"is_valid_ent", is_valid_ent},
{"drop_to_floor", drop_to_floor},
{"get_info_keybuffer", get_info_keybuffer},
{"force_use", force_use},
{"get_global_float", get_global_float},
{"get_global_int", get_global_int},
{"get_global_string", get_global_string},
{"get_global_edict", get_global_edict},
{"get_global_vector", get_global_vector},
{"set_size", set_size},
{"get_decal_index", get_decal_index},
{"precache_event", precache_event},
{"call_think", call_think},
{ NULL, NULL } { NULL, NULL }

View File

@ -1,4 +1,4 @@
MODNAME = fun_amx MODNAME = fun_mm
SRCFILES = fun.cpp SRCFILES = fun.cpp
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
@ -12,7 +12,7 @@ EXTRA_FLAGS = -Dstrcmpi=strcasecmp
AMXDIR=../amxmodx AMXDIR=../amxmodx
SDKTOP=../hlsdk SDKTOP=../hlsdk
METADIR=../metamodx METADIR=../metamod/metamod
SDKSRC=$(SDKTOP)/SourceCode SDKSRC=$(SDKTOP)/SourceCode
@ -26,7 +26,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc-2.95 CC_LINUX=gcc
ifeq "$(OS)" "WIN32" ifeq "$(OS)" "WIN32"
CC_WIN32=gcc CC_WIN32=gcc
LD_WINDLL=dllwrap LD_WINDLL=dllwrap
@ -55,7 +55,7 @@ endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i386 -O2 -ffast-math -funroll-loops \ CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG -lstdc++ -malign-jumps=2 -malign-functions=2 -s -DNDEBUG -lstdc++

View File

@ -67,18 +67,6 @@
} }
*/ */
// ######## Utils:
void FUNUTIL_ResetPlayer(int index)
{
// Reset silent slippers
g_silent[index] = false;
// Reset hitzones
g_zones_toHit[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);
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);
}
// ######## Natives:
static cell AMX_NATIVE_CALL get_client_listening(AMX *amx, cell *params) // get_client_listening(receiver, sender); = 2 params static cell AMX_NATIVE_CALL get_client_listening(AMX *amx, cell *params) // get_client_listening(receiver, sender); = 2 params
{ {
// Gets who can listen to who. // Gets who can listen to who.
@ -496,101 +484,21 @@ static cell AMX_NATIVE_CALL get_user_gravity(AMX *amx, cell *params) // Float:ge
return *(cell*)((void *)&(pPlayer->v.gravity)); // The way to return floats... (sigh) return *(cell*)((void *)&(pPlayer->v.gravity)); // The way to return floats... (sigh)
} }
/*static cell AMX_NATIVE_CALL set_hitzones(AMX *amx, cell *params) // set_hitzones(body = 255) = 1 argument static cell AMX_NATIVE_CALL set_hitzones(AMX *amx, cell *params) // set_hitzones(body = 255) = 1 argument
{ {
// Sets "hitable" zones. // Gets user gravity.
// params[1] = body hitzones // params[1] = body hitzones
//native set_user_hitzones(index=0,target=0,body=255); // Fetch player pointer
//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]; 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
{
// Sets user hitzones.
// params[1] = the one(s) who shoot(s), shooter
int shooter = params[1];
if (shooter == -1)
shooter = 0;
// params[2] = the one getting hit
int gettingHit = params[2];
if (gettingHit == -1)
gettingHit = 0;
// params[3] = specified hit zones
int hitzones = params[3];
if (hitzones == -1)
hitzones = 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
if (shooter == 0 && gettingHit == 0) {
// set hitzones for ALL, both where people can hit and where they can _get_ hit.
for (int i = 1; i <= 32; i++) {
g_zones_toHit[i] = hitzones;
g_zones_getHit[i] = hitzones;
}
}
else {
if (shooter == 0) {
// "All" shooters, target (gettingHit) should be existing player id
if (gettingHit < 1 || gettingHit > gpGlobals->maxClients) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
// Where can gettingHit get hit by all?
g_zones_getHit[gettingHit] = hitzones;
}
else {
// "shooter" will now only be able to hit other people in "hitzones". (target should be 0 here)
g_zones_toHit[shooter] = hitzones;
}
}
return 1; return 1;
} }
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_hitzones(AMX *amx, cell *params) // get_hitzones() = 0 arguments
{ {
// Gets user hitzones. // Gets hitzones.
// params[1] = if this is not 0, return what zones this player can hit return g_body;
int shooter = params[1];
// params[2] = if shooter was 0, and if this is a player, return what zones this player can get hit in, else... make runtime error?
int gettingHit = params[2];
if (shooter) {
if (FNullEnt(shooter)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
return g_zones_toHit[shooter];
}
else {
if (!gettingHit) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
else {
if (FNullEnt(gettingHit)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
else {
return g_zones_getHit[gettingHit];
}
}
}
} }
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
@ -673,11 +581,11 @@ static cell AMX_NATIVE_CALL set_user_footsteps(AMX *amx, cell *params) // set_us
if (params[2]) { if (params[2]) {
pPlayer->v.flTimeStepSound = 999; pPlayer->v.flTimeStepSound = 999;
g_silent[params[1]] = true; silent[params[1]] = true;
} }
else { else {
pPlayer->v.flTimeStepSound = STANDARDTIMESTEPSOUND; pPlayer->v.flTimeStepSound = STANDARDTIMESTEPSOUND;
g_silent[params[1]] = false; silent[params[1]] = false;
} }
return 1; return 1;
@ -699,8 +607,8 @@ AMX_NATIVE_INFO fun_Exports[] = {
{"get_user_maxspeed", get_user_maxspeed}, {"get_user_maxspeed", get_user_maxspeed},
{"set_user_gravity", set_user_gravity}, {"set_user_gravity", set_user_gravity},
{"get_user_gravity", get_user_gravity}, {"get_user_gravity", get_user_gravity},
{"set_user_hitzones", set_user_hitzones}, {"set_hitzones", set_hitzones},
{"get_user_hitzones", get_user_hitzones}, {"get_hitzones", get_hitzones},
{"set_user_noclip", set_user_noclip}, {"set_user_noclip", set_user_noclip},
{"get_user_noclip", get_user_noclip}, {"get_user_noclip", get_user_noclip},
{"set_user_footsteps", set_user_footsteps}, {"set_user_footsteps", set_user_footsteps},
@ -711,7 +619,7 @@ AMX_NATIVE_INFO fun_Exports[] = {
/******************************************************************************************/ /******************************************************************************************/
void PlayerPreThink(edict_t *pEntity) void PlayerPreThink(edict_t *pEntity)
{ {
if (g_silent[ENTINDEX(pEntity)]) { if (silent[ENTINDEX(pEntity)]) {
pEntity->v.flTimeStepSound = 999; pEntity->v.flTimeStepSound = 999;
RETURN_META(MRES_HANDLED); RETURN_META(MRES_HANDLED);
} }
@ -719,46 +627,14 @@ void PlayerPreThink(edict_t *pEntity)
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }
/* <--- removed, only needed with akimbot void ClientDisconnect( edict_t *pEntity)
int ClientConnect(edict_t *pPlayer, const char *pszName, const char *pszAddress, char szRejectReason[128])
{
int index = ENTINDEX(pPlayer);
if (index < 1 || index > gpGlobals->maxClients) // This is probably not really necessary... but just in case to not cause out of bounds errors below.
return 1;
// Find out if user is bot (this doesn't seem to be ever called when bot connects though, but leave it here)
const char* auth = GETPLAYERAUTHID(pPlayer);
if (strcmp(auth, "BOT") == 0)
g_bot[index] = true;
else
g_bot[index] = false;
// Reset stuff:
FUNUTIL_ResetPlayer(index);
return 1;
}
void ClientDisconnect(edict_t *pEntity)
{ {
int index = ENTINDEX(pEntity); int index = ENTINDEX(pEntity);
silent[index] = false;
if (index < 1 || index > gpGlobals->maxClients) // This is probably not really necessary... but just in case to not cause out of bounds errors below.
RETURN_META(MRES_IGNORED);
// Reset stuff:
FUNUTIL_ResetPlayer(index);
// Set to be bot until proven not in ClientConnect
g_bot[index] = true;
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }
*/
DLL_FUNCTIONS gFunctionTable; /* = { DLL_FUNCTIONS gFunctionTable = {
NULL, // pfnGameInit NULL, // pfnGameInit
NULL, // pfnSpawn NULL, // pfnSpawn
NULL, // pfnThink NULL, // pfnThink
@ -777,7 +653,7 @@ DLL_FUNCTIONS gFunctionTable; /* = {
NULL, // pfnRestoreGlobalState NULL, // pfnRestoreGlobalState
NULL, // pfnResetGlobalState NULL, // pfnResetGlobalState
ClientConnect, // pfnClientConnect NULL, // pfnClientConnect
ClientDisconnect, // pfnClientDisconnect ClientDisconnect, // pfnClientDisconnect
NULL, // pfnClientKill NULL, // pfnClientKill
NULL, // pfnClientPutInServer NULL, // pfnClientPutInServer
@ -819,7 +695,8 @@ DLL_FUNCTIONS gFunctionTable; /* = {
NULL, // pfnCreateInstancedBaselines NULL, // pfnCreateInstancedBaselines
NULL, // pfnInconsistentFile NULL, // pfnInconsistentFile
NULL, // pfnAllowLagCompensation NULL, // pfnAllowLagCompensation
};*/ };
C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion) C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion)
{ {
if(!pFunctionTable) { if(!pFunctionTable) {
@ -832,20 +709,13 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
*interfaceVersion = INTERFACE_VERSION; *interfaceVersion = INTERFACE_VERSION;
return(FALSE); return(FALSE);
} }
//gFunctionTable.pfnClientConnect = ClientConnect; <--- removed, only needed with akimbot
//gFunctionTable.pfnClientDisconnect = ClientDisconnect; <--- removed, only needed with akimbot
//gFunctionTable.pfnClientPutInServer = ClientPutInServer;
gFunctionTable.pfnPlayerPreThink = PlayerPreThink;
memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS)); memcpy(pFunctionTable, &gFunctionTable, sizeof(DLL_FUNCTIONS));
return(TRUE); return(TRUE);
} }
/********/ /********/
/*void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr) void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr)
{ {
if (g_body == 255) { if (g_body == 255) {
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
@ -860,58 +730,6 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
RETURN_META(MRES_SUPERCEDE); RETURN_META(MRES_SUPERCEDE);
} }
}*/
void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr)
{
/* from eiface.h:
// Returned by TraceLine
typedef struct
{
int fAllSolid; // if true, plane is not valid
int fStartSolid; // if true, the initial point was in a solid area
int fInOpen;
int fInWater;
float flFraction; // time completed, 1.0 = didn't hit anything
vec3_t vecEndPos; // final position
float flPlaneDist;
vec3_t vecPlaneNormal; // surface normal at impact
edict_t *pHit; // entity the surface is on
int iHitgroup; // 0 == generic, non zero is specific body part
} TraceResult;
*/
/*if (g_bot[ENTINDEX(pentToSkip)]) <--- removed, only needed with akimbot
RETURN_META(MRES_IGNORED);*/
TRACE_LINE(v1, v2, fNoMonsters, pentToSkip, ptr); // pentToSkip gotta be the one that is shooting, so filter it
int hitIndex = ENTINDEX(ptr->pHit);
if (hitIndex >= 1 && hitIndex <= gpGlobals->maxClients) {
if ( !(
g_zones_getHit[hitIndex] & (1 << ptr->iHitgroup) // can ptr->pHit get hit in ptr->iHitgroup at all?
&& g_zones_toHit[hitIndex] & (1 << ptr->iHitgroup) ) // can pentToSkip hit other people in that hit zone?
) {
ptr->flFraction = 1.0; // set to not hit anything (1.0 = shot doesn't hit anything)
}
}
/* if ( !(
g_zones_getHit[ENTINDEX(ptr->pHit)] & (1 << ptr->iHitgroup) // can ptr->pHit get hit in ptr->iHitgroup at all?
&& g_zones_toHit[ENTINDEX(pentToSkip)] & (1 << ptr->iHitgroup) ) // can pentToSkip hit other people in that hit zone?
) {
ptr->flFraction = 1.0; // set to not hit anything (1.0 = shot doesn't hit anything)
}*/
RETURN_META(MRES_SUPERCEDE);
/*
MRES_IGNORED, // plugin didn't take any action
MRES_HANDLED, // plugin did something, but real function should still be called
MRES_OVERRIDE, // call real function, but use my return value
MRES_SUPERCEDE, // skip real function; use my return value
*/
//RETURN_META(MRES_IGNORED);
} }
enginefuncs_t meta_engfuncs; enginefuncs_t meta_engfuncs;
@ -948,29 +766,22 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
// JGHG added stuff below (initing stuff here) // JGHG added stuff below (initing stuff here)
//g_body = (1<<HITGROUP_GENERIC) | (1<<HITGROUP_HEAD) | (1<<HITGROUP_CHEST) | (1<<HITGROUP_STOMACH) | (1<<HITGROUP_LEFTARM) | (1<<HITGROUP_RIGHTARM)| (1<<HITGROUP_LEFTLEG) | (1<<HITGROUP_RIGHTLEG); // init hs_body g_body = (1<<HITGROUP_GENERIC) | (1<<HITGROUP_HEAD) | (1<<HITGROUP_CHEST) | (1<<HITGROUP_STOMACH) | (1<<HITGROUP_LEFTARM) | (1<<HITGROUP_RIGHTARM)| (1<<HITGROUP_LEFTLEG) | (1<<HITGROUP_RIGHTLEG); // init hs_body
CVAR_REGISTER(&fun_version);
// generic is needed or bots go crazy... don't know what its for otherwise. You can still kill people. // generic is needed or bots go crazy... don't know what its for otherwise. You can still kill people.
// these hitzones never affect CS knife? ie you can always hit with knife no matter what you set here // these hitzones never affect CS knife? ie you can always hit with knife no matter what you set here
//hs_body = (1<<HITGROUP_GENERIC) | (1<<HITGROUP_LEFTLEG) | (1<<HITGROUP_LEFTARM); // init hs_body //hs_body = (1<<HITGROUP_GENERIC) | (1<<HITGROUP_LEFTLEG) | (1<<HITGROUP_LEFTARM); // init hs_body
// Set default zones for people to hit and get hit.
for (int i = 1; i <= 32; i++) {
g_zones_toHit[i] = (1<<HITGROUP_GENERIC) | (1<<HITGROUP_HEAD) | (1<<HITGROUP_CHEST) | (1<<HITGROUP_STOMACH) | (1<<HITGROUP_LEFTARM) | (1<<HITGROUP_RIGHTARM)| (1<<HITGROUP_LEFTLEG) | (1<<HITGROUP_RIGHTLEG);
g_zones_getHit[i] = (1<<HITGROUP_GENERIC) | (1<<HITGROUP_HEAD) | (1<<HITGROUP_CHEST) | (1<<HITGROUP_STOMACH) | (1<<HITGROUP_LEFTARM) | (1<<HITGROUP_RIGHTARM)| (1<<HITGROUP_LEFTLEG) | (1<<HITGROUP_RIGHTLEG);
// Also set to be bot until proven not in ClientDisconnect (that seems to be only called by real players...)
// g_bot[i] = true; <--- removed, only needed with akimbot
}
// JGHG added stuff above // JGHG added stuff above
/* /*
#define HITGROUP_GENERIC 0 // none == 1 #define HITGROUP_GENERIC 0 // none
#define HITGROUP_HEAD 1 = 2 #define HITGROUP_HEAD 1
#define HITGROUP_CHEST 2 = 4 #define HITGROUP_CHEST 2
#define HITGROUP_STOMACH 3 = 8 #define HITGROUP_STOMACH 3
#define HITGROUP_LEFTARM 4 = 16 #define HITGROUP_LEFTARM 4
#define HITGROUP_RIGHTARM 5 = 32 #define HITGROUP_RIGHTARM 5
#define HITGROUP_LEFTLEG 6 = 64 #define HITGROUP_LEFTLEG 6
#define HITGROUP_RIGHTLEG 7 = 128 #define HITGROUP_RIGHTLEG 7
*/ */
return(TRUE); return(TRUE);

View File

@ -56,7 +56,7 @@ LINK32=link.exe
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# Begin Special Build Tool # Begin Special Build Tool
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PostBuild_Cmds=echo Copying dll... copy Release\fun.dll K:\S\cstrike\addons\amxx\modules\fun_amx.dll echo Copying inc... copy ..\plugins\include\fun.inc K:\S\cstrike\addons\amxx\scripting\include PostBuild_Cmds=echo Copying dll... copy Release\fun.dll K:\S\cstrike\addons\amx\dlls echo Copying inc... copy fun.inc K:\S\cstrike\addons\amx\examples\include copy fun.inc K:\S\cstrike\addons\amx\plugins\include
# End Special Build Tool # End Special Build Tool
!ELSEIF "$(CFG)" == "fun - Win32 Debug" !ELSEIF "$(CFG)" == "fun - Win32 Debug"
@ -117,7 +117,7 @@ SOURCE=.\fun.h
# End Group # End Group
# Begin Source File # Begin Source File
SOURCE=..\plugins\include\fun.inc SOURCE=.\fun.inc
# End Source File # End Source File
# End Target # End Target
# End Project # End Project

View File

@ -59,27 +59,27 @@ pfnmodule_engine_g* g_engModuleFunc; // These seem to be meta/amxmod related
#define NAME "Fun" #define NAME "Fun"
#define AUTHOR "AMX Mod X Dev Team" #define AUTHOR "AMX Mod X Dev Team"
#define VERSION "0.15" #define VERSION "0.1"
#define URL "http://www.amxmodx.org" #define URL "http://www.amxmodx.org"
#define LOGTAG "FUN" #define LOGTAG "FUN"
#define DATE __DATE__ #define DATE __DATE__
// Fun-specific defines below // Fun-specific defines below
#define CVAR_FUN_VERSION "fun_version"
#define GETCLIENTLISTENING (*g_engfuncs.pfnVoice_GetClientListening) #define GETCLIENTLISTENING (*g_engfuncs.pfnVoice_GetClientListening)
#define SETCLIENTLISTENING (*g_engfuncs.pfnVoice_SetClientListening) #define SETCLIENTLISTENING (*g_engfuncs.pfnVoice_SetClientListening)
#define SETCLIENTMAXSPEED (*g_engfuncs.pfnSetClientMaxspeed) #define SETCLIENTMAXSPEED (*g_engfuncs.pfnSetClientMaxspeed)
#define GETPLAYERAUTHID (*g_engfuncs.pfnGetPlayerAuthId)
#define SF_NORESPAWN (1 << 30)// !!!set this bit on guns and stuff that should never respawn. #define SF_NORESPAWN (1 << 30)// !!!set this bit on guns and stuff that should never respawn.
#define STANDARDTIMESTEPSOUND 400 #define STANDARDTIMESTEPSOUND 400
#define HITGROUP_GENERIC 0 // none #define HITGROUP_GENERIC 0 // none
#define HITGROUP_HEAD 1 // 1 << 1 = 2 #define HITGROUP_HEAD 1
#define HITGROUP_CHEST 2 // 1 << 2 = 4 #define HITGROUP_CHEST 2
#define HITGROUP_STOMACH 3 // 8 #define HITGROUP_STOMACH 3
#define HITGROUP_LEFTARM 4 // 16 #define HITGROUP_LEFTARM 4
#define HITGROUP_RIGHTARM 5 // 32 #define HITGROUP_RIGHTARM 5
#define HITGROUP_LEFTLEG 6 // 64 #define HITGROUP_LEFTLEG 6
#define HITGROUP_RIGHTLEG 7 // 128 #define HITGROUP_RIGHTLEG 7
// Fun-specific defines above // Fun-specific defines above
// Globals below // Globals below
@ -101,10 +101,7 @@ module_info_s module_info = {
AMX_INTERFACE_VERSION, AMX_INTERFACE_VERSION,
RELOAD_MODULE, RELOAD_MODULE,
}; };
cvar_t fun_version = {"fun_version", "0.1", FCVAR_EXTDLL};
// The stuff below might end up in a class soon int g_body = 0; // bits of parts of body to hit
int g_zones_toHit[33]; // where can people hit other people? bool silent[33]; // used for set_user_footsteps()
int g_zones_getHit[33]; // where can people get hit by other people?
bool g_silent[33]; // used for set_user_footsteps()
//bool g_bot[33]; // is user bot? <--- removed, only needed with akimbot
// Globals above // Globals above

View File

@ -1,195 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="fun"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FUN_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/fun.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Release/fun.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\fun.def"
ProgramDatabaseFile=".\Release/fun.pdb"
ImportLibrary=".\Release/fun.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/fun.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="echo Copying dll...
copy Release\fun.dll K:\S\cstrike\addons\amx\dlls
echo Copying inc...
copy fun.inc K:\S\cstrike\addons\amx\examples\include
copy fun.inc K:\S\cstrike\addons\amx\plugins\include
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1053"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FUN_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/fun.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="Debug/fun_debug.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\fun.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/fun_debug.pdb"
ImportLibrary=".\Debug/fun_debug.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/fun.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1053"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="fun.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;FUN_EXPORTS;$(NoInherit)"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;FUN_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
</File>
<File
RelativePath="fun.def">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="fun.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="fun.inc">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -48,7 +48,7 @@ new g_cmdLoopback[16]
public plugin_init() public plugin_init()
{ {
register_plugin("Admin Base","0.15","AMXX Dev Team") register_plugin("Admin Base","0.1","AMXX Dev Team")
register_cvar("amx_mode","2.0") register_cvar("amx_mode","2.0")
register_cvar("amx_password_field","_pw") register_cvar("amx_password_field","_pw")
register_cvar("amx_default_access","") register_cvar("amx_default_access","")
@ -71,8 +71,11 @@ public plugin_init()
remove_user_flags(0,read_flags("z")) // Remove 'user' flag from server rights remove_user_flags(0,read_flags("z")) // Remove 'user' flag from server rights
server_cmd("exec addons/amxx/amx.cfg") // Execute main configuration file new filename[64]
loadSettings("addons/amxx/configs/users.ini") // Load admins accounts get_basedir( filename , 31 )
server_cmd("exec %s/amx.cfg" , filename ) // Execute main configuration file
format( filename, 63 , "%s/configs/users.ini" , filename )
loadSettings( filename ) // Load admins accounts
} }
loadSettings(szFilename[]) loadSettings(szFilename[])

View File

@ -49,7 +49,7 @@ new g_cmdLoopback[16]
public plugin_init() public plugin_init()
{ {
register_plugin("Admin Base for MySQL","0.15","AMXX Dev Team") register_plugin("Admin Base for MySQL","0.1","AMXX Dev Team")
register_cvar("amx_mode","2.0") register_cvar("amx_mode","2.0")
register_cvar("amx_password_field","_pw") register_cvar("amx_password_field","_pw")
@ -80,8 +80,10 @@ public plugin_init()
remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights remove_user_flags(0,read_flags("z")) // remove 'user' flag from server rights
server_cmd("exec addons/amxx/amx.cfg") new filename[32]
server_cmd("exec addons/amxx/configs/mysql.cfg;amx_sqladmins") get_basedir( filename , 31 )
server_cmd("exec %s/amx.cfg" , filename)
server_cmd("exec %s/configs/mysql.cfg;amx_sqladmins" , filename)
} }
public adminSql() { public adminSql() {

View File

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

View File

@ -45,7 +45,7 @@ new bool:g_Paused
new g_addCvar[] = "amx_cvar add %s" new g_addCvar[] = "amx_cvar add %s"
public plugin_init(){ public plugin_init(){
register_plugin("Admin Commands","0.15","AMXX Dev Team") register_plugin("Admin Commands","0.1","AMXX Dev Team")
register_concmd("amx_kick","cmdKick",ADMIN_KICK,"<name or #userid> [reason]") register_concmd("amx_kick","cmdKick",ADMIN_KICK,"<name or #userid> [reason]")
register_concmd("amx_ban","cmdAddBan",ADMIN_BAN,"<authid or ip> <minutes> [reason]") register_concmd("amx_ban","cmdAddBan",ADMIN_BAN,"<authid or ip> <minutes> [reason]")
register_concmd("amx_banid","cmdBan",ADMIN_BAN,"<name or #userid> <minutes> [reason]") register_concmd("amx_banid","cmdBan",ADMIN_BAN,"<name or #userid> <minutes> [reason]")
@ -103,15 +103,9 @@ public cmdKick(id,level,cid){
else else
{ {
#if !defined NO_STEAM #if !defined NO_STEAM
if (reason[0]) server_cmd("kick #%d ^"%s^"",userid2,reason)
server_cmd("kick #%d ^"%s^"",userid2,reason)
else
server_cmd("kick #%d",userid2)
#else #else
if (reason[0]) client_cmd(player,"echo ^"%s^";disconnect",reason)
client_cmd(player,"echo ^"Kicked: Reason: %s^";disconnect",reason)
else
client_cmd(player,"echo ^"Kicked^";disconnect",reason)
#endif #endif
} }
console_print(id,"Client ^"%s^" kicked",name2) console_print(id,"Client ^"%s^" kicked",name2)
@ -189,7 +183,7 @@ public cmdBan(id,level,cid){
name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason) name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason)
new temp[64] new temp[64]
if (str_to_num(minutes)) if (str_to_int(minutes))
format(temp,63,"for %s min.",minutes) format(temp,63,"for %s min.",minutes)
else else
temp = "permanently" temp = "permanently"
@ -198,30 +192,18 @@ public cmdBan(id,level,cid){
new address[32] new address[32]
get_user_ip(player,address,31,1) get_user_ip(player,address,31,1)
#if !defined NO_STEAM #if !defined NO_STEAM
if (reason[0]) server_cmd("kick #%d ^"%s (banned %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,temp,minutes,address)
server_cmd("kick #%d ^"%s (banned %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,temp,minutes,address)
else
server_cmd("kick #%d ^"banned %s^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,temp,minutes,address)
#else #else
if (reason[0]) client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp)
client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp)
else
client_cmd(player,"echo ^"banned %s^";disconnect",temp)
server_cmd("addip ^"%s^" ^"%s^";wait;writeip",minutes,address) server_cmd("addip ^"%s^" ^"%s^";wait;writeip",minutes,address)
#endif #endif
} }
else else
{ {
#if !defined NO_STEAM #if !defined NO_STEAM
if (reason[0]) server_cmd("kick #%d ^"%s (banned %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,temp,minutes,authid2)
server_cmd("kick #%d ^"%s (banned %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,temp,minutes,authid2)
else
server_cmd("kick #%d ^"banned %s^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,temp,minutes,authid2)
#else #else
if (reason[0]) client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp)
client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp)
else
client_cmd(player,"echo ^"banned %s^";disconnect",temp)
server_cmd("banid ^"%s^" ^"%s^";wait;writeip",minutes,authid2) server_cmd("banid ^"%s^" ^"%s^";wait;writeip",minutes,authid2)
#endif #endif
} }
@ -274,7 +256,7 @@ public cmdSlap(id,level,cid){
if (!player) return PLUGIN_HANDLED if (!player) return PLUGIN_HANDLED
new spower[32],authid[32],name2[32],authid2[32],name[32] new spower[32],authid[32],name2[32],authid2[32],name[32]
read_argv(2,spower,31) read_argv(2,spower,31)
new damage = str_to_num(spower) new damage = str_to_int(spower)
user_slap(player,damage) user_slap(player,damage)
get_user_authid(id,authid,31) get_user_authid(id,authid,31)
get_user_name(id,name,31) get_user_name(id,name,31)
@ -385,9 +367,8 @@ public cmdPlugins(id,level,cid)
if (!cmd_access(id,level,cid,1)) if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new name[32],version[32],author[32],filename[32],status[32] #if !defined NO_STEAM
#define MOTD_LEN 1024
/*
new motd_body[MOTD_LEN],state[4] new motd_body[MOTD_LEN],state[4]
new num = get_pluginsnum() new num = get_pluginsnum()
new running = 0 new running = 0
@ -399,6 +380,7 @@ public cmdPlugins(id,level,cid)
{ {
if (equal(state,"one")) copy(state,3,"two") if (equal(state,"one")) copy(state,3,"two")
else copy(state,3,"one") else copy(state,3,"one")
new name[32],version[32],author[32],filename[32],status[32]
get_plugin(i,filename,31,name,31,version,31,author,31,status,31) get_plugin(i,filename,31,name,31,version,31,author,31,status,31)
pos += format(motd_body[pos],MOTD_LEN-pos,"<tr class=^"%s^"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",state,name,version,author,filename,status) pos += format(motd_body[pos],MOTD_LEN-pos,"<tr class=^"%s^"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",state,name,version,author,filename,status)
if (equal(status,"running")) if (equal(status,"running"))
@ -406,19 +388,21 @@ public cmdPlugins(id,level,cid)
} }
format(motd_body[pos],MOTD_LEN-pos,"</table>%d plugins, %d running</body></html>",num,running) format(motd_body[pos],MOTD_LEN-pos,"</table>%d plugins, %d running</body></html>",num,running)
show_motd(id,motd_body,"Currently loaded plugins:") show_motd(id,motd_body,"Currently loaded plugins:")
*/ #else
new num = get_pluginsnum() new num = get_pluginsnum()
new running = 0 new running = 0
console_print(id,"Currently loaded plugins:") console_print(id,"Currently loaded plugins:")
console_print(id,"%-18.17s %-8.7s %-17.16s %-16.15s %-9.8s","name","version","author","file","status") console_print(id,"%-18.17s %-8.7s %-17.16s %-16.15s %-9.8s","name","version","author","file","status")
for (new i=0;i<num;i++) for (new i=0;i<num;i++)
{ {
new name[32],version[32],author[32],filename[32],status[32]
get_plugin(i,filename,31,name,31,version,31,author,31,status,31) get_plugin(i,filename,31,name,31,version,31,author,31,status,31)
console_print(id,"%-18.17s %-8.7s %-17.16s %-16.15s %-9.8s",name,version,author,filename,status) console_print("%-18.17s %-8.7s %-17.16s %-16.15s %-9.8s",name,version,author,filename,status)
if (equal(status,"running")) if (equal(status,"running"))
running++ running++
} }
console_print(id,"%d plugins, %d running",num,running) console_print(id,"%d plugins, %d running",num,running)
#endif
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -428,9 +412,10 @@ public cmdModules(id,level,cid)
if (!cmd_access(id,level,cid,1)) if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new name[32],version[32],author[32],status,sStatus[16] #if !defined NO_STEAM
#if !defined MOTD_LEN
/* #define MOTD_LEN 1024
#endif
new motd_body[MOTD_LEN],state[4] new motd_body[MOTD_LEN],state[4]
new num = get_modulesnum() new num = get_modulesnum()
new pos = copy(motd_body,MOTD_LEN,"<html><head><body><style type=^"text/css^">") new pos = copy(motd_body,MOTD_LEN,"<html><head><body><style type=^"text/css^">")
@ -441,26 +426,24 @@ public cmdModules(id,level,cid)
{ {
if (equal(state,"one")) copy(state,3,"two") if (equal(state,"one")) copy(state,3,"two")
else copy(state,3,"one") else copy(state,3,"one")
get_module(i,name,31,author,31,version,31) new name[32],version[32],author[32],filename[32],status[32]
get_plugin(i,filename,31,name,31,version,31,author,31,status,31)
pos += format(motd_body[pos],MOTD_LEN-pos,"<tr class=^"%s^"><td>%s</td><td>%s</td><td>%s</td></tr>",state,name,version,author) pos += format(motd_body[pos],MOTD_LEN-pos,"<tr class=^"%s^"><td>%s</td><td>%s</td><td>%s</td></tr>",state,name,version,author)
} }
format(motd_body[pos],MOTD_LEN-pos,"</table>%d modules</body></html>",num) format(motd_body[pos],MOTD_LEN-pos,"</table>%d modules</body></html>",num)
show_motd(id,motd_body,"Currently loaded modules:") show_motd(id,motd_body,"Currently loaded modules:")
*/ #else
new num = get_modulesnum() new num = get_modulesnum()
console_print(id,"Currently loaded modules:") console_print(id,"Currently loaded modules:")
console_print(id,"%-23.22s %-8.7s %-20.19s","name","version","author") console_print(id,"%-23.22s %-8.7s %-20.19s","name","version","author")
for (new i=0;i<num;i++) for (new i=0;i<num;i++)
{ {
get_module(i,name,31,author,31,version,31,status) new name[32],version[32],author[32]
switch (status) get_module(i,name,31,author,31,version,31)
{ console_print("%-23.22s %-8.7s %-20.19s",name,version,author)
case module_loaded: copy(sStatus,15,"running")
default: copy(sStatus,15,"error")
}
console_print(id,"%-23.22s %-8.7s %-20.19s",name,version,author)
} }
console_print(id,"%d modules",num) console_print(id,"%d modules",num)
#endif
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }

View File

@ -41,7 +41,7 @@ new g_timeInfo1[] = "Time Left: %d:%02d min. Next Map: %s"
new g_timeInfo2[] = "No Time Limit. Next Map: %s" new g_timeInfo2[] = "No Time Limit. Next Map: %s"
public plugin_init() { public plugin_init() {
register_plugin("Admin Help","0.15","AMXX Dev Team") register_plugin("Admin Help","0.1","AMXX Dev Team")
register_concmd("amx_help","cmdHelp",0,"- displays this help") register_concmd("amx_help","cmdHelp",0,"- displays this help")
setHelp(0) setHelp(0)
} }
@ -51,7 +51,7 @@ public client_putinserver(id)
public cmdHelp(id,level,cid){ public cmdHelp(id,level,cid){
new arg1[8],flags = get_user_flags(id) new arg1[8],flags = get_user_flags(id)
new start = read_argv(1,arg1,7) ? str_to_num(arg1) : 1 new start = read_argv(1,arg1,7) ? str_to_int(arg1) : 1
if (--start < 0) start = 0 if (--start < 0) start = 0
new clcmdsnum = get_concmdsnum(flags,id) new clcmdsnum = get_concmdsnum(flags,id)
if (start >= clcmdsnum) start = clcmdsnum - 1 if (start >= clcmdsnum) start = clcmdsnum - 1

View File

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

View File

@ -54,7 +54,7 @@ new bool:g_execResult
new Float:g_voteRatio new Float:g_voteRatio
public plugin_init() { public plugin_init() {
register_plugin("Admin Votes","0.15","AMXX Dev Team") register_plugin("Admin Votes","0.1","AMXX Dev Team")
register_menucmd(register_menuid("Change map to ") ,(1<<0)|(1<<1),"voteCount") register_menucmd(register_menuid("Change map to ") ,(1<<0)|(1<<1),"voteCount")
register_menucmd(register_menuid("Choose map: ") ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"voteCount") register_menucmd(register_menuid("Choose map: ") ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"voteCount")
register_menucmd(register_menuid("Kick ") ,(1<<0)|(1<<1),"voteCount") register_menucmd(register_menuid("Kick ") ,(1<<0)|(1<<1),"voteCount")
@ -333,7 +333,7 @@ public cmdVoteKickBan(id,level,cid) {
if (voteban) if (voteban)
get_user_authid(player,g_optionName[0],31) get_user_authid(player,g_optionName[0],31)
else else
num_to_str(get_user_userid(player),g_optionName[0],31) int_to_str(get_user_userid(player),g_optionName[0],31)
new authid[32],name[32] new authid[32],name[32]
get_user_authid(id,authid,31) get_user_authid(id,authid,31)
get_user_name(id,name,31) get_user_name(id,name,31)

View File

@ -38,7 +38,7 @@ new Float:g_Flooding[33]
public plugin_init() public plugin_init()
{ {
register_plugin("Anti Flood","0.15","AMXX Dev Team") register_plugin("Anti Flood","0.1","AMXX Dev Team")
register_clcmd("say","chkFlood") register_clcmd("say","chkFlood")
register_clcmd("say_team","chkFlood") register_clcmd("say_team","chkFlood")
register_cvar("amx_flood_time","0.75") register_cvar("amx_flood_time","0.75")

View File

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

View File

@ -46,12 +46,12 @@ new g_MessagesNum
new g_Current new g_Current
public plugin_init(){ public plugin_init(){
register_plugin("Info. Messages","0.15","AMXX Dev Team") register_plugin("Info. Messages","0.1","AMXX Dev Team")
register_srvcmd("amx_imessage","setMessage") register_srvcmd("amx_imessage","setMessage")
register_cvar("amx_freq_imessage","10") register_cvar("amx_freq_imessage","10")
new lastinfo[8] new lastinfo[8]
get_localinfo("lastinfomsg",lastinfo,7) get_localinfo("lastinfomsg",lastinfo,7)
g_Current = str_to_num(lastinfo) g_Current = str_to_int(lastinfo)
set_localinfo("lastinfomsg","") set_localinfo("lastinfomsg","")
} }
@ -82,11 +82,11 @@ public setMessage(id,level,cid) {
while(replace(g_Messages[g_MessagesNum],380,"\n","^n")){} while(replace(g_Messages[g_MessagesNum],380,"\n","^n")){}
new mycol[12] new mycol[12]
read_argv(2,mycol,11) // RRRGGGBBB read_argv(2,mycol,11) // RRRGGGBBB
g_Values[g_MessagesNum][2] = str_to_num(mycol[6]) g_Values[g_MessagesNum][2] = str_to_int(mycol[6])
mycol[6] = 0 mycol[6] = 0
g_Values[g_MessagesNum][1] = str_to_num(mycol[3]) g_Values[g_MessagesNum][1] = str_to_int(mycol[3])
mycol[3] = 0 mycol[3] = 0
g_Values[g_MessagesNum][0] = str_to_num(mycol[0]) g_Values[g_MessagesNum][0] = str_to_int(mycol[0])
g_MessagesNum++ g_MessagesNum++
new Float:freq_im = get_cvar_float("amx_freq_imessage") new Float:freq_im = get_cvar_float("amx_freq_imessage")
if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345) if ( freq_im > 0.0 ) set_task( freq_im ,"infoMessage",12345)
@ -95,6 +95,6 @@ public setMessage(id,level,cid) {
public plugin_end(){ public plugin_end(){
new lastinfo[8] new lastinfo[8]
num_to_str(g_Current,lastinfo,7) int_to_str(g_Current,lastinfo,7)
set_localinfo("lastinfomsg",lastinfo) set_localinfo("lastinfomsg",lastinfo)
} }

View File

@ -49,7 +49,7 @@ stock Entvars_Set_Byte(iIndex, iVariable, iNewValue)
return entity_set_byte(iIndex, iVariable, iNewValue) return entity_set_byte(iIndex, iVariable, iNewValue)
stock CreateEntity(szClassname[]) stock CreateEntity(szClassname[])
return create_entity(szClassname) return create_entity(szClassname[])
stock ENT_SetModel(iIndex, szModel[]) stock ENT_SetModel(iIndex, szModel[])
return entity_set_model(iIndex, szModel) return entity_set_model(iIndex, szModel)
@ -58,7 +58,7 @@ stock ENT_SetOrigin(iIndex, Float:fNewOrigin[3])
return entity_set_origin(iIndex, fNewOrigin) return entity_set_origin(iIndex, fNewOrigin)
stock FindEntity(iIndex, szValue[]) stock FindEntity(iIndex, szValue[])
return find_ent_by_class(iIndex, szValue) return find_entity(iIndex, szValue)
stock RemoveEntity(iIndex) stock RemoveEntity(iIndex)
return remove_entity(iIndex) return remove_entity(iIndex)

View File

@ -208,15 +208,3 @@ enum {
force_model_samebounds, /* For model files only, the geometry must fit in the same bbox */ force_model_samebounds, /* For model files only, the geometry must fit in the same bbox */
force_model_specifybounds, /* For model files only, the geometry must fit in the specified bbox */ force_model_specifybounds, /* For model files only, the geometry must fit in the specified bbox */
} }
/* Status for get_module() */
enum {
module_none = 0,
module_query,
module_badload,
module_loaded,
module_noinfo,
module_noquery,
module_noattach,
module_old,
};

View File

@ -42,7 +42,7 @@ stock cmd_target(id,const arg[],flags = 1) {
} }
} }
else if ( ( player = find_player("c",arg) )==0 && arg[0]=='#' && arg[1] ) else if ( ( player = find_player("c",arg) )==0 && arg[0]=='#' && arg[1] )
player = find_player("k",str_to_num(arg[1])) player = find_player("k",strtonum(arg[1]))
if (!player) { if (!player) {
console_print(id,"Client with that name or userid not found") console_print(id,"Client with that name or userid not found")
return 0 return 0
@ -92,9 +92,11 @@ stock is_running(const arg[]) {
} }
stock build_path( path[] , len , {Float,_}:... ) { stock build_path( path[] , len , {Float,_}:... ) {
new basedir[32]
get_localinfo( "amxx_basedir", basedir , 31 )
format_args( path , len , 2 ) format_args( path , len , 2 )
return replace( path , len , "$basedir", "addons/amxx" ) return replace( path , len , "$basedir", basedir )
} }
stock get_basedir( name[], len ) stock get_basedir( name[], len )
return copy(name,len,"addons/amxx") return get_localinfo( "amxx_basedir", name , len )

View File

@ -15,23 +15,25 @@
#include <engine> #include <engine>
#include <fun> #include <fun>
native numtostr(num,string[],len)
native strtonum(const string[])
stock set_user_hitzones(index=0,target=0,body=255)
return set_hitzones(body)
stock get_user_hitzones(index,target)
return get_hitzones()
stock user_spawn(index) stock user_spawn(index)
return spawn(index) return spawn(index)
/* use log_amx() instead */
stock get_logfile( name[], len ) stock get_logfile( name[], len )
return get_time("admin%m%d.log",name,len) return get_time("admin%m%d.log",name,len)
stock get_user_wonid(index)
return 0
stock get_user_money(index) stock get_user_money(index)
return cs_get_user_money(index) return cs_get_user_money(index)
stock set_user_money(index,money,flash=1) stock set_user_money(index,money,flash=1)
return cs_set_user_money(index,money,flash) return cs_set_user_money(index,money,flash)
stock numtostr(num,string[],len)
return num_to_str(num,string,len)
stock strtonum(const string[])
return str_to_num(string)

View File

@ -254,6 +254,9 @@ native get_user_name(index,name[],len);
/* Gets player authid. */ /* Gets player authid. */
native get_user_authid(index, authid[] ,len); native get_user_authid(index, authid[] ,len);
/* Returns player wonid. */
native get_user_wonid(index);
/* Returns player userid. */ /* Returns player userid. */
native get_user_userid(index); native get_user_userid(index);
@ -442,21 +445,6 @@ native register_concmd(const cmd[],const function[],flags=-1, info[]="");
/* Registers function which will be called from server console. */ /* Registers function which will be called from server console. */
native register_srvcmd(const server_cmd[],const function[],flags=-1, info[]=""); native register_srvcmd(const server_cmd[],const function[],flags=-1, info[]="");
/* These functinos are used to generate client messages.
* You may generate menu, smoke, shockwaves, thunderlights,
* intermission and many many others messages.
* See HL SDK for more examples. */
native message_begin( dest, msg_type, origin[3]={0,0,0},player=0);
native message_end();
native write_byte( x );
native write_char( x );
native write_short( x );
native write_long( x );
native write_entity( x );
native write_angle( x );
native write_coord( x );
native write_string( x[] );
/* Gets info about client command. */ /* Gets info about client command. */
native get_clcmd(index, command[], len1, &flags, info[], len2, flag); native get_clcmd(index, command[], len1, &flags, info[], len2, flag);
@ -548,11 +536,10 @@ native is_module_loaded(const name[]);
* authorLen - maximal length of the author * authorLen - maximal length of the author
* version[] - the version of the module will be stored here * version[] - the version of the module will be stored here
* versionLen - maximal length of the version * versionLen - maximal length of the version
* status - the status of the module will be stored here
* Return value: * Return value:
* id - success * id - success
* -1 - module not found */ * -1 - module not found */
native get_module(id, name[], nameLen, author[], authorLen, version[], versionLen, &status); native get_module(id, name[], nameLen, author[], authorLen, version[], versionLen);
/* Returns number of currently registered modules */ /* Returns number of currently registered modules */
native get_modulesnum(); native get_modulesnum();

View File

@ -13,6 +13,21 @@
#include <engine_const> #include <engine_const>
/* These functinos are used to generate client messages.
* You may generate menu, smoke, shockwaves, thunderlights,
* intermission and many many others messages.
* See HL SDK for more examples. */
native message_begin( dest, msg_type, origin[3]={0,0,0},player=0);
native message_end();
native write_byte( x );
native write_char( x );
native write_short( x );
native write_long( x );
native write_entity( x );
native write_angle( x );
native write_coord( x );
native write_string( x[] );
/* This is a highly experimental command that will directly hook a message in the engine! /* This is a highly experimental command that will directly hook a message in the engine!
* You can overwrite the message before anything happens and either let the message continue * You can overwrite the message before anything happens and either let the message continue
* or fully block it. Here is how it works: * or fully block it. Here is how it works:
@ -24,7 +39,7 @@ native register_message(iMsgId, szFunction[]);
/* The get/set _msg commands will utterly fail if used outside a hooked message scope. /* The get/set _msg commands will utterly fail if used outside a hooked message scope.
* They should never, NEVER, EVER be used unless inside a registered message function. * They should never, NEVER, EVER be used unless inside a registered message function.
* There are eight different ways of sending a message, five are ints, two are floats, and one is string. * There are eight different ways of sending a message, five are ints, two are floats, and one is string.
* These are denoted by iArgType. argn is the number * These are denoted by iArgType. msg_tid is the message you are hooking. argn is the number
* of the argument. Exceeding the bounds of 1 to get_msg_args() is a bad idea. */ * of the argument. Exceeding the bounds of 1 to get_msg_args() is a bad idea. */
/* Gets number of arguments that were passed to this message */ /* Gets number of arguments that were passed to this message */
@ -59,31 +74,6 @@ native set_offset_short(id, offset);
/* Precaches any file. */ /* Precaches any file. */
native precache_generic(szFile[]); native precache_generic(szFile[]);
/* Precaches an event. */
native precache_event(type, Name[], {float,_}:...);
//Drops an entity to the floor (work?)
native drop_to_floor(entity)
/* Get whole buffer containing keys and their data. */
native get_info_keybuffer(id, buffer[], length);
/* Use an entity with another entity. "used" could be a hostage, "user" a player. */
native force_use(pPlayer, pEntity);
/* Get globals from server. */
native Float:get_global_float(variable);
native get_global_int(variable);
native get_global_string(variable, string[], maxlen);
native get_global_vector(variable, Float:vector[3]);
native get_global_edict(variable);
/* Set entity bounds. */
native set_size(index, Float:mins[3], Float:maxs[3]);
/* Get decal index */
native get_decal_index(const szDecalName[]);
/* Sets/gets things in an entities Entvars Struct. */ /* Sets/gets things in an entities Entvars Struct. */
native entity_get_int(iIndex, iKey); native entity_get_int(iIndex, iKey);
@ -102,8 +92,8 @@ native entity_set_byte(iIndex, iKey, iVal);
/* Creates an entity, will return the index of the created entity. ClassName must be valid. */ /* Creates an entity, will return the index of the created entity. ClassName must be valid. */
native create_entity(szClassname[]); native create_entity(szClassname[]);
/* Finds an entity in the world, will return 0 if nothing is found */ /* Finds an entity in the world, will return -1 if nothing is found */
native find_ent_by_class(iIndex, szClass[]); native find_entity(iIndex, szClass[]);
native find_ent_by_owner(iIndex, szClass[], iOwner); native find_ent_by_owner(iIndex, szClass[], iOwner);
native find_ent_by_target(iIndex, szClass[]); native find_ent_by_target(iIndex, szClass[]);
native find_ent_by_tname(iIndex, szClass[]); native find_ent_by_tname(iIndex, szClass[]);

View File

@ -308,48 +308,3 @@ enum {
#define EF_NOINTERP 32 /* don't interpolate the next frame */ #define EF_NOINTERP 32 /* don't interpolate the next frame */
#define EF_LIGHT 64 /* rocket flare glow sprite */ #define EF_LIGHT 64 /* rocket flare glow sprite */
#define EF_NODRAW 128 /* don't draw entity */ #define EF_NODRAW 128 /* don't draw entity */
enum {
// Edict
GL_trace_ent = 0,
// Float
GL_coop,
GL_deathmatch,
GL_force_retouch,
GL_found_secrets,
GL_frametime,
GL_serverflags,
GL_teamplay,
GL_time,
GL_trace_allsolid,
GL_trace_fraction,
GL_trace_inopen,
GL_trace_inwater,
GL_trace_plane_dist,
GL_trace_startsolid,
// Int
GL_cdAudioTrack,
GL_maxClients,
GL_maxEntities,
GL_msg_entity,
GL_trace_flags,
GL_trace_hitgroup,
// String
GL_pStringBase,
GL_mapname,
GL_startspot,
// Vector
GL_trace_endpos,
GL_trace_plane_normal,
GL_v_forward,
GL_v_right,
GL_v_up,
GL_vecLandmarkOffset,
// Void (not supported)
GL_pSaveData
}

View File

@ -11,12 +11,6 @@
#endif #endif
#define _engine_stocks_included #define _engine_stocks_included
//wrapper for find_ent_by_class
stock find_ent(iStart, szClassname[])
{
return find_ent_by_classname(iStart, szClassname)
}
/* Changes an integer vec to a floating vec */ /* Changes an integer vec to a floating vec */
stock IVecFVec(IVec[3], Float:FVec[3]) stock IVecFVec(IVec[3], Float:FVec[3])
@ -67,13 +61,13 @@ stock get_entity_distance(ent1, ent2)
/* Get grenade thrown by this user */ /* Get grenade thrown by this user */
stock get_grenade(id) stock get_grenade(id)
{ {
new iGrenade = find_ent_by_class(-1, "grenade") new iGrenade = find_entity(-1, "grenade")
while(iGrenade > 0) while(iGrenade > 0)
{ {
if(entity_get_edict(iGrenade, EV_ENT_owner) == id) if(entity_get_edict(iGrenade, EV_ENT_owner) == id)
return iGrenade return iGrenade
iGrenade = find_ent_by_class(iGrenade, "grenade") iGrenade = find_entity(iGrenade, "grenade")
} }
return 0 return 0
@ -98,7 +92,7 @@ stock remove_entity_name(eName[])
while (iEntity > 0) while (iEntity > 0)
{ {
remove_entity(iEntity) remove_entity(iEntity)
iEntity = find_ent_by_class(-1, eName) iEntity = find_entity(-1, eName)
} }
return 1 return 1

View File

@ -31,29 +31,25 @@ native set_user_origin(index, origin[3]);
native set_user_rendering(index, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16); native set_user_rendering(index, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16);
/* Gives item to player, name of item can start /* Gives item to player, name of item can start
* with weapon_, ammo_ and item_. This event * with weapon_, ammo_ and item_. This event
* is announced with proper message to all players. */ * is announced with proper message to all players. */
native give_item(index, const item[]); native give_item(index, const item[]);
/* Sets hit zones for player. /* (not yet implemented, don't know how to use native)
* Parts of body are as bits: * Sets hit zones for player. This event is announced
* 1 - generic * with proper message to all players.
* 2 - head * Parts of body are as bits:
* 4 - chest * 2 - head
* 8 - stomach * 4 - chest
* 16 - left arm * 8 - stomach
* 32 - right arm * 16 - left arm
* 64 - left leg * 32 - right arm
* 128 - right leg * 64 - left leg
* Set index to a player's index and leave target at 0 to define what bodyparts this player can hit when he is firing. * 128 - right leg */
* Set index to 0 and target to a player's index to define what bodyparts on player other players can hit when they are firing. native set_hitzones(body = 255);
* Set both index and target to 0 to define globally what bodyparts people can hit and what bodyparts can be hit when firing. */
native set_user_hitzones(index = 0, target = 0, body = 255);
/* Get user hitzones. /* Get current hitzones. */
* To get what bodyparts a player can hit when firing, set the player's index to index and target to 0. native get_hitzones();
* To get what bodyparts other players can hit when firing at player, set index to 0 and target to player's index. */
native get_user_hitzones(index, target);
/* Sets users max. speed. */ /* Sets users max. speed. */
native set_user_maxspeed(index, Float:speed = -1.0); native set_user_maxspeed(index, Float:speed = -1.0);

View File

@ -40,6 +40,18 @@ native num_to_str(num,string[],len);
/* Returns converted string to number. */ /* Returns converted string to number. */
native str_to_num(const string[]); native str_to_num(const string[]);
stock int_to_str(num,string[],len)
return num_to_str(num,string,len)
stock str_to_int(const string[])
return str_to_num(string)
stock numtostr(num,string[],len)
return num_to_str(num,string,len)
stock strtonum(const string[])
return str_to_num(string)
/* Checks if two strings equal. If len var is set /* Checks if two strings equal. If len var is set
* then there are only c chars comapred. */ * then there are only c chars comapred. */
native equal(const a[],const b[],c=0); native equal(const a[],const b[],c=0);

View File

@ -1,105 +0,0 @@
/* Xtrafun backwards compatibility
*
* by the AMX Mod X Development Team
* These natives were originally made by SpaceDude, EJ, and JustinHoMi.
*
* This file is provided as is (no warranties).
*/
#if !defined _xtrafun_included
#define _xtrafun_included
#if !defined _engine_included
#include <engine.inc>
#endif
/* Gets the velocity of an entity */
stock get_entity_velocity(index, velocity[3]) {
new Float:vector[3]
entity_get_vector(index, EV_VEC_velocity, vector)
FVecIVec(vector, velocity)
}
/* Sets the velocity of an entity */
stock set_entity_velocity(index, velocity[3]) {
new Float:vector[3]
IVecFVec(velocity, vector)
entity_set_vector(index, EV_VEC_velocity, vector)
}
/* Gets the origin of an entity */
stock get_entity_origin(index, origin[3]) {
new Float:vector[3]
entity_get_vector(index, EV_VEC_origin, vector)
FVecIVec(vector, origin)
}
/* Sets the origin of an entity */
stock set_entity_origin(index, origin[3]) {
new Float:vector[3]
IVecFVec(originvector)
entity_set_vector(index, EV_VEC_origin, vector)
}
/* Gets the velocity of a player */
stock get_user_velocity(index, velocity[3]) {
get_entity_velocity(index, velocity)
}
/* Sets the velocity of a player */
stock set_user_velocity(index, velocity[3]) {
set_entity_velocity(index, velocity)
}
/* Get the index of the grenade belonging to index.
* Model of grenade is returned in model[].
* Specify the grenadeindex to start searching from,
* or leave it at 0 to search from the start.
* Returns grenade index.
* Paths + models of grenades in Counter-Strike:
* HEGRENADE = "models/w_hegrenade.mdl"
* FLASHBANG = "models/w_flashbang.mdl"
* SMOKEGRENADE = "models/w_smokegrenade.mdl" */
stock get_grenade_index(index, model[], len, grenadeindex = 0) {
new entfind = grenadeindex
new entowner = index
for (;;) {
entfind = find_entity_by_class(entfind, "grenade")
if (entfind && is_valid_ent(entfind)) {
if (entity_get_edict(entFind, EV_ENT_owner) == entowner) {
entity_get_string(entfind, EV_SZ_model, model)
return entfind
}
}
else {
// Eventually comes here if loop fails to find a grenade with specified owner.
return 0;
}
}
}
/* Find the number of entities in the game */
stock current_num_ents() {
return entity_count();
}
enum {
classname = 0,
target,
targetname
}
/* Find an entity ID from start_from_ent id (use 0 to start from
* the beginning, category is either "classname", "target" or
* "targetname", value is the name you are searching for */
stock find_entity(start_from_ent, category, value[]) {
switch (category) {
case target: return find_entity_by_target(start_from_ent, value)
case targetname: return find_ent_by_tname(start_from_ent, value)
}
return find_entity_by_class(start_from_ent, value)
}
#endif // _xtrafun_included

View File

@ -52,7 +52,7 @@ new bool:g_selected = false
public plugin_init() public plugin_init()
{ {
register_plugin("Nextmap Chooser","0.15","AMXX Dev Team") register_plugin("Nextmap Chooser","0.1","AMXX Dev Team")
register_menucmd(register_menuid("AMX Choose nextmap:"),(-1^(-1<<(SELECTMAPS+2))),"countVote") register_menucmd(register_menuid("AMX Choose nextmap:"),(-1^(-1<<(SELECTMAPS+2))),"countVote")
register_cvar("amx_extendmap_max","90") register_cvar("amx_extendmap_max","90")
register_cvar("amx_extendmap_step","15") register_cvar("amx_extendmap_step","15")
@ -63,7 +63,9 @@ public plugin_init()
get_localinfo("lastMap",g_lastMap,31) get_localinfo("lastMap",g_lastMap,31)
set_localinfo("lastMap","") set_localinfo("lastMap","")
if ( loadSettings("addons/amxx/configs/maps.ini") ) new filename[64]
build_path( filename , 63 , "$basedir/configs/maps.ini" )
if ( loadSettings( filename ) )
set_task(15.0,"voteNextmap",987456,"",0,"b") set_task(15.0,"voteNextmap",987456,"",0,"b")
} }

View File

@ -54,7 +54,7 @@ new g_choosed
public plugin_init() public plugin_init()
{ {
register_plugin("Maps Menu","0.15","AMXX Dev Team") register_plugin("Maps Menu","0.1","AMXX Dev Team")
register_clcmd("amx_mapmenu","cmdMapsMenu",ADMIN_MAP,"- displays changelevel menu") register_clcmd("amx_mapmenu","cmdMapsMenu",ADMIN_MAP,"- displays changelevel menu")
register_clcmd("amx_votemapmenu","cmdVoteMapMenu",ADMIN_MAP,"- displays votemap menu") register_clcmd("amx_votemapmenu","cmdVoteMapMenu",ADMIN_MAP,"- displays votemap menu")
@ -64,7 +64,9 @@ public plugin_init()
register_menucmd(register_menuid("Votemap Menu"),1023,"actionVoteMapMenu") register_menucmd(register_menuid("Votemap Menu"),1023,"actionVoteMapMenu")
register_menucmd(register_menuid("The winner: ") ,3,"actionResult") register_menucmd(register_menuid("The winner: ") ,3,"actionResult")
load_settings("addons/amxx/configs/maps.ini") new filename[64]
build_path( filename , 63 , "$basedir/configs/maps.ini" )
load_settings( filename )
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
} }

View File

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

View File

@ -146,7 +146,7 @@ new g_teamsNames[2][] = {
} }
public plugin_init(){ public plugin_init(){
register_plugin("CS Misc. Stats","0.15","AMXX Dev Team") register_plugin("CS Misc. Stats","0.1","AMXX Dev Team")
register_event("DeathMsg","eDeathMsg","a") register_event("DeathMsg","eDeathMsg","a")
register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w") register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w")
register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw") register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")

View File

@ -45,7 +45,7 @@ new g_pos
public plugin_init() public plugin_init()
{ {
register_plugin("NextMap","0.15","AMXX Dev Team") register_plugin("NextMap","0.1","AMXX Dev Team")
register_event("30","changeMap","a") register_event("30","changeMap","a")
register_clcmd("say nextmap","sayNextMap",0,"- displays nextmap") register_clcmd("say nextmap","sayNextMap",0,"- displays nextmap")
register_cvar("amx_nextmap","",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY) register_cvar("amx_nextmap","",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
@ -53,7 +53,7 @@ public plugin_init()
new szString[32], szString2[32], szString3[8] new szString[32], szString2[32], szString3[8]
get_localinfo( "lastmapcycle", szString , 31 ) get_localinfo( "lastmapcycle", szString , 31 )
parse( szString, szString2, 31, szString3 , 7 ) parse( szString, szString2, 31, szString3 , 7 )
g_pos = str_to_num( szString3 ) g_pos = str_to_int( szString3 )
get_cvar_string( "mapcyclefile" , g_mapCycle , 31 ) get_cvar_string( "mapcyclefile" , g_mapCycle , 31 )
if ( !equal( g_mapCycle , szString2 ) ) if ( !equal( g_mapCycle , szString2 ) )

View File

@ -43,7 +43,7 @@
#define MAX_SYSTEM 32 #define MAX_SYSTEM 32
new g_menuPos[33] new g_menuPos[33]
new g_fileToSave[] = "addons/amxx/configs/pausecfg.ini" new g_fileToSave[64]
new g_cstrikeRunning new g_cstrikeRunning
new g_Modified new g_Modified
new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^"" new g_couldntFind[] = "Couldn't find a plugin matching ^"%s^""
@ -53,7 +53,7 @@ new g_system[MAX_SYSTEM]
new g_systemNum new g_systemNum
public plugin_init(){ public plugin_init(){
register_plugin("Pause Plugins","0.15","AMXX Dev Team") register_plugin("Pause Plugins","0.1","AMXX Dev Team")
register_concmd("amx_pausecfg","cmdPlugin",ADMIN_CFG,"- list commands for pause/unpause managment") register_concmd("amx_pausecfg","cmdPlugin",ADMIN_CFG,"- list commands for pause/unpause managment")
register_clcmd("amx_pausecfgmenu","cmdMenu",ADMIN_CFG,"- pause/unpause plugins with menu") register_clcmd("amx_pausecfgmenu","cmdMenu",ADMIN_CFG,"- pause/unpause plugins with menu")
#if defined DIRECT_ONOFF #if defined DIRECT_ONOFF
@ -82,6 +82,7 @@ public cmdON(id,level,cid){
#endif #endif
public plugin_cfg() { public plugin_cfg() {
build_path( g_fileToSave , 63 , "$basedir/configs/pausecfg.ini" )
loadSettings(g_fileToSave) loadSettings(g_fileToSave)
// Put here titles of plugins which you don't want to pause // Put here titles of plugins which you don't want to pause
server_cmd(g_addCmd , "Pause Plugins" ) server_cmd(g_addCmd , "Pause Plugins" )
@ -317,7 +318,7 @@ public cmdPlugin(id,level,cid){
} }
else if ( equal(cmds, "list" ) ) { else if ( equal(cmds, "list" ) ) {
new arg1[8], running = 0 new arg1[8], running = 0
new start = read_argv(2,arg1,7) ? str_to_num(arg1) : 1 new start = read_argv(2,arg1,7) ? str_to_int(arg1) : 1
if (--start < 0) start = 0 if (--start < 0) start = 0
new plgnum = get_pluginsnum() new plgnum = get_pluginsnum()
if (start >= plgnum) start = plgnum - 1 if (start >= plgnum) start = plgnum - 1

View File

@ -55,7 +55,7 @@ new g_cstrikeRunning
public plugin_init() public plugin_init()
{ {
register_plugin("Players Menu","0.15","AMXX Dev Team") register_plugin("Players Menu","0.1","AMXX Dev Team")
register_clcmd("amx_kickmenu","cmdKickMenu",ADMIN_KICK,"- displays kick menu") register_clcmd("amx_kickmenu","cmdKickMenu",ADMIN_KICK,"- displays kick menu")
register_clcmd("amx_banmenu","cmdBanMenu",ADMIN_BAN,"- displays ban menu") register_clcmd("amx_banmenu","cmdBanMenu",ADMIN_BAN,"- displays ban menu")
register_clcmd("amx_slapmenu","cmdSlapMenu",ADMIN_SLAY,"- displays slap/slay menu") register_clcmd("amx_slapmenu","cmdSlapMenu",ADMIN_SLAY,"- displays slap/slay menu")
@ -70,7 +70,9 @@ public plugin_init()
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
load_settings("addons/amxx/configs/clcmds.ini") new filename[64]
build_path( filename , 63 , "$basedir/configs/clcmds.ini" )
load_settings( filename )
} }
/* Ban menu */ /* Ban menu */
@ -573,7 +575,7 @@ public actionClcmdMenu(id,key)
copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]]) copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
get_user_authid(player,authid,31) get_user_authid(player,authid,31)
get_user_name(player,name,31) get_user_name(player,name,31)
num_to_str(get_user_userid(player),userid,31) int_to_str(get_user_userid(player),userid,31)
replace(command,63,"%userid%",userid) replace(command,63,"%userid%",userid)
replace(command,63,"%authid%",authid) replace(command,63,"%authid%",authid)
replace(command,63,"%name%",name) replace(command,63,"%name%",name)

View File

@ -336,7 +336,7 @@ new g_Aliases2[MAXMENUPOS][] = {
#endif #endif
public plugin_init(){ public plugin_init(){
register_plugin("Restrict Weapons","0.15","AMXX Dev Team") register_plugin("Restrict Weapons","0.1","AMXX Dev Team")
register_clcmd("buyammo1","ammoRest1") register_clcmd("buyammo1","ammoRest1")
register_clcmd("buyammo2","ammoRest2") register_clcmd("buyammo2","ammoRest2")
#if !defined NO_STEAM #if !defined NO_STEAM
@ -366,9 +366,9 @@ public plugin_init(){
#if defined MAPSETTINGS #if defined MAPSETTINGS
new mapname[32] new mapname[32]
get_mapname(mapname,31) get_mapname(mapname,31)
build_path(g_saveFile,63,"addons/amxx/configs/weaprest_%s.ini",mapname) build_path( g_saveFile , 63 , "$basedir/configs/weaprest_%s.ini" ,mapname )
#else #else
build_path(g_saveFile,63,"addons/amxx/configs/weaprest.ini") build_path( g_saveFile , 63 , "$basedir/configs/weaprest.ini" )
#endif #endif
loadSettings(g_saveFile) loadSettings(g_saveFile)
} }
@ -466,7 +466,7 @@ public cmdRest(id,level,cid){
switchCommand( id, 0 ) switchCommand( id, 0 )
else if ( equali( "list" , cmd ) ) { else if ( equali( "list" , cmd ) ) {
new arg1[8] new arg1[8]
new start = read_argv(2,arg1,7) ? str_to_num(arg1) : 1 new start = read_argv(2,arg1,7) ? str_to_int(arg1) : 1
if (--start < 0) start = 0 if (--start < 0) start = 0
if (start >= MAXMENUPOS) start = MAXMENUPOS - 1 if (start >= MAXMENUPOS) start = MAXMENUPOS - 1
new end = start + 10 new end = start + 10

Binary file not shown.

Binary file not shown.

View File

@ -46,7 +46,7 @@ new g_Length
new g_Frequency new g_Frequency
public plugin_init(){ public plugin_init(){
register_plugin("Scrolling Message","0.15","AMXX Dev Team") register_plugin("Scrolling Message","0.1","AMXX Dev Team")
register_srvcmd("amx_scrollmsg","setMessage") register_srvcmd("amx_scrollmsg","setMessage")
} }
@ -92,7 +92,7 @@ public setMessage(id,level,cid) {
g_Length = strlen(g_scrollMsg) g_Length = strlen(g_scrollMsg)
new mytime[32] new mytime[32]
read_argv(2,mytime,31) read_argv(2,mytime,31)
g_Frequency = str_to_num(mytime) g_Frequency = str_to_int(mytime)
if (g_Frequency > 0) { if (g_Frequency > 0) {
new minimal = floatround((g_Length + 48) * (SPEED + 0.1)) new minimal = floatround((g_Length + 48) * (SPEED + 0.1))
if (g_Frequency < minimal) { if (g_Frequency < minimal) {

View File

@ -71,7 +71,7 @@ new g_teamScore[2]
new g_disabledMsg[] = "Server has disabled that option" new g_disabledMsg[] = "Server has disabled that option"
public plugin_init() { public plugin_init() {
register_plugin("CS Stats","0.15","AMXX Dev Team") register_plugin("CS Stats","0.1","AMXX Dev Team")
register_event("CS_DeathMsg","eCSDeathMsg","a") register_event("CS_DeathMsg","eCSDeathMsg","a")
register_event("ResetHUD","eResetHud","b") register_event("ResetHUD","eResetHud","b")
register_event("SendAudio","eRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw") register_event("SendAudio","eRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
@ -372,14 +372,14 @@ public displayStats(id,dest) {
pos += copy(g_Buffer[pos],2047-pos,"body{font-family:Arial,sans-serif;font-size:12px;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}.header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}") pos += copy(g_Buffer[pos],2047-pos,"body{font-family:Arial,sans-serif;font-size:12px;color:#FFCC99;background-color:#000000;margin-left:8px;margin-top:3px}.header{background-color:#9C0000;}.one{background-color:#310000;}.two{background-color:#630000;}")
pos += format(g_Buffer[pos],2047-pos,"</style></head><body><table><tr class=^"one^"><td>Kills:</td><td>%d</td></tr><tr class=^"two^"><td>Deaths:</td><td>%d</td></tr><tr class=^"one^"><td>Damage:</td><td>%d</td></tr><tr class=^"two^"><td>Hits:</td><td>%d</td></tr><tr class=^"one^"><td>Shots:</td><td>%d</td></tr></table><br><br>", pos += format(g_Buffer[pos],2047-pos,"</style></head><body><table><tr class=^"one^"><td>Kills:</td><td>%d</td></tr><tr class=^"two^"><td>Deaths:</td><td>%d</td></tr><tr class=^"one^"><td>Damage:</td><td>%d</td></tr><tr class=^"two^"><td>Hits:</td><td>%d</td></tr><tr class=^"one^"><td>Shots:</td><td>%d</td></tr></table><br><br>",
stats[0],stats[1],stats[6],stats[5],stats[4]) stats[0],stats[1],stats[6],stats[5],stats[4])
pos += copy(g_Buffer[pos],2047-pos,"<table><tr class=^"header^"><td>Weapon</td><td>Shots</td><td>Hits</td><td>Damage</td><td>Kills</td><td>Deaths</td></tr>") pos += copy(g_Buffer[pos],2047-pos,"<table><tr class^"header^"><td>Weapon</td><td>Shots</td><td>Hits</td><td>Damage</td><td>Kills</td><td>deaths</td></tr>")
for(new a = 1; a < 31; ++a) { for(new a = 1; a < 31; ++a) {
if (get_user_wstats(id,a,stats,body)) { if (get_user_wstats(id,a,stats,body)) {
if (equal(state,"one")) copy(state,3,"two") if (equal(state,"one")) copy(state,3,"two")
else copy(state,3,"one") else copy(state,3,"one")
get_weaponname(a,name,31) get_weaponname(a,name,31)
pos += format(g_Buffer[pos],2047-pos,"<tr class=^"%s^"><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>", pos += format(g_Buffer[pos],2047-pos,"<tr class=^"%s^"><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>",
state,name[7],stats[4],stats[5],stats[6],stats[0],stats[1]) name[7],stats[4],stats[5],stats[6],stats[0],stats[1])
} }
} }
copy(g_Buffer[pos],2047-pos,"</table></body></html>") copy(g_Buffer[pos],2047-pos,"</table></body></html>")
@ -419,10 +419,10 @@ displayRank(id,dest) {
pos += format(g_Buffer[pos],2047-pos,"</style></head><body><table><tr><td colspan=2>%s rank is %d of %d</td></tr>",(id==dest)?"Your":"His", rank_pos,get_statsnum()) pos += format(g_Buffer[pos],2047-pos,"</style></head><body><table><tr><td colspan=2>%s rank is %d of %d</td></tr>",(id==dest)?"Your":"His", rank_pos,get_statsnum())
pos += format(g_Buffer[pos],2047-pos,"<tr class=^"one^"><td>Kills:</td><td>%d</td></tr><tr class=^"two^"><td>Deaths:</td><td>%d</td></tr><tr class=^"one^"><td>Damage:</td><td>%d</td></tr><tr class=^"two^"><td>Hits:</td><td>%d</td></tr><tr class=^"one^"><td>Shots:</td><td>%d</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr>", pos += format(g_Buffer[pos],2047-pos,"<tr class=^"one^"><td>Kills:</td><td>%d</td></tr><tr class=^"two^"><td>Deaths:</td><td>%d</td></tr><tr class=^"one^"><td>Damage:</td><td>%d</td></tr><tr class=^"two^"><td>Hits:</td><td>%d</td></tr><tr class=^"one^"><td>Shots:</td><td>%d</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr>",
stats[0],stats[1],stats[6],stats[5],stats[4]) stats[0],stats[1],stats[6],stats[5],stats[4])
pos += format(g_Buffer[pos],2047-pos,"<tr class=^"header^"><td colspan=2>Hits</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr><tr class=^"two^"><td>%s:</td><td>%d</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr><tr class=^"two^"><td>%s:</td><td>%d</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr><tr class=^"two^"><td>%s:</td><td>%d</td></tr><tr class=^"one^"><td>%s:</td><td>%d</td></tr>", pos += format(g_Buffer[pos],2047-pos,"<tr class=^"header^"><td colspan=2>Hits</td></tr><tr class^"one^"><td>%s:</td><td>%d</td></tr><tr class^"two^"><td>%s:</td><td>%d</td></tr><tr class^"one^"><td>%s:</td><td>%d</td></tr><tr class^"two^"><td>%s:</td><td>%d</td></tr><tr class^"one^"><td>%s:</td><td>%d</td></tr><tr class^"two^"><td>%s:</td><td>%d</td></tr><tr class^"one^"><td>%s:</td><td>%d</td></tr>",
g_bodyParts[1],body[1],g_bodyParts[2],body[2],g_bodyParts[3],body[3], g_bodyParts[4],body[4], g_bodyParts[1],body[1],g_bodyParts[2],body[2],g_bodyParts[3],body[3], g_bodyParts[4],body[4],
g_bodyParts[5],body[5],g_bodyParts[6],body[6],g_bodyParts[7],body[7]) g_bodyParts[5],body[5],g_bodyParts[6],body[6],g_bodyParts[7],body[7])
copy(g_Buffer[pos],2047-pos,"</table></body></html>") copy(g_Buffer,2047,"</table></body></html>")
#else #else
pos = format(g_Buffer,2047,"%s rank is %d of %d^n^n",(id==dest)?"Your":"His", rank_pos,get_statsnum()) pos = format(g_Buffer,2047,"%s rank is %d of %d^n^n",(id==dest)?"Your":"His", rank_pos,get_statsnum())
pos += format(g_Buffer[pos],2047-pos,"%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n^n", pos += format(g_Buffer[pos],2047-pos,"%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n^n",

View File

@ -39,7 +39,7 @@ new g_pingSum[33]
new g_pingCount[33] new g_pingCount[33]
public plugin_init() public plugin_init()
register_plugin("CS Stats Logging","0.15","AMXX Dev Team") register_plugin("CS Stats Logging","0.1","AMXX Dev Team")
public client_disconnect(id) { public client_disconnect(id) {
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE if ( is_user_bot( id ) ) return PLUGIN_CONTINUE

View File

@ -42,7 +42,7 @@ new g_menuDataVar[MAX_MENU_DATA][32]
new g_menuDataId[MAX_MENU_DATA] new g_menuDataId[MAX_MENU_DATA]
new g_menuDataNum new g_menuDataNum
new g_menuPosition[33] new g_menuPosition[33]
new g_fileToSave[] = "addons/amxx/configs/stats.ini" new g_fileToSave[64]
new bool:g_modified new bool:g_modified
public plugin_precache(){ public plugin_precache(){
@ -51,8 +51,9 @@ public plugin_precache(){
} }
public plugin_init() { public plugin_init() {
register_plugin("Stats Configuration","0.15","AMXX Dev Team") register_plugin("Stats Configuration","0.1","AMXX Dev Team")
register_menucmd(register_menuid("\yStats Configuration"),1023,"actionCfgMenu") register_menucmd(register_menuid("\yStats Configuration"),1023,"actionCfgMenu")
build_path( g_fileToSave , 63 , "$basedir/configs/stats.ini" )
loadSettings(g_fileToSave) loadSettings(g_fileToSave)
} }
@ -104,7 +105,7 @@ public cmdCfg( id,level,cid ){
} }
else if ( equali(cmds, "list" ) ) { else if ( equali(cmds, "list" ) ) {
new arg1[8] new arg1[8]
new start = read_argv(2,arg1,7) ? str_to_num(arg1) : 1 new start = read_argv(2,arg1,7) ? str_to_int(arg1) : 1
if (--start < 0) start = 0 if (--start < 0) start = 0
if (start >= g_menuDataNum) start = g_menuDataNum - 1 if (start >= g_menuDataNum) start = g_menuDataNum - 1
new end = start + 10 new end = start + 10

View File

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

View File

@ -40,7 +40,7 @@ new g_CountDown
new g_Switch new g_Switch
public plugin_init() { public plugin_init() {
register_plugin("TimeLeft","0.15","AMXX Dev Team") register_plugin("TimeLeft","0.1","AMXX Dev Team")
register_cvar("amx_time_voice","1") register_cvar("amx_time_voice","1")
register_srvcmd("amx_time_display","setDisplaying") register_srvcmd("amx_time_display","setDisplaying")
register_cvar("amx_timeleft","00:00",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) register_cvar("amx_timeleft","00:00",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
@ -54,8 +54,8 @@ public sayTheTime(id){
new mhours[6], mmins[6], whours[32], wmins[32], wpm[6] new mhours[6], mmins[6], whours[32], wmins[32], wpm[6]
get_time("%H",mhours,5) get_time("%H",mhours,5)
get_time("%M",mmins,5) get_time("%M",mmins,5)
new mins = str_to_num(mmins) new mins = str_to_int(mmins)
new hrs = str_to_num(mhours) new hrs = str_to_int(mhours)
if (mins) if (mins)
num_to_word(mins,wmins,31) num_to_word(mins,wmins,31)
else else
@ -154,7 +154,7 @@ public setDisplaying(){
while (i < argc && i < 32){ while (i < argc && i < 32){
read_argv(i+1,arg,31) read_argv(i+1,arg,31)
parse(arg,flags,31,num,31) parse(arg,flags,31,num,31)
g_TimeSet[i][0] = str_to_num(num) g_TimeSet[i][0] = str_to_int(num)
g_TimeSet[i][1] = read_flags(flags) g_TimeSet[i][1] = read_flags(flags)
i++ i++
} }

View File

@ -45,13 +45,16 @@
new g_cstrikeRunning new g_cstrikeRunning
#if defined READ_FROM_FILE #if defined READ_FROM_FILE
new g_motdFile[] = "addons/amxx/configs/conmotd.txt" new g_motdFile[64]
#endif #endif
public plugin_init() public plugin_init()
{ {
register_plugin("Welcome Message","0.15","AMXX Dev Team") register_plugin("Welcome Message","0.1","AMXX Dev Team")
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
#if defined READ_FROM_FILE
build_path( g_motdFile , 63 , "$basedir/conmotd.txt" )
#endif
} }
public plugin_cfg() public plugin_cfg()
@ -115,7 +118,7 @@ public alt_motd(param[]) {
new mod_ver[32] new mod_ver[32]
len += copy(motdBody[len],MOTD_LENGTH-len,"<br>Server mods:<ul>") len += copy(motdBody[len],MOTD_LENGTH-len,"<br>Server mods:<ul>")
get_cvar_string("amxmodx_version",mod_ver,31) get_cvar_string("amxmodx_version",mod_ver,31)
if (mod_ver[0]) len += format(motdBody[len],MOTD_LENGTH-len,"<li>AMX Mod X %s</li>",mod_ver) if (mod_ver[0]) len += format(motdBody[len],MOTD_LENGTH-len,"<li>AMX Mod %s</li>",mod_ver)
get_cvar_string("statsme_version",mod_ver,31) get_cvar_string("statsme_version",mod_ver,31)
if (mod_ver[0]) len += format(motdBody[len],MOTD_LENGTH-len,"<li>StatsMe %s</li>",mod_ver) if (mod_ver[0]) len += format(motdBody[len],MOTD_LENGTH-len,"<li>StatsMe %s</li>",mod_ver)
get_cvar_string("clanmod_version",mod_ver,31) get_cvar_string("clanmod_version",mod_ver,31)

View File

@ -43,13 +43,16 @@
new g_cstrikeRunning new g_cstrikeRunning
#if defined READ_FROM_FILE #if defined READ_FROM_FILE
new g_motdFile[] = "addons/amxx/configs/conmotd.txt" new g_motdFile[64]
#endif #endif
public plugin_init() public plugin_init()
{ {
register_plugin("Welcome Message","0.15","AMXX Dev Team") register_plugin("Welcome Message","0.1","AMXX Dev Team")
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
#if defined READ_FROM_FILE
build_path( g_motdFile , 63 , "$basedir/conmotd.txt" )
#endif
} }
new g_Bar[] = "==============" new g_Bar[] = "=============="
@ -101,7 +104,7 @@ public client_connect(id) {
new mod_ver[32] new mod_ver[32]
client_cmd(id, "echo ;echo ^" Server mods:^"") client_cmd(id, "echo ;echo ^" Server mods:^"")
get_cvar_string("amxmodx_version",mod_ver,31) get_cvar_string("amxmodx_version",mod_ver,31)
if (mod_ver[0]) client_cmd(id, "echo ^" o AMX Mod X %s^"",mod_ver) if (mod_ver[0]) client_cmd(id, "echo ^" o AMX Mod %s^"",mod_ver)
get_cvar_string("statsme_version",mod_ver,31) get_cvar_string("statsme_version",mod_ver,31)
if (mod_ver[0]) client_cmd(id, "echo ^" o StatsMe %s^"",mod_ver) if (mod_ver[0]) client_cmd(id, "echo ^" o StatsMe %s^"",mod_ver)
get_cvar_string("clanmod_version",mod_ver,31) get_cvar_string("clanmod_version",mod_ver,31)