.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Common Questions (http://forums.bots-united.com/forumdisplay.php?f=51)
-   -   BOT confusing after transfered (http://forums.bots-united.com/showthread.php?t=7635)

aba010 25-06-2010 20:54

BOT confusing after transfered
 
My server has installed ptb.amxx, which swap players when it checks team unbalance. The problem is after the bots has been transfered, they thought they are still in another team and keep trying to shoot at me.
For example, at first BOT A and BOT B in CT, then I joined T and played a few rounds. PTB checks that CT is stronger and automatically transfer BOT A to T. Now, BOT A will try to shoot me untill he see BOT B or any CT members.
Anyone know how to fix that?

KWo 26-06-2010 07:33

Re: BOT confusing after transfered
 
This is not pb mm bug nor issue. This is metamod problem which blocks standard messges sent by other plugins (i.e. amxmodx messages are blocked so pb mm cannot intercept/handle them). You need to ask ptb plugin developer to rewrite it to use emassages. If he is just using set_user_team or cs_set_user team none of metamod bots can see messges sent by those functions. Thus bots don't know they have been transferred into opposite team. Example of working code below.
Code:

(...)
    fm_set_user_team(id, team); // call the function to change the team by the user
    cs_reset_user_model( id );
(...)

stock fm_set_user_team(id, team)
{
    set_pdata_int(id, OFFSET_CSTEAMS, team, OFFSET_LINUX);
    fm_set_user_team_msg(id);
}

// Send User Team Message
public fm_set_user_team_msg(id)
{
    // Beware: this message can now be picked up by other metamod
    // plugins (yeah, that includes AMXX plugins as well)
       
    // Tell everyone my new team
    emessage_begin(MSG_ALL, g_msgTeamInfo)
    ewrite_byte(id)
    switch (fm_get_user_team(id))
    {
        case CS_TEAM_UNASSIGNED: ewrite_string("UNASSIGNED");
        case CS_TEAM_T: ewrite_string("TERRORIST");
        case CS_TEAM_CT: ewrite_string("CT");
        case CS_TEAM_SPECTATOR: ewrite_string("SPECTATOR");
    }   
    emessage_end()
}

stock fm_get_user_team(id)
{
    return get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}


aba010 26-06-2010 11:35

Re: BOT confusing after transfered
 
Thank you. Since the author haven't update for a long time, I'm not sure this problem can be fixed. But anyway, Thanks.


All times are GMT +2. The time now is 20:08.

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