/* Plugin generated by AMXX-Studio */ #include #include #define PLUGIN "[BF3]Tickety!" #define VERSION "1.0" #define AUTHOR "CheQ" new ticket_start=3; new tickety_ct; new tickety_tt; new punkty_ct; new punkty_tt; new HUD; new HUD_t; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) HUD = CreateHudSyncObj(); HUD_t= CreateHudSyncObj(); register_event("DeathMsg", "Death", "ade"); start_game(); } public start_game() { tickety_ct = ticket_start; tickety_tt = ticket_start; } public client_putinserver(id) { set_task(3.0,"HudInfo",id+8120); } public HudInfo(id) { id-=8120; set_hudmessage(212, 255, 85,-1.0, 0.0, 0, 6.0, 5.0); ShowSyncHudMsg(id,HUD, "Ct [%i] - %i / %i - [%i] Tt",punkty_ct,tickety_ct,tickety_tt,punkty_tt); if(is_user_connected(id)) set_task(0.3,"HudInfo",id+8120); } public Death() { new id = read_data(2); new attacker = read_data(1); if(!is_user_alive(attacker)) return PLUGIN_CONTINUE; switch(get_user_team(id)) { case 1: { tickety_tt--; if(tickety_tt < 1) Win(2); } case 2: { tickety_ct-- if(tickety_ct < 1) Win(1); } } return PLUGIN_CONTINUE; } public Win(team) { for(new i = 0; i < get_playersnum();i++) { if(get_user_team(i) == team) { set_hudmessage(212, 255, 85,-1.0, -1.0, 0, 6.0, 5.0); ShowSyncHudMsg(i,HUD_t, "TWOJA DRUZYNA WYGRALA!"); } else { set_hudmessage(212, 255, 85,-1.0, -1.0, 0, 6.0, 5.0); ShowSyncHudMsg(i,HUD_t, "TWOJA DRUZYNA PRZEGRALA!"); } } if(team == 1) { punkty_tt++; } if(team == 2) { punkty_ct++; } set_task(5.0,"start_game"); return PLUGIN_CONTINUE; }