View Single Post
Re: not correct detection by bots chicken as a friend/enemy
Old
  (#8)
T(+)rget
AMX Dev Team
 
T(+)rget's Avatar
 
Status: Offline
Posts: 28
Join Date: Dec 2004
Location: UK
Default Re: not correct detection by bots chicken as a friend/enemy - 24-04-2005

Code:
void Client_ScoreInfo(void* value) {
	static int id;
	static int deaths;
	switch (state++) {
		case 0:
			id = *(int*)value;
			break;
		case 2:
			deaths = *(int*)value;
			break;
		case 4:
			if(id < 1 || id > gpGlobals->maxClients) {
				break;
			}
			CPlayer* pPlayer = GET_PLAYER_POINTER_I(id);
			pPlayer->deaths = deaths;
			pPlayer->team = *(int*)value;
	}
}
Above is how I get which team someone is on, works on VexdUM bots just tested for Counter-Strike.

How above was tested:
Test1) Using radius_damage with sv_friendlyfire 0, bot didn't take no damage (correct) teams match so its a team mate.

Test2) Using radius_damage with sv_friendlyfire 1, bot died by my rocket launcher (correct) because team matching is ignored since sv_friendlyfire is enabled.

Conclusion:
Above code must be working correctly, else my new damage natives would fail, since I get the team variables from that code.

ChickenMod:
As for PMB's mention on ChickenMod, VexdUM uses different code which was carried across to AMXX (engine module) which does actually change the player model. Also the chicken model supplied is not the normal chicken model from cs_italy, its been modified so it has animation + a few fixes.

Last edited by T(+)rget; 24-04-2005 at 13:49..
  
Reply With Quote