#include <amxmodx> #include <amxmisc> #include <orpheu> #define VERSION "0.0.1" #define PLUGIN "Swap Teams" new OrpheuFunction:g_OfSwapAllPlayers new g_pGameRules new bool:g_bSwapTeamsOnNextRound new runda=0; public plugin_precache() { OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"), "OnInstallGameRules_Post", OrpheuHookPost) } public OnInstallGameRules_Post() { g_pGameRules = OrpheuGetReturn() } public plugin_init() { register_plugin(PLUGIN, VERSION, "ConnorMcLeod") g_OfSwapAllPlayers = OrpheuGetFunction("SwapAllPlayers", "CHalfLifeMultiplay") register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0") register_concmd("amx_swap_teams", "ConCmd_SwapTeam", ADMIN_LEVEL_A, "Swap teams and teams scores on next round") register_logevent("ConCmd_SwapTeam", 2, "1=Round_Start") register_event("HLTV", "newRound", "a", "1=0", "2=0"); register_logevent("GameCommencing", 2, "1=Game_Commencing"); } public newRound() { ++runda; } public ConCmd_SwapTeam(id, lvl, cid) { if(runda=14) { if( cmd_access(id, lvl, cid, 1) ) { g_bSwapTeamsOnNextRound = true client_print(0, print_center, "Swap teams on next round.") } } } public Event_HLTV_New_Round() { if( g_bSwapTeamsOnNextRound ) { g_bSwapTeamsOnNextRound = false OrpheuCall(g_OfSwapAllPlayers, g_pGameRules) } } public GameCommencing() { runda=0; }
masz powinno dzialac