phew... updated to include old tsfun stuffs

This commit is contained in:
David Anderson
2006-02-26 08:11:25 +00:00
parent d9f9c5256a
commit b968f437ca
7 changed files with 281 additions and 30 deletions

View File

@ -36,13 +36,15 @@
// class CPlayer
// *****************************************************
void CPlayer::Disconnect(){
void CPlayer::Disconnect()
{
if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
return;
rank->updatePosition( &life );
ingame = false;
}
void CPlayer::PutInServer(){
void CPlayer::PutInServer()
{
restartStats();
ingame = true;
@ -74,7 +76,8 @@ void CPlayer::PutInServer(){
if ( ( rank = g_rank.findEntryInRank( unique , name ) ) == 0 )
ingame = false;
}
void CPlayer::Connect( const char* ippp ){
void CPlayer::Connect(const char* ippp)
{
strcpy(ip,ippp);
}
@ -96,7 +99,8 @@ void CPlayer::Init( int pi, edict_t* pe )
ingame = false;
}
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk)
{
if ( ignoreBots(pEdict,pVictim->pEdict) )
return;
@ -144,7 +148,8 @@ void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
life.tks += ttk;
}
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody)
{
if ( ignoreBots(pEdict,pVictim->pEdict) )
return;
@ -183,7 +188,8 @@ void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
life.bodyHits[bbody]++;
}
void CPlayer::saveShot(int weapon){
void CPlayer::saveShot(int weapon)
{
if ( ignoreBots(pEdict) )
return;
@ -196,3 +202,44 @@ void CPlayer::saveShot(int weapon){
weaponsRnd[0].shots++; // DEC-Weapon (round) stats
}
void CPlayer::SetOffsetF(int offs, float val)
{
*((float *)pEdict->pvPrivateData + offs) = val;
}
void CPlayer::SetOffset(int offs, int val)
{
*((int *)pEdict->pvPrivateData + offs) = val;
}
float CPlayer::GetOffsetF(int offs)
{
return *((float *)pEdict->pvPrivateData + offs);
}
int CPlayer::GetOffset(int offs)
{
return *((int *)pEdict->pvPrivateData + offs);
}
float CPlayer::GetTime()
{
return GetOffsetF(TSX_TIME_OFFSET);
}
void CPlayer::SetMoney(int money)
{
SetOffset(TSX_MONEY_OFFSET, money);
}
void CPlayer::SetSlots(int slots)
{
SetOffset(TSX_SLOTS_OFFSET, slots);
}
int CPlayer::GetSlots()
{
return GetOffset(TSX_SLOTS_OFFSET);
}