.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Ideas (http://forums.bots-united.com/forumdisplay.php?f=50)
-   -   Bot check team (http://forums.bots-united.com/showthread.php?t=9040)

Bend3R 19-04-2012 12:18

Bot check team
 
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 :)

KWo 19-04-2012 18:17

Re: Bot check team
 
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.


All times are GMT +2. The time now is 04:19.

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