.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > POD-Bot mm > Ideas
Ideas One idea per thread please! :)

Reply
 
Thread Tools
Bot check team
Old
  (#1)
Bend3R
Member
 
Status: Offline
Posts: 50
Join Date: Jun 2005
Default Bot check team - 19-04-2012

Hi,

I'm in need of PodBot to check the bots team sometimes.
Since I don't have the source file of a *.sma so I can edit it when a bot have been transfered over to the other team so the round never ends when the other team and the transfered bot do not react on this.
Can you make a cvar for this for me in the next release? Thanks
  
Reply With Quote
Re: Bot check team
Old
  (#2)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: Bot check team - 19-04-2012

Ask to amxmodx plugin writers to use emessages to transfer the player to the team, instead using standard functions cs_set_user_team, which sends normal messages (those cannot be hooked out of amxmodx.dll - by other mm plugins). Emessages aren't blocked by metamod, so bots code perfectly knows the exact moment of transfering the player to the team. I'm not going to change the bot code only because of that amxx scripters don't know how metamod works.
Code example:
Code:
// Set a Player's Team
stock fm_set_user_team(id, team)
{
    set_pdata_int(id, OFFSET_CSTEAMS, team, OFFSET_LINUX);
} 

(...)
//some function here...
        // Switch to CT
        if (fm_get_user_team(id) != CS_TEAM_CT) // need to change team?
        {        
            fm_set_user_team(id, CS_TEAM_CT)
            fm_set_user_team_msg(id+TEAM_TASK)
        }
(...)

// Send User Team Message
public fm_set_user_team_msg(taskid)
{    
    // Beware: this message can now be picked up by other metamod
    // plugins (yeah, that includes AMXX plugins as well)
    
    // Set the switching team flag
    g_switchingteam[ID_TEAM] = true;
    
    // Tell everyone my new team
    emessage_begin(MSG_ALL, g_msgTeamInfo)
    ewrite_byte(ID_TEAM)
    
    switch (fm_get_user_team(ID_TEAM))
    {
        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()
    
    // Done switching team
    g_switchingteam[ID_TEAM] = false;
}
Show them the example of the code above and they should know how to use it.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com