.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Releases, Installers, Docs & Coding (http://forums.bots-united.com/forumdisplay.php?f=48)
-   -   PODBot and the cs_set_team function (http://forums.bots-united.com/showthread.php?t=6633)

blooblood 04-02-2008 15:11

PODBot and the cs_set_team function
 
Hi. I using the function cs_set_user_team(AMXX) on players while they are alive to switch team and my problem is that it mess up the bot's targeting (it does not know which one is friendly.) Can anyone help me out?

KWo 04-02-2008 19:53

Re: PODBot and the cs_set_team function
 
Respawn the player after using cs_set_user_team and the info about teams will be also sent to the bots. If is not - the bot is thinking the team of the player is from the moment before using at him cs_set_user_team.

blooblood 05-02-2008 06:03

Re: PODBot and the cs_set_team function
 
That sorta fixes my problem. This time I changed team, respawned the player, and move the bot back to its original origin, code below. Anyways the attacker wont stop attacking the victim until the attacker "lost sight" of the victim.

PHP Code:

register_event("Damage""event_damage""be""2!0")
...
public 
event_damage(id)
{
 new 
attacker get_user_attacker(id)
 if(!
is_user_alive(attacker))
  return 
PLUGIN_CONTINUE
 
 cs_set_user_team
(idcs_get_user_team(attacker))
 
 static 
Float:origin[3]
 
pev(idpev_originorigin)
 
cs_user_spawn(id)
 
set_pev(idpev_originorigin)
 
 return 
PLUGIN_CONTINUE




All times are GMT +2. The time now is 15:46.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.