// #name = TeamInfo Support Script // #version = 1.00 // #date = June 23, 2001 // #status = release // #description = Support script which keeps lists of all teams and players. Also generates client messages of key events such as players connecting, dropping, joining teams, etc. Useful for scripters. See the ReadMe file for more info. // #author = |TIA|Prometheus // #warrior = Prometheus^ // #email = rrk@u.arizona.edu // #web = http://www.tribe-tia.com // #readme = scripts/autoexec/TeamInfo.txt Documentation for TeamInfo.cs (version 1.00) Written by |TIA|Prometheus (rrk@u.arizona.edu) TeamInfo defines some utility functions for keeping track of team information. It is a support script for scripter to use. Scripters are encouraged to use it. Hopefully, you'll find it useful. The following constants, functions, and messages are defined: Constants $MyClientId - contains your client ID $MyTeamId - contains your team ID $PlayerName - contains your player's name $MyTeamName - contains your team's name $EnemyTeamName - contains the enemy team's name Function Calls TeamName(%teamId) - returns a team's name given it's id number getPlayer(%clientId) - returns the player object for a client ClientName(%clientId) - Returns the client's player name ClientId(%name) - Returns the Client ID given a player name ClientTeamId(%clientId) - Returns the Team ID for a client (0=Observers, 1=Storm, 2=Inferno) ClientTeamName(%clientId) - Returns the Team Name for a client addFirstMessageCallback - adds a function to handle a message like addMessageCallback, but handler is called BEFORE instead of after the default handler rawName(%name) - detags and strips off markup characters from a name New Messages 'MsgTeammateJoined' - Is triggered when a player joins your team and passes his client ID 'MsgEnemyJoined' - Is triggered when a player joins an enemy team and passes his client ID and new team ID 'MsgTeammateLeft' - Is triggered when a player leaves your team and passes his client ID 'MsgEnemyLeft' - Is triggered when a player leaves an enemy team and passes his client ID and old team ID 'MsgTeamUpdate' - Is triggered when a team changes and passes the team ID and updated player count 'MsgIJoinedTeam' - Is triggered when you change teams and passes your new and old team IDs 'MsgConnecting' - Is triggered when attempting to connect to a server and passes the IP address Handler functions for the new messages described above receive the following parameters: 'MsgTeammateJoined' or 'MsgTeammateLeft' - ("", %clientId) 'MsgEnemyJoined' or 'MsgEnemyLeft' - ("", %clientId, %teamId) 'MsgTeamUpdate' - ("", %teamId, %teamcount) 'MsgIJoinedTeam' - ("", %teamId, %oldteamId) 'MsgConnecting' - ("", %address) Also, please note that a 'MsgIJoinedTeam' will NOT be followed by a 'MsgTeammateDropped' for every member of your old team NOR by a 'MsgTeammateJoined' for everyone on your new team. The following named objects are maintained by TeamInfo and can be accessed by your script: TeamsGroup - A set containing all the teams (and observers), not necessarily in any order. TeamList0 - Set containing all the observers TeamList1 - Set containing the players on team 1 (Storm) TeamList2 - Set containing the players on team 2 (Inferno) Every object in a team list as described above (e.g. TeamList1) is a "TeamPlayer" object with the following properties: name - has the player's name guid - has the player's global id clientId - has the player's clientId number player - has the player's "player" object number, same as $PlayerList[%clientId] isSmurf - indicates whether the player's name is a smurf name or real name Expressions for the object properties above are "." delimited just like all other objects in T2, so the name of the first players on team Storm is "TeamList1.getObject(0).name" (without the quotes). Questions? E-mail me at rrk@u.arizona.edu and I'll try to help.