153 Commits

Author SHA1 Message Date
3c28f57786 Tagged 0.16 2006-07-20 05:48:53 +00:00
05cf53e1b9 nothing important 2004-03-25 18:37:02 +00:00
a3c9489360 plugins using localinfo paths now 2004-03-25 16:52:04 +00:00
63e1d7e43b added password description 2004-03-25 14:30:33 +00:00
a82b5383d7 added amxx_customdir and amxx_configsdir 2004-03-25 13:35:24 +00:00
9b551916f1 making sure amxx_customdir and amxx_configsdir are set 2004-03-25 13:35:02 +00:00
64a7afa371 added localinfo stocks 2004-03-25 13:34:27 +00:00
c7981eb54b added build_path() 2004-03-25 13:33:58 +00:00
a6473737a2 entity_set_model should take const strings 2004-03-25 11:42:34 +00:00
3fc4049b0a Placed meta_api.cpp under right folder in workspace 2004-03-25 08:33:48 +00:00
4f6450abf0 amxx_pluginsdir and amxx_modulesdir added 2004-03-24 19:00:03 +00:00
130f274f86 more localinfos 2004-03-24 18:59:37 +00:00
98c63e8efd new localinfos 2004-03-24 18:39:25 +00:00
2b7b1a844c get_modulesnum function updated (using UTIL_GetModulesNum now) 2004-03-24 18:35:42 +00:00
012507c38a fixed getline function 2004-03-24 18:35:04 +00:00
a9a46e20b2 fixed size() function, added empty() function 2004-03-24 18:34:47 +00:00
ab110d3d27 added localinfo paths, fixed amx_version and amxmodx_version cvars (module count) 2004-03-24 18:34:18 +00:00
cfb45c1302 added UTIL_GetModulesNum function 2004-03-24 18:33:41 +00:00
e40daf1315 another fix 2004-03-24 12:56:21 +00:00
5967f7d951 fixed entity_set_string to take const strings 2004-03-24 08:53:40 +00:00
ca0c0bfce2 disabled restrictmenu by default 2004-03-24 08:30:49 +00:00
079f824a81 updated version information 2004-03-24 08:30:08 +00:00
d850e62a02 updated amxx version 2004-03-24 08:24:35 +00:00
10b887147e added [AMXX] before messages 2004-03-24 08:24:19 +00:00
df2a96e2d7 removed map descriptions 2004-03-24 08:21:13 +00:00
63bc246264 changed ban commands 2004-03-24 08:20:35 +00:00
16e3582ef5 nothing important 2004-03-24 08:19:08 +00:00
0a582d4635 Didn't work - fixed a lot of stuff 2004-03-24 08:18:07 +00:00
cd3f57987b updated to new ban command 2004-03-24 08:16:43 +00:00
ecbf698486 removed descriptions 2004-03-24 08:16:29 +00:00
64a0c95bfa Engine is deactivated by default 2004-03-24 08:16:14 +00:00
894d650593 welcomemsg and stats_logging are deactivated by default 2004-03-24 08:15:58 +00:00
8d89be8de3 confirmed WON offset: OFFSET_CLIPAMMO as 51 2004-03-24 07:54:15 +00:00
b9bb70d410 fixed maxclients bug 2004-03-24 07:54:13 +00:00
8c7938d47a Fixed workspace 2004-03-24 07:28:49 +00:00
c78e2bcf7e new makefile 2004-03-24 06:33:39 +00:00
0bea18ca9f New makefile 2004-03-24 06:33:03 +00:00
7937c77eed imported jghg2 support 2004-03-24 05:10:11 +00:00
8110271bdd imported jghg2 support 2004-03-24 05:01:33 +00:00
f566ac2eb7 new file names+headers 2004-03-24 03:39:37 +00:00
b311a9ccc3 new file names+headers 2004-03-24 02:10:20 +00:00
2a7b5b714d Fixed header files in makefile. 2004-03-24 01:40:10 +00:00
f711baf3df new file names 2004-03-24 01:35:44 +00:00
5c82095e81 removed useless hook 2004-03-24 01:10:38 +00:00
15904761e8 compiles now 2004-03-24 00:54:35 +00:00
6d58afcedb undid some stuff 2004-03-23 13:25:59 +00:00
1b0cc63b5b amx.cfg --> amxx.cfg 2004-03-23 10:15:26 +00:00
94b9bc9939 fixed give_item 2004-03-23 01:18:22 +00:00
95445293a2 Fixed anim after cs_set_weapon_silenc 2004-03-22 12:20:00 +00:00
431bfbb4d9 Updated set_entity_visibility 2004-03-22 11:44:47 +00:00
e47104aa29 Fixed reference to find_ent_by_classname in find_ent
Added set_entity_visibility and get_entity_visibility
2004-03-22 11:29:29 +00:00
180fa52acb Added cs_get_weapon_ammo/cs_set_weapon_ammo 2004-03-22 09:10:11 +00:00
bbbe0cda78 Added cs_get_weapon_ammo/cs_set_weapon_ammo 2004-03-22 08:57:23 +00:00
b21bbcbf90 Fixed prototype of set_offset_short
Fixed all offset natives (they checked ent index above maxClients, should've been maxEntities (some also checked if player is online))
Added s/get_offset_char()
Fixed set_pdata_float to set float value from parameter properly
Fixed set_pdata_short to set short value from parameter properly
Reimplemented find_ent_by_owner
2004-03-22 08:27:52 +00:00
66a1f11387 Shortened all natives that had longer names than old compiler limit of 19 characters. 2004-03-22 07:23:47 +00:00
2b366a354c fixed amx_show_activity 2004-03-22 06:33:11 +00:00
cebf782a90 amx_show_activity is now registered 2004-03-22 06:30:37 +00:00
4ffa954055 Fixed bug with get_offset 2004-03-22 05:43:47 +00:00
556e9cee57 removed a forgotten debug message 2004-03-21 17:10:35 +00:00
421c62c6a0 Added native support for set_speak and get_speak and SetSpeak 2004-03-21 09:17:55 +00:00
9bec921fd8 Added set_speak and get_speak 2004-03-21 09:13:55 +00:00
b7b2d59613 Changed set_user_maxspeed 2004-03-21 08:59:18 +00:00
db41e1830a Added CSW_GALI for backwards support 2004-03-21 07:14:40 +00:00
9061e13e11 Fixed access level bug. 2004-03-21 06:32:27 +00:00
a72b749fac Fixed fun include from amxmodx and cs_set_user_nvg 2004-03-20 23:58:26 +00:00
cd0cd140ac Fixed native character length for cs_set_user_nvgoggles 2004-03-20 23:57:24 +00:00
7fef5aad34 Includes were broken - it is fixed. 2004-03-18 01:32:39 +00:00
38af364744 fixed filters bug 2004-03-17 18:57:36 +00:00
a7c4f5a147 typo fix courtesy of pimp daddy 2004-03-17 11:38:23 +00:00
96b79cd24f fixed find_entity 2004-03-17 07:30:07 +00:00
bbb5adc70f added get_user_wonid() 2004-03-16 19:40:02 +00:00
a4eccaa4bb removed get_user_wonid() 2004-03-16 19:39:48 +00:00
6a10397641 Fixed xtrafun include 2004-03-16 05:21:42 +00:00
398773849c Fixed get_global_int bug 2004-03-16 01:12:24 +00:00
41c8013adf Removed bad lstdc++ line. 2004-03-16 01:00:22 +00:00
93a4d8a0d3 Fixed call_think 2004-03-16 00:48:37 +00:00
bf35c8f079 *** empty log message *** 2004-03-15 22:13:43 +00:00
1425615e20 Fixed headers. 2004-03-15 21:05:08 +00:00
ee947b1673 Redid lots of destruction stuff. 2004-03-15 20:27:53 +00:00
439550c2ac Moved msg functions 2004-03-15 19:55:29 +00:00
35fe033d53 Fixed controller, blending, and reduced view lag.
(T(+)rget suggestions)
2004-03-15 18:23:23 +00:00
8b81138800 *** empty log message *** 2004-03-14 20:14:51 +00:00
308e77d3b1 *** empty log message *** 2004-03-14 19:14:29 +00:00
e6ad1b5b65 *** empty log message *** 2004-03-14 19:07:32 +00:00
b70fb5b525 *** empty log message *** 2004-03-14 19:06:52 +00:00
1dfe40c135 *** empty log message *** 2004-03-14 19:00:43 +00:00
29f31e808f version changed to 0.15 2004-03-14 17:45:09 +00:00
f4a729e85a cpp std lib depedencies removed 2004-03-14 14:05:44 +00:00
d3839db6f8 message_begin, message_end, write_* functions added back to core 2004-03-14 13:57:53 +00:00
41a56a8fda not using c++ std lib 2004-03-14 13:57:27 +00:00
812ee46260 commented message_begin() etc 2004-03-14 12:47:16 +00:00
5ddb726a12 Added VS7 project file 2004-03-14 08:31:36 +00:00
5b56c27e67 Added new ENGINE stocks and natives 2004-03-14 08:23:42 +00:00
faafdf9498 fixed reference to "find_entity_by_class" -> "find_ent_by_class" 2004-03-14 08:20:13 +00:00
d9b84087d9 Removed messaging code.
Fixed last argument bug in set/get msg arg funcs.
2004-03-13 20:48:00 +00:00
79b2095932 switched back to old compiler 2004-03-13 10:06:52 +00:00
5679cb285a removed fun's version cvar 2004-03-12 19:04:02 +00:00
47a2ecaa81 fixed find_entity should return value warning 2004-03-12 13:41:16 +00:00
1e78c58aa9 Removed botrelated code 2004-03-12 11:19:44 +00:00
d819a55802 version says 0.1 WON for won and 0.1 STEAM for steam 2004-03-12 09:49:49 +00:00
7d1a26e4ca fixed so it's now possible to shoot and break func_breakable:s again :-) 2004-03-12 07:42:54 +00:00
d0965d38c8 removed stock get_user_hitzones 2004-03-11 14:56:08 +00:00
6a8380fb0f another bugfix :) 2004-03-11 14:22:06 +00:00
cecb04944f updated paths 2004-03-11 14:05:01 +00:00
d47ed6c48c another bugfix 2004-03-11 13:48:57 +00:00
4656bb246e possible fix of the events bug 2004-03-11 12:35:13 +00:00
fe3977ee61 #include <string> added 2004-03-11 12:15:15 +00:00
486e8da7a8 updated paths 2004-03-11 10:13:01 +00:00
d65d599b2c removed debug msg 2004-03-11 10:10:49 +00:00
655c5a5db3 Updated cs_set_user_vip/cs_get_user_vip (bug in cs_get_user_vip fixed)
cs_set_user_deaths now updates ingame scoreboard (sending ScoreInfo message).
2004-03-11 09:29:08 +00:00
3598791060 fixed small comment mistake 2004-03-11 08:10:12 +00:00
b505bdb7e8 updated set_user_hitzones, added get_user_hitzones 2004-03-10 22:32:10 +00:00
1e69aaff18 removed set_hitzones 2004-03-10 21:59:21 +00:00
fa725d1838 added set_user_hitzones, remove set_hitzones 2004-03-10 21:58:47 +00:00
be58c942c0 Linux small compiler. 2004-03-10 18:53:29 +00:00
bed1df8237 using __linux__ instead of LINUX 2004-03-10 16:28:38 +00:00
7206639ef9 directory paths should be ok now (not using localinfos) 2004-03-10 16:28:17 +00:00
fbb6b260a6 Removed get_user_wonid 2004-03-10 16:26:18 +00:00
753426440d nothing important 2004-03-10 13:46:21 +00:00
de0cf4da9a making sure basedir is set 2004-03-10 08:31:51 +00:00
923f3a987f removed get_user_wonid 2004-03-09 20:36:22 +00:00
145455ecfb removed one of the two set_user_money stocks 2004-03-09 20:35:50 +00:00
21dbe183e3 added get_user_wonid 2004-03-09 17:12:58 +00:00
0bdc09d3d9 hardcoded pathes 2004-03-09 15:53:40 +00:00
31f59ea92e changed to find_entity_by_class where stock used find_entity 2004-03-09 14:12:10 +00:00
513a005f3d removed so as to not accidentally use old builds 2004-03-09 10:26:40 +00:00
91d4d821ec fixed link to plugins.ini (was in amxx/configs, now is in amxx/) 2004-03-09 09:39:09 +00:00
acb2ebaaf9 fixed link to modules.ini (was in amxx/configs, now is in amxx/) 2004-03-09 09:38:36 +00:00
6385e00106 removed #define LINUX 2004-03-09 09:36:54 +00:00
666bc67f3d updated to use find_entity_by_class 2004-03-09 08:54:12 +00:00
2d327e8d14 backwards comp. intitial version 2004-03-09 08:53:06 +00:00
d1379bb671 renamed find_entity in engine to find_ent_by_class (find_ent_by_classname works too) 2004-03-09 08:32:50 +00:00
0f4c470e67 added status to amx_modules 2004-03-08 17:44:49 +00:00
af26dc83a5 changed to str_to_num/num_to_str 2004-03-08 17:34:37 +00:00
87378017fd fixed conmotd.txt path 2004-03-08 17:33:55 +00:00
e25aadd7a3 fixed /rank, /stats and /statsme | changed to str_to_num/num_to_str 2004-03-08 17:33:06 +00:00
a26606f799 amx_plugins, amx_modules: switched to console ouput instead of motd window 2004-03-08 17:30:30 +00:00
b938e955f5 removed stocks: int_to_str, str_to_int, numtostr and strtonum 2004-03-08 17:28:57 +00:00
864c6d6aa4 added status to get_module 2004-03-08 17:27:18 +00:00
96ab54a107 added Status for get_module() 2004-03-08 17:26:38 +00:00
d37bdc026c added numtostr() and strtonum() 2004-03-08 17:19:41 +00:00
10a28dcde9 changed to str_to_num/num_to_str 2004-03-08 17:18:34 +00:00
57747fff55 changed to str_to_num/num_to_str | fixed get_modules 2004-03-08 16:06:11 +00:00
5cb9cb1c05 fixed potencial logging crashes in Meta_Attach 2004-03-08 15:12:53 +00:00
db278c390d log_amx: remove .amx from plugin names 2004-03-08 15:12:16 +00:00
8ffcb98ce7 hardcoded directory names 2004-03-08 14:09:44 +00:00
c2879eafab get_module returns module status too 2004-03-08 14:09:09 +00:00
214f914547 this is steamid/wonid 2004-03-08 10:27:51 +00:00
1e880869e7 Fixed amxmod.inc 2004-03-08 10:24:10 +00:00
d3a58298c9 fixed find_entity 2004-03-08 10:07:55 +00:00
0b129c3a9f Updated explanation of find_entity saying "will return 0 if nothing is found" 2004-03-08 09:28:30 +00:00
da149e4580 Confirmed hostage follow offset for WON, tidied up csplayerclass 2004-03-08 09:18:06 +00:00
913b72451d fixed return create_entity(szClassname[]) 2004-03-08 08:36:23 +00:00
102 changed files with 6965 additions and 1005 deletions

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "CCmd.h" #include "CCmd.h"
// ***************************************************** // *****************************************************

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "CEvent.h" #include "CEvent.h"
// ***************************************************** // *****************************************************
@ -44,6 +44,9 @@ 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
@ -55,11 +58,54 @@ 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()
@ -69,6 +115,8 @@ int EventsMngr::ClEvent::getFunction()
EventsMngr::EventsMngr() EventsMngr::EventsMngr()
{ {
m_ParseVault = NULL;
m_ParseVaultSize = 0;
clearEvents(); clearEvents();
} }
@ -106,23 +154,34 @@ void EventsMngr::ClEvent::registerFilter(char *filter)
if (!*value) if (!*value)
return; return;
CondMapPair pair; cond_t *tmpCond = new cond_t;
if (!tmpCond)
return;
// type character // type character
pair.second.type = *value; tmpCond->type = *value;
// set a null here so param id can be recognized later // set a null here so param id can be recognized, and save it
*value++ = 0; *value++ = 0;
tmpCond->paramId = atoi(filter);
// rest of line // rest of line
pair.second.sValue = value; tmpCond->sValue.set(value);
pair.second.fValue = atof(value); tmpCond->fValue = atof(value);
pair.second.iValue = atoi(value); tmpCond->iValue = atoi(value);
// param id tmpCond->next = NULL;
pair.first = atoi(filter);
m_Conditions.insert(pair); if (m_Conditions)
{
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)
@ -135,7 +194,7 @@ EventsMngr::ClEvent* EventsMngr::registerEvent(CPluginMngr::CPlugin* plugin, int
if (!event) if (!event)
return NULL; return NULL;
m_Events[msgid].push_back(event); m_Events[msgid].put(event);
return event; return event;
} }
@ -149,37 +208,38 @@ 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].empty()) if (!m_Events[msg_type].size())
return; return;
for(ClEventVecIter iter = m_Events[msg_type].begin(); iter != m_Events[msg_type].end(); ++iter) for(ClEventVecIter iter = m_Events[msg_type].begin(); iter; ++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;
@ -187,15 +247,10 @@ 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;
m_ParseVault[m_ParsePos].type = MSG_INTEGER; NextParam();
m_ParseVault[m_ParsePos].iValue = index; m_ParseVault[0].type = MSG_INTEGER;
m_ParseVault[0].iValue = index;
} }
m_ParseFun = &m_Events[msg_type]; m_ParseFun = &m_Events[msg_type];
} }
@ -206,45 +261,43 @@ void EventsMngr::parseValue(int iValue)
if (!m_ParseNotDone || !m_ParseFun) if (!m_ParseNotDone || !m_ParseFun)
return; return;
// grow if needed // grow if needed
if (m_ParseVault.size() <= static_cast<size_t>(++m_ParsePos)) ++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 // loop through the registered funcs, and decide whether they have to be called or not
bool skip; // if they shouldnt, their m_Done is set to true
for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter)
{ {
if ((*iter)->m_Done) if ((*iter).m_Done)
continue; continue; // already skipped; don't bother with parsing
skip = false; // loop through conditions
ClEvent::CondMapIter condIter = (*iter)->m_Conditions.find(m_ParsePos); bool execute = false;
if (condIter == (*iter)->m_Conditions.end()) bool anyConditions = false;
continue; for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next)
do
{ {
switch(condIter->second.type) if (condIter->paramId == m_ParsePos)
{ {
case '=': if (condIter->second.iValue == iValue) skip=true; break; anyConditions = true;
case '!': if (condIter->second.iValue != iValue) skip=true; break; switch(condIter->type)
case '&': if (iValue & condIter->second.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->iValue) execute=true; break;
case '<': if (iValue < condIter->iValue) execute=true; break;
case '>': if (iValue > condIter->iValue) execute=true; break;
}
if (execute)
break;
} }
if (skip) }
break; if (anyConditions && !execute)
} while ( ++condIter != (*iter)->m_Conditions.end() ); (*iter).m_Done = true; // don't execute
if (skip)
continue;
(*iter)->m_Done = true;
} }
} }
@ -254,44 +307,42 @@ void EventsMngr::parseValue(float fValue)
if (!m_ParseNotDone || !m_ParseFun) if (!m_ParseNotDone || !m_ParseFun)
return; return;
// grow if needed // grow if needed
if (m_ParseVault.size() <= static_cast<size_t>(++m_ParsePos)) ++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 // loop through the registered funcs, and decide whether they have to be called or not
bool skip; // if they shouldnt, their m_Done is set to true
for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter)
{ {
if ((*iter)->m_Done) if ((*iter).m_Done)
continue; continue; // already skipped; don't bother with parsing
skip = false; // loop through conditions
ClEvent::CondMapIter condIter = (*iter)->m_Conditions.find(m_ParsePos); bool execute = false;
if (condIter == (*iter)->m_Conditions.end()) bool anyConditions = false;
continue; for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next)
do
{ {
switch(condIter->second.type) if (condIter->paramId == m_ParsePos)
{ {
case '=': if (condIter->second.fValue == fValue) skip=true; break; anyConditions = true;
case '!': if (condIter->second.fValue != fValue) skip=true; break; switch(condIter->type)
case '<': if (fValue < condIter->second.fValue) skip=true; break; {
case '>': if (fValue > condIter->second.fValue) skip=true; break; case '=': if (condIter->fValue == fValue) execute=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)
break;
} }
if (skip) }
break; if (anyConditions && !execute)
} while ( ++condIter != (*iter)->m_Conditions.end() ); (*iter).m_Done = true; // don't execute
if (skip)
continue;
(*iter)->m_Done = true;
} }
} }
@ -302,42 +353,39 @@ void EventsMngr::parseValue(const char *sz)
return; return;
// grow if needed // grow if needed
if (m_ParseVault.size() <= static_cast<size_t>(++m_ParsePos)) ++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 // loop through the registered funcs, and decide whether they have to be called or not
bool skip; // if they shouldnt, their m_Done is set to true
for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter)
{ {
if ((*iter)->m_Done) if ((*iter).m_Done)
continue; continue; // already skipped; don't bother with parsing
skip = false; // loop through conditions
ClEvent::CondMapIter condIter = (*iter)->m_Conditions.find(m_ParsePos); bool execute = false;
if (condIter == (*iter)->m_Conditions.end()) bool anyConditions = false;
continue; for (ClEvent::cond_t *condIter = (*iter).m_Conditions; condIter; condIter = condIter->next)
do
{ {
switch(condIter->second.type) if (condIter->paramId == m_ParsePos)
{ {
case '=': if (!strcmp(sz, condIter->second.sValue.c_str())) skip=true; break; anyConditions = true;
case '!': if (!strstr(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 (!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)
break;
} }
if (skip) }
break; if (anyConditions && !execute)
} while ( ++condIter != (*iter)->m_Conditions.end() ); (*iter).m_Done = true; // don't execute
if (skip)
continue;
(*iter)->m_Done = true;
} }
} }
@ -354,20 +402,20 @@ void EventsMngr::executeEvents()
try try
{ {
#endif // #ifdef ENABLEEXEPTIONS #endif // #ifdef ENABLEEXEPTIONS
for (ClEventVecIter iter = m_ParseFun->begin(); iter != m_ParseFun->end(); ++iter) for (ClEventVecIter iter = m_ParseFun->begin(); iter; ++iter)
{ {
if ( (*iter)->m_Done ) if ( (*iter).m_Done )
{ {
(*iter)->m_Done = false; (*iter).m_Done = false;
continue; continue;
} }
(*iter)->m_Stamp = *m_Timer; (*iter).m_Stamp = (float)*m_Timer;
if ((err = amx_Exec((*iter)->m_Plugin->getAMX(), NULL, (*iter)->m_Func, 1, m_ParseVault.size() ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE) if ((err = amx_Exec((*iter).m_Plugin->getAMX(), NULL, (*iter).m_Func, 1, m_ParseVault ? m_ParseVault[0].iValue : 0)) != AMX_ERR_NONE)
{ {
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());
} }
} }
@ -378,6 +426,8 @@ 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()
@ -441,13 +491,15 @@ 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();
} }
// delete parsevault
if (m_ParseVault)
{
delete [] m_ParseVault;
m_ParseVault = NULL;
m_ParseVaultSize = 0;
}
} }
int EventsMngr::getEventId(const char* msg) int EventsMngr::getEventId(const char* msg)

View File

@ -32,10 +32,6 @@
#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 {
@ -90,46 +86,48 @@ public:
// conditions // conditions
struct cond_t struct cond_t
{ {
std::string sValue; // value int paramId; // the message parameter id
float fValue;
int iValue; String sValue; // value (string)
int type; float fValue; // value (float)
int iValue; // value (int)
int type; // type (can be int, float, string)
cond_t *next;
}; };
typedef std::pair<int, cond_t> CondMapPair; cond_t *m_Conditions;
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 MsgDataVault struct MsgDataEntry
{ {
float fValue; float fValue;
int iValue; int iValue;
const char* sValue; const char* sValue;
MsgParamType type; MsgParamType type;
}; };
typedef std::vector<MsgDataVault> MsgDataVaultVec; MsgDataEntry *m_ParseVault;
typedef MsgDataVaultVec::iterator MsgDataVaultVecIter; int m_ParseVaultSize;
MsgDataVaultVec m_ParseVault; void NextParam(); // make sure a new parameter can be added
typedef std::vector<ClEvent*> ClEventVec; typedef CList<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 -1 less then args. num. int m_ParsePos; // is args. num. - 1
float* m_Timer; float* m_Timer;
ClEvent* getValidEvent(ClEvent* a ); ClEvent* getValidEvent(ClEvent* a );

View File

@ -94,6 +94,7 @@ File& operator>>( File& f, char* n )
int File::getline( char* buf, int sz ) int File::getline( char* buf, int sz )
{ {
int a = sz; int a = sz;
char *origBuf = buf;
if ( *this ) if ( *this )
{ {
int c; int c;
@ -101,6 +102,15 @@ int File::getline( char* buf, int sz )
*buf++ = c; *buf++ = c;
*buf = 0; *buf = 0;
} }
// trim 0x0a and 0x0d characters at the end
while (buf != origBuf)
{
if (*buf == 0x0a || *buf == 0x0d)
*buf = 0;
--buf;
}
return a - sz; return a - sz;
} }

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "CForward.h" #include "CForward.h"
void CForwardMngr::registerForward( CPluginMngr::CPlugin* p, int func , int type ){ void CForwardMngr::registerForward( CPluginMngr::CPlugin* p, int func , int type ){

View File

@ -51,21 +51,28 @@ public:
}; };
private: private:
CListEle *head; CListEle *head;
int cur_size;
public: public:
CList<T,F>() { head = 0; cur_size = 0; } CList<T,F>() { head = 0; }
~CList<T,F>() { clear(); } ~CList<T,F>() { clear(); }
void clear() { void clear() {
iterator a = begin(); iterator a = begin();
while( a ) a.remove(); while( a ) a.remove();
cur_size = 0; }
bool empty() {
return (head ? false : true);
} }
void put( T* a ) { void put( T* a ) {
head = new CListEle( a , head ); head = new CListEle( a , head );
++cur_size;
} }
int size() { int size() {
return cur_size; CListEle *p = head;
int i = 0;
while (p)
{
p = p->next;
++i;
}
return i;
} }
class iterator { class iterator {
CListEle** a; CListEle** a;

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "CLogEvent.h" #include "CLogEvent.h"
// ***************************************************** // *****************************************************

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "CMenu.h" #include "CMenu.h"
// ***************************************************** // *****************************************************

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
// ***************************************************** // *****************************************************
// class CPlayer // class CPlayer

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#ifndef FAR // PM: Test: FAR #ifndef FAR // PM: Test: FAR
#define FAR #define FAR

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "CPlugin.h" #include "CPlugin.h"
#include "CForward.h" #include "CForward.h"
#include "CFile.h" #include "CFile.h"
@ -62,7 +62,7 @@ int CPluginMngr::loadPluginsFromFile( const char* filename )
// Find now folder // Find now folder
char pluginName[256], line[256], error[256]; char pluginName[256], line[256], error[256];
const char pluginsDir[] = "addons/amxx/plugins"; // hardcoded; :TODO: make it localinfo const char *pluginsDir = get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
while ( fp.getline(line , 255 ) ) while ( fp.getline(line , 255 ) )

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "CTask.h" #include "CTask.h"

View File

@ -1,7 +1,7 @@
MODNAME = amx_mm MODNAME = amxx_mm
SRCFILES = meta_api.cpp CFile.cpp CString.cpp CVault.cpp vault.cpp\ SRCFILES = meta_api.cpp CFile.cpp CString.cpp CVault.cpp vault.cpp\
float.cpp file.cpp modules.cpp CMisc.cpp CTask.cpp string.cpp\ float.cpp file.cpp modules.cpp CMisc.cpp CTask.cpp string.cpp\
amxmod.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp srvcmd.cpp strptime.cpp\ amxmodx.cpp CEvent.cpp CCmd.cpp CLogEvent.cpp srvcmd.cpp strptime.cpp\
CForward.cpp CPlugin.cpp CModule.cpp CMenu.cpp emsg.cpp util.cpp CForward.cpp CPlugin.cpp CModule.cpp CMenu.cpp emsg.cpp util.cpp
CSRCFILES = amx.c amxcore.c amxtime.c power.c CSRCFILES = amx.c amxcore.c amxtime.c power.c
@ -29,7 +29,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc CC_LINUX=gcc-2.95
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 = -march=i586 -O6 -ffast-math -funroll-loops \ CCOPT = -O2 -march=i586 -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) -lstdc++ -shared -ldl -lm $(OBJ_LINUX) $(OBJC_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@ LINK_LINUX=$(CC_LINUX) $(CFLAGS) -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,10 +10,8 @@
* 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
*/ */
#define LINUX #if defined __linux__
#if defined LINUX
#include <sclinux.h> #include <sclinux.h>
#endif #endif
#ifndef __AMX_H #ifndef __AMX_H
@ -22,7 +20,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;
@ -109,7 +107,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)
@ -298,7 +296,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,11 +401,6 @@ 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 */
{ {
@ -1019,6 +1014,95 @@ 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;
@ -2009,23 +2093,46 @@ 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); // native get_module(id, name[], nameLen, author[], authorLen, version[], versionLen, &status);
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; return -1; // not found
// 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[], ...);
@ -2033,6 +2140,7 @@ 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;
} }
@ -2361,7 +2469,6 @@ 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 },
@ -2441,5 +2548,15 @@ 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.1" #define AMX_VERSION "0.15"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

2562
amxmodx/amxmodx.cpp Executable file

File diff suppressed because it is too large Load Diff

247
amxmodx/amxmodx.h Executable file
View File

@ -0,0 +1,247 @@
/* AMX Mod X
*
* by the AMX Mod X Development Team
* originally developed by OLO
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/
#ifndef AMXMODX_H
#define AMXMODX_H
#include "modules.h"
#include "CString.h"
#include "CList.h"
#include "CPlugin.h"
#include "CMisc.h"
#include "CVault.h"
#include "CModule.h"
#include "CTask.h"
#include "CLogEvent.h"
#include "CForward.h"
#include "CCmd.h"
#include "CMenu.h"
#include "CEvent.h"
#define AMX_VERSION "0.16"
#ifdef __cplusplus
extern "C" {
#endif
extern AMX_NATIVE_INFO core_Natives[];
extern AMX_NATIVE_INFO time_Natives[];
extern AMX_NATIVE_INFO power_Natives[];
#ifdef __cplusplus
}
#endif
extern AMX_NATIVE_INFO amxmod_Natives[];
extern AMX_NATIVE_INFO file_Natives[];
extern AMX_NATIVE_INFO float_Natives[];
extern AMX_NATIVE_INFO string_Natives[];
extern AMX_NATIVE_INFO vault_Natives[];
#ifndef __linux__
#define DLLOAD(path) (DLHANDLE)LoadLibrary(path);
#define DLPROC(m,func) GetProcAddress(m,func);
#define DLFREE(m) FreeLibrary(m);
#else
#define DLLOAD(path) (DLHANDLE)dlopen(path, RTLD_NOW);
#define DLPROC(m,func) dlsym(m,func);
#define DLFREE(m) dlclose(m);
#endif
#ifndef __linux__
typedef HINSTANCE DLHANDLE;
#else
typedef void* DLHANDLE;
#endif
#ifndef GETPLAYERAUTHID
#define GETPLAYERAUTHID (*g_engfuncs.pfnGetPlayerAuthId)
#endif
#define ANGLEVECTORS (*g_engfuncs.pfnAngleVectors)
#define CLIENT_PRINT (*g_engfuncs.pfnClientPrintf)
#define CVAR_DIRECTSET (*g_engfuncs.pfnCvar_DirectSet)
#define GETCLIENTLISTENING (*g_engfuncs.pfnVoice_GetClientListening)
#define RUNPLAYERMOVE (*g_engfuncs.pfnRunPlayerMove)
#define SETCLIENTLISTENING (*g_engfuncs.pfnVoice_SetClientListening)
#define SETCLIENTMAXSPEED (*g_engfuncs.pfnSetClientMaxspeed)
char* UTIL_SplitHudMessage(register const char *src);
int UTIL_ReadFlags(const char* c);
void UTIL_ClientPrint( edict_t *pEntity, int msg_dest, char *msg );
void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1 = NULL, const char *arg2 = NULL);
void UTIL_GetFlags(char* flags,int flag);
void UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, char *pMessage);
void UTIL_IntToString(int value, char *output);
void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name);
void UTIL_ShowMenu( edict_t* pEntity, int slots, int time, char *menu, int mlen );
void UTIL_MakeNewLogFile();
void UTIL_Log(const char *fmt, ...);
#define UTIL_MODULES_RUNNING 0
#define UTIL_MODULES_ALL 1
#define UTIL_MODULES_STOPPED 2
int UTIL_GetModulesNum(int mode);
#define GET_PLAYER_POINTER(e) (&g_players[ENTINDEX(e)])
//#define GET_PLAYER_POINTER(e) (&g_players[(((int)e-g_edict_point)/sizeof(edict_t ))])
#define GET_PLAYER_POINTER_I(i) (&g_players[i])
struct WeaponsVault {
String fullName;
short int iId;
short int ammoSlot;
};
struct fakecmd_t {
char args[256];
const char *argv[3];
//char argv[3][128];
int argc;
bool fake;
};
extern CPluginMngr g_plugins;
extern CTaskMngr g_tasksMngr;
extern CPlayer g_players[33];
extern CPlayer* mPlayer;
extern CmdMngr g_commands;
extern CList<CCVar> g_cvars;
extern CList<ForceObject> g_forcemodels;
extern CList<ForceObject> g_forcesounds;
extern CList<ForceObject> g_forcegeneric;
extern CList<CModule> g_modules;
extern CList<CPlayer*> g_auth;
extern EventsMngr g_events;
extern Grenades g_grenades;
extern LogEventsMngr g_logevents;
extern MenuMngr g_menucmds;
extern String g_log_dir;
extern String g_mod_name;
extern TeamIds g_teamsIds;
extern Vault g_vault;
extern CForwardMngr g_forwards;
extern WeaponsVault g_weaponsData[MAX_WEAPONS];
extern XVars g_xvars;
extern bool g_bmod_cstrike;
extern bool g_bmod_dod;
extern bool g_dontprecache;
extern bool g_initialized;
extern int g_srvindex;
extern cvar_t* amx_version;
extern cvar_t* amxmodx_version;
extern cvar_t* hostname;
extern cvar_t* mp_timelimit;
extern fakecmd_t g_fakecmd;
extern float g_game_restarting;
extern float g_game_timeleft;
extern float g_task_time;
extern float g_auth_time;
extern hudtextparms_t g_hudset;
//extern int g_edict_point;
extern int g_players_num;
extern int mPlayerIndex;
extern int mState;
extern void (*endfunction)(void*);
extern void (*function)(void*);
typedef void (*funEventCall)(void*);
extern funEventCall modMsgsEnd[MAX_REG_MSGS];
extern funEventCall modMsgs[MAX_REG_MSGS];
extern int gmsgAmmoPickup;
extern int gmsgAmmoX;
extern int gmsgBattery;
extern int gmsgCurWeapon;
extern int gmsgDamage;
extern int gmsgDeathMsg;
extern int gmsgHealth;
extern int gmsgMOTD;
extern int gmsgScoreInfo;
extern int gmsgSendAudio;
extern int gmsgServerName;
extern int gmsgShowMenu;
extern int gmsgTeamInfo;
extern int gmsgTextMsg;
extern int gmsgVGUIMenu;
extern int gmsgWeapPickup;
extern int gmsgWeaponList;
extern int gmsgintermission;
extern int gmsgResetHUD;
extern int gmsgRoundTime;
void Client_AmmoPickup(void*);
void Client_AmmoX(void*);
void Client_CurWeapon(void*);
void Client_ScoreInfo(void*);
void Client_ShowMenu(void*);
void Client_TeamInfo(void*);
void Client_TextMsg(void*);
void Client_VGUIMenu(void*);
void Client_WeaponList(void*);
void Client_DamageEnd(void*);
void Client_DeathMsg(void*);
void amx_command();
void plugin_srvcmd();
const char* stristr(const char* a,const char* b);
char *strptime(const char *buf, const char *fmt, struct tm *tm, short addthem);
int loadModules(const char* filename);
void dettachModules();
void dettachReloadModules();
void attachModules();
void attachMetaModModules( const char* filename );
void dettachMetaModModules( const char* filename );
int add_amxnatives(module_info_s* info,AMX_NATIVE_INFO*natives);
cell* get_amxaddr(AMX *amx,cell amx_addr);
char* build_pathname(char *fmt, ... );
char* format_amxstring(AMX *amx, cell *params, int parm,int& len);
AMX* get_amxscript(int, void**,const char**);
const char* get_amxscriptname(AMX* amx);
char* get_amxstring(AMX *amx,cell amx_addr,int id,int& len);
int amxstring_len(cell* cstr);
int load_amxscript(AMX* amx, void** program, const char* path, char error[64]);
int set_amxnatives(AMX* amx,char error[64]);
int set_amxstring(AMX *amx,cell amx_addr,const char *source,int max);
int unload_amxscript(AMX* amx,void** program);
void copy_amxmemory(cell* dest,cell* src,int len);
void get_modname(char*);
void print_srvconsole( char *fmt, ... );
void report_error( int code, char* fmt, ... );
void* alloc_amxmemory(void**, int size);
void free_amxmemory(void **ptr);
// get_localinfo
const char* get_localinfo( const char* name , const char* def );
#endif // AMXMODX_H

11
amxmodx/amxx_mm.def Executable file
View File

@ -0,0 +1,11 @@
; /usr/local/cross-tools/bin/i386-mingw32msvc-dlltool --base-file /tmp/cc4kB6s0.base --output-exp amx_mm.exp --dllname amx_mm.dll --output-def amx_mm.def --add-stdcall-alias --exclude-symbol=DllMainCRTStartup@12 --def /tmp/ccyI7I7K.def
EXPORTS
GetEngineFunctions @ 1 ;
GetEngineFunctions_Post @ 2 ;
GetEntityAPI2 @ 3 ;
GetEntityAPI2_Post @ 4 ;
GiveFnptrsToDll = GiveFnptrsToDll@8 @ 5 ;
GiveFnptrsToDll@8 @ 6 ;
Meta_Attach @ 7 ;
Meta_Detach @ 8 ;
Meta_Query @ 9 ;

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
int gmsgAmmoPickup; int gmsgAmmoPickup;
int gmsgAmmoX; int gmsgAmmoX;

View File

@ -37,7 +37,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
// header file for unlink() // header file for unlink()
#ifdef __linux__ #ifdef __linux__

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
plugin_info_t Plugin_info = { plugin_info_t Plugin_info = {
META_INTERFACE_VERSION, // ifvers META_INTERFACE_VERSION, // ifvers
@ -212,40 +212,36 @@ 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");
// ###### Initialize logging // we need to initialize logging in Meta_Attach, but we have to create a new logfile each map,
g_log_dir.set( get_localinfo("amx_logdir" , "addons/amxx/logs" ) ); // so we clear g_log_dir in ServerDeactivate_Post to know we should create one...
UTIL_MakeNewLogFile(); if (g_log_dir.empty())
{
g_log_dir.set(get_localinfo("amxx_logs", "addons/amxx/logs"));
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_" );
g_commands.registerPrefix( "cm_" ); g_commands.registerPrefix( "cm_" );
Vault amx_config; // make sure localinfos are set
// ###### Load custom path configuration get_localinfo("amxx_basedir", "addons/amxx");
amx_config.setSource( build_pathname("%s", get_localinfo("amxx_pluginsdir", "addons/amxx/plugins");
get_localinfo("amxx_cfg" , "addons/amxx/configs/core.ini")) ); get_localinfo("amxx_modulesdir", "addons/amxx/modules");
get_localinfo("amxx_configsdir", "addons/amxx/configs");
if ( amx_config.loadVault() ){ get_localinfo("amxx_customdir", "addons/amxx/custom");
Vault::iterator a = amx_config.begin();
while ( a != amx_config.end() ) {
SET_LOCALINFO( (char*)a.key().str() , (char*)a.value().str() );
++a;
}
amx_config.clear();
}
// ###### Make sure basedir is set
get_localinfo("amxx_basedir" , "addons/amxx" );
// ###### Load modules // ###### Load modules
int loaded = loadModules( get_localinfo("amxx_modules" , "addons/amxx/modules.ini" ) ); loadModules(get_localinfo("amxx_modules", "addons/amxx/modules.ini"));
attachModules(); attachModules();
int loaded = UTIL_GetModulesNum(UTIL_MODULES_RUNNING); // Call after attachModules so all modules don't have pending stat
// Set some info about amx version and modules // Set some info about amx version and modules
if ( loaded ){ if ( loaded ){
char buffer[64]; char buffer[64];
@ -260,8 +256,7 @@ int Spawn( edict_t *pent ) {
} }
// ###### Load Vault // ###### Load Vault
g_vault.setSource( build_pathname("%s", g_vault.setSource( build_pathname("%s", get_localinfo("amxx_vault", "addons/amxx/configs/vault.ini")) );
get_localinfo("amxx_vault" , "addons/amxx/configs/vault.ini" ) ) );
g_vault.loadVault( ); g_vault.loadVault( );
@ -275,8 +270,7 @@ 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( g_plugins.loadPluginsFromFile( get_localinfo("amxx_plugins", "addons/amxx/plugins.ini") ); // :TODO: Where the hell should this be!?!?!
get_localinfo("amxx_plugins" , "addons/amxx/plugins.ini" ) );
// ###### Call precache forward function // ###### Call precache forward function
g_dontprecache = false; g_dontprecache = false;
@ -440,6 +434,7 @@ 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,9 +968,25 @@ 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);
// ###### Load custom path configuration
Vault amx_config;
amx_config.setSource(build_pathname("%s", get_localinfo("amxx_cfg", "addons/amxx/configs/core.ini")));
if ( amx_config.loadVault() ){
Vault::iterator a = amx_config.begin();
while ( a != amx_config.end() ) {
SET_LOCALINFO( (char*)a.key().str() , (char*)a.value().str() );
++a;
}
amx_config.clear();
}
// ###### Initialize logging here
g_log_dir.set(get_localinfo("amxx_logs", "addons/amxx/logs"));
UTIL_MakeNewLogFile();
// ###### Now attach metamod modules // ###### Now attach metamod modules
attachMetaModModules( get_localinfo("amxx_modules" , attachMetaModModules( get_localinfo("amxx_modules", "addons/amxx/modules.ini") );
"addons/amxx/modules.ini" ) );
return(TRUE); return(TRUE);
} }
@ -1004,8 +1015,7 @@ C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) {
dettachModules(); dettachModules();
// ###### Now dettach metamod modules // ###### Now dettach metamod modules
dettachMetaModModules( get_localinfo("amxx_modules" , dettachMetaModModules( get_localinfo("amxx_modules", "addons/amxx/modules.ini") );
"addons/amxx/modules.ini" ) );
return(TRUE); return(TRUE);
} }

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
#include "osdep.h" // sleep, etc #include "osdep.h" // sleep, etc
#include "CFile.h" #include "CFile.h"
@ -362,7 +362,7 @@ int loadModules(const char* filename)
if (!isalnum(*moduleName) || !validFile(moduleName) ) if (!isalnum(*moduleName) || !validFile(moduleName) )
continue; continue;
char* pathname = build_pathname("addons/amxx/modules/%s", line); char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
CList<CModule>::iterator a = g_modules.find( pathname ); CList<CModule>::iterator a = g_modules.find( pathname );
@ -476,8 +476,8 @@ void dettachMetaModModules( const char* filename )
if (!isalnum(*moduleName) || !validFile(moduleName) ) if (!isalnum(*moduleName) || !validFile(moduleName) )
continue; continue;
char* pathname = build_pathname_addons("addons/amxx/modules/%s", line); char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line); char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
module = DLLOAD( pathname ); // link dll module = DLLOAD( pathname ); // link dll
@ -520,8 +520,8 @@ void attachMetaModModules( const char* filename )
if (!isalnum(*moduleName) || !validFile(moduleName) ) if (!isalnum(*moduleName) || !validFile(moduleName) )
continue; continue;
char* pathname = build_pathname("addons/amxx/modules/%s", line); char* pathname = build_pathname("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
char* mmpathname = build_pathname_addons("addons/amxx/modules/%s", line); char* mmpathname = build_pathname_addons("%s/%s", get_localinfo("amxx_modulesdir", "addons/amxx/modules"), line);
module = DLLOAD( pathname ); // link dll module = DLLOAD( pathname ); // link dll
if ( module ) if ( module )

6
amxmodx/msvc/amxmodx_mm.def Executable file
View File

@ -0,0 +1,6 @@
LIBRARY amxx_mm
EXPORTS
GiveFnptrsToDll @1
SECTIONS
.data READ WRITE

288
amxmodx/msvc/amxmodx_mm.dsp Executable file
View File

@ -0,0 +1,288 @@
# Microsoft Developer Studio Project File - Name="amxmodx_mm" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=amxmodx_mm - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "amxmodx_mm.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "amxmodx_mm.mak" CFG="amxmodx_mm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "amxmodx_mm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "amxmodx_mm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "amxmodx_mm - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\metamod\metamod" /I "..\..\hlsdk\sourcecode\common" /I "..\..\hlsdk\sourcecode\engine" /I "..\..\hlsdk\sourcecode\dlls" /I "..\..\hlsdk\sourcecode\pm_shared" /I "..\extra\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /def:".\amxmodx_mm.def" /out:"release/amxxmm.dll" /libpath:"..\extra\lib_win32"
# Begin Custom Build
TargetPath=.\release\amxxmm.dll
TargetName=amxxmm
InputPath=.\release\amxxmm.dll
SOURCE="$(InputPath)"
"$(TargetName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(TargetPath) D:\SIERRA\Half-Life\cstrike\addons\amx\dlls
# End Custom Build
!ELSEIF "$(CFG)" == "amxmodx_mm - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /Zp4 /MTd /W3 /Gm /GX /ZI /Od /I "..\..\metamod\metamod" /I "..\...\hlsdk\sourcecode\common" /I "..\...\hlsdk\sourcecode\engine" /I "..\...\hlsdk\sourcecode\dlls" /I "..\...\hlsdk\sourcecode\pm_shared" /I "..\extra\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "amxmodx_mm_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /def:".\amxmodx_mm.def" /out:"debug/amxxmm.dll" /pdbtype:sept /libpath:"..\extra\lib_win32"
# SUBTRACT LINK32 /incremental:no /nodefaultlib
# Begin Custom Build
TargetPath=.\debug\amxxmm.dll
TargetName=amxxmm
InputPath=.\debug\amxxmm.dll
SOURCE="$(InputPath)"
"$(TargetName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(TargetPath) D:\SIERRA\Half-Life\cstrike\addons\amx\dlls
# End Custom Build
!ENDIF
# Begin Target
# Name "amxmodx_mm - Win32 Release"
# Name "amxmodx_mm - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\amx.c
# End Source File
# Begin Source File
SOURCE=..\amxcore.c
# End Source File
# Begin Source File
SOURCE=..\amxmodx.cpp
# End Source File
# Begin Source File
SOURCE=..\amxtime.c
# End Source File
# Begin Source File
SOURCE=..\CCmd.cpp
# End Source File
# Begin Source File
SOURCE=..\CEvent.cpp
# End Source File
# Begin Source File
SOURCE=..\CFile.cpp
# End Source File
# Begin Source File
SOURCE=..\CForward.cpp
# End Source File
# Begin Source File
SOURCE=..\CLogEvent.cpp
# End Source File
# Begin Source File
SOURCE=..\CMenu.cpp
# End Source File
# Begin Source File
SOURCE=..\CMisc.cpp
# End Source File
# Begin Source File
SOURCE=..\CModule.cpp
# End Source File
# Begin Source File
SOURCE=..\CPlugin.cpp
# End Source File
# Begin Source File
SOURCE=..\CString.cpp
# End Source File
# Begin Source File
SOURCE=..\CTask.cpp
# End Source File
# Begin Source File
SOURCE=..\CVault.cpp
# End Source File
# Begin Source File
SOURCE=..\emsg.cpp
# End Source File
# Begin Source File
SOURCE=..\file.cpp
# End Source File
# Begin Source File
SOURCE=..\float.cpp
# End Source File
# Begin Source File
SOURCE=..\meta_api.cpp
# End Source File
# Begin Source File
SOURCE=..\modules.cpp
# End Source File
# Begin Source File
SOURCE=..\power.c
# End Source File
# Begin Source File
SOURCE=..\srvcmd.cpp
# End Source File
# Begin Source File
SOURCE=..\string.cpp
# End Source File
# Begin Source File
SOURCE=..\strptime.cpp
# End Source File
# Begin Source File
SOURCE=..\util.cpp
# End Source File
# Begin Source File
SOURCE=..\vault.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\amxmodx.h
# End Source File
# Begin Source File
SOURCE=..\CCmd.h
# End Source File
# Begin Source File
SOURCE=..\CEvent.h
# End Source File
# Begin Source File
SOURCE=..\CFile.h
# End Source File
# Begin Source File
SOURCE=..\CForward.h
# End Source File
# Begin Source File
SOURCE=..\CList.h
# End Source File
# Begin Source File
SOURCE=..\CLogEvent.h
# End Source File
# Begin Source File
SOURCE=..\CMenu.h
# End Source File
# Begin Source File
SOURCE=..\CMisc.h
# End Source File
# Begin Source File
SOURCE=..\CModule.h
# End Source File
# Begin Source File
SOURCE=..\CPlugin.h
# End Source File
# Begin Source File
SOURCE=..\CString.h
# End Source File
# Begin Source File
SOURCE=..\CTask.h
# End Source File
# Begin Source File
SOURCE=..\CVault.h
# End Source File
# Begin Source File
SOURCE=..\modules.h
# End Source File
# End Group
# End Target
# End Project

29
amxmodx/msvc/amxmodx_mm.dsw Executable file
View File

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "amxmodx_mm"=.\amxmodx_mm.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

21
amxmodx/msvc/amxmodx_mm.sln Executable file
View File

@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "amxmodx_mm", "amxmodx_mm.vcproj", "{2FDEE868-4051-4918-81E9-5CBA63F3E785}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Debug.ActiveCfg = Debug|Win32
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Debug.Build.0 = Debug|Win32
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Release.ActiveCfg = Release|Win32
{2FDEE868-4051-4918-81E9-5CBA63F3E785}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

752
amxmodx/msvc/amxmodx_mm.vcproj Executable file
View File

@ -0,0 +1,752 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="amxmodx_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;amxmodx_mm_EXPORTS"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\release/amxmodx_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/amxx_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\extra\lib_win32"
ModuleDefinitionFile=".\amxmodx_mm.def"
ProgramDatabaseFile=".\release/amxx_mm.pdb"
ImportLibrary=".\release/amxx_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\release/amxmodx_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;amxmodx_mm_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
StructMemberAlignment="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\debug/amxmodx_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/amxx_mm.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\extra\lib_win32"
ModuleDefinitionFile=".\amxmodx_mm.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\debug/amxx_mm.pdb"
ImportLibrary=".\debug/amxx_mm.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\debug/amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\amxmodx.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_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;amxmodx_mm_EXPORTS;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;amxmodx_mm_EXPORTS;$(NoInherit)"
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\amxmodx.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>

View File

@ -31,7 +31,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "amxmod.h" #include "amxmodx.h"
void amx_command(){ void amx_command(){

View File

@ -32,7 +32,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include <ctype.h> #include <ctype.h>
#include "amxmod.h" #include "amxmodx.h"
const char* stristr(const char* str,const char* substr) const char* stristr(const char* str,const char* substr)
{ {

View File

@ -33,7 +33,7 @@
#include <meta_api.h> #include <meta_api.h>
#include <time.h> #include <time.h>
#include "amxmod.h" #include "amxmodx.h"
int UTIL_ReadFlags(const char* c) int UTIL_ReadFlags(const char* c)
{ {
@ -272,7 +272,7 @@ void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1,
g_fakecmd.fake = false; g_fakecmd.fake = false;
} }
std::string g_UTIL_LogFile; 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 = build_pathname("%s/L%02d%02d%03d.log", g_log_dir.str(), curTime->tm_mon + 1, curTime->tm_mday, i); g_UTIL_LogFile.set(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.c_str(), "r"); // open for reading to check whether the file exists FILE *pTmpFile = fopen(g_UTIL_LogFile.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.c_str(), "a+"); FILE *pF = fopen(g_UTIL_LogFile.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
@ -330,3 +330,36 @@ void UTIL_Log(const char *fmt, ...)
fclose(pF); fclose(pF);
print_srvconsole("L %s: %s\n", date, msg); print_srvconsole("L %s: %s\n", date, msg);
} }
// Get the number of running modules
int UTIL_GetModulesNum(int mode)
{
CList<CModule>::iterator iter;
int num;
switch (mode)
{
case UTIL_MODULES_ALL:
return g_modules.size();
case UTIL_MODULES_RUNNING:
iter = g_modules.begin();
num = 0;
while (iter)
{
if ((*iter).getStatusValue() == MODULE_LOADED)
++num;
++iter;
}
return num;
case UTIL_MODULES_STOPPED:
iter = g_modules.begin();
num = 0;
while (iter)
{
if ((*iter).getStatusValue() != MODULE_LOADED)
++num;
++iter;
}
return num;
}
return 0;
}

View File

@ -32,7 +32,7 @@
#include <extdll.h> #include <extdll.h>
#include <meta_api.h> #include <meta_api.h>
#include "CVault.h" #include "CVault.h"
#include "amxmod.h" #include "amxmodx.h"
Vault g_vault; Vault g_vault;

View File

@ -15,4 +15,4 @@
"Kick player" "amx_kick #%userid%" "b" "u" "Kick player" "amx_kick #%userid%" "b" "u"
"Slay player" "amx_slay #%userid%" "bd" "u" "Slay player" "amx_slay #%userid%" "bd" "u"
"Slap with 1 dmg." "amx_slap #%userid% 1" "b" "u" "Slap with 1 dmg." "amx_slap #%userid% 1" "b" "u"
"Ban for 5 minutes" "amx_banid #%userid% 5" "b" "u" "Ban for 5 minutes" "amx_ban #%userid% id 5" "b" "u"

View File

@ -1,7 +1,11 @@
; Configuration file for AMX Mod X ; Configuration file for AMX Mod X
amx_logdir addons/amxx/logs amxx_logdir addons/amxx/logs
amx_modules addons/amxx/modules.ini amxx_configsdir addons/amxx/configs
amx_plugins addons/amxx/plugins/plugins.ini amxx_customdir addons/amxx/custom
amx_vault addons/amxx/vault.ini amxx_modules addons/amxx/modules.ini
csstats_score addons/amxx/csstats.amx amxx_plugins addons/amxx/plugins.ini
csstats addons/amxx/csstats.dat amxx_pluginsdir addons/amxx/plugins
amxx_modulesdir addons/amxx/modules
amxx_vault addons/amxx/configs/vault.ini
csstats_score addons/amxx/custom/csstats.amx
csstats addons/amxx/custom/csstats.dat

View File

@ -2,28 +2,28 @@
; File location: $moddir/addons/amxx/configs/maps.ini ; File location: $moddir/addons/amxx/configs/maps.ini
; To use with Maps Menu plugin ; To use with Maps Menu plugin
as_oilrig "OilRig - Assassination" as_oilrig
cs_747 "747 Hijack - Hostage Rescue" cs_747
cs_assault "Assault - Hostage Rescue" cs_assault
cs_backalley "Alleyway - Hostage Rescue" cs_backalley
cs_estate "Zaphod's Estate - Hostage Rescue" cs_estate
cs_havana "Havana - Hostage Rescue" cs_havana
cs_italy "Italy - Hostage Rescue" cs_italy
cs_militia "Militia - Hostage Rescue" cs_militia
cs_office "The Office Complex - Hostage Rescue" cs_office
cs_siege "Canyon Siege - Hostage Rescue" cs_siege
de_airstrip "Airstrip - Defusion" de_airstrip
de_aztec "Aztec - Defusion" de_aztec
de_cbble "Cobble - Defusion" de_cbble
de_chateau "Chateau - Defusion" de_chateau
de_dust "Dust - Defusion" de_dust
de_dust2 "Dust II - Defusion" de_dust2
de_inferno "Inferno - Defusion" de_inferno
de_nuke "Nuke - Defusion" de_nuke
de_piranesi "Piranesi - Defusion" de_piranesi
de_prodigy "Prodigy - Defusion" de_prodigy
de_storm "Storm - Defusion" de_storm
de_survivor "Survivor - Defusion" de_survivor
de_torn "Torn - Defusion" de_torn
de_train "Trainyard - Defusion" de_train
de_vertigo "Vertigo - Defusion" de_vertigo

View File

@ -1,11 +1,12 @@
; 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
; MySQL - This adds MySQL connection support ; MySQL - This adds MySQL connection support
;mysql_amx.dll ;mysql_amx.dll

View File

@ -8,7 +8,7 @@ adminslots.amx ; slot reservation
menufront.amx ; front-end for admin menus menufront.amx ; front-end for admin menus
cmdmenu.amx ; command menu (speech, settings) cmdmenu.amx ; command menu (speech, settings)
plmenu.amx ; players menu (kick, ban, client cmds.) plmenu.amx ; players menu (kick, ban, client cmds.)
restmenu.amx ; restrict weapons menu ;restmenu.amx ; restrict weapons menu
;telemenu.amx ; teleport menu (Fun Module required!) ;telemenu.amx ; teleport menu (Fun Module required!)
mapsmenu.amx ; maps menu (vote, changelevel) mapsmenu.amx ; maps menu (vote, changelevel)
antiflood.amx ; prevent clients from chat-flooding the server antiflood.amx ; prevent clients from chat-flooding the server
@ -19,9 +19,9 @@ timeleft.amx ; displays time left on map
mapchooser.amx ; allows to vote for next map mapchooser.amx ; allows to vote for next map
scrollmsg.amx ; displays a scrolling message scrollmsg.amx ; displays a scrolling message
imessage.amx ; displays information messages imessage.amx ; displays information messages
welcomemsg.amx ; displays motd @ client connection ;welcomemsg.amx ; displays motd @ client connection
pausecfg.amx ; allows to pause and unpause some plugins pausecfg.amx ; allows to pause and unpause some plugins
stats.amx ; stats on death or round end (CSStats Module required!) stats.amx ; stats on death or round end (CSStats Module required!)
stats_logging.amx ; weapons stats logging (CSStats Module required!) ;stats_logging.amx ; weapons stats logging (CSStats Module required!)
miscstats.amx ; bunch of events announcement for Counter-Strike miscstats.amx ; bunch of events announcement for Counter-Strike
statscfg.amx ; allows to manage stats plugins via menu and commands statscfg.amx ; allows to manage stats plugins via menu and commands

View File

@ -30,10 +30,14 @@
; 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 ; c - this is steamid/wonid
; 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)
; Password:
; Add to your autoexec.cfg: setinfo _pw "<password>"
; Change _pw to the value of amx_password_field
; Format of admin account: ; Format of admin account:
; <name|ip|steamid> <password> <access flags> <account flags> ; <name|ip|steamid> <password> <access flags> <account flags>

View File

@ -11,22 +11,10 @@
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;
@ -45,22 +33,11 @@ const char* CCstrikePlayer::GetModel()
return model; return model;
} }
const char* CCstrikePlayer::SetModel(const char* modelIn) void CCstrikePlayer::SetModel(const char* modelIn)
{ {
//SetTime(0.0); strcpy(model, modelIn);
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,22 +10,17 @@ 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();
const char* SetModel(const char* modelIn); void SetModel(const char* modelIn);
bool GetInspectModel(); bool GetInspectModel();
void SetInspectModel(bool inspectModelIn); void SetInspectModel(bool inspectModelIn);
private: private:
bool online, inspectModel; bool inspectModel;
bool modelled; bool modelled;
char model[32]; char model[32];
//float time;
}; };
#endif // !defined(INCLUDED_CCSTRIKEPLAYER) #endif // !defined(INCLUDED_CCSTRIKEPLAYER)

View File

@ -1,17 +1,18 @@
MODNAME = cstrike_mm MODNAME = cstrike_amx
SRCFILES = cstrike.cpp CstrikePlayer.cpp SRCFILES = CstrikePlayer.cpp cstrike.cpp
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
EXTRA_LIBS_WIN32 = 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 EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
AMXDIR=../amxmodx
SDKTOP=../hlsdk SDKTOP=../hlsdk
METADIR=../metamod/metamod METADIR=../metamodx
SDKSRC=$(SDKTOP)/SourceCode SDKSRC=$(SDKTOP)/SourceCode
@ -52,43 +53,34 @@ else
ASRCFILES := $(shell dir /b) ASRCFILES := $(shell dir /b)
endif endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -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
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$(AMXDIR) -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
ODEF = -DOPT_TYPE=\"optimized\" ODEF = -DOPT_TYPE=\"optimized\"
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS) 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) -shared -ldl -lm $(OBJ_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) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c
$(DO_CC_LINUX)
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_LINUX) $(DO_CC_LINUX)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.c
$(DO_CC_WIN32)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_WIN32) $(DO_CC_WIN32)
default: $(DEFAULT) default: $(DEFAULT)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(OBJC_LINUX) $(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
$(LINK_LINUX) $(LINK_LINUX)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(OBJC_WIN32) $(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
$(LINK_WIN32) $(LINK_WIN32)
$(OBJDIR_LINUX): $(OBJDIR_LINUX):

View File

@ -175,6 +175,15 @@ 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;
} }
@ -234,10 +243,10 @@ static cell AMX_NATIVE_CALL cs_get_weapon_silenced(AMX *amx, cell *params) // cs
int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE); int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE);
switch (weapontype) { switch (weapontype) {
case CSW_M4A1: case CSW_M4A1:
if (*silencemode == M4A1_SILENCED) if (*silencemode & M4A1_SILENCED)
return 1; return 1;
case CSW_USP: case CSW_USP:
if (*silencemode == USP_SILENCED) if (*silencemode & USP_SILENCED)
return 1; return 1;
} }
@ -249,7 +258,7 @@ static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs
{ {
// Silence/unsilence gun. Does only work on M4A1 and USP. // Silence/unsilence gun. Does only work on M4A1 and USP.
// params[1] = weapon index // params[1] = weapon index
// params[2] = 1, and we silence the gun, 0 and we unsilence gun- // params[2] = 1, and we silence the gun, 0 and we unsilence gun.
// Valid entity should be within range // Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities) if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
@ -272,22 +281,41 @@ static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs
switch (weapontype) { switch (weapontype) {
case CSW_M4A1: case CSW_M4A1:
if (params[2]) if (params[2] == 1) {
*silencemode = M4A1_SILENCED; if (!(*silencemode & M4A1_SILENCED)) { // want to silence - can't already be silenced
else *silencemode |= M4A1_SILENCED;
*silencemode = M4A1_UNSILENCED; // If this weapon has an owner that is a player, play animation for that player.
if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = M4A1_ATTACHSILENCEANIM;
}
}
else if (*silencemode & M4A1_SILENCED) { // want to unsilence - can't already be unsilenced
*silencemode &= ~M4A1_SILENCED;
// If this weapon has an owner that is a player, play animation for that player.
if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = M4A1_DETACHSILENCEANIM;
}
break; break;
case CSW_USP: case CSW_USP:
if (params[2]) if (params[2] == 1) {
*silencemode = USP_SILENCED; if (!(*silencemode & USP_SILENCED)) { // want to silence - can't already be silenced
else *silencemode |= USP_SILENCED;
*silencemode = USP_UNSILENCED; // If this weapon has an owner that is a player, play animation for that player.
break; if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = USP_ATTACHSILENCEANIM;
}
}
else if (*silencemode & USP_SILENCED) { // want to unsilence - can't already be unsilenced
*silencemode &= ~USP_SILENCED;
// If this weapon has an owner that is a player, play animation for that player.
if (UTIL_IsPlayer(amx, pWeapon->v.owner))
pWeapon->v.owner->v.weaponanim = USP_DETACHSILENCEANIM;
}
break;
default: default:
return 0; return 0;
} }
return 1; return 1;
} }
@ -419,7 +447,7 @@ static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_us
return 0; return 0;
} }
if ((int)((int *)pPlayer->pvPrivateData + OFFSET_VIP) == PLAYER_IS_VIP) if ( *((int *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP )
return 1; return 1;
return 0; return 0;
@ -448,9 +476,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_NOT_VIP; *((int *)pPlayer->pvPrivateData + OFFSET_VIP) &= ~PLAYER_IS_VIP;
return 1; return 1;
} }
@ -918,7 +946,7 @@ static cell AMX_NATIVE_CALL cs_set_user_backpackammo(AMX *amx, cell *params) //
return 1; return 1;
} }
static cell AMX_NATIVE_CALL cs_get_user_nvgoggles(AMX *amx, cell *params) // cs_get_user_nvgoggles(index); = 1 param static cell AMX_NATIVE_CALL cs_get_user_nvg(AMX *amx, cell *params) // cs_get_user_nvg(index); = 1 param
{ {
// Does user have night vision goggles? // Does user have night vision goggles?
// params[1] = user index // params[1] = user index
@ -945,7 +973,7 @@ static cell AMX_NATIVE_CALL cs_get_user_nvgoggles(AMX *amx, cell *params) // cs_
return 0; return 0;
} }
static cell AMX_NATIVE_CALL cs_set_user_nvgoggles(AMX *amx, cell *params) // cs_set_user_nvgoggles(index, nvgoggles = 1); = 2 params static cell AMX_NATIVE_CALL cs_set_user_nvg(AMX *amx, cell *params) // cs_set_user_nvg(index, nvgoggles = 1); = 2 params
{ {
// Give/take nvgoggles.. // Give/take nvgoggles..
// params[1] = user index // params[1] = user index
@ -1176,35 +1204,88 @@ static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_
return 1; return 1;
} }
static cell AMX_NATIVE_CALL cs_get_weapon_ammo(AMX *amx, cell *params) // cs_get_weapon_ammo(index); = 1 param
{
// Get amount of ammo in weapon's clip
// params[1] = weapon index
// Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
{
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
// Make into edict pointer
edict_t *pWeapon = INDEXENT(params[1]);
// Check entity validity
if (FNullEnt(pWeapon)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
return *((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO);
}
static cell AMX_NATIVE_CALL cs_set_weapon_ammo(AMX *amx, cell *params) // cs_set_weapon_ammo(index, newammo); = 2 params
{
// Set amount of ammo in weapon's clip
// params[1] = weapon index
// params[2] = newammo
// Valid entity should be within range
if (params[1] < 1 || params[1] > gpGlobals->maxEntities)
{
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
// Make into edict pointer
edict_t *pWeapon = INDEXENT(params[1]);
// Check entity validity
if (FNullEnt(pWeapon)) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
*((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO) = params[2];
return 1;
}
AMX_NATIVE_INFO cstrike_Exports[] = { AMX_NATIVE_INFO cstrike_Exports[] = {
{"cs_set_user_money", cs_set_user_money}, {"cs_set_user_money", cs_set_user_money},
{"cs_get_user_money", cs_get_user_money}, {"cs_get_user_money", cs_get_user_money},
{"cs_get_user_deaths", cs_get_user_deaths}, {"cs_get_user_deaths", cs_get_user_deaths},
{"cs_set_user_deaths", cs_set_user_deaths}, {"cs_set_user_deaths", cs_set_user_deaths},
{"cs_get_hostage_id", cs_get_hostage_id}, {"cs_get_hostage_id", cs_get_hostage_id},
{"cs_get_weapon_silenced", cs_get_weapon_silenced}, {"cs_get_weapon_silen", cs_get_weapon_silenced},
{"cs_set_weapon_silenced", cs_set_weapon_silenced}, {"cs_set_weapon_silen", cs_set_weapon_silenced},
{"cs_get_weapon_burstmode", cs_get_weapon_burstmode}, {"cs_get_weapon_burst", cs_get_weapon_burstmode},
{"cs_set_weapon_burstmode", cs_set_weapon_burstmode}, {"cs_set_weapon_burst", cs_set_weapon_burstmode},
{"cs_get_user_vip", cs_get_user_vip}, {"cs_get_user_vip", cs_get_user_vip},
{"cs_set_user_vip", cs_set_user_vip}, {"cs_set_user_vip", cs_set_user_vip},
{"cs_get_user_team", cs_get_user_team}, {"cs_get_user_team", cs_get_user_team},
{"cs_set_user_team", cs_set_user_team}, {"cs_set_user_team", cs_set_user_team},
{"cs_get_user_inside_buyzone", cs_get_user_inside_buyzone}, {"cs_get_user_buyzone", cs_get_user_inside_buyzone},
{"cs_get_user_plant", cs_get_user_plant}, {"cs_get_user_plant", cs_get_user_plant},
{"cs_set_user_plant", cs_set_user_plant}, {"cs_set_user_plant", cs_set_user_plant},
{"cs_get_user_defusekit", cs_get_user_defusekit}, {"cs_get_user_defuse", cs_get_user_defusekit},
{"cs_set_user_defusekit", cs_set_user_defusekit}, {"cs_set_user_defuse", cs_set_user_defusekit},
{"cs_get_user_backpackammo", cs_get_user_backpackammo}, {"cs_get_user_bpammo", cs_get_user_backpackammo},
{"cs_set_user_backpackammo", cs_set_user_backpackammo}, {"cs_set_user_bpammo", cs_set_user_backpackammo},
{"cs_get_user_nvgoggles", cs_get_user_nvgoggles}, {"cs_get_user_nvg", cs_get_user_nvg},
{"cs_set_user_nvgoggles", cs_set_user_nvgoggles}, {"cs_set_user_nvg", cs_set_user_nvg},
{"cs_get_hostage_follow", cs_get_hostage_follow}, {"cs_get_hostage_foll", cs_get_hostage_follow},
{"cs_set_hostage_follow", cs_set_hostage_follow}, {"cs_set_hostage_foll", cs_set_hostage_follow},
{"cs_get_user_model", cs_get_user_model}, {"cs_get_user_model", cs_get_user_model},
{"cs_set_user_model", cs_set_user_model}, {"cs_set_user_model", cs_set_user_model},
{"cs_reset_user_model", cs_reset_user_model}, {"cs_reset_user_model", cs_reset_user_model},
{"cs_set_weapon_ammo", cs_set_weapon_ammo},
{"cs_get_weapon_ammo", cs_get_weapon_ammo},
//------------------- <-- max 19 characters!
{NULL, NULL} {NULL, NULL}
}; };
@ -1257,7 +1338,7 @@ void PlayerPostThink(edict_t* pPlayer) {
if(g_players[entityIndex].GetModelled()) { if(g_players[entityIndex].GetModelled()) {
if (g_players[entityIndex].GetInspectModel() && strcmp(g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model")) != 0) { if (g_players[entityIndex].GetInspectModel() && strcmp(g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model")) != 0) {
LOG_CONSOLE(PLID, "%s should have model %s and currently has %s", STRING(pPlayer->v.netname), (char*)g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model")); //LOG_CONSOLE(PLID, "%s should have model %s and currently has %s", STRING(pPlayer->v.netname), (char*)g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model"));
SETCLIENTKEYVALUE(entityIndex, GETINFOKEYBUFFER(pPlayer), "model", (char*)g_players[entityIndex].GetModel()); SETCLIENTKEYVALUE(entityIndex, GETINFOKEYBUFFER(pPlayer), "model", (char*)g_players[entityIndex].GetModel());
g_players[entityIndex].SetInspectModel(false); g_players[entityIndex].SetInspectModel(false);
} }

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 /out:"Release/cstrike_amxx.dll" # 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\cstrike_amxx.dll K:\S\cstrike\addons\amx\dlls echo Copying inc... copy cstrike_amxx.inc K:\S\cstrike\addons\amx\examples\include 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\
# End Special Build Tool # End Special Build Tool
!ELSEIF "$(CFG)" == "cstrike - Win32 Debug" !ELSEIF "$(CFG)" == "cstrike - Win32 Debug"
@ -83,7 +83,7 @@ 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 /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/cstrike_amxx_debug.dll" /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"Debug/cstrike_amx_debug.dll" /pdbtype:sept
!ENDIF !ENDIF
@ -125,7 +125,7 @@ SOURCE=.\CstrikePlayer.h
# End Group # End Group
# Begin Source File # Begin Source File
SOURCE=.\cstrike_amxx.inc SOURCE=..\plugins\include\cstrike.inc
# End Source File # End Source File
# End Target # End Target
# End Project # End Project

View File

@ -1,4 +1,4 @@
//#define __cswonbuild__ // comment when compiling for STEAM #define __cswonbuild__ // comment when compiling for STEAM
/* AMX Mod X /* AMX Mod X
* Counter-Strike Module * Counter-Strike Module
@ -66,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 CS_WON_BUILD #if defined __cswonbuild__
#define VERSION "0.1 WON" // change both these versions #define VERSION "0.16 WON" // change both these versions
#else #else
#define VERSION "0.1" // change both these versions #define VERSION "0.16 STEAM" // change both these versions
#endif // defined CS_WON_BUILD #endif // defined __cswonbuild__
#define URL "http://www.amxmodx.org" #define URL "http://www.amxmodx.org"
#define LOGTAG "AMXCS" #define LOGTAG "AMXCS"
#define DATE __DATE__ #define DATE __DATE__
@ -112,9 +112,10 @@ pfnmodule_engine_g* g_engModuleFunc;
#define OFFSET_CSDEATHS 448 + EXTRAOFFSET // differs -1 from STEAM #define OFFSET_CSDEATHS 448 + EXTRAOFFSET // differs -1 from STEAM
// "weapon_*" entities // "weapon_*" entities
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET // same as STEAM #define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET // same as STEAM
#define OFFSET_CLIPAMMO 51 + 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 // 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
@ -143,6 +144,7 @@ pfnmodule_engine_g* g_engModuleFunc;
#define OFFSET_CSDEATHS 449 + EXTRAOFFSET #define OFFSET_CSDEATHS 449 + EXTRAOFFSET
// "weapon_*" entities // "weapon_*" entities
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET #define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET
#define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET #define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET
// "hostage_entity" entities // "hostage_entity" entities
#define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET #define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET
@ -199,18 +201,19 @@ pfnmodule_engine_g* g_engModuleFunc;
//#define CSW_KNIFE 29 //#define CSW_KNIFE 29
#define CSW_P90 30 #define CSW_P90 30
#define M4A1_UNSILENCED 0 #define M4A1_SILENCED (1<<2)
#define M4A1_SILENCED 4 #define M4A1_ATTACHSILENCEANIM 6
#define USP_UNSILENCED 0 #define M4A1_DETACHSILENCEANIM 13
#define USP_SILENCED 1 #define USP_SILENCED (1<<0)
#define USP_ATTACHSILENCEANIM 7
#define USP_DETACHSILENCEANIM 15
#define GLOCK_SEMIAUTOMATIC 0 #define GLOCK_SEMIAUTOMATIC 0
#define GLOCK_BURSTMODE 2 #define GLOCK_BURSTMODE 2
#define FAMAS_AUTOMATIC 0 #define FAMAS_AUTOMATIC 0
#define FAMAS_BURSTMODE 16 #define FAMAS_BURSTMODE 16
#define PLAYER_IS_NOT_VIP 0 #define PLAYER_IS_VIP (1<<8)
#define PLAYER_IS_VIP 256
#define TEAM_T 1 #define TEAM_T 1
#define TEAM_CT 2 #define TEAM_CT 2

218
dlls/cstrike/cstrike.vcproj Executable file
View File

@ -0,0 +1,218 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="cstrike"
ProjectGUID="{AB148B92-4F47-42E6-8268-AB4E588EC6A2}"
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_amx_debug.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\cstrike.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/cstrike_amx_debug.pdb"
ImportLibrary=".\Debug/cstrike_amx_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_amx.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\cstrike.def"
ProgramDatabaseFile=".\Release/cstrike_amx.pdb"
ImportLibrary=".\Release/cstrike_amx.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_amx.dll K:\S\cstrike\addons\amx\dlls
echo Copying inc...
copy cstrike_amx.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_amx.inc">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,4 +1,4 @@
MODNAME = engine_mm MODNAME = engine_amx
SRCFILES = meta_api.cpp SRCFILES = meta_api.cpp
EXTRA_LIBS_LINUX = EXTRA_LIBS_LINUX =
@ -6,12 +6,13 @@ 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 EXTRA_INCLUDEDIRS = -Iextra/include -I../amxmodx
EXTRA_FLAGS = -Dstrcmpi=strcasecmp EXTRA_FLAGS = -Dstrcmpi=strcasecmp
AMXDIR=../amxmodx
SDKTOP=../hlsdk SDKTOP=../hlsdk
METADIR=../metamod/metamod METADIR=../metamodx
SDKSRC=$(SDKTOP)/SourceCode SDKSRC=$(SDKTOP)/SourceCode
@ -25,7 +26,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc CC_LINUX=gcc-2.95
ifeq "$(OS)" "WIN32" ifeq "$(OS)" "WIN32"
CC_WIN32=gcc CC_WIN32=gcc
LD_WINDLL=dllwrap LD_WINDLL=dllwrap
@ -52,43 +53,34 @@ else
ASRCFILES := $(shell dir /b) ASRCFILES := $(shell dir /b)
endif endif
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o) OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
OBJC_LINUX := $(CSRCFILES:%.c=$(OBJDIR_LINUX)/%.o)
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o) OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
OBJC_WIN32 := $(CSRCFILES:%.c=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -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
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$(AMXDIR) -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
ODEF = -DOPT_TYPE=\"optimized\" ODEF = -DOPT_TYPE=\"optimized\"
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS) 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) -shared -ldl -lm $(OBJ_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) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.c
$(DO_CC_LINUX)
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_LINUX) $(DO_CC_LINUX)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.c
$(DO_CC_WIN32)
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp $(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
$(DO_CC_WIN32) $(DO_CC_WIN32)
default: $(DEFAULT) default: $(DEFAULT)
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX) $(OBJC_LINUX) $(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
$(LINK_LINUX) $(LINK_LINUX)
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32) $(OBJC_WIN32) $(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
$(LINK_WIN32) $(LINK_WIN32)
$(OBJDIR_LINUX): $(OBJDIR_LINUX):

View File

@ -1,8 +0,0 @@
rm meta_api.o
rm engine.so
#use VexD's optimizations
gcc -static -march=i686 -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -fno-exceptions -fno-rtti -s -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\" -lstdc++ -fPIC -I. -I../metamod/metamod -I../hlsdk/multiplayer/engine -I../hlsdk/multiplayer/common -I../hlsdk/multiplayer/pm_shared -I../hlsdk/multiplayer/dlls -I../hlsdk/multiplayer -I../amxmodx/ -c meta_api.cpp -o meta_api.o
gcc -static -march=i686 -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-exceptions -fno-rtti -s -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\" -shared -ldl -lm -lstdc++ meta_api.o -o engine.so

View File

@ -17,7 +17,7 @@ CFG=engine - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "engine_mm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "engine_amx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "engine - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "engine - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE !MESSAGE
@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe MTL=midl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "engine_mm - Win32 Release" !IF "$(CFG)" == "engine_amx - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
@ -52,7 +52,7 @@ 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 /out:"release/engine_mm.dll" # 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/engine_amx.dll"
!ELSEIF "$(CFG)" == "engine - Win32 Debug" !ELSEIF "$(CFG)" == "engine - Win32 Debug"
@ -83,19 +83,19 @@ LINK32=link.exe
# Begin Target # Begin Target
# Name "engine_mm - Win32 Release" # Name "engine_amx - Win32 Release"
# Name "engine - Win32 Debug" # Name "engine - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File # Begin Source File
SOURCE=.\meta_api.cpp SOURCE=.\meta_api.cpp
# End Source File # End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File # Begin Source File
SOURCE=.\engine.h SOURCE=.\engine.h
@ -110,7 +110,7 @@ SOURCE=.\engine.inc
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\engine.def SOURCE=.\engine_amx.def
# End Source File # End Source File
# End Group # End Group
# End Target # End Target

View File

@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
############################################################################### ###############################################################################
Project: "engine_mm"=".\engine.dsp" - Package Owner=<4> Project: "engine_amx"=".\engine.dsp" - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{

View File

@ -32,16 +32,12 @@
* version. * version.
*/ */
#define VERSION "0.1" #define VERSION "0.16"
#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
@ -53,7 +49,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,
@ -115,6 +111,8 @@ 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
@ -131,6 +129,52 @@ 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,
@ -312,6 +356,7 @@ 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
@ -329,6 +374,7 @@ public:
writeangle = 0.0; writeangle = 0.0;
writecoord = 0.0; writecoord = 0.0;
writeentity = 0; writeentity = 0;
writestring = NULL;
} }
argStack* arg() argStack* arg()
@ -344,6 +390,13 @@ 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;
@ -387,7 +440,9 @@ public:
switch (argtype) switch (argtype)
{ {
case arg_string: case arg_string:
writestring.append((char *)sz); delete [] writestring;
writestring = new char[strlen(sz)+1];
strcpy(writestring, sz);
break; break;
} }
} }
@ -415,7 +470,7 @@ public:
WRITE_COORD(writecoord); WRITE_COORD(writecoord);
break; break;
case arg_string: case arg_string:
WRITE_STRING(writestring.c_str()); WRITE_STRING(writestring);
break; break;
case arg_entity: case arg_entity:
WRITE_ENTITY(writeentity); WRITE_ENTITY(writeentity);
@ -466,7 +521,7 @@ public:
switch (argtype) switch (argtype)
{ {
case arg_string: case arg_string:
return (writestring.length()); return strlen(writestring);
break; break;
} }
return 0; return 0;
@ -477,7 +532,7 @@ public:
switch (argtype) switch (argtype)
{ {
case arg_string: case arg_string:
return writestring.c_str(); return (const char*)writestring;
break; break;
} }
@ -671,6 +726,20 @@ 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;
@ -679,7 +748,7 @@ private:
int writelong; int writelong;
float writeangle; float writeangle;
float writecoord; float writecoord;
std::string writestring; char *writestring;
int writeentity; int writeentity;
argStack *next; argStack *next;
}; };
@ -759,16 +828,9 @@ public:
void Destroy() void Destroy()
{ {
argStack *p; CHeadArg->destroy();
delete CHeadArg;
p = CHeadArg->link(); CHeadArg = NULL;
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)

188
dlls/engine/engine.vcproj Executable file
View File

@ -0,0 +1,188 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="engine"
ProjectGUID="{7CAE7BDF-52CB-49D0-B82E-568259869811}"
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_amx.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\engine_amx.def"
ProgramDatabaseFile=".\Release/engine_amx.pdb"
ImportLibrary=".\Release/engine_amx.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_amx.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_amx.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

@ -1,4 +1,4 @@
LIBRARY engine_mm LIBRARY engine_amx
EXPORTS EXPORTS
GiveFnptrsToDll @1 GiveFnptrsToDll @1
Meta_Attach @2 Meta_Attach @2

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
MODNAME = fun_mm MODNAME = fun_amx
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=../metamod/metamod METADIR=../metamodx
SDKSRC=$(SDKTOP)/SourceCode SDKSRC=$(SDKTOP)/SourceCode
@ -26,7 +26,7 @@ else
OS=LINUX OS=LINUX
endif endif
CC_LINUX=gcc CC_LINUX=gcc-2.95
ifeq "$(OS)" "WIN32" ifeq "$(OS)" "WIN32"
CC_WIN32=gcc CC_WIN32=gcc
LD_WINDLL=dllwrap LD_WINDLL=dllwrap
@ -57,7 +57,7 @@ OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
CCOPT = -march=i586 -O6 -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
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -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$(AMXDIR) -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

@ -67,6 +67,18 @@
} }
*/ */
// ######## 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.
@ -201,19 +213,46 @@ static cell AMX_NATIVE_CALL give_item(AMX *amx, cell *params) // native give_ite
int length; int length;
const char *szItem = GET_AMXSTRING(amx, params[2], 1, length); const char *szItem = GET_AMXSTRING(amx, params[2], 1, length);
//check for valid item
if (strncmp(szItem, "weapon_", 7) &&
strncmp(szItem, "ammo_", 5) &&
strncmp(szItem, "item_", 5)) {
return 0;
}
//string_t item = MAKE_STRING(szItem); //string_t item = MAKE_STRING(szItem);
string_t item = ALLOC_STRING(szItem); // Using MAKE_STRING makes "item" contents get lost when we leave this scope! ALLOC_STRING seems to allocate properly... string_t item = ALLOC_STRING(szItem); // Using MAKE_STRING makes "item" contents get lost when we leave this scope! ALLOC_STRING seems to allocate properly...
// Create the entity, returns to pointer // Create the entity, returns to pointer
pItemEntity = CREATE_NAMED_ENTITY(item); pItemEntity = CREATE_NAMED_ENTITY(item);
VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I //VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I
pItemEntity->v.spawnflags |= SF_NORESPAWN; //I'm not sure, normally I use macros too =P
pItemEntity->v.origin = pPlayer->v.origin;
pItemEntity->v.spawnflags |= (1<<30); //SF_NORESPAWN;
MDLL_Spawn(pItemEntity); MDLL_Spawn(pItemEntity);
int save = pItemEntity->v.solid;
MDLL_Touch(pItemEntity, ENT(pPlayer)); MDLL_Touch(pItemEntity, ENT(pPlayer));
return 1; //The problem with the original give_item was the
// item was not removed. I had tried this but it
// did not work. OLO's implementation is better.
/*
int iEnt = ENTINDEX(pItemEntity->v.owner);
if (iEnt > 32 || iEnt <1 ) {
MDLL_Think(pItemEntity);
}*/
if (pItemEntity->v.solid == save) {
REMOVE_ENTITY(pItemEntity);
//the function did not fail - we're just deleting the item
return -1;
}
return ENTINDEX(pItemEntity);
} }
static cell AMX_NATIVE_CALL spawn(AMX *amx, cell *params) // spawn(id) = 1 param static cell AMX_NATIVE_CALL spawn(AMX *amx, cell *params) // spawn(id) = 1 param
@ -392,6 +431,8 @@ static cell AMX_NATIVE_CALL set_user_maxspeed(AMX *amx, cell *params) // set_use
// params[1] = index // params[1] = index
// params[2] = speed (should be -1.0 if not specified) (JGHG: unspecified parameters seems to always be -1.0!) // params[2] = speed (should be -1.0 if not specified) (JGHG: unspecified parameters seems to always be -1.0!)
float fNewSpeed = *(float *)((void *)&params[2]);
// Check index // Check index
if (params[1] < 1 || params[1] > gpGlobals->maxClients) if (params[1] < 1 || params[1] > gpGlobals->maxClients)
{ {
@ -408,7 +449,8 @@ static cell AMX_NATIVE_CALL set_user_maxspeed(AMX *amx, cell *params) // set_use
} }
//pPlayer->v.maxspeed = ; // JGHG: Gotta love the way to get floats from parameters :-P //pPlayer->v.maxspeed = ; // JGHG: Gotta love the way to get floats from parameters :-P
SETCLIENTMAXSPEED(pPlayer, *(float *)((void *)&params[2])); SETCLIENTMAXSPEED(pPlayer, fNewSpeed);
pPlayer->v.maxspeed = fNewSpeed;
return 1; return 1;
} }
@ -484,21 +526,101 @@ 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
{ {
// Gets user gravity. // Sets "hitable" zones.
// params[1] = body hitzones // params[1] = body hitzones
// Fetch player pointer //native set_user_hitzones(index=0,target=0,body=255);
//set_user_hitzones(id, 0, 0) // Makes ID not able to shoot EVERYONE - id can shoot on 0 (all) at 0
//set_user_hitzones(0, id, 0) // Makes EVERYONE not able to shoot ID - 0 (all) can shoot id at 0
g_body = params[1]; 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_hitzones(AMX *amx, cell *params) // get_hitzones() = 0 arguments static cell AMX_NATIVE_CALL get_user_hitzones(AMX *amx, cell *params) // get_user_hitzones(index, target); = 2 arguments
{ {
// Gets hitzones. // Gets user hitzones.
return g_body; // params[1] = if this is not 0, return what zones this player can hit
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
@ -581,11 +703,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;
silent[params[1]] = true; g_silent[params[1]] = true;
} }
else { else {
pPlayer->v.flTimeStepSound = STANDARDTIMESTEPSOUND; pPlayer->v.flTimeStepSound = STANDARDTIMESTEPSOUND;
silent[params[1]] = false; g_silent[params[1]] = false;
} }
return 1; return 1;
@ -607,8 +729,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_hitzones", set_hitzones}, {"set_user_hitzones", set_user_hitzones},
{"get_hitzones", get_hitzones}, {"get_user_hitzones", get_user_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},
@ -619,7 +741,7 @@ AMX_NATIVE_INFO fun_Exports[] = {
/******************************************************************************************/ /******************************************************************************************/
void PlayerPreThink(edict_t *pEntity) void PlayerPreThink(edict_t *pEntity)
{ {
if (silent[ENTINDEX(pEntity)]) { if (g_silent[ENTINDEX(pEntity)]) {
pEntity->v.flTimeStepSound = 999; pEntity->v.flTimeStepSound = 999;
RETURN_META(MRES_HANDLED); RETURN_META(MRES_HANDLED);
} }
@ -627,14 +749,46 @@ void PlayerPreThink(edict_t *pEntity)
RETURN_META(MRES_IGNORED); RETURN_META(MRES_IGNORED);
} }
void ClientDisconnect( edict_t *pEntity) /* <--- removed, only needed with akimbot
int ClientConnect(edict_t *pPlayer, const char *pszName, const char *pszAddress, char szRejectReason[128])
{ {
int index = ENTINDEX(pEntity); int index = ENTINDEX(pPlayer);
silent[index] = false;
RETURN_META(MRES_IGNORED); 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;
} }
DLL_FUNCTIONS gFunctionTable = { void ClientDisconnect(edict_t *pEntity)
{
int index = ENTINDEX(pEntity);
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);
}
*/
DLL_FUNCTIONS gFunctionTable; /* = {
NULL, // pfnGameInit NULL, // pfnGameInit
NULL, // pfnSpawn NULL, // pfnSpawn
NULL, // pfnThink NULL, // pfnThink
@ -653,7 +807,7 @@ DLL_FUNCTIONS gFunctionTable = {
NULL, // pfnRestoreGlobalState NULL, // pfnRestoreGlobalState
NULL, // pfnResetGlobalState NULL, // pfnResetGlobalState
NULL, // pfnClientConnect ClientConnect, // pfnClientConnect
ClientDisconnect, // pfnClientDisconnect ClientDisconnect, // pfnClientDisconnect
NULL, // pfnClientKill NULL, // pfnClientKill
NULL, // pfnClientPutInServer NULL, // pfnClientPutInServer
@ -695,8 +849,7 @@ 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) {
@ -709,13 +862,20 @@ 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);
@ -730,6 +890,58 @@ void TraceLine(const float *v1, const float *v2, int fNoMonsters, edict_t *pentT
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;
@ -766,22 +978,29 @@ 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 #define HITGROUP_GENERIC 0 // none == 1
#define HITGROUP_HEAD 1 #define HITGROUP_HEAD 1 = 2
#define HITGROUP_CHEST 2 #define HITGROUP_CHEST 2 = 4
#define HITGROUP_STOMACH 3 #define HITGROUP_STOMACH 3 = 8
#define HITGROUP_LEFTARM 4 #define HITGROUP_LEFTARM 4 = 16
#define HITGROUP_RIGHTARM 5 #define HITGROUP_RIGHTARM 5 = 32
#define HITGROUP_LEFTLEG 6 #define HITGROUP_LEFTLEG 6 = 64
#define HITGROUP_RIGHTLEG 7 #define HITGROUP_RIGHTLEG 7 = 128
*/ */
return(TRUE); return(TRUE);

View File

@ -4,7 +4,7 @@
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=fun - Win32 Debug CFG=fun_amx - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
@ -17,8 +17,8 @@ CFG=fun - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "fun - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "fun_amx - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "fun - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "fun_amx - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe MTL=midl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "fun - Win32 Release" !IF "$(CFG)" == "fun_amx - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
@ -56,10 +56,10 @@ 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\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 PostBuild_Cmds=echo Copying dll... copy Release\fun_amx.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
# End Special Build Tool # End Special Build Tool
!ELSEIF "$(CFG)" == "fun - Win32 Debug" !ELSEIF "$(CFG)" == "fun_amx - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
@ -89,8 +89,8 @@ LINK32=link.exe
# Begin Target # Begin Target
# Name "fun - Win32 Release" # Name "fun_amx - Win32 Release"
# Name "fun - Win32 Debug" # Name "fun_amx - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@ -100,7 +100,7 @@ SOURCE=.\fun.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\fun.def SOURCE=.\fun_amx.def
# End Source File # End Source File
# End Group # End Group
# Begin Group "Header Files" # Begin Group "Header Files"
@ -117,7 +117,7 @@ SOURCE=.\fun.h
# End Group # End Group
# Begin Source File # Begin Source File
SOURCE=.\fun.inc SOURCE=..\plugins\include\fun.inc
# End Source File # End Source File
# End Target # End Target
# End Project # End Project

View File

@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
############################################################################### ###############################################################################
Project: "fun"=".\fun.dsp" - Package Owner=<4> Project: "fun_amx"=".\fun.dsp" - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{

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.1" #define VERSION "0.16"
#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 #define HITGROUP_HEAD 1 // 1 << 1 = 2
#define HITGROUP_CHEST 2 #define HITGROUP_CHEST 2 // 1 << 2 = 4
#define HITGROUP_STOMACH 3 #define HITGROUP_STOMACH 3 // 8
#define HITGROUP_LEFTARM 4 #define HITGROUP_LEFTARM 4 // 16
#define HITGROUP_RIGHTARM 5 #define HITGROUP_RIGHTARM 5 // 32
#define HITGROUP_LEFTLEG 6 #define HITGROUP_LEFTLEG 6 // 64
#define HITGROUP_RIGHTLEG 7 #define HITGROUP_RIGHTLEG 7 // 128
// Fun-specific defines above // Fun-specific defines above
// Globals below // Globals below
@ -101,7 +101,10 @@ 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};
int g_body = 0; // bits of parts of body to hit // The stuff below might end up in a class soon
bool silent[33]; // used for set_user_footsteps() int g_zones_toHit[33]; // where can people hit other people?
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

195
dlls/fun/fun.vcproj Executable file
View File

@ -0,0 +1,195 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="fun_amx"
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_amx.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ModuleDefinitionFile=".\fun_amx.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_amx.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

@ -1,4 +1,4 @@
LIBRARY fun LIBRARY fun_amx
EXPORTS EXPORTS
GiveFnptrsToDll @1 GiveFnptrsToDll @1
Meta_Attach @2 Meta_Attach @2

View File

@ -48,7 +48,7 @@ new g_cmdLoopback[16]
public plugin_init() public plugin_init()
{ {
register_plugin("Admin Base","0.1","AMXX Dev Team") register_plugin("Admin Base","0.16","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","")
@ -58,6 +58,7 @@ public plugin_init()
register_cvar("amx_vote_answers","1") register_cvar("amx_vote_answers","1")
register_cvar("amx_vote_delay","60") register_cvar("amx_vote_delay","60")
register_cvar("amx_last_voting","0") register_cvar("amx_last_voting","0")
register_cvar("amx_show_activity","2")
set_cvar_float("amx_last_voting",0.0) set_cvar_float("amx_last_voting",0.0)
register_concmd("amx_reloadadmins","cmdReload",ADMIN_ADMIN) register_concmd("amx_reloadadmins","cmdReload",ADMIN_ADMIN)
@ -71,11 +72,12 @@ 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
new filename[64] new configsDir[128]
get_basedir( filename , 31 ) get_configsdir(configsDir, 127)
server_cmd("exec %s/amx.cfg" , filename ) // Execute main configuration file server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file
format( filename, 63 , "%s/configs/users.ini" , filename ) new users_ini_file[128]
loadSettings( filename ) // Load admins accounts format(users_ini_file, 127, "%s/users.ini", configsDir)
loadSettings("addons/amxx/configs/users.ini") // Load admins accounts
} }
loadSettings(szFilename[]) loadSettings(szFilename[])
@ -83,23 +85,26 @@ loadSettings(szFilename[])
if (!file_exists(szFilename)) return 0 if (!file_exists(szFilename)) return 0
new szText[256], szFlags[32], szAccess[32] new szText[256], szFlags[32], szAccess[32]
new a, pos = 0 new a, pos = 0, iAccess
while ( g_aNum < MAX_ADMINS && read_file(szFilename,pos++,szText,255,a) ) while ( g_aNum < MAX_ADMINS && read_file(szFilename,pos++,szText,255,a) )
{ {
if ( szText[0] == ';' ) continue if ( szText[0] == ';' ) continue
if ( parse(szText, g_aName[ g_aNum ] ,31, if ( parse(szText, g_aName[ g_aNum ] ,31, g_aPassword[ g_aNum ], 31, szAccess,31,szFlags,31 ) < 2 )
g_aPassword[ g_aNum ], 31, szAccess,31,szFlags,31 ) < 2 ) continue continue
if ( (containi(szAccess,"z")==-1) && (containi(szAccess,"y")==-1) ) iAccess = read_flags(szAccess)
szAccess[strlen(szAccess)] = 'y'
g_aAccess[ g_aNum ] = read_flags( szAccess ) if (!(iAccess & ADMIN_USER) && !(iAccess & ADMIN_ADMIN)) {
iAccess |= ADMIN_ADMIN
}
g_aAccess[ g_aNum ] = iAccess
g_aFlags[ g_aNum ] = read_flags( szFlags ) g_aFlags[ g_aNum ] = read_flags( szFlags )
++g_aNum ++g_aNum
} }
server_print("Loaded %d admin%s from file",g_aNum, (g_aNum == 1) ? "" : "s" ) server_print("[AMXX] Loaded %d admin%s from file",g_aNum, (g_aNum == 1) ? "" : "s" )
return 1 return 1
} }
@ -108,9 +113,9 @@ public cmdReload(id,level,cid)
if (!cmd_access(id,level,cid,1)) if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new filename[64] new filename[128]
get_basedir(filename,31) get_configsdir(filename,127)
format(filename,63,"%s/configs/users.ini",filename) format(filename,63,"%s/users.ini", filename)
g_aNum = 0 g_aNum = 0
loadSettings(filename) // Re-Load admins accounts loadSettings(filename) // Re-Load admins accounts
@ -187,8 +192,8 @@ getAccess(id,name[],authid[],ip[], password[])
else { else {
new defaccess[32] new defaccess[32]
get_cvar_string("amx_default_access",defaccess,31) get_cvar_string("amx_default_access",defaccess,31)
if (!defaccess[0]) if (!strlen(defaccess))
defaccess[0] = 'z' copy(defaccess, 32, "z")
new idefaccess = read_flags(defaccess) new idefaccess = read_flags(defaccess)
if (idefaccess){ if (idefaccess){
result |= 8 result |= 8
@ -215,7 +220,6 @@ accessUser( id, name[] = "" )
#if !defined NO_STEAM #if !defined NO_STEAM
client_cmd(id,g_cmdLoopback) client_cmd(id,g_cmdLoopback)
#else #else
client_cmd(id,"echo ^"* You have no entry to the server...^";disconnect") client_cmd(id,"echo ^"* You have no entry to the server...^";disconnect")
#endif #endif

View File

@ -49,7 +49,7 @@ new g_cmdLoopback[16]
public plugin_init() public plugin_init()
{ {
register_plugin("Admin Base for MySQL","0.1","AMXX Dev Team") register_plugin("Admin Base for MySQL","0.16","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")
@ -68,6 +68,7 @@ public plugin_init()
register_cvar("amx_vote_answers","1") register_cvar("amx_vote_answers","1")
register_cvar("amx_vote_delay","60") register_cvar("amx_vote_delay","60")
register_cvar("amx_last_voting","0") register_cvar("amx_last_voting","0")
register_cvar("amx_show_activity","2")
set_cvar_float("amx_last_voting",0.0) set_cvar_float("amx_last_voting",0.0)
register_concmd("amx_reloadadmins","cmdReload",ADMIN_ADMIN) register_concmd("amx_reloadadmins","cmdReload",ADMIN_ADMIN)
@ -80,10 +81,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
new filename[32] new configsDir[128]
get_basedir( filename , 31 ) get_configsdir(configsDir, 127)
server_cmd("exec %s/amx.cfg" , filename) server_cmd("exec %s/amxx.cfg", configsDir) // Execute main configuration file
server_cmd("exec %s/configs/mysql.cfg;amx_sqladmins" , filename) server_cmd("exec %s/mysql.cfg;amx_sqladmins", configsDir)
} }
public adminSql() { public adminSql() {
@ -95,7 +96,7 @@ public adminSql() {
new mysql = mysql_connect(host,user,pass,db,error,127) new mysql = mysql_connect(host,user,pass,db,error,127)
if(mysql < 1){ if(mysql < 1){
server_print("MySQL error: can't connect: '%s'",error) server_print("[AMXX] MySQL error: can't connect: '%s'",error)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -103,7 +104,7 @@ public adminSql() {
if(mysql_query(mysql,"SELECT auth,password,access,flags FROM admins") < 1) { if(mysql_query(mysql,"SELECT auth,password,access,flags FROM admins") < 1) {
mysql_error(mysql,error,127) mysql_error(mysql,error,127)
server_print("MySQL error: can't load admins: '%s'",error) server_print("[AMXX] MySQL error: can't load admins: '%s'",error)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -123,7 +124,7 @@ public adminSql() {
++g_aNum ++g_aNum
} }
server_print("Loaded %d admin%s from database",g_aNum, (g_aNum == 1) ? "" : "s" ) server_print("[AMXX] Loaded %d admin%s from database",g_aNum, (g_aNum == 1) ? "" : "s" )
mysql_close(mysql) mysql_close(mysql)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }

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.1","AMXX Dev Team") register_plugin("Admin Chat","0.16","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

@ -34,7 +34,6 @@
#include <amxmodx> #include <amxmodx>
#include <amxmisc> #include <amxmisc>
#include <engine>
#define MAXRCONCVARS 16 #define MAXRCONCVARS 16
new g_cvarRcon[ MAXRCONCVARS ][32] new g_cvarRcon[ MAXRCONCVARS ][32]
@ -45,11 +44,10 @@ 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.1","AMXX Dev Team") register_plugin("Admin Commands","0.16","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","cmdBan",ADMIN_BAN,"<name or #userid> <id/ip> <minutes> [reason]")
register_concmd("amx_banid","cmdBan",ADMIN_BAN,"<name or #userid> <minutes> [reason]") register_concmd("amx_addban","cmdAddBan",ADMIN_BAN,"<authid or ip> <minutes> [reason]")
register_concmd("amx_banip","cmdBan",ADMIN_BAN,"<name or #userid> <minutes> [reason]")
register_concmd("amx_unban","cmdUnban",ADMIN_BAN,"<authid or ip>") register_concmd("amx_unban","cmdUnban",ADMIN_BAN,"<authid or ip>")
register_concmd("amx_slay","cmdSlay",ADMIN_SLAY,"<name or #userid>") register_concmd("amx_slay","cmdSlay",ADMIN_SLAY,"<name or #userid>")
register_concmd("amx_slap","cmdSlap",ADMIN_SLAY,"<name or #userid> [power]") register_concmd("amx_slap","cmdSlap",ADMIN_SLAY,"<name or #userid> [power]")
@ -103,12 +101,18 @@ public cmdKick(id,level,cid){
else else
{ {
#if !defined NO_STEAM #if !defined NO_STEAM
server_cmd("kick #%d ^"%s^"",userid2,reason) if (reason[0])
server_cmd("kick #%d ^"%s^"",userid2,reason)
else
server_cmd("kick #%d",userid2)
#else #else
client_cmd(player,"echo ^"%s^";disconnect",reason) if (reason[0])
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,"[AMXX] Client ^"%s^" kicked",name2)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -119,11 +123,11 @@ public cmdUnban(id,level,cid){
read_argv(1,arg,31) read_argv(1,arg,31)
if (contain(arg,".")!=-1) { if (contain(arg,".")!=-1) {
server_cmd("removeip ^"%s^";writeip",arg) server_cmd("removeip ^"%s^";writeip",arg)
console_print(id,"Ip ^"%s^" removed from ban list", arg ) console_print(id,"[AMXX] Ip ^"%s^" removed from ban list", arg )
} }
else { else {
server_cmd("removeid ^"%s^";writeid",arg) server_cmd("removeid ^"%s^";writeid",arg)
console_print(id,"Authid ^"%s^" removed from ban list", arg ) console_print(id,"[AMXX] Authid ^"%s^" removed from ban list", arg )
} }
get_user_name(id,name,31) get_user_name(id,name,31)
switch(get_cvar_num("amx_show_activity")) { switch(get_cvar_num("amx_show_activity")) {
@ -145,11 +149,11 @@ public cmdAddBan(id,level,cid){
read_argv(3,reason,31) read_argv(3,reason,31)
if (contain(arg,".")!=-1) { if (contain(arg,".")!=-1) {
server_cmd("addip ^"%s^" ^"%s^";wait;writeip",minutes,arg) server_cmd("addip ^"%s^" ^"%s^";wait;writeip",minutes,arg)
console_print(id,"Ip ^"%s^" added to ban list", arg ) console_print(id,"[AMXX] Ip ^"%s^" added to ban list", arg )
} }
else { else {
server_cmd("banid ^"%s^" ^"%s^";wait;writeid",minutes,arg) server_cmd("banid ^"%s^" ^"%s^";wait;writeid",minutes,arg)
console_print(id,"Authid ^"%s^" added to ban list", arg ) console_print(id,"[AMXX] Authid ^"%s^" added to ban list", arg )
} }
get_user_name(id,name,31) get_user_name(id,name,31)
switch(get_cvar_num("amx_show_activity")) { switch(get_cvar_num("amx_show_activity")) {
@ -163,47 +167,67 @@ public cmdAddBan(id,level,cid){
} }
public cmdBan(id,level,cid){ public cmdBan(id,level,cid){
if (!cmd_access(id,level,cid,3)) if (!cmd_access(id,level,cid,4))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new arg[32], cmd[32] new target[32],mode[3],minutes[8],reason[32]
read_argv(0,cmd,31) read_argv(1,target,31)
read_argv(1,arg,31) read_argv(2,mode,2)
new player = cmd_target(id,arg,9) strtolower(mode)
read_argv(3,minutes,7)
read_argv(4,reason,31)
if ( (!equal(mode,"id")) && (!equal(mode,"ip")) )
{
new hcmd[32],hinfo[128],hflag
get_concmd(cid,hcmd,31,hflag,hinfo,127,level)
console_print(id,"Usage: %s %s",hcmd,hinfo)
return PLUGIN_HANDLED
}
new player = cmd_target(id,target,9)
if (!player) return PLUGIN_HANDLED if (!player) return PLUGIN_HANDLED
new minutes[32],authid[32],name2[32],authid2[32],name[32],reason[32] new authid[32],name2[32],authid2[32],name[32]
new userid2 = get_user_userid(player) new userid2 = get_user_userid(player)
read_argv(2,minutes,31)
get_user_authid(player,authid2,31) get_user_authid(player,authid2,31)
get_user_authid(id,authid,31) get_user_authid(id,authid,31)
get_user_name(player,name2,31) get_user_name(player,name2,31)
get_user_name(id,name,31) get_user_name(id,name,31)
userid2 = get_user_userid(player) userid2 = get_user_userid(player)
read_argv(3,reason,31) log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (mode ^"%s^") (minutes ^"%s^") (reason ^"%s^")",
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name,get_user_userid(id),authid, name2,userid2,authid2,mode,minutes,reason)
name,get_user_userid(id),authid, name2,userid2,authid2,minutes,reason)
new temp[64] new temp[64]
if (str_to_int(minutes)) if (str_to_num(minutes))
format(temp,63,"for %s min.",minutes) format(temp,63,"for %s min.",minutes)
else else
temp = "permanently" temp = "permanently"
if ( equal(cmd[7],"ip") || (!equal(cmd[7],"id") && get_cvar_num("sv_lan")) ){ if ( equal(mode,"ip") ){
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
server_cmd("kick #%d ^"%s (banned %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip",userid2,reason,temp,minutes,address) if (reason[0])
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
client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) if (reason[0])
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
server_cmd("kick #%d ^"%s (banned %s)^";wait;banid ^"%s^" ^"%s^";wait;writeid",userid2,reason,temp,minutes,authid2) if (reason[0])
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
client_cmd(player,"echo ^"%s (banned %s)^";disconnect",reason,temp) if (reason[0])
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
} }
@ -218,7 +242,7 @@ public cmdBan(id,level,cid){
client_print(0,print_chat,"%s ban %s %s",temp2,name2,temp) client_print(0,print_chat,"%s ban %s %s",temp2,name2,temp)
} }
console_print(id,"Client ^"%s^" banned",name2) console_print(id,"[AMXX] Client ^"%s^" banned",name2)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -243,7 +267,7 @@ public cmdSlay(id,level,cid){
case 1: client_print(0,print_chat,"ADMIN: slay %s",name2) case 1: client_print(0,print_chat,"ADMIN: slay %s",name2)
} }
console_print(id,"Client ^"%s^" slayed",name2) console_print(id,"[AMXX] Client ^"%s^" slayed",name2)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -256,7 +280,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_int(spower) new damage = str_to_num(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)
@ -270,7 +294,7 @@ public cmdSlap(id,level,cid){
case 1: client_print(0,print_chat,"ADMIN: slap %s with %d damage",name2,damage) case 1: client_print(0,print_chat,"ADMIN: slap %s with %d damage",name2,damage)
} }
console_print(id,"Client ^"%s^" slaped with %d damage",name2,damage) console_print(id,"[AMXX] Client ^"%s^" slaped with %d damage",name2,damage)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -283,7 +307,7 @@ public cmdMap(id,level,cid){
new arg[32] new arg[32]
new arglen = read_argv(1,arg,31) new arglen = read_argv(1,arg,31)
if ( !is_map_valid(arg) ){ if ( !is_map_valid(arg) ){
console_print(id,"Map with that name not found or map is invalid") console_print(id,"[AMXX] Map with that name not found or map is invalid")
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32],name[32] new authid[32],name[32]
@ -318,25 +342,25 @@ public cmdCvar(id,level,cid){
if ( g_cvarRconNum < MAXRCONCVARS ) if ( g_cvarRconNum < MAXRCONCVARS )
copy( g_cvarRcon[ g_cvarRconNum++ ] , 31, arg2 ) copy( g_cvarRcon[ g_cvarRconNum++ ] , 31, arg2 )
else else
console_print(id,"Can't add more cvars for rcon access!") console_print(id,"[AMXX] Can't add more cvars for rcon access!")
} }
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
if (!cvar_exists(arg)){ if (!cvar_exists(arg)){
console_print(id,"Unknown cvar: %s",arg) console_print(id,"[AMXX] Unknown cvar: %s",arg)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
if ( onlyRcon(arg) && !(get_user_flags(id) & ADMIN_RCON)){ if ( onlyRcon(arg) && !(get_user_flags(id) & ADMIN_RCON)){
console_print(id,"You have no access to that cvar") console_print(id,"[AMXX] You have no access to that cvar")
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
else if (equal(arg,"sv_password") && !(get_user_flags(id) & ADMIN_PASSWORD)){ else if (equal(arg,"sv_password") && !(get_user_flags(id) & ADMIN_PASSWORD)){
console_print(id,"You have no access to that cvar") console_print(id,"[AMXX] You have no access to that cvar")
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
if (read_argc() < 3){ if (read_argc() < 3){
get_cvar_string(arg,arg2,63) get_cvar_string(arg,arg2,63)
console_print(id,"Cvar ^"%s^" is ^"%s^"",arg,arg2) console_print(id,"[AMXX] Cvar ^"%s^" is ^"%s^"",arg,arg2)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32],name[32] new authid[32],name[32]
@ -358,7 +382,7 @@ public cmdCvar(id,level,cid){
client_print(0,print_chat,"%s set cvar %s to ^"%s^"",temp,arg,arg2) client_print(0,print_chat,"%s set cvar %s to ^"%s^"",temp,arg,arg2)
} }
console_print(id,"Cvar ^"%s^" changed to ^"%s^"",arg,arg2) console_print(id,"[AMXX] Cvar ^"%s^" changed to ^"%s^"",arg,arg2)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -367,8 +391,9 @@ 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
#if !defined NO_STEAM new name[32],version[32],author[32],filename[32],status[32]
#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
@ -380,7 +405,6 @@ 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"))
@ -388,21 +412,19 @@ 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("%-18.17s %-8.7s %-17.16s %-16.15s %-9.8s",name,version,author,filename,status) console_print(id,"%-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
} }
@ -412,10 +434,9 @@ 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
#if !defined NO_STEAM new name[32],version[32],author[32],status,sStatus[16]
#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^">")
@ -426,24 +447,26 @@ 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")
new name[32],version[32],author[32],filename[32],status[32] get_module(i,name,31,author,31,version,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></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++)
{ {
new name[32],version[32],author[32] get_module(i,name,31,author,31,version,31,status)
get_module(i,name,31,author,31,version,31) switch (status)
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
} }
@ -454,7 +477,7 @@ public cmdCfg(id,level,cid){
new arg[128] new arg[128]
read_argv(1,arg,127) read_argv(1,arg,127)
if (!file_exists(arg)){ if (!file_exists(arg)){
console_print(id,"File ^"%s^" not found",arg) console_print(id,"[AMXX] File ^"%s^" not found",arg)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32],name[32] new authid[32],name[32]
@ -462,7 +485,7 @@ public cmdCfg(id,level,cid){
get_user_name(id,name,31) get_user_name(id,name,31)
log_amx("Cmd: ^"%s<%d><%s><>^" execute cfg (file ^"%s^")", log_amx("Cmd: ^"%s<%d><%s><>^" execute cfg (file ^"%s^")",
name,get_user_userid(id),authid, arg) name,get_user_userid(id),authid, arg)
console_print(id,"Executing file ^"%s^"",arg) console_print(id,"[AMXX] Executing file ^"%s^"",arg)
server_cmd("exec %s",arg) server_cmd("exec %s",arg)
switch(get_cvar_num("amx_show_activity")) { switch(get_cvar_num("amx_show_activity")) {
@ -475,7 +498,7 @@ public cmdCfg(id,level,cid){
public cmdLBack(){ public cmdLBack(){
set_cvar_float("pausable",g_pausAble) set_cvar_float("pausable",g_pausAble)
console_print(g_pauseCon,"Server %s", g_Paused ? "unpaused" : "paused") console_print(g_pauseCon,"[AMXX] Server %s", g_Paused ? "unpaused" : "paused")
if (g_Paused) g_Paused = false if (g_Paused) g_Paused = false
else g_Paused = true else g_Paused = true
return PLUGIN_HANDLED return PLUGIN_HANDLED
@ -490,14 +513,14 @@ public cmdPause(id,level,cid){
g_pausAble = get_cvar_float("pausable") g_pausAble = get_cvar_float("pausable")
if (!slayer) slayer = find_player("h") if (!slayer) slayer = find_player("h")
if (!slayer){ if (!slayer){
console_print(id,"Server was unable to pause the game. Real players on server are needed") console_print(id,"[AMXX] Server was unable to pause the game. Real players on server are needed")
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
set_cvar_float("pausable",1.0) set_cvar_float("pausable",1.0)
client_cmd(slayer,"pause;pauseAck") client_cmd(slayer,"pause;pauseAck")
log_amx("Cmd: ^"%s<%d><%s><>^" %s server", log_amx("Cmd: ^"%s<%d><%s><>^" %s server",
name,get_user_userid(id),authid, g_Paused ? "unpause" : "pause" ) name,get_user_userid(id),authid, g_Paused ? "unpause" : "pause" )
console_print(id,"Server proceed %s", g_Paused ? "unpausing" : "pausing") console_print(id,"[AMXX] Server proceed %s", g_Paused ? "unpausing" : "pausing")
switch(get_cvar_num("amx_show_activity")) { switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: %s server",name,g_Paused ? "unpause" : "pause") case 2: client_print(0,print_chat,"ADMIN %s: %s server",name,g_Paused ? "unpause" : "pause")
@ -517,7 +540,7 @@ public cmdRcon(id,level,cid){
get_user_name(id,name,31) get_user_name(id,name,31)
log_amx("Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")", log_amx("Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")",
name,get_user_userid(id),authid, arg) name,get_user_userid(id),authid, arg)
console_print(id,"Commmand line ^"%s^" sent to server console",arg) console_print(id,"[AMXX] Commmand line ^"%s^" sent to server console",arg)
server_cmd(arg) server_cmd(arg)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
@ -571,14 +594,14 @@ public cmdLeave(id,level,cid){
get_user_name(b,nick,31) get_user_name(b,nick,31)
ires = hasTag(nick,ltags,ltagsnum) ires = hasTag(nick,ltags,ltagsnum)
if (ires!=-1){ if (ires!=-1){
console_print(id,"Skipping ^"%s^" (matching ^"%s^")",nick,ltags[ires]) console_print(id,"[AMXX] Skipping ^"%s^" (matching ^"%s^")",nick,ltags[ires])
continue continue
} }
if (get_user_flags(b)&ADMIN_IMMUNITY){ if (get_user_flags(b)&ADMIN_IMMUNITY){
console_print(id,"Skipping ^"%s^" (immunity)",nick) console_print(id,"[AMXX] Skipping ^"%s^" (immunity)",nick)
continue continue
} }
console_print(id,"Kicking ^"%s^"",nick) console_print(id,"[AMXX] Kicking ^"%s^"",nick)
if (is_user_bot(b)) if (is_user_bot(b))
server_cmd("kick #%d",get_user_userid(b)) server_cmd("kick #%d",get_user_userid(b))
else else
@ -591,7 +614,7 @@ public cmdLeave(id,level,cid){
} }
count++ count++
} }
console_print(id,"Kicked %d clients",count) console_print(id,"[AMXX] Kicked %d clients",count)
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

@ -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.1","AMXX Dev Team") register_plugin("Admin Help","0.16","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,11 +51,11 @@ 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_int(arg1) : 1 new start = read_argv(1,arg1,7) ? str_to_num(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
console_print(id,"^n----- AMX Help: Commands -----") console_print(id,"^n----- AMX Mod X Help: Commands -----")
new info[128], cmd[32], eflags new info[128], cmd[32], eflags
new end = start + HELPAMOUNT new end = start + HELPAMOUNT
if (end > clcmdsnum) end = clcmdsnum if (end > clcmdsnum) end = clcmdsnum

View File

@ -42,7 +42,7 @@ new g_cmdLoopback[16]
public plugin_init() public plugin_init()
{ {
register_plugin("Slots Reservation","0.1","AMXX Dev Team") register_plugin("Slots Reservation","0.16","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.1","AMXX Dev Team") register_plugin("Admin Votes","0.16","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
int_to_str(get_user_userid(player),g_optionName[0],31) num_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.1","AMXX Dev Team") register_plugin("Anti Flood","0.16","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,22 +88,24 @@ new g_cstrikeRunning
public plugin_init() public plugin_init()
{ {
register_plugin("Commands Menu","0.1","AMXX Dev Team") register_plugin("Commands Menu","0.16","AMXX Dev Team")
new basedir[32], workdir[64] new configsDir[64];
get_basedir( basedir , 31 ) get_configsdir(configsDir, 63);
new config[64]
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( workdir, 63, "%s/configs/%s" , basedir , g_cmdMenuCfg[ a ] ) format(config,63,"%s/%s",configsDir,g_cmdMenuCfg[a])
loadCmdSettings( workdir , a ) loadCmdSettings(config,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")
format( workdir, 63, "%s/configs/cvars.ini" , basedir ) new cvars_ini_file[64];
loadCvarSettings( workdir ) format(cvars_ini_file, 63, "%s/%s", configsDir, "cvars.ini");
loadCvarSettings(cvars_ini_file)
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.1","AMXX Dev Team") register_plugin("Info. Messages","0.16","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_int(lastinfo) g_Current = str_to_num(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_int(mycol[6]) g_Values[g_MessagesNum][2] = str_to_num(mycol[6])
mycol[6] = 0 mycol[6] = 0
g_Values[g_MessagesNum][1] = str_to_int(mycol[3]) g_Values[g_MessagesNum][1] = str_to_num(mycol[3])
mycol[3] = 0 mycol[3] = 0
g_Values[g_MessagesNum][0] = str_to_int(mycol[0]) g_Values[g_MessagesNum][0] = str_to_num(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]
int_to_str(g_Current,lastinfo,7) num_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_entity(iIndex, szValue) return find_ent_by_class(iIndex, szValue)
stock RemoveEntity(iIndex) stock RemoveEntity(iIndex)
return remove_entity(iIndex) return remove_entity(iIndex)
@ -96,6 +96,9 @@ stock AttachView(iIndex, iTargetIndex)
stock SetView(iIndex, ViewType) stock SetView(iIndex, ViewType)
return set_view(iIndex, ViewType) return set_view(iIndex, ViewType)
stock SetSpeak(iIndex, iSpeakFlags)
return set_speak(iIndex, iSpeakFlags)
forward vexd_pfntouch(pToucher, pTouched) forward vexd_pfntouch(pToucher, pTouched)
forward ServerFrame() forward ServerFrame()

View File

@ -11,7 +11,7 @@
#endif #endif
#define _amxconst_included #define _amxconst_included
#define AMXX_VERSION 0.1 #define AMXX_VERSION 0.16
/* Uncomment if you are not using Steam */ /* Uncomment if you are not using Steam */
//#define NO_STEAM //#define NO_STEAM
@ -97,6 +97,7 @@
#define CSW_FIVESEVEN 11 #define CSW_FIVESEVEN 11
#define CSW_UMP45 12 #define CSW_UMP45 12
#define CSW_SG550 13 #define CSW_SG550 13
#define CSW_GALI 14
#define CSW_GALIL 14 #define CSW_GALIL 14
#define CSW_FAMAS 15 #define CSW_FAMAS 15
#define CSW_USP 16 #define CSW_USP 16
@ -208,3 +209,15 @@ 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",strtonum(arg[1])) player = find_player("k",str_to_num(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
@ -91,12 +91,20 @@ stock is_running(const arg[]) {
return equal(mod_name,arg) return equal(mod_name,arg)
} }
stock build_path( path[] , len , {Float,_}:... ) { stock get_basedir(name[],len)
new basedir[32] return get_localinfo("amxx_basedir",name,len)
get_localinfo( "amxx_basedir", basedir , 31 )
format_args( path , len , 2 )
return replace( path , len , "$basedir", basedir )
}
stock get_basedir( name[], len ) stock get_configsdir(name[],len)
return get_localinfo( "amxx_basedir", name , len ) return get_localinfo("amxx_configsdir",name,len)
stock get_customdir(name[],len)
return get_localinfo("amxx_customdir",name,len)
#if defined NO_STEAM
stock get_user_wonid(index)
{
new authid[32]
get_user_authid(index,authid,31)
return str_to_num(authid)
}
#endif

View File

@ -15,20 +15,9 @@
#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)
@ -37,3 +26,17 @@ stock 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)
stock build_path( path[] , len , {Float,_}:... )
{
new basedir[32]
get_localinfo("amxx_basedir",basedir,31)
format_args(path,len,2)
return replace(path,len,"$basedir",basedir)
}

View File

@ -254,9 +254,6 @@ 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);
@ -445,6 +442,21 @@ 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);
@ -536,10 +548,11 @@ 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); native get_module(id, name[], nameLen, author[], authorLen, version[], versionLen, &status);
/* Returns number of currently registered modules */ /* Returns number of currently registered modules */
native get_modulesnum(); native get_modulesnum();

View File

@ -17,10 +17,10 @@ native cs_get_user_deaths(index);
native cs_set_user_deaths(index, newdeaths); native cs_set_user_deaths(index, newdeaths);
/* Returns index of entity (does not have to be a player) which hostage is following. 0 is hostage doesn't follow anything. */ /* Returns index of entity (does not have to be a player) which hostage is following. 0 is hostage doesn't follow anything. */
native cs_get_hostage_follow(index); native cs_get_hostage_foll(index);
/* Set hostage to follow entity specified in followedindex. Does not have to be a player. If followedindex is 0 the hostage will stop following. */ /* Set hostage to follow entity specified in followedindex. Does not have to be a player. If followedindex is 0 the hostage will stop following. */
native cs_set_hostage_follow(index, followedindex = 0); native cs_set_hostage_foll(index, followedindex = 0);
/* Get unique hostage id. */ /* Get unique hostage id. */
native cs_get_hostage_id(index); native cs_get_hostage_id(index);
@ -41,21 +41,21 @@ native cs_get_hostage_id(index);
* flash * flash
* he * he
* smoke */ * smoke */
native cs_get_user_backpackammo(index, weapon); native cs_get_user_bpammo(index, weapon);
/* Restock/remove ammo in a user's backpack. */ /* Restock/remove ammo in a user's backpack. */
native cs_set_user_backpackammo(index, weapon, amount); native cs_set_user_bpammo(index, weapon, amount);
/* Returns 1 if user has a defuse kit. */ /* Returns 1 if user has a defuse kit. */
native cs_get_user_defusekit(index); native cs_get_user_defuse(index);
/* If defusekit is 1, the user will have a defuse kit. /* If defusekit is 1, the user will have a defuse kit.
* You can specify a different colour for the defuse kit icon showing on hud. Default is the normal green. * You can specify a different colour for the defuse kit icon showing on hud. Default is the normal green.
* You can specify an icon. Default is "defuser". Set flash to 1 if you want the icon to flash red. */ * You can specify an icon. Default is "defuser". Set flash to 1 if you want the icon to flash red. */
native cs_set_user_defusekit(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0); native cs_set_user_defuse(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0);
/* Is user in buyzone? Returns 1 when true, 0 when false. */ /* Is user in buyzone? Returns 1 when true, 0 when false. */
native cs_get_user_inside_buyzone(index); native cs_get_user_buyzone(index);
/* Get user model. */ /* Get user model. */
native cs_get_user_model(index, model[], len); native cs_get_user_model(index, model[], len);
@ -73,10 +73,10 @@ native cs_get_user_money(index);
native cs_set_user_money(index, money, flash = 1); native cs_set_user_money(index, money, flash = 1);
/* Does user have night vision goggles? */ /* Does user have night vision goggles? */
native cs_get_user_nvgoggles(index); native cs_get_user_nvg(index);
/* Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them. */ /* Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them. */
native cs_set_user_nvgoggles(index, nvgoggles = 1); native cs_set_user_nvg(index, nvgoggles = 1);
/* Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb. */ /* Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb. */
native cs_get_user_plant(index); native cs_get_user_plant(index);
@ -104,14 +104,20 @@ native cs_get_user_vip(index);
native cs_set_user_vip(index, vip = 1); native cs_set_user_vip(index, vip = 1);
/* Returns 1 if specified weapon is in burst mode. */ /* Returns 1 if specified weapon is in burst mode. */
native cs_get_weapon_burstmode(index); native cs_get_weapon_burst(index);
/* If burstmode = 1, weapon will be changed to burst mode, 0 and non-burst mode (semiautomatic/automatic) will be activated. /* If burstmode = 1, weapon will be changed to burst mode, 0 and non-burst mode (semiautomatic/automatic) will be activated.
* Only GLOCK and FAMAS can enter/leave burst mode. */ * Only GLOCK and FAMAS can enter/leave burst mode. */
native cs_set_weapon_burstmode(index, burstmode = 1); native cs_set_weapon_burst(index, burstmode = 1);
/* Returns 1 if weapon is silenced, else 0. */ /* Returns 1 if weapon is silenced, else 0. */
native cs_get_weapon_silenced(index); native cs_get_weapon_silen(index);
/* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced. */ /* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced. */
native cs_set_weapon_silenced(index, silence = 1); native cs_set_weapon_silen(index, silence = 1);
/* Returns amount of ammo in weapon's clip. */
native cs_get_weapon_ammo(index);
/* Set amount of ammo in weapon's clip. */
native cs_set_weapon_ammo(index, newammo);

View File

@ -13,21 +13,6 @@
#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:
@ -39,7 +24,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. msg_tid is the message you are hooking. argn is the number * These are denoted by iArgType. 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 */
@ -66,14 +51,48 @@ native set_msg_arg_string(argn, szString[]);
native get_offset(id, offset); native get_offset(id, offset);
native Float:get_offset_float(id, offset); native Float:get_offset_float(id, offset);
native get_offset_short(id, offset); native get_offset_short(id, offset);
native get_offset_char(id, offset);
/* sets pvPrivateData offset. */ /* sets pvPrivateData offset. */
native set_offset(id, offset, value); native set_offset(id, offset, value);
native set_offset_float(id, offset, Float:value); native set_offset_float(id, offset, Float:value);
native set_offset_short(id, offset); native set_offset_short(id, offset, value);
native set_offset_char(id, offset, value);
/* Get entity pointer into string pointer[]. If pointer/len is 0 pointer is returned as integer. */
native get_entity_pointer(index, pointer[] = 0, len = 0);
/* Precaches any file. */ /* Precaches any file. */
native precache_generic(szFile[]); native precache_generic(szFile[]);
/* Precaches an event. */
native precache_event(type, Name[], {float,_}:...);
//set/get a user's speak flags
native set_speak(iIndex, iSpeakFlags)
native get_speak(iIndex)
//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);
@ -85,19 +104,22 @@ native entity_set_vector(iIndex, iKey, Float:vNewVector[3]);
native entity_get_edict(iIndex, iKey); native entity_get_edict(iIndex, iKey);
native entity_set_edict(iIndex, iKey, iNewIndex); native entity_set_edict(iIndex, iKey, iNewIndex);
native entity_get_string(iIndex, iKey, szReturn[], iRetLen); native entity_get_string(iIndex, iKey, szReturn[], iRetLen);
native entity_set_string(iIndex, iKey, szNewVal[]); native entity_set_string(iIndex, iKey, const szNewVal[]);
native entity_get_byte(iIndex, iKey); native entity_get_byte(iIndex, iKey);
native entity_set_byte(iIndex, iKey, iVal); 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 -1 if nothing is found */ /* Finds an entity in the world, will return 0 if nothing is found */
native find_entity(iIndex, szClass[]); native find_ent_by_class(iIndex, szClass[]);
native find_ent_by_owner(iIndex, szClass[], iOwner); //optionally you can set a jghg2 type
// 1: target, 2:targetname, 0:classname (default)
native find_ent_by_owner(iIndex, szClass[], iOwner, iJghgType=0);
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[]);
native find_ent_by_model(iIndex, szClass[], szModel[]); native find_ent_by_model(iIndex, szClass[], szModel[]);
native find_ent_in_sphere(start_from_ent, Float:origin[3], Float:radius);
//this will CBaseEntity::Think() or something from the entity //this will CBaseEntity::Think() or something from the entity
native call_think(entity) native call_think(entity)
@ -109,7 +131,7 @@ native is_valid_ent(iIndex);
native entity_set_origin(iIndex, Float:fNewOrigin[3]); native entity_set_origin(iIndex, Float:fNewOrigin[3]);
/* Sets the model of an Entity. */ /* Sets the model of an Entity. */
native entity_set_model(iIndex, szModel[]); native entity_set_model(iIndex, const szModel[]);
/* Remove an entity from the world. */ /* Remove an entity from the world. */
native remove_entity(iIndex); native remove_entity(iIndex);
@ -184,4 +206,12 @@ forward client_kill(id);
forward client_PreThink(id); forward client_PreThink(id);
forward client_PostThink(id); forward client_PostThink(id);
//from jghg2
/* As above, but returns number of ents stored in entlist. Use to find a specific type of entity classname (specify in _lookforclassname) around a
* certain entity specified in aroundent. All matching ents are stored in entlist. Specify max amount of entities to find in maxents.
* If aroundent is 0 its origin is not used, but origin in 6th parameter. Ie, do not specify 6th parameter (origin) if you specified an entity
* in aroundent.
*/
native find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0});
#include <engine_stocks> #include <engine_stocks>

View File

@ -308,3 +308,52 @@ 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 */
#if defined _jghg_enums
#endinput
#endif
#define _jghg_enums
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,6 +11,12 @@
#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_class(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])
@ -61,13 +67,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_entity(-1, "grenade") new iGrenade = find_ent_by_class(-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_entity(iGrenade, "grenade") iGrenade = find_ent_by_class(iGrenade, "grenade")
} }
return 0 return 0
@ -92,7 +98,7 @@ stock remove_entity_name(eName[])
while (iEntity > 0) while (iEntity > 0)
{ {
remove_entity(iEntity) remove_entity(iEntity)
iEntity = find_entity(-1, eName) iEntity = find_ent_by_class(-1, eName)
} }
return 1 return 1
@ -186,3 +192,15 @@ stock set_entity_flags(ent,flag,onoff)
return 0 return 0
} }
/* If visible = 1, entity will be set to be visible, else invisible. */
stock set_entity_visibility(entity, visible = 1) {
entity_set_int(entity, EV_INT_effects, visible == 1 ? entity_get_int(entity, EV_INT_effects) & ~EF_NODRAW : entity_get_int(entity, EV_INT_effects) | EF_NODRAW)
return 1
}
/* Returns 1 if entity is visible. */
stock get_entity_visibility(entity) {
return (entity_get_int(entity, EV_INT_effects) & EF_NODRAW)
}

View File

@ -5,6 +5,11 @@
* This file is provided as is (no warranties). * This file is provided as is (no warranties).
*/ */
#if defined _fun_included
#endinput
#endif
#define _fun_included
/* Returns 1 if receiver hears sender via voice communication. */ /* Returns 1 if receiver hears sender via voice communication. */
native get_client_listen(receiver, sender); native get_client_listen(receiver, sender);
@ -31,25 +36,29 @@ 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[]);
/* (not yet implemented, don't know how to use native) /* Sets hit zones for player.
* Sets hit zones for player. This event is announced * Parts of body are as bits:
* with proper message to all players. * 1 - generic
* Parts of body are as bits: * 2 - head
* 2 - head * 4 - chest
* 4 - chest * 8 - stomach
* 8 - stomach * 16 - left arm
* 16 - left arm * 32 - right arm
* 32 - right arm * 64 - left leg
* 64 - left leg * 128 - right leg
* 128 - right 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.
native set_hitzones(body = 255); * 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.
* 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 current hitzones. */ /* Get user hitzones.
native get_hitzones(); * To get what bodyparts a player can hit when firing, set the player's index to index and target to 0.
* 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);

172
plugins/include/jghg2.inc Executable file
View File

@ -0,0 +1,172 @@
// JGHG2 module
//This file is provided for backwards compatibility.
//It includes the engine and cstrike modules automatically.
//It is intended for AMX Mod X
#if !defined INCLUDED_JGHG
#define INCLUDED_JGHG
#include <engine>
#include <cstrike>
#if !defined _jghg_enums
#define _jghg_enums
// Global member variables
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
}
// jghg_categories
enum {
jghg2_classname = 0,
jghg2_target = 1,
jghg2_targetname = 2
}
#endif
stock jghg_find_ent_owner(start_from_ent, jghg_category, value[], owner_index)
{
find_ent_by_owner(start_from_ent, value, owner_index, jghg_category)
}
stock find_ent_sphere(start_from_ent, Float:origin[3], Float:radius)
{
return find_ent_in_sphere(start_from_ent, origin, radius)
}
stock get_hostage_id(hostage)
{
return cs_get_hostage_id(hostage)
}
stock get_owner(id)
{
return entity_get_edict(id, EV_ENT_owner)
}
stock get_pdata(entity, offset)
{
return get_offset(entity, offset)
}
stock Float:get_pdata_float(entity, offset)
{
return get_offset_float(entity, offset)
}
stock get_pdata_char(entity, offset)
{
return get_offset_char(entity, offset)
}
stock get_pdata_short(entity, offset)
{
return get_offset_short(entity, offset)
}
stock set_pdata(entity, offset, value)
{
return set_offset(entity, offset, value)
}
stock set_pdata_float(entity, offset, Float:value)
{
return set_offset_float(entity, offset, value)
}
stock set_pdata_char(entity, offset, value)
{
return set_offset_char(entity, offset, value)
}
stock set_pdata_short(entity, offset, value)
{
return set_offset_short(entity, offset, value)
}
stock is_ent_valid(id)
{
return is_valid_ent(id)
}
stock number_of_entities()
{
return entity_count()
}
stock use(used, user)
{
return force_use(user, used)
}
stock Float:globals_get_float(variable)
{
return get_global_float(variable)
}
stock globals_get_int(variable)
{
return get_global_int(variable)
}
stock globals_get_string(variable, string[], maxlen)
{
return get_global_string(variable, string, maxlen)
}
stock globals_get_vector(variable, Float:vector[3])
{
return get_global_vector(variable, vector)
}
stock globals_get_edict(variable)
{
return get_global_edict(variable)
}
stock get_max_entities() {
return get_global_int(GL_maxEntities)
}
stock jghg2_set_size(index, Float:mins[3], Float:maxs[3])
{
return set_size(index, mins, maxs)
}
stock jghg2_think(index)
{
return call_think(index)
}
#endif // INCLUDED_JGHG

View File

@ -40,18 +40,6 @@ 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);

105
plugins/include/xtrafun.inc Executable file
View File

@ -0,0 +1,105 @@
/* 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_ent_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_ent_by_target(start_from_ent, value)
case targetname: return find_ent_by_tname(start_from_ent, value)
}
return find_ent_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.1","AMXX Dev Team") register_plugin("Nextmap Chooser","0.16","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,9 +63,10 @@ public plugin_init()
get_localinfo("lastMap",g_lastMap,31) get_localinfo("lastMap",g_lastMap,31)
set_localinfo("lastMap","") set_localinfo("lastMap","")
new filename[64] new maps_ini_file[64];
build_path( filename , 63 , "$basedir/configs/maps.ini" ) get_configsdir(maps_ini_file, 63);
if ( loadSettings( filename ) ) format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file);
if ( loadSettings(maps_ini_file) )
set_task(15.0,"voteNextmap",987456,"",0,"b") set_task(15.0,"voteNextmap",987456,"",0,"b")
} }

View File

@ -34,12 +34,10 @@
#include <amxmodx> #include <amxmodx>
#include <amxmisc> #include <amxmisc>
#include <engine>
#define MAX_MAPS 64 #define MAX_MAPS 64
new g_mapName[MAX_MAPS][32] new g_mapName[MAX_MAPS][32]
new g_mapDesc[MAX_MAPS][32]
new g_mapNums new g_mapNums
new g_menuPosition[33] new g_menuPosition[33]
@ -54,7 +52,7 @@ new g_choosed
public plugin_init() public plugin_init()
{ {
register_plugin("Maps Menu","0.1","AMXX Dev Team") register_plugin("Maps Menu","0.16","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,9 +62,10 @@ 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")
new filename[64] new maps_ini_file[64];
build_path( filename , 63 , "$basedir/configs/maps.ini" ) get_configsdir(maps_ini_file, 63);
load_settings( filename ) format(maps_ini_file, 63, "%s/maps.ini", maps_ini_file);
load_settings(maps_ini_file)
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
} }
@ -186,14 +185,14 @@ displayVoteMapsMenu(id,pos)
{ {
++b ++b
if ( g_cstrikeRunning) if ( g_cstrikeRunning)
len += format(menuBody[len],511-len,"\d%d. %s^n\w", b ,g_mapDesc[ a ]) len += format(menuBody[len],511-len,"\d%d. %s^n\w", b ,g_mapName[ a ])
else else
len += format(menuBody[len],511-len,"#. %s^n", g_mapDesc[ a ]) len += format(menuBody[len],511-len,"#. %s^n", g_mapName[ a ])
} }
else else
{ {
keys |= (1<<b) keys |= (1<<b)
len += format(menuBody[len],511-len,"%d. %s^n", ++b ,g_mapDesc[ a ]) len += format(menuBody[len],511-len,"%d. %s^n", ++b ,g_mapName[ a ])
} }
} }
@ -220,7 +219,7 @@ displayVoteMapsMenu(id,pos)
for(new c = 0; c < 4; c++) for(new c = 0; c < 4; c++)
{ {
if ( c < g_voteSelectedNum[id] ) if ( c < g_voteSelectedNum[id] )
len += format(menuBody[len],511-len,"%s^n", g_mapDesc[ g_voteSelected[id][ c ] ] ) len += format(menuBody[len],511-len,"%s^n", g_mapName[ g_voteSelected[id][ c ] ] )
else else
len += format(menuBody[len],511-len,"^n" ) len += format(menuBody[len],511-len,"^n" )
} }
@ -312,7 +311,7 @@ public actionVoteMapMenu(id,key)
"\yWhich map do you want?^n\w^n" : "Which map do you want?^n^n") "\yWhich map do you want?^n\w^n" : "Which map do you want?^n^n")
for(new c = 0; c < g_voteSelectedNum[id] ; ++c) for(new c = 0; c < g_voteSelectedNum[id] ; ++c)
{ {
len += format(menuBody[len],511,"%d. %s^n", c + 1 , g_mapDesc[ g_voteSelected[id][ c ] ] ) len += format(menuBody[len],511,"%d. %s^n", c + 1 , g_mapName[ g_voteSelected[id][ c ] ] )
keys |= (1<<c) keys |= (1<<c)
} }
keys |= (1<<8) keys |= (1<<8)
@ -321,7 +320,7 @@ public actionVoteMapMenu(id,key)
else else
{ {
len = format(menuBody,511, g_cstrikeRunning ? "\yChange map to^n%s?^n\w^n1. Yes^n2. No^n" len = format(menuBody,511, g_cstrikeRunning ? "\yChange map to^n%s?^n\w^n1. Yes^n2. No^n"
: "Change map to^n%s?^n^n1. Yes^n2. No^n" , g_mapDesc[ g_voteSelected[id][ 0 ] ] ) : "Change map to^n%s?^n^n1. Yes^n2. No^n" , g_mapName[ g_voteSelected[id][ 0 ] ] )
keys = (1<<0) | (1<<1) keys = (1<<0) | (1<<1)
} }
@ -420,7 +419,7 @@ displayMapsMenu(id,pos)
for(new a = start; a < end; ++a) for(new a = start; a < end; ++a)
{ {
keys |= (1<<b) keys |= (1<<b)
len += format(menuBody[len],511-len,"%d. %s^n",++b,g_mapDesc[ a ]) len += format(menuBody[len],511-len,"%d. %s^n",++b,g_mapName[ a ])
} }
if (end != g_mapNums) if (end != g_mapNums)
@ -438,25 +437,17 @@ load_settings(filename[])
if (!file_exists(filename)) if (!file_exists(filename))
return 0 return 0
new text[256], szDesc[48] new text[256]
new a , pos = 0 new a , pos = 0
while ( g_mapNums < MAX_MAPS && read_file(filename,pos++,text,255,a) ) while ( g_mapNums < MAX_MAPS && read_file(filename,pos++,text,255,a) )
{ {
if ( text[0] == ';' ) continue if ( text[0] == ';' ) continue
if ( parse(text, g_mapName[g_mapNums] ,31, szDesc ,47) < 2 ) continue if ( parse(text,g_mapName[g_mapNums],31) < 1 ) continue
if ( !is_map_valid( g_mapName[g_mapNums] ) ) continue if ( !is_map_valid( g_mapName[g_mapNums] ) ) continue
if ( strlen( szDesc ) > 31 )
{
copy(g_mapDesc[g_mapNums],28, szDesc )
g_mapDesc[g_mapNums][28] = g_mapDesc[g_mapNums][29] = g_mapDesc[g_mapNums][30] = '.'
g_mapDesc[g_mapNums][31] = 0
}
else copy(g_mapDesc[g_mapNums],31, szDesc )
g_mapNums++ g_mapNums++
} }

View File

@ -122,7 +122,7 @@ new g_funModule
public plugin_init() public plugin_init()
{ {
register_plugin("Menus Front-End","0.1","AMXX Dev Team") register_plugin("Menus Front-End","0.16","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.1","AMXX Dev Team") register_plugin("CS Misc. Stats","0.16","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.1","AMXX Dev Team") register_plugin("NextMap","0.16","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_int( szString3 ) g_pos = str_to_num( 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[64] 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.1","AMXX Dev Team") register_plugin("Pause Plugins","0.16","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
@ -62,6 +62,9 @@ public plugin_init(){
#endif #endif
register_menucmd(register_menuid("Pause/Unpause Plugins"),1023,"actionMenu") register_menucmd(register_menuid("Pause/Unpause Plugins"),1023,"actionMenu")
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
get_configsdir(g_fileToSave, 63);
format(g_fileToSave, 63, "%s/pausecfg.ini", g_fileToSave);
return PLUGIN_CONTINUE return PLUGIN_CONTINUE
} }
@ -82,7 +85,6 @@ 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" )
@ -318,7 +320,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_int(arg1) : 1 new start = read_argv(2,arg1,7) ? str_to_num(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.1","AMXX Dev Team") register_plugin("Players Menu","0.16","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,9 +70,10 @@ public plugin_init()
g_cstrikeRunning = is_running("cstrike") g_cstrikeRunning = is_running("cstrike")
new filename[64] new clcmds_ini_file[64];
build_path( filename , 63 , "$basedir/configs/clcmds.ini" ) get_configsdir(clcmds_ini_file, 63);
load_settings( filename ) format(clcmds_ini_file, 63, "%s/clcmds.ini", clcmds_ini_file);
load_settings(clcmds_ini_file)
} }
/* Ban menu */ /* Ban menu */
@ -575,7 +576,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)
int_to_str(get_user_userid(player),userid,31) num_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.1","AMXX Dev Team") register_plugin("Restrict Weapons","0.16","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
@ -363,12 +363,14 @@ public plugin_init(){
register_menucmd(-34,511,"menuItem") register_menucmd(-34,511,"menuItem")
register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction") register_concmd("amx_restrict","cmdRest",ADMIN_CFG,"- displays help for weapons restriction")
new configsDir[64];
get_configsdir(configsDir, 63);
#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 , "$basedir/configs/weaprest_%s.ini" ,mapname ) format(g_saveFile,63,"%s/weaprest_%s.ini",configsDir,mapname)
#else #else
build_path( g_saveFile , 63 , "$basedir/configs/weaprest.ini" ) format(g_saveFile,63,"%s/weaprest.ini",configsDir)
#endif #endif
loadSettings(g_saveFile) loadSettings(g_saveFile)
} }
@ -466,7 +468,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_int(arg1) : 1 new start = read_argv(2,arg1,7) ? str_to_num(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
@ -495,8 +497,12 @@ public cmdRest(id,level,cid){
else if ( equali( "load" , cmd ) ) { else if ( equali( "load" , cmd ) ) {
setc( g_blockPos, 112, 0 ) // Clear current settings setc( g_blockPos, 112, 0 ) // Clear current settings
new arg1[64] new arg1[64]
if ( read_argv(2, arg1 , 63 ) ) build_path( arg1 , 63, "$basedir/%s", arg1 ) if ( read_argv(2, arg1 , 63 ) )
else copy( arg1, 63, g_saveFile ) {
new configsdir[32]
get_configsdir(configsdir,31)
format(arg1,63,"%s/%s",configsdir,arg1)
}
if ( loadSettings( arg1 ) ){ if ( loadSettings( arg1 ) ){
console_print( id , "Configuration has been loaded (file ^"%s^")" , arg1 ) console_print( id , "Configuration has been loaded (file ^"%s^")" , arg1 )
g_Modified = true g_Modified = true

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.1","AMXX Dev Team") register_plugin("Scrolling Message","0.16","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_int(mytime) g_Frequency = str_to_num(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.1","AMXX Dev Team") register_plugin("CS Stats","0.16","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>",
name[7],stats[4],stats[5],stats[6],stats[0],stats[1]) state,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,2047,"</table></body></html>") copy(g_Buffer[pos],2047-pos,"</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.1","AMXX Dev Team") register_plugin("CS Stats Logging","0.16","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

@ -51,9 +51,10 @@ public plugin_precache(){
} }
public plugin_init() { public plugin_init() {
register_plugin("Stats Configuration","0.1","AMXX Dev Team") register_plugin("Stats Configuration","0.16","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" ) get_configsdir(g_fileToSave, 63)
format(g_fileToSave, 63, "%s/stats.ini", g_fileToSave)
loadSettings(g_fileToSave) loadSettings(g_fileToSave)
} }
@ -105,7 +106,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_int(arg1) : 1 new start = read_argv(2,arg1,7) ? str_to_num(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.1","AMXX Dev Team") register_plugin("Teleport Menu","0.16","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.1","AMXX Dev Team") register_plugin("TimeLeft","0.16","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_int(mmins) new mins = str_to_num(mmins)
new hrs = str_to_int(mhours) new hrs = str_to_num(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_int(num) g_TimeSet[i][0] = str_to_num(num)
g_TimeSet[i][1] = read_flags(flags) g_TimeSet[i][1] = read_flags(flags)
i++ i++
} }

Some files were not shown because too many files have changed in this diff Show More