Raised This Month: $ Target: $400
 0% 

Amx_match in CS tournament


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-26-2007 , 04:57   Re: Amx_match in CS tournament
Reply With Quote #1

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.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Reply



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


All times are GMT -4. The time now is 01:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode