2004-06-30 13:01:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef CMISC_H
|
|
|
|
#define CMISC_H
|
|
|
|
|
|
|
|
#include "amxxmodule.h"
|
|
|
|
#include "CRank.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define CSW_HEGRENADE 4
|
|
|
|
#define CSW_SMOKEGRENADE 9
|
|
|
|
#define CSW_FLASHBANG 25
|
|
|
|
|
|
|
|
// *****************************************************
|
|
|
|
// class CPlayer
|
|
|
|
// *****************************************************
|
|
|
|
|
|
|
|
struct CPlayer {
|
|
|
|
edict_t* pEdict;
|
|
|
|
char ip[32];
|
|
|
|
int index;
|
|
|
|
int aiming;
|
|
|
|
int current;
|
|
|
|
bool bot;
|
|
|
|
float clearStats;
|
|
|
|
RankSystem::RankStats* rank;
|
|
|
|
|
|
|
|
struct PlayerWeapon : Stats {
|
|
|
|
const char* name;
|
|
|
|
int ammo;
|
|
|
|
int clip;
|
|
|
|
};
|
|
|
|
|
2004-08-05 11:56:33 +00:00
|
|
|
PlayerWeapon weapons[MAX_WEAPONS];
|
2004-06-30 13:01:07 +00:00
|
|
|
PlayerWeapon attackers[33];
|
|
|
|
PlayerWeapon victims[33];
|
2004-08-05 11:56:33 +00:00
|
|
|
Stats weaponsRnd[MAX_WEAPONS]; // DEC-Weapon (Round) stats
|
2004-06-30 13:01:07 +00:00
|
|
|
Stats life;
|
|
|
|
|
|
|
|
int teamId;
|
|
|
|
|
|
|
|
void Init( int pi, edict_t* pe );
|
|
|
|
void Connect(const char* ip );
|
|
|
|
void PutInServer();
|
|
|
|
void Disconnect();
|
|
|
|
void saveKill(CPlayer* pVictim, int weapon, int hs, int tk);
|
|
|
|
void saveHit(CPlayer* pVictim, int weapon, int damage, int aiming);
|
|
|
|
void saveShot(int weapon);
|
|
|
|
|
|
|
|
void saveBPlant();
|
|
|
|
void saveBExplode();
|
|
|
|
void saveBDefusing();
|
|
|
|
void saveBDefused();
|
|
|
|
|
|
|
|
void restartStats(bool all = true);
|
|
|
|
inline bool IsBot(){
|
|
|
|
const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict);
|
|
|
|
return ( auth && !strcmp( auth , "BOT" ) );
|
|
|
|
}
|
|
|
|
inline bool IsAlive(){
|
|
|
|
return ((pEdict->v.deadflag==DEAD_NO)&&(pEdict->v.health>0));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// *****************************************************
|
|
|
|
// class Grenades
|
|
|
|
// *****************************************************
|
|
|
|
|
|
|
|
class Grenades
|
|
|
|
{
|
|
|
|
struct Obj
|
|
|
|
{
|
|
|
|
CPlayer* player;
|
|
|
|
edict_t* grenade;
|
|
|
|
float time;
|
|
|
|
int type;
|
|
|
|
Obj* next;
|
|
|
|
Obj* prev;
|
|
|
|
} *head;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Grenades() { head = 0; }
|
|
|
|
~Grenades() { clear(); }
|
|
|
|
void put( edict_t* grenade, float time, int type, CPlayer* player );
|
|
|
|
bool find( edict_t* enemy, CPlayer** p, int* type );
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CMISC_H
|
|
|
|
|
|
|
|
|
|
|
|
|