mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
TraceLine tweaks
This commit is contained in:
parent
9c24b9ae05
commit
8885714465
@ -18,7 +18,7 @@
|
|||||||
#define PD_SENTRY_OWNER 83 + LINUXOFFSET
|
#define PD_SENTRY_OWNER 83 + LINUXOFFSET
|
||||||
#define PD_TIMER_OWNER 932 + LINUXOFFSET
|
#define PD_TIMER_OWNER 932 + LINUXOFFSET
|
||||||
|
|
||||||
#define MAX_TRACE 14 // +1 // timer
|
#define MAX_TRACE 13
|
||||||
//#define NADE_OFFSET 24
|
//#define NADE_OFFSET 24
|
||||||
|
|
||||||
|
|
||||||
@ -99,9 +99,12 @@ struct weaponsVault {
|
|||||||
|
|
||||||
struct traceVault {
|
struct traceVault {
|
||||||
char * szName;
|
char * szName;
|
||||||
|
char * szTa;
|
||||||
int iId;
|
int iId;
|
||||||
int iAction;
|
int iAction;
|
||||||
float fDel;
|
float fDel;
|
||||||
|
int start;
|
||||||
|
int stop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,21 +33,19 @@
|
|||||||
#include "tfcx.h"
|
#include "tfcx.h"
|
||||||
|
|
||||||
traceVault traceData[] = {
|
traceVault traceData[] = {
|
||||||
{ "tf_gl_grenade", TFC_WPN_GL, ACT_NADE_PUT, 2.0 },
|
{ "timer","ti", TFC_WPN_TIMER,ACT_NADE_NONE, 2.0 , 0 , 2 },
|
||||||
{ "tf_gl_pipebomb", TFC_WPN_PL, ACT_NADE_PUT, 2.0 },
|
{ "caltrop","ca", TFC_WPN_CALTROP, ACT_NADE_SHOT,0.0 , 0 , 2 },
|
||||||
{ "tf_weapon_normalgrenade", TFC_WPN_NORMALGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 },
|
{ "tf_rpg_rocket","roc", TFC_WPN_RPG,ACT_NADE_PUT, 2.0 , 7 , 3 },
|
||||||
{ "tf_weapon_nailgrenade", TFC_WPN_NAILGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 },
|
{ "tf_gl_grenade","gl_g", TFC_WPN_GL, ACT_NADE_PUT, 2.0 , 3 , 4 },
|
||||||
{ "tf_weapon_mirvgrenade", TFC_WPN_MIRVGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 },
|
{ "tf_gl_pipebomb","gl_p", TFC_WPN_PL, ACT_NADE_PUT, 2.0 , 3 , 4 },
|
||||||
{ "tf_weapon_napalmgrenade", TFC_WPN_NAPALMGRENADE, ACT_NADE_SHOT, 0.0 },
|
{ "tf_weapon_gasgrenade","ga", TFC_WPN_GASGRENADE, ACT_NADE_SHOT, 0.0 , 10 , 2 },
|
||||||
{ "tf_weapon_gasgrenade", TFC_WPN_GASGRENADE, ACT_NADE_SHOT, 0.0 },
|
{ "tf_weapon_empgrenade","em", TFC_WPN_EMPGRENADE, ACT_NADE_SHOT, 0.0 , 10 , 2 },
|
||||||
{ "tf_weapon_empgrenade", TFC_WPN_EMPGRENADE, ACT_NADE_SHOT, 0.0 },
|
{ "tf_weapon_mirvbomblet","mirvb", TFC_WPN_MIRVGRENADE,ACT_NADE_PUT, 2.0 , 10 , 5 },
|
||||||
{ "tf_weapon_mirvbomblet", TFC_WPN_MIRVGRENADE,ACT_NADE_PUT, 2.0 },
|
{ "tf_weapon_nailgrenade","nai", TFC_WPN_NAILGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 , 10 , 3 },
|
||||||
{ "tf_rpg_rocket", TFC_WPN_RPG,ACT_NADE_PUT, 2.0 },
|
{ "tf_weapon_mirvgrenade","mirvg", TFC_WPN_MIRVGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 , 10 , 5 },
|
||||||
{ "caltrop", TFC_WPN_CALTROP, ACT_NADE_SHOT,0.0 },
|
{ "tf_weapon_napalmgrenade","nap", TFC_WPN_NAPALMGRENADE, ACT_NADE_SHOT, 0.0 , 10 , 3 },
|
||||||
{ "tf_weapon_concussiongrenade", TFC_WPN_CONCUSSIONGRENADE, ACT_NADE_NONE, 0.0 },
|
{ "tf_weapon_normalgrenade","no", TFC_WPN_NORMALGRENADE, ACT_NADE_SHOT|ACT_NADE_PUT, 2.0 , 10 , 2 },
|
||||||
|
{ "tf_weapon_concussiongrenade","co", TFC_WPN_CONCUSSIONGRENADE, ACT_NADE_NONE, 0.0 , 10 , 2 },
|
||||||
// { "timer", TFC_WPN_TIMER,ACT_NADE_NONE, 2.0 },
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther){
|
bool ignoreBots (edict_t *pEnt, edict_t *pOther){
|
||||||
@ -62,6 +60,16 @@ bool isModuleActive(){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool util_strncmp( const char *sz1, const char *sz2, int size){
|
||||||
|
int i = 0;
|
||||||
|
while( sz1[i] && i<=size){
|
||||||
|
if ( sz1[i] != sz2[i] )
|
||||||
|
return false;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
medikit,iSlot:-1,iId:3
|
medikit,iSlot:-1,iId:3
|
||||||
spanner,iSlot:2,iId:4
|
spanner,iSlot:2,iId:4
|
||||||
|
@ -137,7 +137,7 @@ void PlayerPreThink_Post( edict_t *pEntity ) {
|
|||||||
|
|
||||||
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time && pPlayer->ingame){
|
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time && pPlayer->ingame){
|
||||||
|
|
||||||
if ( !ignoreBots(pEntity) ){
|
if ( !ignoreBots(pEntity,NULL) ){
|
||||||
pPlayer->clearStats = 0.0f;
|
pPlayer->clearStats = 0.0f;
|
||||||
pPlayer->rank->updatePosition( &pPlayer->life );
|
pPlayer->rank->updatePosition( &pPlayer->life );
|
||||||
pPlayer->restartStats(false);
|
pPlayer->restartStats(false);
|
||||||
@ -290,8 +290,7 @@ void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *
|
|||||||
CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner);
|
CPlayer *pPlayer = GET_PLAYER_POINTER(e->v.owner);
|
||||||
|
|
||||||
for ( int i=0;i<MAX_TRACE;i++){
|
for ( int i=0;i<MAX_TRACE;i++){
|
||||||
if ( strcmp( traceData[i].szName,STRING(e->v.classname)) == 0 ){
|
if ( util_strncmp( traceData[i].szName,traceData[i].start ? STRING(e->v.classname)+traceData[i].start : STRING(e->v.classname) ,traceData[i].stop) ){
|
||||||
|
|
||||||
if ( traceData[i].iAction & ACT_NADE_SHOT ){
|
if ( traceData[i].iAction & ACT_NADE_SHOT ){
|
||||||
pPlayer->saveShot(traceData[i].iId);
|
pPlayer->saveShot(traceData[i].iId);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /def:".\tfcx.def" /out:"release/tfcx_amx.dll"
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"release/tfcx_amxx.dll"
|
||||||
# SUBTRACT LINK32 /pdb:none
|
# SUBTRACT LINK32 /pdb:none
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "tfcx - Win32 Debug"
|
!ELSEIF "$(CFG)" == "tfcx - Win32 Debug"
|
||||||
|
@ -103,6 +103,7 @@ void Client_ResetHUD(void*);
|
|||||||
|
|
||||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
bool ignoreBots (edict_t *pEnt, edict_t *pOther = NULL );
|
||||||
bool isModuleActive();
|
bool isModuleActive();
|
||||||
|
bool util_strncmp( const char *sz1, const char *sz2, int size);
|
||||||
|
|
||||||
#endif // TFCX_H
|
#endif // TFCX_H
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user