AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Amx_match in CS tournament (https://forums.alliedmods.net/showthread.php?t=62343)

adiction 10-24-2007 13:49

Amx_match in CS tournament
 
Is possible make a script that associate the STEAM ID of the captains with their teams, and then, replace the line in amx_match command?

for example

abc|captain(CT) : /start
def|captain(T) : /start

[Console writes : rcon amx_match "abc" "def" mr15 cal recboth"]
then, the match can start with "all type ready" sistem, it doesnt matter.

can u do this 4 me? :up:

im going to do a tournament and i need a method to exec amx_match by the most easy way 4 the captains without using rcon, or amx_match complete command, i mean, the most automaticly possible.

Thanks for your time again
waiting 4 help :grrr:
adiction

Wilson [29th ID] 10-26-2007 04:57

Re: Amx_match in CS tournament
 
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.

adiction 10-28-2007 17:55

Re: Amx_match in CS tournament
 
thanks, but that script doesnt connect the ID of captain with the amx_match command????

Wilson [29th ID] 10-28-2007 21:53

Re: Amx_match in CS tournament
 
You have to make sure that the captain's steamid is defined in the global variable..

adiction 10-29-2007 13:57

Re: Amx_match in CS tournament
 
this is chinesse 4 me , can u explain me? :(

i need this :

(CT)SK|fisker : /start
(T)fnatic f0rest : /start

then, the console writes :

amx_match sk fnatic mr15 cal recboth
[STEAM ID fisker = sk; STEAM ID f0rest = fnatic]


thanks !

adiction 11-01-2007 18:34

Re: Amx_match in CS tournament
 
up


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

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