Raised This Month: $ Target: $400
 0% 

Count rounds in a match


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hx7r
Member
Join Date: Mar 2009
Old 11-27-2009 , 12:41   Re: Count rounds in a match
Reply With Quote #1

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Match Mod" #define VERSION "0.1a RC 1" #define AUTHOR "Ramiro Escudero" new ready_players = 0 new ctscore = 0 new tscore = 0 new round_counter = 0 new trigger = 0 public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("ma_matchmode", "check_players", ADMIN_ALL, "Usage: ma_matchmode")     register_event("say .r", "ready", "a")     register_event("TeamScore", "team_score", "a")     register_logevent("roundstart", 2, "0=World triggered", "1=Round_Start")     register_logevent("round_end", 2, "0=World triggered", "1=Round_End") } public check_players() {     new players = get_playersnum()         if(players == 10) {         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE;     } public start_match() {     server_cmd("say The match will start when all players put .r in say")     if(ready_players == 10) {         server_cmd("say All players are ready, executing match.cfg")         server_cmd("exec match.cfg")         server_cmd("say Match.cfg executed, the first half will start")         server_cmd("say The match is to 30, with two half of 15")                 trigger = 1         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE; } public ready() {     ready_players++ } public roundstart() {     round_counter++ } public team_score() {     new team[32]     read_data(1,team,32)         if (equal(team,"CT"))     {         ctscore = read_data(2)     }     else if (equal(team,"TERRORIST"))     {         tscore = read_data(2)     }     return PLUGIN_CONTINUE }   public  round_end() {     while(trigger == 1 && round_counter < 31) {         server_cmd("say Team 1: %d Team 2: %d", ctscore, tscore)     }     } public first_half() {     server_cmd("exec lo3.cfg")     server_cmd("say First half started GL HF, Plugin by Fus!l3r")     if(round_counter == 16) {         server_cmd("exec swap.cfg")         server_cmd("say First half ended")         server_cmd("say Scores so far: Team 1: %d Team 2: %d", ctscore, tscore)         server_cmd("say Starting Second Half")         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE; } public second_half() {     server_cmd("exec lo3.cfg")     server_cmd("say Second half started GL HF, Plugin by Fus!l3r")     if(ctscore == 16) {         return PLUGIN_CONTINUE     }     else if(tscore == 16) {         return PLUGIN_CONTINUE     }     else if(ctscore == 15 && tscore == 15) {         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE; } public end_match() {     server_cmd("say Match ended! Final Score: Team 1: %d Team 2: %d", ctscore, tscore)     server_cmd("exec normal.cfg")     server_cmd("say All settings Back to normal!. Plugin by Fus!l3r")     trigger = 0     return PLUGIN_HANDLED }
Hx7r is offline
ramiro000
New Member
Join Date: Nov 2009
Old 11-27-2009 , 12:48   Re: Count rounds in a match
Reply With Quote #2

Thanks, you were very helpful, now itīs solved.
ramiro000 is offline
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 13:41.


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