mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 05:45:36 +03:00
some changes in bot's code
This commit is contained in:
parent
3155a300c6
commit
796a7ad4d7
@ -91,7 +91,6 @@ void CPlayer::PutInServer(){
|
||||
}
|
||||
|
||||
void CPlayer::Connect(const char* address ){
|
||||
bot = IsBot();
|
||||
strcpy(ip,address);
|
||||
rank = 0;
|
||||
clearStats = 0.0f;
|
||||
|
@ -21,7 +21,6 @@ struct CPlayer {
|
||||
int index;
|
||||
int aiming;
|
||||
int current;
|
||||
bool bot;
|
||||
float clearStats;
|
||||
RankSystem::RankStats* rank;
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
// *****************************************************
|
||||
|
||||
void CPlayer::Disconnect(){
|
||||
ingame = staminaSet = fuseSet = false;
|
||||
ingame = staminaSet = fuseSet = bot = false;
|
||||
}
|
||||
|
||||
void CPlayer::PutInServer(){
|
||||
@ -55,7 +55,7 @@ void CPlayer::Init( int pi, edict_t* pe )
|
||||
pEdict = pe;
|
||||
index = pi;
|
||||
current = 0;
|
||||
ingame = staminaSet = false;
|
||||
ingame = staminaSet = fuseSet = bot = false;
|
||||
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,7 @@ void Grenades::clear()
|
||||
|
||||
void CPlayer::Disconnect(){
|
||||
ingame = false;
|
||||
bot = false;
|
||||
savedScore = 0;
|
||||
|
||||
if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
|
||||
@ -150,6 +151,7 @@ void CPlayer::Init( int pi, edict_t* pe )
|
||||
current = 0;
|
||||
clearStats = 0.0f;
|
||||
ingame = false;
|
||||
bot = false;
|
||||
savedScore = 0;
|
||||
}
|
||||
|
||||
|
@ -195,13 +195,13 @@ void ServerDeactivate() {
|
||||
|
||||
BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ){
|
||||
GET_PLAYER_POINTER(pEntity)->Connect(pszName,pszAddress);
|
||||
|
||||
|
||||
RETURN_META_VALUE(MRES_IGNORED, TRUE);
|
||||
}
|
||||
|
||||
void ClientDisconnect( edict_t *pEntity ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
|
||||
|
||||
if (pPlayer->ingame)
|
||||
pPlayer->Disconnect();
|
||||
|
||||
|
@ -93,6 +93,7 @@ void Grenades::clear()
|
||||
void CPlayer::Disconnect(){
|
||||
|
||||
ingame = false;
|
||||
bot = false;
|
||||
|
||||
if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
|
||||
return;
|
||||
@ -145,6 +146,8 @@ void CPlayer::Init( int pi, edict_t* pe )
|
||||
current = 0;
|
||||
clearStats = 0.0f;
|
||||
rank = 0;
|
||||
ingame = false;
|
||||
bot = false;
|
||||
}
|
||||
|
||||
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
|
||||
|
@ -75,7 +75,6 @@ void CPlayer::PutInServer(){
|
||||
ingame = false;
|
||||
}
|
||||
void CPlayer::Connect( const char* ippp ){
|
||||
bot = IsBot();
|
||||
strcpy(ip,ippp);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,6 @@ struct CPlayer {
|
||||
int frags; // suma dla kontroli ostatniego fraga, to - v.frags = lastfrag
|
||||
|
||||
bool ingame;
|
||||
bool bot;
|
||||
float clearStats;
|
||||
|
||||
struct PlayerWeapon : public Stats {
|
||||
@ -117,6 +116,7 @@ struct CPlayer {
|
||||
void saveHit(CPlayer* pVictim, int weapon, int damage, int aiming);
|
||||
void saveShot(int weapon);
|
||||
void restartStats(bool all = true);
|
||||
|
||||
inline bool IsBot(){
|
||||
const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict);
|
||||
return ( auth && !strcmp( auth , "BOT" ) );
|
||||
|
@ -188,7 +188,7 @@ void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
|
||||
const char* name = INFOKEY_VALUE(infobuffer,"name");
|
||||
const char* oldname = STRING(pEntity->v.netname);
|
||||
|
||||
if ( pPlayer->ingame){
|
||||
if ( pPlayer->ingame ){
|
||||
if ( strcmp(oldname,name) ) {
|
||||
if (!tsstats_rank->value)
|
||||
pPlayer->rank = g_rank.findEntryInRank( name, name );
|
||||
@ -197,7 +197,6 @@ void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) {
|
||||
}
|
||||
}
|
||||
else if ( pPlayer->IsBot() ) {
|
||||
pPlayer->Connect( "127.0.0.1" );
|
||||
pPlayer->PutInServer();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user