Re: gg_ffa v1.0
Posted: Tue Dec 06, 2011 1:14 am
In fact, the call of SetBotEnemy is useless here. Since players are not in the same team when OnTakeDamage is fired, bots defend themselves. Now, to make it all more realistic, we can hook CCSBot::OnAudibleEvent and switch the player to the opposite team of the bot to get his attention on what happens. Here's the signature:You only need to know two values here:But since this function is called on all the following events:I'm afraid that will take a lot of ressources if there are a lot of bots/players on the server. You can try, and lets me know. That said, this is sad that you never give credits where it is due in your codes but well, reals knows.
# void CCSBot::OnAudibleEvent(IGameEvent *, CBasePlayer *, float, PriorityType, bool, bool, Vector const*)
[CCSBot::OnAudibleEvent]
"shortname" = "OnAudibleEvent"
"sig" = " 83 EC 18 53 8B 5C 24 24 85 DB 56 8B F1 0F 84 9E 02 00 00"
"symbol" = "_ZN6CCSBot14OnAudibleEventEP10IGameEventP11CBasePlayerf12PriorityTypebbPK6Vector"
"param" = "pppfibbp)v"
"convention" = "thiscall"
[CCSBot::OnAudibleEvent]
"shortname" = "OnAudibleEvent"
"sig" = " 83 EC 18 53 8B 5C 24 24 85 DB 56 8B F1 0F 84 9E 02 00 00"
"symbol" = "_ZN6CCSBot14OnAudibleEventEP10IGameEventP11CBasePlayerf12PriorityTypebbPK6Vector"
"param" = "pppfibbp)v"
"convention" = "thiscall"
args[1] = the player's pointer
args[7] = the bot's pointer
args[7] = the bot's pointer
player_footstep
player_falldamage
weapon_zoom
weapon_fire
weapon_fire_on_empty
hegrenade_detonate
flashbang_detonate
smokegrenade_detonate
player_jump
player_falldamage
weapon_zoom
weapon_fire
weapon_fire_on_empty
hegrenade_detonate
flashbang_detonate
smokegrenade_detonate
player_jump