Initial import of mostly re-written NS module (also synced with ns2amx).
Renamed module to simply "ns". Module is mostly untested until NS beta 5 is release.
This commit is contained in:
parent
6236590aed
commit
6cd5790ea8
48
dlls/ns/ns/CCallList.h
Executable file
48
dlls/ns/ns/CCallList.h
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#ifndef CCALLLIST_H
|
||||||
|
#define CCALLLIST_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
Very basic call list.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class CCallList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct CallList {
|
||||||
|
int iFunctionIdx;
|
||||||
|
int iCheckInt;
|
||||||
|
CallList* next;
|
||||||
|
CallList(int i, int check,CallList* n): iFunctionIdx(i), iCheckInt(check), next(n) {}
|
||||||
|
} *head;
|
||||||
|
|
||||||
|
int execute(int check,int id) {
|
||||||
|
int ret = 0;
|
||||||
|
CallList *a = head;
|
||||||
|
while (a)
|
||||||
|
{
|
||||||
|
if (check == a->iCheckInt)
|
||||||
|
{
|
||||||
|
int temp = MF_ExecuteForward(a->iFunctionIdx,id);
|
||||||
|
if (temp > ret)
|
||||||
|
ret = temp;
|
||||||
|
}
|
||||||
|
a = a->next;
|
||||||
|
}
|
||||||
|
LOG_CONSOLE(PLID,"[IMPULSE] Returning: %i",ret);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
void create(int function,int check) {
|
||||||
|
head = new CallList(function, check , head );
|
||||||
|
};
|
||||||
|
void clear() {
|
||||||
|
while (head)
|
||||||
|
{
|
||||||
|
CallList* a = head->next;
|
||||||
|
delete head;
|
||||||
|
head = a;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
131
dlls/ns/ns/CPlayer.cpp
Executable file
131
dlls/ns/ns/CPlayer.cpp
Executable file
|
@ -0,0 +1,131 @@
|
||||||
|
#include "ns.h"
|
||||||
|
|
||||||
|
void CPlayer::PreThink()
|
||||||
|
{
|
||||||
|
if (!connected)
|
||||||
|
{
|
||||||
|
// This usually means it's a bot...
|
||||||
|
// So just emulate connections
|
||||||
|
Connect();
|
||||||
|
bot=true;
|
||||||
|
}
|
||||||
|
int tClass = GetClass();
|
||||||
|
if (tClass != iclass)
|
||||||
|
ChangeClass(tClass);
|
||||||
|
oldimpulse=pev->impulse;
|
||||||
|
}
|
||||||
|
void CPlayer::PreThink_Post()
|
||||||
|
{
|
||||||
|
// Trying to incorperate this into PostThink_Post led to really *weird* results (i don't think it was propagated to the client properly).
|
||||||
|
// Change the users speed here
|
||||||
|
maxspeed=(int)pev->maxspeed;
|
||||||
|
pev->maxspeed+=speedchange;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::PostThink_Post()
|
||||||
|
{
|
||||||
|
// Change the player's models...
|
||||||
|
if (custommodel)
|
||||||
|
SET_MODEL(edict,model);
|
||||||
|
if (customskin)
|
||||||
|
pev->skin=skin;
|
||||||
|
if (custombody)
|
||||||
|
pev->body=body;
|
||||||
|
}
|
||||||
|
void CPlayer::ChangeClass(int newclass)
|
||||||
|
{
|
||||||
|
MF_ExecuteForward(ChangeclassForward, index, newclass, iclass, oldimpulse);
|
||||||
|
iclass=newclass;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CPlayer::GetClass()
|
||||||
|
{
|
||||||
|
if (pev->deadflag)
|
||||||
|
return CLASS_DEAD;
|
||||||
|
if (!pev->team)
|
||||||
|
return CLASS_NOTEAM;
|
||||||
|
switch (pev->iuser3)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
// Light armor marine..
|
||||||
|
if (pev->iuser4 & MASK_HEAVYARMOR)
|
||||||
|
return CLASS_HEAVY;
|
||||||
|
if (pev->iuser4 & MASK_JETPACK)
|
||||||
|
return CLASS_JETPACK;
|
||||||
|
return CLASS_MARINE;
|
||||||
|
case 2:
|
||||||
|
return CLASS_COMMANDER;
|
||||||
|
case 3:
|
||||||
|
return CLASS_SKULK;
|
||||||
|
case 4:
|
||||||
|
return CLASS_GORGE;
|
||||||
|
case 5:
|
||||||
|
return CLASS_LERK;
|
||||||
|
case 6:
|
||||||
|
return CLASS_FADE;
|
||||||
|
case 7:
|
||||||
|
return CLASS_ONOS;
|
||||||
|
case 8:
|
||||||
|
return CLASS_GESTATE;
|
||||||
|
}
|
||||||
|
return CLASS_UNKNOWN;
|
||||||
|
|
||||||
|
}
|
||||||
|
void CPlayer::Connect()
|
||||||
|
{
|
||||||
|
connected=true;
|
||||||
|
bot=false;
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
void CPlayer::Disconnect()
|
||||||
|
{
|
||||||
|
connected=false;
|
||||||
|
bot=false;
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
void CPlayer::Reset()
|
||||||
|
{
|
||||||
|
this->custombody=false;
|
||||||
|
this->custommodel=false;
|
||||||
|
this->customskin=false;
|
||||||
|
this->maxspeed=0;
|
||||||
|
this->speedchange=0;
|
||||||
|
this->menucmd.chan=0;
|
||||||
|
this->menucmd.channel1=0;
|
||||||
|
this->menucmd.channel2=0;
|
||||||
|
this->menucmd.iFunctionIndex=0;
|
||||||
|
this->menucmd.inmenu=false;
|
||||||
|
this->menucmd.keys=0;
|
||||||
|
this->menucmd.text[0]='\0';
|
||||||
|
this->menucmd.time=0.0;
|
||||||
|
this->model[0]='\0';
|
||||||
|
this->skin=0;
|
||||||
|
this->body=0;
|
||||||
|
}
|
||||||
|
BOOL CPlayer::ClientCommand()
|
||||||
|
{
|
||||||
|
// As of now, all that needs to be checked is the "menuselect" command.
|
||||||
|
if (menucmd.inmenu)
|
||||||
|
{
|
||||||
|
if (FStrEq(CMD_ARGV(0),"menuselect"))
|
||||||
|
{
|
||||||
|
int key=0;
|
||||||
|
int key_mask=0;
|
||||||
|
menucmd.inmenu=false;
|
||||||
|
if (gpGlobals->time > menucmd.time)
|
||||||
|
{
|
||||||
|
menucmd.inmenu=0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
key=atoi(CMD_ARGV(1)) - 1;
|
||||||
|
key_mask=(1<<key);
|
||||||
|
if (key_mask & menucmd.keys)
|
||||||
|
{
|
||||||
|
ClearHudMessage(edict,menuhudtext," ");
|
||||||
|
// AMX_EXEC(menucmd.amx,NULL,menucmd.iFunctionIndex,2,index,key);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
53
dlls/ns/ns/CPlayer.h
Executable file
53
dlls/ns/ns/CPlayer.h
Executable file
|
@ -0,0 +1,53 @@
|
||||||
|
#ifndef CPLAYER_H
|
||||||
|
#define CPLAYER_H
|
||||||
|
class CPlayer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void PreThink();
|
||||||
|
void PreThink_Post();
|
||||||
|
void PostThink_Post();
|
||||||
|
void Spawn();
|
||||||
|
void ChangeTeam();
|
||||||
|
void ChangeClass(int newclass);
|
||||||
|
void Connect();
|
||||||
|
void Disconnect();
|
||||||
|
void Reset();
|
||||||
|
void Die();
|
||||||
|
BOOL ClientCommand();
|
||||||
|
int GetClass();
|
||||||
|
bool bot;
|
||||||
|
// Basic engine stuff.
|
||||||
|
edict_t *edict;
|
||||||
|
entvars_t *pev;
|
||||||
|
int oldimpulse; // Store the previous impulse.
|
||||||
|
int index;
|
||||||
|
|
||||||
|
bool connected;
|
||||||
|
|
||||||
|
// Custom model/body/skin
|
||||||
|
bool custommodel;
|
||||||
|
bool customskin;
|
||||||
|
bool custombody;
|
||||||
|
char model[128];
|
||||||
|
int skin;
|
||||||
|
int body;
|
||||||
|
|
||||||
|
// Speed change
|
||||||
|
int speedchange;
|
||||||
|
int maxspeed;
|
||||||
|
|
||||||
|
int iclass;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
int iFunctionIndex;
|
||||||
|
bool inmenu;
|
||||||
|
float time;
|
||||||
|
int keys;
|
||||||
|
char text[512];
|
||||||
|
int chan;
|
||||||
|
int channel1;
|
||||||
|
int channel2;
|
||||||
|
} menucmd;
|
||||||
|
hudtextparms_t menuhudtext;
|
||||||
|
};
|
||||||
|
#endif
|
46
dlls/ns/ns/CSpawn.cpp
Executable file
46
dlls/ns/ns/CSpawn.cpp
Executable file
|
@ -0,0 +1,46 @@
|
||||||
|
#include "ns.h"
|
||||||
|
|
||||||
|
void CSpawn::clear()
|
||||||
|
{
|
||||||
|
while (spawnpointinfo)
|
||||||
|
{
|
||||||
|
spawnpointInfo* a = spawnpointinfo->next;
|
||||||
|
delete spawnpointinfo;
|
||||||
|
spawnpointinfo = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
void CSpawn::put(int type, vec3_t location)
|
||||||
|
{
|
||||||
|
spawnpointinfo = new spawnpointInfo(type, location, spawnpointinfo);
|
||||||
|
}
|
||||||
|
float CSpawn::getnum(int type)
|
||||||
|
{
|
||||||
|
float iTemp=0.0;
|
||||||
|
spawnpointInfo *a = spawnpointinfo;
|
||||||
|
while (a)
|
||||||
|
{
|
||||||
|
if (a->type == type)
|
||||||
|
iTemp+=1.0;
|
||||||
|
a = a->next;
|
||||||
|
}
|
||||||
|
return iTemp;
|
||||||
|
}
|
||||||
|
vec3_t CSpawn::getpoint(int type, int num)
|
||||||
|
{
|
||||||
|
int iTemp=0;
|
||||||
|
spawnpointInfo *a = spawnpointinfo;
|
||||||
|
while (a)
|
||||||
|
{
|
||||||
|
if (a->type == type)
|
||||||
|
{
|
||||||
|
iTemp++;
|
||||||
|
if (iTemp == num)
|
||||||
|
{
|
||||||
|
return a->location;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a=a->next;
|
||||||
|
}
|
||||||
|
return Vector(0.0,0.0,0.0);
|
||||||
|
}
|
20
dlls/ns/ns/CSpawn.h
Executable file
20
dlls/ns/ns/CSpawn.h
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#ifndef CSPAWN_H
|
||||||
|
#define CSPAWN_H
|
||||||
|
class CSpawn
|
||||||
|
{
|
||||||
|
struct spawnpointInfo
|
||||||
|
{
|
||||||
|
int type; // 0 = Ready room, 1 = Marine, 2 = Alien
|
||||||
|
vec3_t location;
|
||||||
|
spawnpointInfo* next;
|
||||||
|
spawnpointInfo(int type, vec3_t location, spawnpointInfo* next): type(type), location(location), next(next) {}
|
||||||
|
} *spawnpointinfo;
|
||||||
|
public:
|
||||||
|
CSpawn() { spawnpointinfo = 0; }
|
||||||
|
~CSpawn() { clear(); }
|
||||||
|
void clear();
|
||||||
|
void put(int type, vec3_t location);
|
||||||
|
float getnum(int type);
|
||||||
|
vec3_t getpoint(int type, int num);
|
||||||
|
};
|
||||||
|
#endif
|
113
dlls/ns/ns/NMenu.cpp
Executable file
113
dlls/ns/ns/NMenu.cpp
Executable file
|
@ -0,0 +1,113 @@
|
||||||
|
#include "ns.h"
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_menu(AMX *amx,cell *params)
|
||||||
|
{
|
||||||
|
if (params[1] == 0) // Setting this for all
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i=0;i<=32;i++)
|
||||||
|
{
|
||||||
|
CPlayer *p = GET_PLAYER_I(i);
|
||||||
|
|
||||||
|
p->menuhudtext.r1=params[2];
|
||||||
|
p->menuhudtext.g1=params[3];
|
||||||
|
p->menuhudtext.b1=params[4];
|
||||||
|
p->menuhudtext.x=CELL_TO_FLOAT(params[5]);
|
||||||
|
p->menuhudtext.y=CELL_TO_FLOAT(params[6]);
|
||||||
|
p->menuhudtext.effect=params[7];
|
||||||
|
p->menuhudtext.fxTime=CELL_TO_FLOAT(params[8]);
|
||||||
|
p->menuhudtext.fadeinTime=CELL_TO_FLOAT(params[9]);
|
||||||
|
p->menuhudtext.channel=params[10];
|
||||||
|
p->menucmd.channel1=params[10];
|
||||||
|
p->menucmd.channel2=params[11];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Setting this specific
|
||||||
|
{
|
||||||
|
CPlayer *p = GET_PLAYER_I(params[1]);
|
||||||
|
p->menuhudtext.r1=params[2];
|
||||||
|
p->menuhudtext.g1=params[3];
|
||||||
|
p->menuhudtext.b1=params[4];
|
||||||
|
p->menuhudtext.x=CELL_TO_FLOAT(params[5]);
|
||||||
|
p->menuhudtext.y=CELL_TO_FLOAT(params[6]);
|
||||||
|
p->menuhudtext.effect=params[7];
|
||||||
|
p->menuhudtext.fxTime=CELL_TO_FLOAT(params[8]);
|
||||||
|
p->menuhudtext.fadeinTime=CELL_TO_FLOAT(params[9]);
|
||||||
|
p->menuhudtext.channel=params[10];
|
||||||
|
p->menucmd.channel1=params[10];
|
||||||
|
p->menucmd.channel2=params[11];
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_show_menu(AMX *amx,cell *params)
|
||||||
|
{
|
||||||
|
// Format: show_ns_menu(id=0,szcommand,sztext,keys,time)
|
||||||
|
edict_t *pEntity=NULL;
|
||||||
|
CPlayer *p = GET_PLAYER_I(params[1]);
|
||||||
|
int iFunctionIndex;
|
||||||
|
if (params[1]!=0 && params[1]<=gpGlobals->maxClients)
|
||||||
|
{
|
||||||
|
pEntity=INDEXENT2(params[1]);
|
||||||
|
if (FNullEnt(INDEXENT2(params[1])))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// First we set the command to be executed here...
|
||||||
|
int len;
|
||||||
|
// AMX publics have a limit of 19 characters.
|
||||||
|
char sTemp[20];
|
||||||
|
sprintf(sTemp,"%s",MF_GetAmxString(amx,params[2],0,&len));
|
||||||
|
char sText[512];
|
||||||
|
sprintf(sText,"%s",MF_GetAmxString(amx,params[3],1,&len));
|
||||||
|
iFunctionIndex = MF_RegisterSPForwardByName(amx, sTemp, ET_IGNORE, FP_CELL, FP_CELL);
|
||||||
|
if (pEntity==NULL)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i=1;i<=gpGlobals->maxClients;i++)
|
||||||
|
{
|
||||||
|
CPlayer *p = GET_PLAYER_I(i);
|
||||||
|
if (p->connected) /* Grrrrrrrrr */
|
||||||
|
{
|
||||||
|
p->menucmd.iFunctionIndex=iFunctionIndex;
|
||||||
|
p->menucmd.inmenu=true;
|
||||||
|
p->menucmd.time=gpGlobals->time+(float)params[5];
|
||||||
|
sprintf(p->menucmd.text,"%s",sText);
|
||||||
|
p->menucmd.keys=params[4];
|
||||||
|
p->menuhudtext.channel = p->menucmd.chan ? p->menucmd.channel1 : p->menucmd.channel2;
|
||||||
|
p->menuhudtext.holdTime=(float)params[5];
|
||||||
|
p->menucmd.chan=p->menuhudtext.channel;
|
||||||
|
p->menucmd.chan = p->menucmd.chan ? 0 : 1;
|
||||||
|
// UTIL_EmptyMenu(INDEXENT2(i),params[4],params[5]);
|
||||||
|
// HudMessage(i,p->menuhudtext,sText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UTIL_EmptyMenu(0,params[4],params[5]);
|
||||||
|
HudMessage(0,p->menuhudtext,sText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CPlayer *p = GET_PLAYER_I(params[1]);
|
||||||
|
if (p->connected)
|
||||||
|
{
|
||||||
|
p->menucmd.iFunctionIndex=iFunctionIndex;
|
||||||
|
p->menucmd.inmenu=true;
|
||||||
|
p->menucmd.time=gpGlobals->time+(float)params[5];
|
||||||
|
sprintf(p->menucmd.text,"%s",sText);
|
||||||
|
p->menucmd.keys=params[4];
|
||||||
|
p->menuhudtext.channel = p->menucmd.chan ? p->menucmd.channel1 : p->menucmd.channel2;
|
||||||
|
UTIL_EmptyMenu(INDEXENT2(params[1]),params[4],params[5]);
|
||||||
|
p->menuhudtext.holdTime=(float)params[5];
|
||||||
|
HudMessage(params[1],p->menuhudtext,sText);
|
||||||
|
p->menucmd.chan=p->menuhudtext.channel;
|
||||||
|
p->menucmd.chan = p->menucmd.chan ? 0 : 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
AMX_NATIVE_INFO ns_menu_natives[] = {
|
||||||
|
{ "ns_set_menu", ns_set_menu },
|
||||||
|
{ "ns_show_menu", ns_show_menu },
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
||||||
|
|
337
dlls/ns/ns/NMisc.cpp
Executable file
337
dlls/ns/ns/NMisc.cpp
Executable file
|
@ -0,0 +1,337 @@
|
||||||
|
#include "ns.h"
|
||||||
|
|
||||||
|
// These are natives directly from NS2AMX
|
||||||
|
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_has_weapon(AMX *amx,cell *params)
|
||||||
|
{
|
||||||
|
CHECK_ENTITY(params[1]);
|
||||||
|
edict_t *pEntity = NULL;
|
||||||
|
pEntity = INDEXENT2(params[1]);
|
||||||
|
if (params[3] == -1)
|
||||||
|
{
|
||||||
|
if ((pEntity->v.weapons & (1<<params[2])) > 0)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((pEntity->v.weapons & (1<<params[2])) > 0)
|
||||||
|
{
|
||||||
|
if (params[3] == 0)
|
||||||
|
{
|
||||||
|
pEntity->v.weapons &= ~(1<<params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (params[3] == 1)
|
||||||
|
{
|
||||||
|
pEntity->v.weapons |= (1<<params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_spawnpoints(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
vec3_t vRet;
|
||||||
|
if (params[2] == 0)
|
||||||
|
{
|
||||||
|
return ns_spawnpoints.getnum(params[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vRet=ns_spawnpoints.getpoint(params[1],params[2]);
|
||||||
|
cell *vCell = MF_GetAmxAddr(amx,params[3]);
|
||||||
|
vCell[0] = FLOAT_TO_CELL(vRet.x);
|
||||||
|
vCell[1] = FLOAT_TO_CELL(vRet.y);
|
||||||
|
vCell[2] = FLOAT_TO_CELL(vRet.z);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MASK_ELECTRICITY 8192
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_build(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int iLength;
|
||||||
|
char *buildtype = MF_GetAmxString(amx,params[1],0,&iLength);
|
||||||
|
int iBuiltOnly = params[2];
|
||||||
|
int iNumber = params[3];
|
||||||
|
edict_t* pBuild = NULL;
|
||||||
|
int iCount=0;
|
||||||
|
int nsversion=params[4];
|
||||||
|
|
||||||
|
while ((pBuild = UTIL_FindEntityByString(pBuild,"classname",buildtype)) != NULL)
|
||||||
|
{
|
||||||
|
if (nsversion == 3)
|
||||||
|
{
|
||||||
|
if (iBuiltOnly > 0)
|
||||||
|
{
|
||||||
|
if (FStrEq("team_advarmory",buildtype) || FStrEq("team_advturretfactory",buildtype))
|
||||||
|
{
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (pBuild->v.fuser1 >= 1000 || pBuild->v.iuser4 & MASK_ELECTRICITY)
|
||||||
|
{
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
|
if (iNumber > 0 && iCount == iNumber)
|
||||||
|
return ENTINDEX(pBuild);
|
||||||
|
}
|
||||||
|
else if (nsversion == 2)
|
||||||
|
{
|
||||||
|
if (iBuiltOnly > 0)
|
||||||
|
{
|
||||||
|
if (FStrEq("team_hive",buildtype))
|
||||||
|
{
|
||||||
|
if (pBuild->v.fuser1 >= 1000)
|
||||||
|
{
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (pBuild->v.fuser1 >= 1000 || pBuild->v.iuser4 & MASK_ELECTRICITY)
|
||||||
|
{
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iCount++;
|
||||||
|
}
|
||||||
|
if (iNumber > 0 && iCount == iNumber)
|
||||||
|
return ENTINDEX(pBuild);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return iCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_speedchange(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
// Params: get_speedchange(index)
|
||||||
|
int index=params[1];
|
||||||
|
if (!(params[1]>0 && params[1]<=gpGlobals->maxClients))
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
return player->speedchange;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_speedchange(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
// Params: set_speedchange(index,speedchange=0)
|
||||||
|
if (!(params[1]>0&¶ms[1]<=32))
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
player->speedchange=params[2];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_maxspeed(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
// Params: get_maxspeed(index) (returns the max speed of the player BEFORE speed change is factored in.)
|
||||||
|
if (!(params[1]>0 && params[1]<=32))
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
return player->maxspeed;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_player_model(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
// Params: set_player_model(id,szModel[])
|
||||||
|
if (!(params[1] > 0 && params[1] <= gpGlobals->maxClients))
|
||||||
|
{
|
||||||
|
MF_Log("Can't set player model for a non-player entity.",MODULE_LOGTAG);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int len;
|
||||||
|
char *temp = MF_GetAmxString(amx,params[2],0,&len);
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
if (!FStrEq(temp,""))
|
||||||
|
{
|
||||||
|
PRECACHE_MODEL(temp);
|
||||||
|
snprintf(player->model,127,"%s",temp);
|
||||||
|
player->custommodel=true;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
player->custommodel=false;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_player_skin(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
// Params: set_player_skin(id,skin=-1)
|
||||||
|
if (!(params[1] > 0 && params[1] <= gpGlobals->maxClients))
|
||||||
|
{
|
||||||
|
LOG_ERROR(PLID,"[%s] Can't set player skin for a non-player entity.",MODULE_LOGTAG);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
if (params[2] < 0)
|
||||||
|
{
|
||||||
|
// Reset skin.
|
||||||
|
player->skin=0;
|
||||||
|
player->customskin=false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player->customskin=true;
|
||||||
|
player->skin=params[2];
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_player_body(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
// Params: set_player_body(id,body=-1)
|
||||||
|
if (!(params[1] > 0 && params[1] <= gpGlobals->maxClients))
|
||||||
|
{
|
||||||
|
LOG_ERROR(PLID,"[%s] Can't set player body for a non-player entity.",MODULE_LOGTAG);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
if (params[2] < 0)
|
||||||
|
{
|
||||||
|
// Reset body.
|
||||||
|
player->body=0;
|
||||||
|
player->custombody=false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player->custombody=true;
|
||||||
|
player->body=params[2];
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_class(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (params[1] < 1 || params[1] > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
|
||||||
|
return player->GetClass();
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_jpfuel(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (params[1] < 1 || params[1] > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
return FLOAT_TO_CELL(player->pev->fuser3 / 10.0);
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_jpfuel(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (params[1] < 1 || params[1] > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
REAL fuel = CELL_TO_FLOAT(params[2]);
|
||||||
|
if (fuel > 100.0)
|
||||||
|
fuel = 100.0;
|
||||||
|
if (fuel < 0.0)
|
||||||
|
fuel = 0.0;
|
||||||
|
player->pev->fuser3 = fuel * 10.0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_is_combat(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
return iscombat;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_mask(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxEntities)
|
||||||
|
return -1;
|
||||||
|
edict_t *pEntity = INDEXENT2(params[1]);
|
||||||
|
if (pEntity->v.iuser4 & params[2])
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_mask(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxEntities)
|
||||||
|
return -1;
|
||||||
|
edict_t *pEntity = INDEXENT2(params[1]);
|
||||||
|
if (params[3] > 0)
|
||||||
|
{
|
||||||
|
if (pEntity->v.iuser4 & params[2])
|
||||||
|
return 0;
|
||||||
|
pEntity->v.iuser4 |= params[2];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (pEntity->v.iuser4 & params[2])
|
||||||
|
{
|
||||||
|
pEntity->v.iuser4 &= ~params[2];
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_popup(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (!gmsgHudText2)
|
||||||
|
gmsgHudText2 = GET_USER_MSG_ID(PLID, "HudText2", NULL);
|
||||||
|
if (params[1])
|
||||||
|
{
|
||||||
|
if (params[1] > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(params[1]);
|
||||||
|
MESSAGE_BEGIN(MSG_ONE,gmsgHudText2,NULL,player->edict);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
MESSAGE_BEGIN(MSG_ALL,gmsgHudText2);
|
||||||
|
int len;
|
||||||
|
char *blah = MF_GetAmxString(amx,params[2],0,&len);
|
||||||
|
char msg[190];
|
||||||
|
strncpy(msg,blah,188);
|
||||||
|
WRITE_STRING(msg);
|
||||||
|
WRITE_BYTE(params[3]);
|
||||||
|
MESSAGE_END();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
AMX_NATIVE_INFO ns_misc_natives[] = {
|
||||||
|
///////////////////
|
||||||
|
{ "ns_get_build", ns_get_build },
|
||||||
|
|
||||||
|
{ "ns_set_player_model", ns_set_player_model },
|
||||||
|
{ "ns_set_player_skin", ns_set_player_skin },
|
||||||
|
{ "ns_set_player_body", ns_set_player_body },
|
||||||
|
|
||||||
|
{ "ns_has_weapon", ns_has_weapon },
|
||||||
|
|
||||||
|
{ "ns_get_spawn", ns_get_spawnpoints },
|
||||||
|
|
||||||
|
{ "ns_get_speedchange", ns_get_speedchange },
|
||||||
|
{ "ns_set_speedchange", ns_set_speedchange },
|
||||||
|
{ "ns_get_maxspeed", ns_get_maxspeed },
|
||||||
|
|
||||||
|
{ "ns_get_class", ns_get_class },
|
||||||
|
|
||||||
|
{ "ns_get_jpfuel", ns_get_jpfuel },
|
||||||
|
{ "ns_set_jpfuel", ns_set_jpfuel },
|
||||||
|
|
||||||
|
{ "ns_get_energy", ns_get_jpfuel }, // They do the same thing...
|
||||||
|
{ "ns_set_energy", ns_set_jpfuel }, //
|
||||||
|
{ "ns_is_combat", ns_is_combat },
|
||||||
|
|
||||||
|
{ "ns_get_mask", ns_get_mask },
|
||||||
|
{ "ns_set_mask", ns_set_mask },
|
||||||
|
|
||||||
|
{ "ns_popup", ns_popup },
|
||||||
|
|
||||||
|
///////////////////
|
||||||
|
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
356
dlls/ns/ns/NPData.cpp
Executable file
356
dlls/ns/ns/NPData.cpp
Executable file
|
@ -0,0 +1,356 @@
|
||||||
|
#include "ns.h"
|
||||||
|
|
||||||
|
int get_private(edict_t *pEntity, int woffset,int loffset)
|
||||||
|
{
|
||||||
|
#ifdef __linux__
|
||||||
|
return *((int *)pEntity->pvPrivateData + loffset);
|
||||||
|
#else
|
||||||
|
return *((int *)pEntity->pvPrivateData + woffset);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
REAL get_private_f(edict_t *pEntity, int woffset, int loffset)
|
||||||
|
{
|
||||||
|
#ifdef __linux__
|
||||||
|
return *((REAL *)pEntity->pvPrivateData + loffset);
|
||||||
|
#else
|
||||||
|
return *((REAL *)pEntity->pvPrivateData + woffset);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
void set_private(edict_t *pEntity, int woffset, int loffset, int value)
|
||||||
|
{
|
||||||
|
#ifdef __linux__
|
||||||
|
*((int *)pEntity->pvPrivateData + loffset) = value;
|
||||||
|
#else
|
||||||
|
*((int *)pEntity->pvPrivateData + woffset) = value;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
void set_private(edict_t *pEntity, int woffset, int loffset, REAL value)
|
||||||
|
{
|
||||||
|
#ifdef __linux__
|
||||||
|
*((REAL *)pEntity->pvPrivateData + loffset) = value;
|
||||||
|
#else
|
||||||
|
*((REAL *)pEntity->pvPrivateData + woffset) = value;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_res(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (iscombat)
|
||||||
|
return 0;
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
|
||||||
|
if (!player->connected)
|
||||||
|
return 0;
|
||||||
|
if (player->edict->pvPrivateData == NULL) // Worth a shot to make sure it's initialized.
|
||||||
|
return 0;
|
||||||
|
REAL res = get_private_f(player->edict,OFFSET_WIN_RESOURCES,OFFSET_LIN_RESOURCES);
|
||||||
|
return FLOAT_TO_CELL(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_res(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (iscombat)
|
||||||
|
return 0;
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
REAL res = CELL_TO_FLOAT(params[2]);
|
||||||
|
set_private(player->edict,OFFSET_WIN_RESOURCES,OFFSET_LIN_RESOURCES,res);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_exp(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (!iscombat)
|
||||||
|
return 0;
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
|
||||||
|
if (!player->connected)
|
||||||
|
return 0;
|
||||||
|
if (player->edict->pvPrivateData == NULL) // Worth a shot to make sure it's initialized.
|
||||||
|
return 0;
|
||||||
|
REAL res = get_private_f(player->edict,OFFSET_WIN_EXP,OFFSET_LIN_EXP);
|
||||||
|
return FLOAT_TO_CELL(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_exp(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
if (!iscombat)
|
||||||
|
return 0;
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
REAL res = CELL_TO_FLOAT(params[2]);
|
||||||
|
set_private(player->edict,OFFSET_WIN_EXP,OFFSET_LIN_EXP,res);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_points(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
return get_private(player->edict,OFFSET_WIN_POINTS,OFFSET_LIN_POINTS);
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_points(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
set_private(player->edict,OFFSET_WIN_POINTS,OFFSET_LIN_POINTS,params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_weapon_dmg(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
REAL dmg = CELL_TO_FLOAT(params[2]);
|
||||||
|
set_private(pEntity,OFFSET_WIN_WEAPDMG,OFFSET_LIN_WEAPDMG,dmg);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_weapon_dmg(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
return FLOAT_TO_CELL(get_private_f(pEntity,OFFSET_WIN_WEAPDMG,OFFSET_LIN_WEAPDMG));
|
||||||
|
}
|
||||||
|
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_weapon_range(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
REAL dmg = CELL_TO_FLOAT(params[2]);
|
||||||
|
set_private(pEntity,OFFSET_WIN_WEAPRANGE,OFFSET_LIN_WEAPRANGE,dmg);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_weapon_range(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
return FLOAT_TO_CELL(get_private_f(pEntity,OFFSET_WIN_WEAPRANGE,OFFSET_LIN_WEAPRANGE));
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_weapon_ammo(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
set_private(pEntity,OFFSET_WIN_WEAPCLIP,OFFSET_LIN_WEAPCLIP,params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_weapon_ammo(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
return get_private(pEntity,OFFSET_WIN_WEAPCLIP,OFFSET_LIN_WEAPCLIP);
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_weap_reserve(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
switch (params[2])
|
||||||
|
{
|
||||||
|
case WEAPON_PISTOL:
|
||||||
|
return get_private(player->edict,OFFSET_WIN_AMMO_PISTOL,OFFSET_LIN_AMMO_PISTOL);
|
||||||
|
case WEAPON_LMG:
|
||||||
|
return get_private(player->edict,OFFSET_WIN_AMMO_LMG,OFFSET_LIN_AMMO_LMG);
|
||||||
|
case WEAPON_HMG:
|
||||||
|
return get_private(player->edict,OFFSET_WIN_AMMO_HMG,OFFSET_LIN_AMMO_HMG);
|
||||||
|
case WEAPON_GRENADE_GUN:
|
||||||
|
return get_private(player->edict,OFFSET_WIN_AMMO_GL,OFFSET_LIN_AMMO_GL);
|
||||||
|
case WEAPON_GRENADE:
|
||||||
|
return get_private(player->edict,OFFSET_WIN_AMMO_HG,OFFSET_LIN_AMMO_HG);
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_weap_reserve(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
switch (params[2])
|
||||||
|
{
|
||||||
|
case WEAPON_PISTOL:
|
||||||
|
set_private(player->edict,OFFSET_WIN_AMMO_PISTOL,OFFSET_LIN_AMMO_PISTOL,params[3]);
|
||||||
|
return 1;
|
||||||
|
case WEAPON_LMG:
|
||||||
|
set_private(player->edict,OFFSET_WIN_AMMO_LMG,OFFSET_LIN_AMMO_LMG,params[3]);
|
||||||
|
return 1;
|
||||||
|
case WEAPON_HMG:
|
||||||
|
set_private(player->edict,OFFSET_WIN_AMMO_HMG,OFFSET_LIN_AMMO_HMG,params[3]);
|
||||||
|
return 1;
|
||||||
|
case WEAPON_GRENADE_GUN:
|
||||||
|
set_private(player->edict,OFFSET_WIN_AMMO_GL,OFFSET_LIN_AMMO_GL,params[3]);
|
||||||
|
return 1;
|
||||||
|
case WEAPON_GRENADE:
|
||||||
|
set_private(player->edict,OFFSET_WIN_AMMO_HG,OFFSET_LIN_AMMO_HG,params[3]);
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_score(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
return get_private(player->edict,OFFSET_WIN_SCORE,OFFSET_LIN_SCORE);
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_score(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
if (!player->connected || player->edict->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
set_private(player->edict,OFFSET_WIN_SCORE,OFFSET_LIN_SCORE,params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_hive_trait(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
set_private(pEntity,OFFSET_WIN_HIVE_TRAIT,OFFSET_LIN_HIVE_TRAIT,params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_hive_trait(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id <= gpGlobals->maxClients || id > gpGlobals->maxEntities)
|
||||||
|
return 0;
|
||||||
|
edict_t *pEntity = INDEXENT2(id);
|
||||||
|
if (pEntity->pvPrivateData == NULL)
|
||||||
|
return 0;
|
||||||
|
return get_private(pEntity,OFFSET_WIN_HIVE_TRAIT,OFFSET_LIN_HIVE_TRAIT);
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_deaths(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
return get_private(player->edict,OFFSET_WIN_DEATHS,OFFSET_LIN_DEATHS);
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_deaths(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
set_private(player->edict,OFFSET_WIN_DEATHS,OFFSET_LIN_DEATHS,params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_get_icon(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
return get_private(player->edict,OFFSET_WIN_ICON,OFFSET_LIN_ICON);
|
||||||
|
}
|
||||||
|
static cell AMX_NATIVE_CALL ns_set_icon(AMX *amx, cell *params)
|
||||||
|
{
|
||||||
|
int id = params[1];
|
||||||
|
if (id < 1 || id > gpGlobals->maxClients)
|
||||||
|
return 0;
|
||||||
|
CPlayer *player = GET_PLAYER_I(id);
|
||||||
|
set_private(player->edict,OFFSET_WIN_ICON,OFFSET_LIN_ICON,params[2]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
AMX_NATIVE_INFO ns_pdata_natives[] = {
|
||||||
|
/*****************/
|
||||||
|
{ "ns_get_res", ns_get_res },
|
||||||
|
{ "ns_set_res", ns_set_res },
|
||||||
|
|
||||||
|
{ "ns_get_exp", ns_get_exp },
|
||||||
|
{ "ns_set_exp", ns_set_exp },
|
||||||
|
|
||||||
|
{ "ns_get_points", ns_get_points },
|
||||||
|
{ "ns_set_points", ns_set_points },
|
||||||
|
|
||||||
|
{ "ns_set_weap_dmg", ns_set_weapon_dmg },
|
||||||
|
{ "ns_get_weap_dmg", ns_get_weapon_dmg },
|
||||||
|
|
||||||
|
{ "ns_set_weap_range", ns_set_weapon_range },
|
||||||
|
{ "ns_get_weap_range", ns_get_weapon_range },
|
||||||
|
|
||||||
|
{ "ns_set_weap_clip", ns_set_weapon_ammo },
|
||||||
|
{ "ns_get_weap_clip", ns_get_weapon_ammo },
|
||||||
|
|
||||||
|
{ "ns_set_weap_reserve", ns_set_weap_reserve },
|
||||||
|
{ "ns_get_weap_reserve", ns_get_weap_reserve },
|
||||||
|
|
||||||
|
{ "ns_set_score", ns_set_score },
|
||||||
|
{ "ns_get_score", ns_get_score },
|
||||||
|
|
||||||
|
{ "ns_get_deaths", ns_get_deaths },
|
||||||
|
{ "ns_set_deaths", ns_set_deaths },
|
||||||
|
|
||||||
|
{ "ns_get_icon", ns_get_icon },
|
||||||
|
{ "ns_set_icon", ns_set_icon },
|
||||||
|
|
||||||
|
{ "ns_get_hive_trait", ns_get_hive_trait },
|
||||||
|
{ "ns_set_hive_trait", ns_set_hive_trait },
|
||||||
|
|
||||||
|
{ NULL, NULL }
|
||||||
|
};
|
7
dlls/ns/ns/amxxapi.h
Executable file
7
dlls/ns/ns/amxxapi.h
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef _INCLUDE_AMXXAPI_H
|
||||||
|
#define _INCLUDE_AMXXAPI_H
|
||||||
|
|
||||||
|
extern int ChangeclassForward;
|
||||||
|
extern int BuiltForward;
|
||||||
|
|
||||||
|
#endif //_INCLUDE_AMXXAPI_H
|
3140
dlls/ns/ns/amxxmodule.cpp
Executable file
3140
dlls/ns/ns/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2152
dlls/ns/ns/amxxmodule.h
Executable file
2152
dlls/ns/ns/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
114
dlls/ns/ns/build
Executable file
114
dlls/ns/ns/build
Executable file
|
@ -0,0 +1,114 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# This bash script will (hopefully), compile Linux based metamods (in i386 architecture)
|
||||||
|
# that should hopefully work on any Linux machine.
|
||||||
|
|
||||||
|
MODNAME=ns_amxx
|
||||||
|
HLSDKDIR=/hlsdk/multiplayer
|
||||||
|
HLSDK=${HLSDKDIR}
|
||||||
|
METAMODDIR=~/mods/metamod
|
||||||
|
SOURCEFILES="auto"
|
||||||
|
OUTPUTDIRECTORY=./linux
|
||||||
|
EXTRAFLAGS="-mcpu=i386"
|
||||||
|
LIBRARIES="-ldl -lm"
|
||||||
|
#LIBRARIES=""
|
||||||
|
COMPILER="gcc296"
|
||||||
|
# Put any extra compiling flags you want in the line above this one.
|
||||||
|
|
||||||
|
# Do not edit below here.
|
||||||
|
if [ "${SOURCEFILES}" = "auto" ]
|
||||||
|
then
|
||||||
|
echo -n "Auto detecting *.cpp files to compile..."
|
||||||
|
SOURCEFILES=""
|
||||||
|
for file in $PWD/*.cpp
|
||||||
|
do
|
||||||
|
SOURCEFILES="${SOURCEFILES} `basename $file`"
|
||||||
|
done
|
||||||
|
echo "finished."
|
||||||
|
echo -n "Compiling the following: "
|
||||||
|
echo ${SOURCEFILES}
|
||||||
|
|
||||||
|
fi
|
||||||
|
# No need to edit below here.
|
||||||
|
|
||||||
|
# Check GCC version here. 2.95 is our ideal version
|
||||||
|
if [ `${COMPILER} -dumpversion |tr "." " " |awk '{ print $1 }'` -gt 2 ]
|
||||||
|
then
|
||||||
|
echo "!!WARNING!! GCC > 2.95 detected! (version `gcc -dumpversion` detected)"
|
||||||
|
echo "Unstable builds may result."
|
||||||
|
elif [ `gcc -dumpversion |tr "." " " |awk '{ print $2 }'` -gt "95" ]
|
||||||
|
then
|
||||||
|
echo "!!WARNING!! GCC > 2.95 detected! (version `gcc -dumpversion` detected)"
|
||||||
|
echo "Unstable builds may result."
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Check for directory structure...
|
||||||
|
echo -n "Checking for directory ${OUTPUTDIRECTORY}..."
|
||||||
|
if [ -d ${OUTPUTDIRECTORY} ]
|
||||||
|
then
|
||||||
|
echo "exists."
|
||||||
|
else
|
||||||
|
echo "non-existant."
|
||||||
|
echo -n "Creating directory ${OUTPUTDIRECTORY}..."
|
||||||
|
if mkdir ${OUTPUTDIRECTORY}
|
||||||
|
then
|
||||||
|
echo "successful."
|
||||||
|
else
|
||||||
|
echo "failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Do backups
|
||||||
|
if [ -e ${OUTPUTDIRECTORY}/${MODNAME}_i386.so.backup ]
|
||||||
|
then
|
||||||
|
echo -n "Old backup found, removing..."
|
||||||
|
if rm -f ${OUTPUTDIRECTORY}/${MODNAME}_i386.so.backup
|
||||||
|
then
|
||||||
|
echo "successful."
|
||||||
|
else
|
||||||
|
echo "failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -e ${OUTPUTDIRECTORY}/${MODNAME}_i386.so ]
|
||||||
|
then
|
||||||
|
echo -n "Old build found, backing up..."
|
||||||
|
if mv ${OUTPUTDIRECTORY}/${MODNAME}_i386.so ${OUTPUTDIRECTORY}/${MODNAME}_i386.so.backup &> /dev/null
|
||||||
|
then
|
||||||
|
echo "successful."
|
||||||
|
else
|
||||||
|
echo "failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Compile
|
||||||
|
#echo ${COMPILER} -w -O3 -Wall -shared ${LIBRARIES} -o ${OUTPUTDIRECTORY}/${MODNAME}_i386.so ${SOURCEFILES} -I- -I . -I $METAMODDIR -I ${HLSDKDIR}/common -I ${HLSDKDIR}/dlls -I ${HLSDKDIR}/pm_shared -I ${HLSDKDIR}/engine ${EXTRAFLAGS}
|
||||||
|
|
||||||
|
echo -n "Compiling..."
|
||||||
|
if ${COMPILER} -w -O3 -Wall -shared ${LIBRARIES} -o ${OUTPUTDIRECTORY}/${MODNAME}_i386.so ${SOURCEFILES} -I- -I . -I $METAMODDIR -I ${HLSDKDIR}/common -I ${HLSDKDIR}/dlls -I ${HLSDKDIR}/pm_shared -I ${HLSDKDIR}/engine ${EXTRAFLAGS}
|
||||||
|
then
|
||||||
|
echo "successful."
|
||||||
|
else
|
||||||
|
echo "compiling failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Strip
|
||||||
|
if [ -f ${OUTPUTDIRECTORY}/${MODNAME}_i386.so ]
|
||||||
|
then
|
||||||
|
echo -n "Stripping file..."
|
||||||
|
else
|
||||||
|
echo "Error stripping: File doesn't exist!?!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if strip linux/${MODNAME}_i386.so
|
||||||
|
then
|
||||||
|
echo "success."
|
||||||
|
else
|
||||||
|
echo "failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Finished with no apparent errors."
|
||||||
|
exit 0
|
385
dlls/ns/ns/hookedfunctions.cpp
Executable file
385
dlls/ns/ns/hookedfunctions.cpp
Executable file
|
@ -0,0 +1,385 @@
|
||||||
|
#include "ns.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <sdk_util.h> //useful almost everywhere
|
||||||
|
#include <usercmd.h>
|
||||||
|
|
||||||
|
CSpawn ns_spawnpoints;
|
||||||
|
CPlayer g_player[33];
|
||||||
|
edict_t *player_edicts[33];
|
||||||
|
|
||||||
|
int gmsgHudText2=0;
|
||||||
|
int ChangeclassForward = 0;
|
||||||
|
int BuiltForward = 0;
|
||||||
|
|
||||||
|
// Index of last entity hooked in CreateNamedEntity
|
||||||
|
int iCreateEntityIndex;
|
||||||
|
BOOL iscombat;
|
||||||
|
int g_MsgInfo[10];
|
||||||
|
int g_MsgLength;
|
||||||
|
int gmsgScoreInfo=0;
|
||||||
|
int hooked_msg=0;
|
||||||
|
int hooked_dest=0;
|
||||||
|
|
||||||
|
|
||||||
|
int gmsgShowMenu=0;
|
||||||
|
int gmsgResetHUD=0;
|
||||||
|
|
||||||
|
// Module is attaching to AMXX
|
||||||
|
void OnAmxxAttach()
|
||||||
|
{
|
||||||
|
MF_AddNatives(ns_misc_natives);
|
||||||
|
MF_AddNatives(ns_menu_natives);
|
||||||
|
MF_AddNatives(ns_pdata_natives);
|
||||||
|
}
|
||||||
|
|
||||||
|
// All plugins have loaded (probably around Spawning worldspawn..
|
||||||
|
void OnPluginsLoaded()
|
||||||
|
{
|
||||||
|
|
||||||
|
gmsgHudText2 = GET_USER_MSG_ID(&Plugin_info,"HudText2",NULL);
|
||||||
|
// Check the map name and see if it's combat or not.
|
||||||
|
iscombat=FALSE;
|
||||||
|
char mapname[255];
|
||||||
|
strcpy(mapname,STRING(gpGlobals->mapname));
|
||||||
|
if ((mapname[0]=='c' || mapname[0]=='C') && (mapname[1]=='o' || mapname[0]=='O') && mapname[2]=='_')
|
||||||
|
iscombat=TRUE;
|
||||||
|
|
||||||
|
ChangeclassForward = MF_RegisterForward("client_changeclass", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL);
|
||||||
|
// No sense in this if it's combat..
|
||||||
|
if (!iscombat)
|
||||||
|
BuiltForward = MF_RegisterForward("client_built", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ClientCommand(edict_t *pEntity)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_E(pEntity);
|
||||||
|
if (player->ClientCommand())
|
||||||
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Spawn(edict_t *pEntity)
|
||||||
|
{
|
||||||
|
// Everything starting up:
|
||||||
|
// - Reset CPlayer classes
|
||||||
|
// - Reset CSpawn classes
|
||||||
|
if (FStrEq(STRING(pEntity->v.classname),"worldspawn"))
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i=0;i<=32;i++)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_I(i);
|
||||||
|
player->Reset();
|
||||||
|
}
|
||||||
|
ns_spawnpoints.clear();
|
||||||
|
}
|
||||||
|
else if (FStrEq(STRING(pEntity->v.classname),"info_player_start"))
|
||||||
|
{
|
||||||
|
// Mark down the ready room spawn point.
|
||||||
|
ns_spawnpoints.put(0,pEntity->v.origin);
|
||||||
|
}
|
||||||
|
else if (FStrEq(STRING(pEntity->v.classname),"info_team_start"))
|
||||||
|
{
|
||||||
|
// Mark down the team based spawn point.
|
||||||
|
ns_spawnpoints.put(pEntity->v.team,pEntity->v.origin);
|
||||||
|
}
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
||||||
|
{
|
||||||
|
// Mark down proper edicts (fixes INDEXENT() bug).
|
||||||
|
// Reset CPlayer classes (again?)
|
||||||
|
for(int i = 1; i <= gpGlobals->maxClients;i++)
|
||||||
|
{
|
||||||
|
player_edicts[i]=pEdictList + i;
|
||||||
|
CPlayer *player = GET_PLAYER_I(i);
|
||||||
|
player->edict=pEdictList + i;
|
||||||
|
player->index=i;
|
||||||
|
player->pev=&player->edict->v;
|
||||||
|
player->oldimpulse=0;
|
||||||
|
player->Reset();
|
||||||
|
player->connected=false;
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
void PlayerPreThink(edict_t *pEntity)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_E(pEntity);
|
||||||
|
player->PreThink();
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
void PlayerPreThink_Post(edict_t *pEntity)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_E(pEntity);
|
||||||
|
player->PreThink_Post();
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
void PlayerPostThink_Post(edict_t *pEntity)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_E(pEntity);
|
||||||
|
player->PostThink_Post();
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
|
||||||
|
{
|
||||||
|
if (gmsgShowMenu==0)
|
||||||
|
gmsgShowMenu=GET_USER_MSG_ID(&Plugin_info,"ShowMenu",NULL);
|
||||||
|
if (gmsgResetHUD==0)
|
||||||
|
gmsgResetHUD=GET_USER_MSG_ID(&Plugin_info,"ResetHUD",NULL);
|
||||||
|
if (msg_dest == MSG_ALL || msg_dest == MSG_BROADCAST)
|
||||||
|
hooked_dest = 0;
|
||||||
|
else
|
||||||
|
hooked_dest = ENTINDEX(ed);
|
||||||
|
hooked_msg = msg_type;
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
void MessageEnd_Post(void)
|
||||||
|
{
|
||||||
|
if (hooked_msg == gmsgResetHUD && hooked_dest != 0)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_I(hooked_dest);
|
||||||
|
if (!player->connected && player->bot)
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
if (player->menucmd.inmenu == true && player->menucmd.time > gpGlobals->time)
|
||||||
|
{
|
||||||
|
// Reset the hold time, or the menu display and menu keys will become terribly out of sync.
|
||||||
|
player->menuhudtext.holdTime=player->menucmd.time - gpGlobals->time;
|
||||||
|
HudMessage(/* 0 */ hooked_dest,player->menuhudtext,player->menucmd.text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Parse log messages here for any desired information (structure_built, etc.)
|
||||||
|
// The following logs are needed:
|
||||||
|
// name<CID><AUTHID><TEAM> triggered "structure_built" (type "type") -- client_built
|
||||||
|
// name<CID><AUTHID><TEAM> changed role to "class" -- client_changeclass
|
||||||
|
void AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...)
|
||||||
|
{
|
||||||
|
if (atype != at_logged || iscombat)
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
va_list LogArg;
|
||||||
|
char *sz, *message;
|
||||||
|
const char *b;
|
||||||
|
char szParm[5][128];
|
||||||
|
int argc,len;
|
||||||
|
va_start(LogArg, szFmt);
|
||||||
|
sz = va_arg(LogArg, char *);
|
||||||
|
va_end(LogArg);
|
||||||
|
message = sz;
|
||||||
|
b=message;
|
||||||
|
argc=0;
|
||||||
|
// Parse the damn message
|
||||||
|
while (*b && *b!='\0' && argc<5)
|
||||||
|
{
|
||||||
|
|
||||||
|
len=0;
|
||||||
|
if (*b == '"')
|
||||||
|
{
|
||||||
|
b++; // Skip over the "
|
||||||
|
while (*b && *b != '"' && len < 127)
|
||||||
|
{
|
||||||
|
szParm[argc][len]=*b;
|
||||||
|
b++;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
//*szParm='\0';
|
||||||
|
szParm[argc][len]='\0';
|
||||||
|
if (*b && *b == '"' && *b+1 != '\0' && *b+2 != '\0')
|
||||||
|
{
|
||||||
|
b+=2;
|
||||||
|
argc++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
argc++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (*b == '(')
|
||||||
|
{
|
||||||
|
b++; // Skip over the (
|
||||||
|
while (*b && *b != ')' && len < 127)
|
||||||
|
{
|
||||||
|
szParm[argc][len]=*b;
|
||||||
|
b++;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
szParm[argc][len]='\0';
|
||||||
|
if (*b && *b == ')' && *b+1 != '\0' && *b+2 != '\0')
|
||||||
|
{
|
||||||
|
b+=2;
|
||||||
|
argc++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
argc++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (*b && *b != '"' && *b != '(' && len < 127)
|
||||||
|
{
|
||||||
|
szParm[argc][len]=*b;
|
||||||
|
b++;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
szParm[argc][len]='\0';
|
||||||
|
if (*b != '"' && *b != '(' && *b != '\0' && *b+1 != '\0' && *b+2 != '\0')
|
||||||
|
{
|
||||||
|
b+=2;
|
||||||
|
argc++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
argc++;
|
||||||
|
if (*b == '\0')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (argc == 3) // changed role to = 3 long
|
||||||
|
{
|
||||||
|
if (FStrEq((const char *)szParm[1],"changed role to "))
|
||||||
|
{
|
||||||
|
int index=LogToIndex(szParm[0]);
|
||||||
|
if (!index)
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
CPlayer *player = GET_PLAYER_I(index);
|
||||||
|
int iImpulse=0;
|
||||||
|
int iClass=1;
|
||||||
|
if (INDEXENT2(index)->v.team != 0)
|
||||||
|
{
|
||||||
|
if (FStrEq((const char *)szParm[2],"gestate"))
|
||||||
|
{
|
||||||
|
iImpulse = player->oldpev.impulse;
|
||||||
|
}
|
||||||
|
if (FStrEq((const char *)szParm[2],"none"))
|
||||||
|
iClass=0;
|
||||||
|
if (iClass > 0)
|
||||||
|
{
|
||||||
|
ns2amx_changeclass.execute(index,player->oldpev.iuser3,player->pev->iuser3,iImpulse);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else */
|
||||||
|
if (argc == 4) // structure_built / structure_destroyed are 4 long
|
||||||
|
{
|
||||||
|
//"NAME<CID><AUTH><TEAM>" triggered "structure_built" (type "TYPE")
|
||||||
|
if (FStrEq((const char *)szParm[2],"structure_built"))
|
||||||
|
{
|
||||||
|
int index=LogToIndex(szParm[0]);
|
||||||
|
if (!index)
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
CPlayer *player = GET_PLAYER_I(index);
|
||||||
|
|
||||||
|
int iForward=0;
|
||||||
|
int iType=player->pev->impulse;
|
||||||
|
if (FStrEq((const char *)szParm[3],"type \"team_hive\""))
|
||||||
|
{
|
||||||
|
iForward=2;
|
||||||
|
iCreateEntityIndex=Find_Building_Hive();
|
||||||
|
}
|
||||||
|
else if (FStrEq((const char *)szParm[3],"type \"offensechamber\""))
|
||||||
|
{
|
||||||
|
iForward=2;
|
||||||
|
}
|
||||||
|
else if (FStrEq((const char *)szParm[3],"type \"movementchamber\""))
|
||||||
|
{
|
||||||
|
iForward=2;
|
||||||
|
}
|
||||||
|
else if (FStrEq((const char *)szParm[3],"type \"sensorychamber\""))
|
||||||
|
{
|
||||||
|
iForward=2;
|
||||||
|
}
|
||||||
|
else if (FStrEq((const char *)szParm[3],"type \"defensechamber\""))
|
||||||
|
{
|
||||||
|
iForward=2;
|
||||||
|
}
|
||||||
|
else if (FStrEq((const char *)szParm[3],"type \"alienresourcetower\""))
|
||||||
|
{
|
||||||
|
iForward=2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iForward = 1;
|
||||||
|
}
|
||||||
|
// ns2amx_built.execute(index,iCreateEntityIndex,iForward,iType);
|
||||||
|
MF_ExecuteForward(BuiltForward, index, iCreateEntityIndex, iForward, iType);
|
||||||
|
iCreateEntityIndex=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
// We hook newly created entities here.
|
||||||
|
// This is where we check for client_built created entities.
|
||||||
|
edict_t* CreateNamedEntity(int className)
|
||||||
|
{
|
||||||
|
if (iscombat)
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED,0);
|
||||||
|
edict_t *pEntity;
|
||||||
|
// Incase another plugin supercedes/overrides, use their returned value here.
|
||||||
|
// (Untested).
|
||||||
|
if (gpMetaGlobals->status >= MRES_OVERRIDE)
|
||||||
|
{
|
||||||
|
pEntity=META_RESULT_OVERRIDE_RET(edict_t *);
|
||||||
|
iCreateEntityIndex=ENTINDEX(pEntity);
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEntity=CREATE_NAMED_ENTITY(className);
|
||||||
|
if (!FNullEnt(pEntity))
|
||||||
|
{
|
||||||
|
iCreateEntityIndex=ENTINDEX(pEntity);
|
||||||
|
RETURN_META_VALUE(MRES_SUPERCEDE,pEntity);
|
||||||
|
}
|
||||||
|
RETURN_META_VALUE(MRES_SUPERCEDE,pEntity);
|
||||||
|
}
|
||||||
|
RETURN_META_VALUE(MRES_IGNORED,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map is changing/server is shutting down.
|
||||||
|
// We do all cleanup routines here, since, as noted in metamod's dllapi
|
||||||
|
// ServerDeactivate is the very last function called before the server loads up a new map.
|
||||||
|
void ServerDeactivate(void)
|
||||||
|
{
|
||||||
|
for (int i=1;i<=gpGlobals->maxClients;i++)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_I(i);
|
||||||
|
if (player->connected)
|
||||||
|
player->Disconnect();
|
||||||
|
}
|
||||||
|
ns_spawnpoints.clear();
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset player data here..
|
||||||
|
qboolean ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ])
|
||||||
|
{
|
||||||
|
// Client's connecting. Freshen up his save data, and mark him as being connected.
|
||||||
|
CPlayer *player = GET_PLAYER_E(pEntity);
|
||||||
|
player->Connect();
|
||||||
|
RETURN_META_VALUE(MRES_HANDLED,0);
|
||||||
|
}
|
||||||
|
void ClientDisconnect(edict_t *pEntity)
|
||||||
|
{
|
||||||
|
// Client is disconnecting, clear all his saved information.
|
||||||
|
CPlayer *player = GET_PLAYER_E(pEntity);
|
||||||
|
player->Disconnect();
|
||||||
|
RETURN_META(MRES_HANDLED);
|
||||||
|
}
|
460
dlls/ns/ns/moduleconfig.h
Executable file
460
dlls/ns/ns/moduleconfig.h
Executable file
|
@ -0,0 +1,460 @@
|
||||||
|
// Configuration
|
||||||
|
#ifndef __MODULECONFIG_H__
|
||||||
|
#define __MODULECONFIG_H__
|
||||||
|
|
||||||
|
// Module info
|
||||||
|
#define MODULE_NAME "NS"
|
||||||
|
#define MODULE_VERSION "0.20"
|
||||||
|
#define MODULE_AUTHOR "Steve Dudenhoeffer"
|
||||||
|
#define MODULE_URL "http://www.amxmodx.org/"
|
||||||
|
#define MODULE_LOGTAG "NS"
|
||||||
|
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||||
|
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||||
|
|
||||||
|
#ifdef __DATE__
|
||||||
|
#define MODULE_DATE __DATE__
|
||||||
|
#else // __DATE__
|
||||||
|
#define MODULE_DATE "Unknown"
|
||||||
|
#endif // __DATE__
|
||||||
|
|
||||||
|
// metamod plugin?
|
||||||
|
#define USE_METAMOD
|
||||||
|
|
||||||
|
// - AMXX Init functions
|
||||||
|
// Also consider using FN_META_*
|
||||||
|
// AMXX query
|
||||||
|
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||||
|
// AMXX attach
|
||||||
|
// Do native functions init here (MF_AddNatives)
|
||||||
|
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||||
|
// AMXX dettach
|
||||||
|
//#define FN_AMXX_DETTACH OnAmxxDettach
|
||||||
|
// All plugins loaded
|
||||||
|
// Do forward functions init here (MF_RegisterForward)
|
||||||
|
#define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||||
|
|
||||||
|
/**** METAMOD ****/
|
||||||
|
// If your module doesn't use metamod, you may close the file now :)
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
// ----
|
||||||
|
// Hook Functions
|
||||||
|
// Uncomment these to be called
|
||||||
|
// You can also change the function name
|
||||||
|
|
||||||
|
// - Metamod init functions
|
||||||
|
// Also consider using FN_AMXX_*
|
||||||
|
// Meta query
|
||||||
|
//#define FN_META_QUERY OnMetaQuery
|
||||||
|
// Meta attach
|
||||||
|
//#define FN_META_ATTACH OnMetaAttach
|
||||||
|
// Meta dettach
|
||||||
|
//#define FN_META_DETTACH OnMetaDettach
|
||||||
|
|
||||||
|
// (wd) are Will Day's notes
|
||||||
|
// - GetEntityAPI2 functions
|
||||||
|
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||||
|
#define FN_DispatchSpawn Spawn /* pfnSpawn() */
|
||||||
|
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||||
|
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||||
|
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||||
|
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||||
|
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||||
|
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||||
|
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||||
|
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||||
|
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||||
|
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||||
|
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||||
|
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||||
|
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||||
|
#define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||||
|
#define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||||
|
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||||
|
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||||
|
#define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||||
|
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||||
|
#define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||||
|
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||||
|
#define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||||
|
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||||
|
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||||
|
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||||
|
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||||
|
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||||
|
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||||
|
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||||
|
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||||
|
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||||
|
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||||
|
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||||
|
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||||
|
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||||
|
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||||
|
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||||
|
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||||
|
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||||
|
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||||
|
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||||
|
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||||
|
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||||
|
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||||
|
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||||
|
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||||
|
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||||
|
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||||
|
|
||||||
|
// - GetEntityAPI2_Post functions
|
||||||
|
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||||
|
// #define FN_DispatchSpawn_Post SpawnPost
|
||||||
|
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||||
|
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||||
|
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||||
|
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||||
|
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||||
|
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||||
|
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||||
|
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||||
|
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||||
|
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||||
|
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||||
|
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||||
|
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||||
|
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||||
|
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||||
|
// #define FN_ClientKill_Post ClientKill_Post
|
||||||
|
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||||
|
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||||
|
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||||
|
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||||
|
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||||
|
#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||||
|
#define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||||
|
// #define FN_StartFrame_Post StartFrame_Post
|
||||||
|
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||||
|
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||||
|
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||||
|
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||||
|
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||||
|
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||||
|
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||||
|
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||||
|
// #define FN_PM_Move_Post PM_Move_Post
|
||||||
|
// #define FN_PM_Init_Post PM_Init_Post
|
||||||
|
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||||
|
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||||
|
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||||
|
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||||
|
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||||
|
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||||
|
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||||
|
// #define FN_CmdStart_Post CmdStart_Post
|
||||||
|
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||||
|
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||||
|
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||||
|
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||||
|
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||||
|
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||||
|
|
||||||
|
// - GetEngineAPI functions
|
||||||
|
// #define FN_PrecacheModel PrecacheModel
|
||||||
|
// #define FN_PrecacheSound PrecacheSound
|
||||||
|
// #define FN_SetModel SetModel
|
||||||
|
// #define FN_ModelIndex ModelIndex
|
||||||
|
// #define FN_ModelFrames ModelFrames
|
||||||
|
// #define FN_SetSize SetSize
|
||||||
|
// #define FN_ChangeLevel ChangeLevel
|
||||||
|
// #define FN_GetSpawnParms GetSpawnParms
|
||||||
|
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||||
|
// #define FN_VecToYaw VecToYaw
|
||||||
|
// #define FN_VecToAngles VecToAngles
|
||||||
|
// #define FN_MoveToOrigin MoveToOrigin
|
||||||
|
// #define FN_ChangeYaw ChangeYaw
|
||||||
|
// #define FN_ChangePitch ChangePitch
|
||||||
|
// #define FN_FindEntityByString FindEntityByString
|
||||||
|
// #define FN_GetEntityIllum GetEntityIllum
|
||||||
|
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||||
|
// #define FN_FindClientInPVS FindClientInPVS
|
||||||
|
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||||
|
// #define FN_MakeVectors MakeVectors
|
||||||
|
// #define FN_AngleVectors AngleVectors
|
||||||
|
// #define FN_CreateEntity CreateEntity
|
||||||
|
// #define FN_RemoveEntity RemoveEntity
|
||||||
|
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||||
|
// #define FN_MakeStatic MakeStatic
|
||||||
|
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||||
|
// #define FN_DropToFloor DropToFloor
|
||||||
|
// #define FN_WalkMove WalkMove
|
||||||
|
// #define FN_SetOrigin SetOrigin
|
||||||
|
// #define FN_EmitSound EmitSound
|
||||||
|
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||||
|
// #define FN_TraceLine TraceLine
|
||||||
|
// #define FN_TraceToss TraceToss
|
||||||
|
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||||
|
// #define FN_TraceHull TraceHull
|
||||||
|
// #define FN_TraceModel TraceModel
|
||||||
|
// #define FN_TraceTexture TraceTexture
|
||||||
|
// #define FN_TraceSphere TraceSphere
|
||||||
|
// #define FN_GetAimVector GetAimVector
|
||||||
|
// #define FN_ServerCommand ServerCommand
|
||||||
|
// #define FN_ServerExecute ServerExecute
|
||||||
|
// #define FN_engClientCommand engClientCommand
|
||||||
|
// #define FN_ParticleEffect ParticleEffect
|
||||||
|
// #define FN_LightStyle LightStyle
|
||||||
|
// #define FN_DecalIndex DecalIndex
|
||||||
|
// #define FN_PointContents PointContents
|
||||||
|
#define FN_MessageBegin MessageBegin
|
||||||
|
// #define FN_MessageEnd MessageEnd
|
||||||
|
// #define FN_WriteByte WriteByte
|
||||||
|
// #define FN_WriteChar WriteChar
|
||||||
|
// #define FN_WriteShort WriteShort
|
||||||
|
// #define FN_WriteLong WriteLong
|
||||||
|
// #define FN_WriteAngle WriteAngle
|
||||||
|
// #define FN_WriteCoord WriteCoord
|
||||||
|
// #define FN_WriteString WriteString
|
||||||
|
// #define FN_WriteEntity WriteEntity
|
||||||
|
// #define FN_CVarRegister CVarRegister
|
||||||
|
// #define FN_CVarGetFloat CVarGetFloat
|
||||||
|
// #define FN_CVarGetString CVarGetString
|
||||||
|
// #define FN_CVarSetFloat CVarSetFloat
|
||||||
|
// #define FN_CVarSetString CVarSetString
|
||||||
|
// #define FN_AlertMessage AlertMessage
|
||||||
|
// #define FN_EngineFprintf EngineFprintf
|
||||||
|
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||||
|
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||||
|
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||||
|
// #define FN_SzFromIndex SzFromIndex
|
||||||
|
// #define FN_AllocString AllocString
|
||||||
|
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||||
|
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||||
|
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||||
|
// #define FN_IndexOfEdict IndexOfEdict
|
||||||
|
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||||
|
// #define FN_FindEntityByVars FindEntityByVars
|
||||||
|
// #define FN_GetModelPtr GetModelPtr
|
||||||
|
// #define FN_RegUserMsg RegUserMsg
|
||||||
|
// #define FN_AnimationAutomove AnimationAutomove
|
||||||
|
// #define FN_GetBonePosition GetBonePosition
|
||||||
|
// #define FN_FunctionFromName FunctionFromName
|
||||||
|
// #define FN_NameForFunction NameForFunction
|
||||||
|
// #define FN_ClientPrintf ClientPrintf
|
||||||
|
// #define FN_ServerPrint ServerPrint
|
||||||
|
// #define FN_Cmd_Args Cmd_Args
|
||||||
|
// #define FN_Cmd_Argv Cmd_Argv
|
||||||
|
// #define FN_Cmd_Argc Cmd_Argc
|
||||||
|
// #define FN_GetAttachment GetAttachment
|
||||||
|
// #define FN_CRC32_Init CRC32_Init
|
||||||
|
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||||
|
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||||
|
// #define FN_CRC32_Final CRC32_Final
|
||||||
|
// #define FN_RandomLong RandomLong
|
||||||
|
// #define FN_RandomFloat RandomFloat
|
||||||
|
// #define FN_SetView SetView
|
||||||
|
// #define FN_Time Time
|
||||||
|
// #define FN_CrosshairAngle CrosshairAngle
|
||||||
|
// #define FN_LoadFileForMe LoadFileForMe
|
||||||
|
// #define FN_FreeFile FreeFile
|
||||||
|
// #define FN_EndSection EndSection
|
||||||
|
// #define FN_CompareFileTime CompareFileTime
|
||||||
|
// #define FN_GetGameDir GetGameDir
|
||||||
|
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||||
|
// #define FN_FadeClientVolume FadeClientVolume
|
||||||
|
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||||
|
// #define FN_CreateFakeClient CreateFakeClient
|
||||||
|
// #define FN_RunPlayerMove RunPlayerMove
|
||||||
|
// #define FN_NumberOfEntities NumberOfEntities
|
||||||
|
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||||
|
// #define FN_InfoKeyValue InfoKeyValue
|
||||||
|
// #define FN_SetKeyValue SetKeyValue
|
||||||
|
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||||
|
// #define FN_IsMapValid IsMapValid
|
||||||
|
// #define FN_StaticDecal StaticDecal
|
||||||
|
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||||
|
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||||
|
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||||
|
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||||
|
// #define FN_CVarGetPointer CVarGetPointer
|
||||||
|
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||||
|
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||||
|
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||||
|
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||||
|
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||||
|
// #define FN_PrecacheEvent PrecacheEvent
|
||||||
|
// #define FN_PlaybackEvent PlaybackEvent
|
||||||
|
// #define FN_SetFatPVS SetFatPVS
|
||||||
|
// #define FN_SetFatPAS SetFatPAS
|
||||||
|
// #define FN_CheckVisibility CheckVisibility
|
||||||
|
// #define FN_DeltaSetField DeltaSetField
|
||||||
|
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||||
|
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||||
|
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||||
|
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||||
|
// #define FN_DeltaFindField DeltaFindField
|
||||||
|
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||||
|
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||||
|
// #define FN_SetGroupMask SetGroupMask
|
||||||
|
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||||
|
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||||
|
// #define FN_ForceUnmodified ForceUnmodified
|
||||||
|
// #define FN_GetPlayerStats GetPlayerStats
|
||||||
|
// #define FN_AddServerCommand AddServerCommand
|
||||||
|
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||||
|
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||||
|
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||||
|
|
||||||
|
// - GetEngineAPI_Post functions
|
||||||
|
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||||
|
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||||
|
// #define FN_SetModel_Post SetModel_Post
|
||||||
|
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||||
|
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||||
|
// #define FN_SetSize_Post SetSize_Post
|
||||||
|
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||||
|
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||||
|
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||||
|
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||||
|
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||||
|
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||||
|
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||||
|
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||||
|
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||||
|
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||||
|
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||||
|
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||||
|
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||||
|
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||||
|
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||||
|
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||||
|
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||||
|
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||||
|
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||||
|
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||||
|
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||||
|
// #define FN_WalkMove_Post WalkMove_Post
|
||||||
|
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||||
|
// #define FN_EmitSound_Post EmitSound_Post
|
||||||
|
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||||
|
// #define FN_TraceLine_Post TraceLine_Post
|
||||||
|
// #define FN_TraceToss_Post TraceToss_Post
|
||||||
|
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||||
|
// #define FN_TraceHull_Post TraceHull_Post
|
||||||
|
// #define FN_TraceModel_Post TraceModel_Post
|
||||||
|
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||||
|
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||||
|
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||||
|
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||||
|
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||||
|
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||||
|
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||||
|
// #define FN_LightStyle_Post LightStyle_Post
|
||||||
|
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||||
|
// #define FN_PointContents_Post PointContents_Post
|
||||||
|
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||||
|
#define FN_MessageEnd_Post MessageEnd_Post
|
||||||
|
// #define FN_WriteByte_Post WriteByte_Post
|
||||||
|
// #define FN_WriteChar_Post WriteChar_Post
|
||||||
|
// #define FN_WriteShort_Post WriteShort_Post
|
||||||
|
// #define FN_WriteLong_Post WriteLong_Post
|
||||||
|
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||||
|
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||||
|
// #define FN_WriteString_Post WriteString_Post
|
||||||
|
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||||
|
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||||
|
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||||
|
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||||
|
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||||
|
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||||
|
#define FN_AlertMessage_Post AlertMessage_Post
|
||||||
|
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||||
|
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||||
|
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||||
|
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||||
|
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||||
|
// #define FN_AllocString_Post AllocString_Post
|
||||||
|
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||||
|
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||||
|
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||||
|
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||||
|
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||||
|
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||||
|
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||||
|
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||||
|
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||||
|
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||||
|
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||||
|
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||||
|
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||||
|
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||||
|
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||||
|
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||||
|
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||||
|
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||||
|
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||||
|
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||||
|
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||||
|
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||||
|
// #define FN_RandomLong_Post RandomLong_Post
|
||||||
|
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||||
|
// #define FN_SetView_Post SetView_Post
|
||||||
|
// #define FN_Time_Post Time_Post
|
||||||
|
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||||
|
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||||
|
// #define FN_FreeFile_Post FreeFile_Post
|
||||||
|
// #define FN_EndSection_Post EndSection_Post
|
||||||
|
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||||
|
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||||
|
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||||
|
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||||
|
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||||
|
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||||
|
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||||
|
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||||
|
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||||
|
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||||
|
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||||
|
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||||
|
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||||
|
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||||
|
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||||
|
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||||
|
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||||
|
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||||
|
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||||
|
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||||
|
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||||
|
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||||
|
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||||
|
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||||
|
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||||
|
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||||
|
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||||
|
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||||
|
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||||
|
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||||
|
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||||
|
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||||
|
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||||
|
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||||
|
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||||
|
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||||
|
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||||
|
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||||
|
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||||
|
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||||
|
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||||
|
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||||
|
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||||
|
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||||
|
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||||
|
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||||
|
|
||||||
|
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||||
|
// #define FN_GameShutdown GameShutdown
|
||||||
|
// #define FN_ShouldCollide ShouldCollide
|
||||||
|
|
||||||
|
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||||
|
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||||
|
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||||
|
|
||||||
|
|
||||||
|
#endif // USE_METAMOD
|
||||||
|
#endif // __MODULECONFIG_H__
|
40
dlls/ns/ns/ns.h
Executable file
40
dlls/ns/ns/ns.h
Executable file
|
@ -0,0 +1,40 @@
|
||||||
|
#ifndef NS_H
|
||||||
|
#define NS_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <extdll.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "amxxmodule.h"
|
||||||
|
#include "ns_const.h"
|
||||||
|
#include "CPlayer.h"
|
||||||
|
#include "CSpawn.h"
|
||||||
|
#include "CCallList.h"
|
||||||
|
#include "utilfunctions.h"
|
||||||
|
|
||||||
|
extern CSpawn ns_spawnpoints;
|
||||||
|
|
||||||
|
|
||||||
|
extern BOOL iscombat;
|
||||||
|
extern CPlayer g_player[33];
|
||||||
|
extern edict_t *player_edicts[33]; // Stupid INDEXENT() bug.
|
||||||
|
|
||||||
|
extern int gmsgHudText2;
|
||||||
|
|
||||||
|
|
||||||
|
extern int gmsgShowMenu;
|
||||||
|
|
||||||
|
extern AMX_NATIVE_INFO ns_misc_natives[];
|
||||||
|
extern AMX_NATIVE_INFO ns_menu_natives[];
|
||||||
|
extern AMX_NATIVE_INFO ns_pdata_natives[];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
extern int ChangeclassForward;
|
||||||
|
extern int BuiltForward;
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // NS_H
|
21
dlls/ns/ns/ns.sln
Executable file
21
dlls/ns/ns/ns.sln
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ns", "ns.vcproj", "{97ABBCAF-5C0E-4103-A11F-3D26032C6377}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfiguration) = preSolution
|
||||||
|
Debug = Debug
|
||||||
|
Release = Release
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfiguration) = postSolution
|
||||||
|
{97ABBCAF-5C0E-4103-A11F-3D26032C6377}.Debug.ActiveCfg = Release|Win32
|
||||||
|
{97ABBCAF-5C0E-4103-A11F-3D26032C6377}.Debug.Build.0 = Release|Win32
|
||||||
|
{97ABBCAF-5C0E-4103-A11F-3D26032C6377}.Release.ActiveCfg = Release|Win32
|
||||||
|
{97ABBCAF-5C0E-4103-A11F-3D26032C6377}.Release.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
BIN
dlls/ns/ns/ns.suo
Executable file
BIN
dlls/ns/ns/ns.suo
Executable file
Binary file not shown.
231
dlls/ns/ns/ns.vcproj
Executable file
231
dlls/ns/ns/ns.vcproj
Executable file
|
@ -0,0 +1,231 @@
|
||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="7.10"
|
||||||
|
Name="ns"
|
||||||
|
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=""c:\Documents and Settings\Steve\My Documents\include\metamod";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\common";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\engine";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\dlls";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\pm_shared""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;mm_ns2amx_EXPORTS"
|
||||||
|
StringPooling="TRUE"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
EnableFunctionLevelLinking="TRUE"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderFile=".\Release/mm_ns2amx.pch"
|
||||||
|
AssemblerListingLocation=".\Release/"
|
||||||
|
ObjectFile=".\Release/"
|
||||||
|
ProgramDataBaseFileName=".\Release/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="./Release/mm_ns2amx.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
ModuleDefinitionFile=".\plugin_exports.def"
|
||||||
|
ProgramDatabaseFile=".\Release/mm_ns2amx.pdb"
|
||||||
|
ImportLibrary=".\Release/mm_ns2amx.lib"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\Release/mm_ns2amx.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"
|
||||||
|
AdditionalOptions="/I "
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""c:\Documents and Settings\Steve\My Documents\include\metamod";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\common";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\engine";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\dlls";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\pm_shared""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;mm_ns2amx_EXPORTS"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
UsePrecompiledHeader="2"
|
||||||
|
PrecompiledHeaderFile=".\Debug/mm_ns2amx.pch"
|
||||||
|
AssemblerListingLocation=".\Debug/"
|
||||||
|
ObjectFile=".\Debug/"
|
||||||
|
ProgramDataBaseFileName=".\Debug/"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="c:\Sierra\Half-Life\ns\addons\mm_ns2amx.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
ModuleDefinitionFile=".\plugin_exports.def"
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile=".\Debug/mm_ns2amx.pdb"
|
||||||
|
ImportLibrary=".\Debug/mm_ns2amx.lib"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
MkTypLibCompatible="TRUE"
|
||||||
|
SuppressStartupBanner="TRUE"
|
||||||
|
TargetEnvironment="1"
|
||||||
|
TypeLibraryName=".\Debug/mm_ns2amx.tlb"
|
||||||
|
HeaderFileName=""/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||||
|
<File
|
||||||
|
RelativePath=".\amxxmodule.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\CPlayer.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\CSpawn.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="hookedfunctions.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;mm_ns2amx_EXPORTS;$(NoInherit)"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Debug|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;mm_ns2amx_EXPORTS;$(NoInherit)"
|
||||||
|
BasicRuntimeChecks="3"/>
|
||||||
|
</FileConfiguration>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\NMenu.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\NMisc.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\NPData.cpp">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl">
|
||||||
|
<File
|
||||||
|
RelativePath=".\amxxmodule.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\CPlayer.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\CSpawn.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\moduleconfig.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ns.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ns_const.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="plugin.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="utilfunctions.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Miscellaneous"
|
||||||
|
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||||
|
<File
|
||||||
|
RelativePath=".\include\ns.inc">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\include\ns_const.inc">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
277
dlls/ns/ns/ns_const.h
Executable file
277
dlls/ns/ns/ns_const.h
Executable file
|
@ -0,0 +1,277 @@
|
||||||
|
|
||||||
|
#ifndef NS_CONST_H
|
||||||
|
#define NS_CONST_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Offsets (used in NPData.cpp)
|
||||||
|
|
||||||
|
#define OFFSET_WIN_RESOURCES 400
|
||||||
|
#define OFFSET_LIN_RESOURCES 405
|
||||||
|
|
||||||
|
#define OFFSET_WIN_WEAPDMG 49
|
||||||
|
#define OFFSET_LIN_WEAPDMG 53
|
||||||
|
|
||||||
|
#define OFFSET_WIN_WEAPRANGE 48
|
||||||
|
#define OFFSET_LIN_WEAPRANGE 52
|
||||||
|
|
||||||
|
#define OFFSET_WIN_WEAPCLIP 41
|
||||||
|
#define OFFSET_LIN_WEAPCLIP 45
|
||||||
|
|
||||||
|
#define OFFSET_WIN_HIVE_TRAIT 67
|
||||||
|
#define OFFSET_LIN_HIVE_TRAIT 67
|
||||||
|
|
||||||
|
#define OFFSET_WIN_SCORE 1570
|
||||||
|
#define OFFSET_LIN_SCORE 1567
|
||||||
|
|
||||||
|
#define OFFSET_WIN_EXP 1557
|
||||||
|
#define OFFSET_LIN_EXP 1554
|
||||||
|
|
||||||
|
#define OFFSET_WIN_POINTS 1559
|
||||||
|
#define OFFSET_LIN_POINTS 1556
|
||||||
|
|
||||||
|
#define OFFSET_WIN_AMMO_LMG 230
|
||||||
|
#define OFFSET_LIN_AMMO_LMG 235
|
||||||
|
|
||||||
|
#define OFFSET_WIN_AMMO_PISTOL 231
|
||||||
|
#define OFFSET_LIN_AMMO_PISTOL 236
|
||||||
|
|
||||||
|
#define OFFSET_WIN_AMMO_SHOTGUN 232
|
||||||
|
#define OFFSET_LIN_AMMO_SHOTGUN 237
|
||||||
|
|
||||||
|
|
||||||
|
#define OFFSET_WIN_AMMO_HMG 233
|
||||||
|
#define OFFSET_LIN_AMMO_HMG 238
|
||||||
|
|
||||||
|
|
||||||
|
#define OFFSET_WIN_AMMO_GL 234
|
||||||
|
#define OFFSET_LIN_AMMO_GL 239
|
||||||
|
|
||||||
|
#define OFFSET_WIN_AMMO_HG 235
|
||||||
|
#define OFFSET_LIN_AMMO_HG 240
|
||||||
|
|
||||||
|
#define OFFSET_WIN_DEATHS 296
|
||||||
|
#define OFFSET_LIN_DEATHS 301
|
||||||
|
|
||||||
|
#define OFFSET_WIN_ICON 1572
|
||||||
|
#define OFFSET_LIN_ICON 1569
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MASK_NONE = 0,
|
||||||
|
MASK_SIGHTED = 1,
|
||||||
|
MASK_DETECTED = 2,
|
||||||
|
MASK_BUILDABLE = 4,
|
||||||
|
MASK_BASEBUILD0 = 8, // Base build slot #0
|
||||||
|
MASK_WEAPONS1 = 8, // Marine weapons 1
|
||||||
|
MASK_CARAPACE = 8, // Alien carapace
|
||||||
|
MASK_WEAPONS2 = 16, // Marines weapons 2
|
||||||
|
MASK_REGENERATION = 16, // Alien regeneration
|
||||||
|
MASK_BASEBUILD1 = 16, // Base build slot #1
|
||||||
|
MASK_WEAPONS3 = 32, // Marine weapons 3
|
||||||
|
MASK_REDEMPTION = 32, // Alien redemption
|
||||||
|
MASK_BASEBUILD2 = 32, // Base build slot #2
|
||||||
|
MASK_ARMOR1 = 64, // Marine armor 1
|
||||||
|
MASK_CELERITY = 64, // Alien celerity
|
||||||
|
MASK_BASEBUILD3 = 64, // Base build slot #3
|
||||||
|
MASK_ARMOR2 = 128, // Marine armor 2
|
||||||
|
MASK_ADRENALINE = 128, // Alien adrenaline
|
||||||
|
MASK_BASEBUILD4 = 128, // Base build slot #4
|
||||||
|
MASK_ARMOR3 = 256, // Marine armor 3
|
||||||
|
MASK_SILENCE = 256, // Alien silence
|
||||||
|
MASK_BASEBUILD5 = 256, // Base build slot #5
|
||||||
|
MASK_JETPACK = 512, // Marine jetpacks
|
||||||
|
MASK_CLOAKING = 512, // Alien cloaking
|
||||||
|
MASK_BASEBUILD6 = 512, // Base build slot #6
|
||||||
|
MASK_FOCUS = 1024, // Alien focus
|
||||||
|
MASK_MOTION = 1024, // Marine motion tracking
|
||||||
|
MASK_BASEBUILD7 = 1024, // Base build slot #7
|
||||||
|
MASK_SCENTOFFEAR = 2048, // Alien scent of fear
|
||||||
|
MASK_DEFENSE2 = 4096, // Defense level 2
|
||||||
|
MASK_DEFENSE3 = 8192, // Defense level 3
|
||||||
|
MASK_ELECTRICITY = 8192, // Electricy
|
||||||
|
MASK_MOVEMENT2 = 16384, // Movement level 2,
|
||||||
|
MASK_MOVEMENT3 = 32768, // Movement level 3
|
||||||
|
MASK_HEAVYARMOR = 32768, // Marine heavy armor
|
||||||
|
MASK_SENSORY2 = 65536, // Sensory level 2
|
||||||
|
MASK_SENSORY3 = 131072, // Sensory level 3
|
||||||
|
MASK_ALIEN_MOVEMENT = 262144, // Onos is charging
|
||||||
|
MASK_WALLSTICKING = 524288, // Flag for wall-sticking
|
||||||
|
MASK_PRIMALSCREAM = 1048576, // Alien is in range of active primal scream
|
||||||
|
MASK_UMBRA = 2097152, // In umbra
|
||||||
|
MASK_DIGESTING = 4194304, // When set on a visible player, player is digesting. When set on invisible player, player is being digested
|
||||||
|
MASK_RECYCLING = 8388608, // Building is recycling
|
||||||
|
MASK_TOPDOWN = 16777216, // Commander view
|
||||||
|
MASK_PLAYER_STUNNED = 33554432, // Player has been stunned by stomp
|
||||||
|
MASK_ENSNARED = 67108864, // Webbed
|
||||||
|
MASK_ALIEN_EMBRYO = 268435456, // Gestating
|
||||||
|
MASK_SELECTABLE = 536870912, // ???
|
||||||
|
MASK_PARASITED = 1073741824, // Parasite flag
|
||||||
|
MASK_SENSORY_NEARBY = 2147483648 // Sensory chamber in range
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
AVH_USER3_NONE = 0,
|
||||||
|
AVH_USER3_MARINE_PLAYER,
|
||||||
|
AVH_USER3_COMMANDER_PLAYER,
|
||||||
|
AVH_USER3_ALIEN_PLAYER1,
|
||||||
|
AVH_USER3_ALIEN_PLAYER2,
|
||||||
|
AVH_USER3_ALIEN_PLAYER3,
|
||||||
|
AVH_USER3_ALIEN_PLAYER4,
|
||||||
|
AVH_USER3_ALIEN_PLAYER5,
|
||||||
|
AVH_USER3_ALIEN_EMBRYO,
|
||||||
|
AVH_USER3_SPAWN_TEAMONE,
|
||||||
|
AVH_USER3_SPAWN_TEAMTWO,
|
||||||
|
AVH_USER3_PARTICLE_ON, // only valid for AvHParticleEntity: entindex as int in fuser1, template index stored in fuser2
|
||||||
|
AVH_USER3_PARTICLE_OFF, // only valid for AvHParticleEntity: particle system handle in fuser1
|
||||||
|
AVH_USER3_WELD, // float progress (0 - 100) stored in fuser1
|
||||||
|
AVH_USER3_ALPHA, // fuser1 indicates how much alpha this entity toggles to in commander mode, fuser2 for players
|
||||||
|
AVH_USER3_MARINEITEM, // Something a friendly marine can pick up
|
||||||
|
AVH_USER3_WAYPOINT,
|
||||||
|
AVH_USER3_HIVE,
|
||||||
|
AVH_USER3_NOBUILD,
|
||||||
|
AVH_USER3_USEABLE,
|
||||||
|
AVH_USER3_AUDIO_ON,
|
||||||
|
AVH_USER3_AUDIO_OFF,
|
||||||
|
AVH_USER3_FUNC_RESOURCE,
|
||||||
|
AVH_USER3_COMMANDER_STATION,
|
||||||
|
AVH_USER3_TURRET_FACTORY,
|
||||||
|
AVH_USER3_ARMORY,
|
||||||
|
AVH_USER3_ADVANCED_ARMORY,
|
||||||
|
AVH_USER3_ARMSLAB,
|
||||||
|
AVH_USER3_PROTOTYPE_LAB,
|
||||||
|
AVH_USER3_OBSERVATORY,
|
||||||
|
AVH_USER3_CHEMLAB,
|
||||||
|
AVH_USER3_MEDLAB,
|
||||||
|
AVH_USER3_NUKEPLANT,
|
||||||
|
AVH_USER3_TURRET,
|
||||||
|
AVH_USER3_SIEGETURRET,
|
||||||
|
AVH_USER3_RESTOWER,
|
||||||
|
AVH_USER3_PLACEHOLDER,
|
||||||
|
AVH_USER3_INFANTRYPORTAL,
|
||||||
|
AVH_USER3_NUKE,
|
||||||
|
AVH_USER3_BREAKABLE,
|
||||||
|
AVH_USER3_UMBRA,
|
||||||
|
AVH_USER3_PHASEGATE,
|
||||||
|
AVH_USER3_DEFENSE_CHAMBER,
|
||||||
|
AVH_USER3_MOVEMENT_CHAMBER,
|
||||||
|
AVH_USER3_OFFENSE_CHAMBER,
|
||||||
|
AVH_USER3_SENSORY_CHAMBER,
|
||||||
|
AVH_USER3_ALIENRESTOWER,
|
||||||
|
AVH_USER3_HEAVY,
|
||||||
|
AVH_USER3_JETPACK,
|
||||||
|
AVH_USER3_ADVANCED_TURRET_FACTORY,
|
||||||
|
AVH_USER3_SPAWN_READYROOM,
|
||||||
|
AVH_USER3_CLIENT_COMMAND,
|
||||||
|
AVH_USER3_FUNC_ILLUSIONARY,
|
||||||
|
AVH_USER3_MENU_BUILD,
|
||||||
|
AVH_USER3_MENU_BUILD_ADVANCED,
|
||||||
|
AVH_USER3_MENU_ASSIST,
|
||||||
|
AVH_USER3_MENU_EQUIP,
|
||||||
|
AVH_USER3_MINE,
|
||||||
|
AVH_USER3_MAX
|
||||||
|
} AvHUser3;
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
WEAPON_NONE = 0,
|
||||||
|
WEAPON_CLAWS,
|
||||||
|
WEAPON_SPIT,
|
||||||
|
WEAPON_SPORES,
|
||||||
|
WEAPON_SPIKE,
|
||||||
|
WEAPON_BITE,
|
||||||
|
WEAPON_BITE2,
|
||||||
|
WEAPON_SWIPE,
|
||||||
|
WEAPON_WEBSPINNER,
|
||||||
|
WEAPON_METABOLIZE,
|
||||||
|
WEAPON_PARASITE,
|
||||||
|
WEAPON_BLINK,
|
||||||
|
WEAPON_DIVINEWIND,
|
||||||
|
WEAPON_KNIFE,
|
||||||
|
WEAPON_PISTOL,
|
||||||
|
WEAPON_LMG,
|
||||||
|
WEAPON_SHOTGUN,
|
||||||
|
WEAPON_HMG,
|
||||||
|
WEAPON_WELDER,
|
||||||
|
WEAPON_MINE,
|
||||||
|
WEAPON_GRENADE_GUN,
|
||||||
|
WEAPON_LEAP,
|
||||||
|
WEAPON_CHARGE,
|
||||||
|
WEAPON_UMBRA,
|
||||||
|
WEAPON_PRIMALSCREAM,
|
||||||
|
WEAPON_BILEBOMB,
|
||||||
|
WEAPON_ACIDROCKET,
|
||||||
|
WEAPON_HEALINGSPRAY,
|
||||||
|
WEAPON_GRENADE,
|
||||||
|
WEAPON_STOMP,
|
||||||
|
WEAPON_DEVOUR,
|
||||||
|
WEAPON_MAX
|
||||||
|
};
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PLAYERCLASS_NONE = 0,
|
||||||
|
PLAYERCLASS_ALIVE_MARINE,
|
||||||
|
PLAYERCLASS_ALIVE_HEAVY_MARINE,
|
||||||
|
PLAYERCLASS_ALIVE_LEVEL1,
|
||||||
|
PLAYERCLASS_ALIVE_LEVEL2,
|
||||||
|
PLAYERCLASS_ALIVE_LEVEL3,
|
||||||
|
PLAYERCLASS_ALIVE_LEVEL4,
|
||||||
|
PLAYERCLASS_ALIVE_LEVEL5,
|
||||||
|
PLAYERCLASS_ALIVE_DIGESTING,
|
||||||
|
PLAYERCLASS_ALIVE_GESTATING,
|
||||||
|
PLAYERCLASS_DEAD_MARINE,
|
||||||
|
PLAYERCLASS_DEAD_ALIEN,
|
||||||
|
PLAYERCLASS_COMMANDER,
|
||||||
|
PLAYERCLASS_REINFORCING,
|
||||||
|
PLAYERCLASS_SPECTATOR
|
||||||
|
};
|
||||||
|
enum classes
|
||||||
|
{
|
||||||
|
CLASS_UNKNOWN = 0,
|
||||||
|
CLASS_SKULK,
|
||||||
|
CLASS_GORGE,
|
||||||
|
CLASS_LERK,
|
||||||
|
CLASS_FADE,
|
||||||
|
CLASS_ONOS,
|
||||||
|
CLASS_MARINE,
|
||||||
|
CLASS_JETPACK,
|
||||||
|
CLASS_HEAVY,
|
||||||
|
CLASS_COMMANDER,
|
||||||
|
CLASS_GESTATE,
|
||||||
|
CLASS_DEAD,
|
||||||
|
CLASS_NOTEAM
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define MENUDEFAULT_CHANNEL 10;
|
||||||
|
#define MENUDEFAULT_CHANNEL2 11;
|
||||||
|
#define MENUDEFAULT_EFFECT 0;
|
||||||
|
#define MENUDEFAULT_FADEINTIME 0.1;
|
||||||
|
#define MENUDEFAULT_FADEOUTTIME 0.1;
|
||||||
|
#define MENUDEFAULT_FXTIME 0.1;
|
||||||
|
#define MENUDEFAULT_RED1 255;
|
||||||
|
#define MENUDEFAULT_GREEN1 255;
|
||||||
|
#define MENUDEFAULT_BLUE1 255;
|
||||||
|
#define MENUDEFAULT_ALPHA1 255;
|
||||||
|
#define MENUDEFAULT_RED2 255;
|
||||||
|
#define MENUDEFAULT_GREEN2 255;
|
||||||
|
#define MENUDEFAULT_BLUE2 255;
|
||||||
|
#define MENUDEFAULT_ALPHA2 255;
|
||||||
|
#define MENUDEFAULT_X 0.2;
|
||||||
|
#define MENUDEFAULT_Y 0.3;
|
||||||
|
#define MENUDEFAULT_HOLDTIME 30.0;
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
2
dlls/ns/ns/plugin_exports.def
Executable file
2
dlls/ns/ns/plugin_exports.def
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
EXPORTS
|
||||||
|
GiveFnptrsToDll @1
|
161
dlls/ns/ns/res_plugin.rc
Executable file
161
dlls/ns/ns/res_plugin.rc
Executable file
|
@ -0,0 +1,161 @@
|
||||||
|
//Microsoft Developer Studio generated resource script.
|
||||||
|
//
|
||||||
|
|
||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Developer Studio generated include file.
|
||||||
|
// Used by res_plugin.rc
|
||||||
|
//
|
||||||
|
#define IDI_ICON1 102
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 105
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
#include "winver.h"
|
||||||
|
|
||||||
|
#ifndef VERS_PLUGIN_H
|
||||||
|
#define VERS_PLUGIN_H
|
||||||
|
|
||||||
|
#pragma message "If the next 2 lines say extdll.h and meta_api.h could not be found, don't worry about it"
|
||||||
|
#include "plugin.h"
|
||||||
|
|
||||||
|
#ifndef OPT_TYPE
|
||||||
|
# if defined(_MSC_VER) && defined(_DEBUG)
|
||||||
|
# define OPT_TYPE "msc debugging"
|
||||||
|
# elif defined(_MSC_VER) && defined(_NDEBUG)
|
||||||
|
# define OPT_TYPE "msc optimized"
|
||||||
|
# else
|
||||||
|
# define OPT_TYPE "default"
|
||||||
|
# endif /* _MSC_VER */
|
||||||
|
#endif /* not OPT_TYPE */
|
||||||
|
|
||||||
|
#define VDATE MY_DATE
|
||||||
|
#define VVERSION MY_VERSION
|
||||||
|
#define RC_VERS_DWORD MY_VERSION_DWORD // Version Windows DLL Resources in res_meta.rc
|
||||||
|
|
||||||
|
#define VNAME MY_NAME
|
||||||
|
#define VAUTHOR MY_AUTHOR
|
||||||
|
#define VURL MY_URL
|
||||||
|
#define VLOGTAG MY_LOGTAG
|
||||||
|
|
||||||
|
// Various strings for the Windows DLL Resources in res_plugin.rc
|
||||||
|
#define RC_COMMENTS MY_COMMENTS
|
||||||
|
#define RC_DESC MY_DESC
|
||||||
|
#define RC_FILENAME MY_FILENAME
|
||||||
|
#define RC_INTERNAL MY_INTERNAL
|
||||||
|
#define RC_COPYRIGHT MY_COPYRIGHT
|
||||||
|
|
||||||
|
#endif /* VERS_PLUGIN_H */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// English (U.S.) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
|
|
||||||
|
#ifndef _MAC
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Version
|
||||||
|
//
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION MY_VERS_DWORD
|
||||||
|
PRODUCTVERSION MY_VERS_DWORD
|
||||||
|
FILEFLAGSMASK 0x3fL
|
||||||
|
#ifdef _DEBUG
|
||||||
|
FILEFLAGS 0x1L
|
||||||
|
#else
|
||||||
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
|
FILEOS 0x4L
|
||||||
|
FILETYPE 0x2L
|
||||||
|
FILESUBTYPE 0x0L
|
||||||
|
BEGIN
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "040904b0"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Comments", RC_COMMENTS "\0"
|
||||||
|
VALUE "CompanyName", VAUTHOR "\0"
|
||||||
|
VALUE "FileDescription", RC_DESC "\0"
|
||||||
|
VALUE "FileVersion", VVERSION "\0"
|
||||||
|
VALUE "InternalName", RC_INTERNAL "\0"
|
||||||
|
VALUE "LegalCopyright", RC_COPYRIGHT "\0"
|
||||||
|
VALUE "LegalTrademarks", "\0"
|
||||||
|
VALUE "OriginalFilename", RC_FILENAME "\0"
|
||||||
|
VALUE "PrivateBuild", "\0"
|
||||||
|
VALUE "ProductName", VNAME "\0"
|
||||||
|
VALUE "ProductVersion", VVERSION "\0"
|
||||||
|
VALUE "SpecialBuild", "\0"
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x409, 1200
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // !_MAC
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"#include ""winver.h""\r\n"
|
||||||
|
"#include ""plugin.h""\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Icon
|
||||||
|
//
|
||||||
|
|
||||||
|
#endif // English (U.S.) resources
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
71
dlls/ns/ns/utilfunctions.h
Executable file
71
dlls/ns/ns/utilfunctions.h
Executable file
|
@ -0,0 +1,71 @@
|
||||||
|
//======================================================================
|
||||||
|
// Forward declarations for functions that deal directly with the engine
|
||||||
|
//======================================================================
|
||||||
|
#ifndef UTILFUNCTIONS_H
|
||||||
|
#define UTILFUNCTIONS_H
|
||||||
|
|
||||||
|
#include "CPlayer.h"
|
||||||
|
extern CPlayer g_player[33];
|
||||||
|
|
||||||
|
#define GET_PLAYER_E(x) (&g_player[ENTINDEX(x)]);
|
||||||
|
#define GET_PLAYER_I(x) (&g_player[x]);
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define FLOAT_TO_CELL(x) *(cell*)&x
|
||||||
|
#define CELL_TO_FLOAT(x) *(float*)&x
|
||||||
|
*/
|
||||||
|
#define FLOAT_TO_CELL amx_ftoc
|
||||||
|
#define CELL_TO_FLOAT amx_ctof
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define ABSOLUTE_VALUE_EASY(x) (((x) < 0) ? (-(x)) : (x)) //very useful for gpGlobals->time comparisons
|
||||||
|
#define GetEdictModel(edict) ( (g_engfuncs.pfnInfoKeyValue((*g_engfuncs.pfnGetInfoKeyBuffer)(edict), "model")) )
|
||||||
|
//#define INFO_KEY_VALUE(entity,keyname) (*g_engfuncs.pfnGetInfoKeyBuffer)(entity),keyname)
|
||||||
|
#define GetKeyValue(edict,key) ( (g_engfuncs.pfnInfoKeyValue((*g_engfuncs.pfnGetInfoKeyBuffer)(edict), key)) )
|
||||||
|
#define INFO_KEY_BUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
|
||||||
|
#define INFO_KEY_VALUE (*g_engfuncs.pfnInfoKeyValue)
|
||||||
|
|
||||||
|
|
||||||
|
//just declare extra helper functions you need here
|
||||||
|
edict_t *UTIL_FindEntityByString(edict_t *pentStart, const char *szKeyword, const char *szValue);
|
||||||
|
edict_t *UTIL_PlayerByIndexE( int playerIndex );
|
||||||
|
int LogToIndex(char logline[128]);
|
||||||
|
int Find_Building_Hive(void);
|
||||||
|
|
||||||
|
void GiveItem(edict_t *pEntity,char *szname);
|
||||||
|
|
||||||
|
void HudMessage(int index, const hudtextparms_t &textparms, const char *pMessage);
|
||||||
|
void ClearHudMessage(edict_t *pEntity, const hudtextparms_t &textparms, const char *pMessage);
|
||||||
|
void UTIL_EmptyMenu(edict_t *pEntity, int keys, int time);
|
||||||
|
void UTIL_FakeClientCmd(edict_t *pEntity, char *cmd);
|
||||||
|
|
||||||
|
inline edict_t* INDEXENT2( int iEdictNum )
|
||||||
|
{
|
||||||
|
if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients)
|
||||||
|
{
|
||||||
|
CPlayer *player = GET_PLAYER_I(iEdictNum);
|
||||||
|
return player->edict;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
inline BOOL isValidEntity(int x)
|
||||||
|
{
|
||||||
|
if (x < 0)
|
||||||
|
return FALSE;
|
||||||
|
if (x >= 0 || x <= gpGlobals->maxClients)
|
||||||
|
return TRUE;
|
||||||
|
if (x > gpGlobals->maxEntities)
|
||||||
|
return FALSE;
|
||||||
|
if (FNullEnt(x))
|
||||||
|
return FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#define CHECK_ENTITY(x) if (x != 0 && (FNullEnt(INDEXENT2(x)) || x < 0 || x > gpGlobals->maxEntities)) return 0;
|
||||||
|
#define CHECK_PARAMS(x) if (*params/sizeof(cell) < x) return 0;
|
||||||
|
|
||||||
|
|
||||||
|
#endif // UTILFUNCTIONS_H
|
Loading…
Reference in New Issue
Block a user