Explanation of Exolent's code:
PHP Code:
stock handle_join(id, iMsgid, iTeam)
{
// Checks if the message is already blocked.
new iMsgBlock = get_msg_block(iMsgid);
// Block it.
set_msg_block(iMsgid, BLOCK_SET);
// Make him join the wanted team.
engclient_cmd(id, "jointeam", g_sTeamNums[iTeam]);
// Need that function code to know what this does.
new iClass = get_team_class(iTeam);
// if the class is between 1 & 4
if(1 <= iClass <= 4)
{
// Make him choose a class
engclient_cmd(id, "joinclass", g_sClassNums[iClass - 1]);
}
// Set it back to it's original block state.
set_msg_block(iMsgid, iMsgBlock);
}
__________________