First of all you establish global variables and hook the command.
Code:
new bool:g_started[2]; // t=0, ct=1
public plugin_init() {
register_clcmd( "say /start", "hook_startmatch" );
}
Then you process the hooked commands and adjust the global variables. If both global variables are set, start the match.
Code:
public hook_startmatch( id ) {
// Steamid bit would go here
new team = get_user_team( id );
g_started[team] = true;
if( g_started[0] && g_started[1] )
server_cmd( "amx_match abc def mr15 cal recboth" );
}
Then if you want to insert a steamid check, you do it where I commented above. First, at the very top, in the global variables, add a steamid global. Make sure you change "3" in the first brackets to how many you have.
Code:
new g_steamids[3][32] =
{
"STEAM_0:1:123456",
"STEAM_0:0:789123",
"STEAM_0:1:234098234"
}
Then, inside the hook_startmatch, where I commented to insert...
Code:
// Get user's steamid and declare match_found variable
new steamid[32], bool:match_found;
get_user_authid( id, steamid, 31 );
// Loop through steamids and check if any match
for( new i; i < sizeof g_steamids; i++ )
if( equali( steamid, g_steamids[i] ) ) match_found = true;
// If no steamid matches were found, get the hell outa here
if( !match_found ) return PLUGIN_CONTINUE;
Now at the very bottom of the hook_startmatch function you'll have to add a return PLUGIN_CONTINUE -- otherwise you'll get a warning when you compile.
__________________