RU
RU
UA
EN
PL
ГЛАВНАЯ
УСЛУГИ
ПЛАГИНЫ
КАРТЫ
REBUY
SCANMON
CASSA
SALE
ФОРУМ
МОНИТОР
HELP
КОНТАКТ
Главная
/
Plugins
/
плагин cs_v34
плагин cs_v34
Теги:
Скачать плагины csgo
Админские
плагин cs_v34 для админ меню перемещение игроков в наблюдатели
Компилятор: 1.10.0
+ZIP
160
Команды:
в админ меню будет доступна вкладка перемещение игроков в спектора..
.sma / .sp
#pragma semicolon 1 #include
#include
#undef REQUIRE_PLUGIN #include
#undef REQUIRE_EXTENSIONS #include
#define REQUIRE_EXTENSIONS #define TEAM_1 2 #define TEAM_2 3 #define TEAM_SPEC 1 #define TEAMSWITCH_VERSION "1.4.0-fix" #define TEAMSWITCH_ADMINFLAG ADMFLAG_KICK new bool:colour = true; public Plugin:myinfo = { name = "TeamSwitch", author = "MistaGee (Modify by Snake 60) and www.MyArena.ru", description = "Switch people to the other team now, at round end, on death", version = TEAMSWITCH_VERSION, url = "http://www.sourcemod.net/ and http://www.MyArena.ru/" }; new Handle:hAdminMenu = INVALID_HANDLE, bool:onRoundEndPossible = false, bool:cstrikeExtAvail = false, String:teamName1[2], String:teamName2[3], bool:switchOnRoundEnd[MAXPLAYERS+1], bool:switchOnDeath[MAXPLAYERS+1]; enum TeamSwitchEvent { TeamSwitchEvent_Immediately = 0, TeamSwitchEvent_OnDeath = 1, TeamSwitchEvent_OnRoundEnd = 2, TeamSwitchEvent_ToSpec = 3 }; public OnPluginStart() { CreateConVar("teamswitch_version", TEAMSWITCH_VERSION, "TeamSwitch version", FCVAR_NOTIFY); RegAdminCmd("teamswitch", Command_SwitchImmed, TEAMSWITCH_ADMINFLAG ); RegAdminCmd("teamswitch_death", Command_SwitchDeath, TEAMSWITCH_ADMINFLAG ); RegAdminCmd("teamswitch_roundend", Command_SwitchRend, TEAMSWITCH_ADMINFLAG ); RegAdminCmd("teamswitch_spec", Command_SwitchSpec, TEAMSWITCH_ADMINFLAG ); HookEvent("player_death", Event_PlayerDeath); decl String:theFolder[40]; GetGameFolderName(theFolder, sizeof(theFolder)); PrintToServer( "[TS] Hooking round end events for game: %s", theFolder); if (strcmp(theFolder, "dod", false) == 0) { HookEvent( "dod_round_win", Event_RoundEnd, EventHookMode_PostNoCopy); onRoundEndPossible = true; } else if (strcmp(theFolder, "tf", false) == 0) { HookEvent("teamplay_round_win", Event_RoundEnd, EventHookMode_PostNoCopy); HookEvent("teamplay_round_stalemate", Event_RoundEnd, EventHookMode_PostNoCopy); onRoundEndPossible = true; } else if (strcmp(theFolder, "cstrike", false) == 0 || strcmp(theFolder, "csgo", false) == 0) { HookEvent("round_end", Event_RoundEnd, EventHookMode_PostNoCopy); onRoundEndPossible = true; } new Handle:topmenu; if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != INVALID_HANDLE)) { OnAdminMenuReady(topmenu); } cstrikeExtAvail = (GetExtensionFileStatus("game.cstrike.ext") == 1); LoadTranslations("common.phrases"); LoadTranslations("teamswitch.phrases"); } public OnMapStart() { GetTeamName(2, teamName1, sizeof(teamName1)); GetTeamName(3, teamName2, sizeof(teamName2)); PrintToServer("[TS] Team Names: %s %s - OnRoundEnd available: %s", teamName1, teamName2, (onRoundEndPossible ? "yes" : "no")); } public Action:Command_SwitchImmed(client, args ) { if (args != 1) { ReplyToCommand(client, "[SM] %t", "ts usage immediately" ); return Plugin_Handled; } decl String:targetArg[64]; GetCmdArg(1, targetArg, sizeof(targetArg)); decl String:target_name[64]; new target = FindTarget(client, targetArg); if (target > 0 && IsClientInGame(target)) { GetClientName(target, target_name, sizeof(target_name)); PerformSwitch(target); } if (colour) { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admin switch", target_name, "ts opposite team"); } else { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admins switch", client, target_name, "ts opposite team"); } } } } else { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "[SM] %t %s %t", "ts admin switch", target_name, "ts opposite team"); } else { PrintToChat(i, "[SM] %t %s %t", "ts admins switch", client, target_name, "ts opposite team"); } } } } return Plugin_Handled; } public Action:Command_SwitchDeath( client, args ) { if (args != 1) { ReplyToCommand( client, "[SM] %t", "ts usage death" ); return Plugin_Handled; } decl String:targetArg[50]; GetCmdArg(1, targetArg, sizeof(targetArg)); decl String:target_name[50]; new target = FindTarget( client, targetArg ); if (target > 0 && IsClientInGame(target)) { switchOnDeath[target] = !switchOnDeath[target]; GetClientName( target, target_name, sizeof(target_name)); if (switchOnDeath[target]) { if (colour) { PrintToChatAll( "\x01[SM] \x03%s \x01%t", target_name, "ts will be switch to apposite team on death"); } else { PrintToChatAll( "[SM] %s %t", target_name, "ts will be switch to apposite team on death" ); } } else { if (colour) { PrintToChatAll( "\x01[SM] \x03%s \x01%t", target_name, "ts will not be switch to apposite team on death"); } else { PrintToChatAll( "[SM] %s %t", target_name, "ts will not be switch to apposite team on death" ); } } } return Plugin_Handled; } public Action:Command_SwitchRend(client, args) { if (args != 1) { ReplyToCommand( client, "[SM] %t", "ts usage roundend" ); return Plugin_Handled; } if (!onRoundEndPossible) { ReplyToCommand( client, "[SM] %t", "ts usage roundend error" ); return Plugin_Handled; } decl String:targetArg[50]; GetCmdArg(1, targetArg, sizeof(targetArg)); new target = FindTarget(client, targetArg); if (target > 0 && IsClientInGame(target)) { decl String:target_name[50]; switchOnRoundEnd[target] = !switchOnRoundEnd[target]; GetClientName(target, target_name, sizeof(target_name)); if (switchOnRoundEnd[target]) { if (colour) { PrintToChatAll( "\x01[SM] \x03%s \x01%t", target_name, "ts will be switch to apposite team on rounend"); } else { PrintToChatAll( "[SM] %s %t", target_name, "ts will be switch to apposite team on rounend"); } } else { if (colour) { PrintToChatAll( "\x01[SM] \x03%s \x01%t", target_name, "ts will not be switch to apposite team on rounend"); } else { PrintToChatAll( "[SM] %s %t", target_name, "ts will not be switch to apposite team on rounend"); } } } return Plugin_Handled; } public Action:Command_SwitchSpec( client, args ) { if (args != 1) { ReplyToCommand( client, "[SM] %t", "ts usage spec" ); return Plugin_Handled; } decl String:targetArg[50]; GetCmdArg(1, targetArg, sizeof(targetArg)); decl String:target_name[50]; new target = FindTarget(client, targetArg); if (target != -1) { GetClientName(target, target_name, sizeof(target_name)); PerformSwitch(target, true); } if (colour) { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admin switch", target_name, "ts to spectators"); } else { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admins switch", client, target_name, "ts to spectators"); } } } } else { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "[SM] %t %s %t", "ts admin switch", target_name, "ts to spectators"); } else { PrintToChat(i, "[SM] %t %s %t", "ts admins switch", client, target_name, "ts to spectators"); } } } } return Plugin_Handled; } public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) { new victim = GetClientOfUserId(GetEventInt(event, "userid")); if (bool:victim && switchOnDeath[victim]) { if (IsClientConnected(victim) && IsClientInGame(victim)) { PerformTimedSwitch(victim); } switchOnDeath[victim] = false; } } public Event_RoundEnd( Handle:event, const String:name[], bool:dontBroadcast) { if (!onRoundEndPossible) { return; } for (new i = 1; i <= MaxClients; i++) { if (switchOnRoundEnd[i]) { PerformTimedSwitch(i); switchOnRoundEnd[i] = false; } } } public OnLibraryRemoved(const String:name[]) { if (StrEqual(name, "adminmenu")) { hAdminMenu = INVALID_HANDLE; } } public OnAdminMenuReady( Handle:topmenu ) { if (topmenu == hAdminMenu) { return; } hAdminMenu = topmenu; new TopMenuObject:menu_category = AddToTopMenu(hAdminMenu, "ts_commands", TopMenuObject_Category, Handle_Category, INVALID_TOPMENUOBJECT); if (menu_category == INVALID_TOPMENUOBJECT) { return; } AddToTopMenu(hAdminMenu, "ts_immed", TopMenuObject_Item, Handle_ModeImmed, menu_category, "ts_immed", TEAMSWITCH_ADMINFLAG); AddToTopMenu(hAdminMenu, "ts_death", TopMenuObject_Item, Handle_ModeDeath,menu_category, "ts_death", TEAMSWITCH_ADMINFLAG); if (onRoundEndPossible) { AddToTopMenu(hAdminMenu, "ts_rend", TopMenuObject_Item, Handle_ModeRend,menu_category, "ts_rend", TEAMSWITCH_ADMINFLAG); } AddToTopMenu(hAdminMenu, "ts_spec", TopMenuObject_Item, Handle_ModeSpec, menu_category, "ts_spec", TEAMSWITCH_ADMINFLAG); } public Handle_Category( Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, String:buffer[], maxlength ) { switch (action) { case TopMenuAction_DisplayTitle: { Format( buffer, maxlength, "%T", "ts when", param); } case TopMenuAction_DisplayOption: { Format( buffer, maxlength, "%T", "ts commands", param); } } } public Handle_ModeImmed(Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, String:buffer[], maxlength) { if (action == TopMenuAction_DisplayOption) { Format( buffer, maxlength, "%T", "ts immediately", param); } else if( action == TopMenuAction_SelectOption) { ShowPlayerSelectionMenu(param, TeamSwitchEvent_Immediately); } } public Handle_ModeDeath(Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, String:buffer[], maxlength) { if (action == TopMenuAction_DisplayOption) { Format(buffer, maxlength, "%T", "ts on death", param); } else if (action == TopMenuAction_SelectOption) { ShowPlayerSelectionMenu(param, TeamSwitchEvent_OnDeath); } } public Handle_ModeRend(Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, String:buffer[], maxlength) { if (action == TopMenuAction_DisplayOption) { Format(buffer, maxlength, "%T", "ts on round end", param); } else if (action == TopMenuAction_SelectOption) { ShowPlayerSelectionMenu(param, TeamSwitchEvent_OnRoundEnd); } } public Handle_ModeSpec(Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, String:buffer[], maxlength) { if (action == TopMenuAction_DisplayOption) { Format(buffer, maxlength, "%T", "ts to spec", param); } else if (action == TopMenuAction_SelectOption) { ShowPlayerSelectionMenu(param, TeamSwitchEvent_ToSpec); } } void:ShowPlayerSelectionMenu(client, TeamSwitchEvent:event, item = 0) { new Handle:playerMenu = INVALID_HANDLE; switch (event) { case TeamSwitchEvent_Immediately: { playerMenu = CreateMenu(Handle_SwitchImmed); } case TeamSwitchEvent_OnDeath: { playerMenu = CreateMenu(Handle_SwitchDeath); } case TeamSwitchEvent_OnRoundEnd: { playerMenu = CreateMenu( Handle_SwitchRend); } case TeamSwitchEvent_ToSpec: { playerMenu = CreateMenu(Handle_SwitchSpec); } } SetMenuTitle(playerMenu, "%T", "ts choose player", client); SetMenuExitButton(playerMenu, true); SetMenuExitBackButton(playerMenu, true); new cTeam = 0; decl String:cName[45], String:buffer[50], String:cBuffer[5]; for (new i = 1; i < MaxClients; i++) { if (IsClientInGame(i)) { cTeam = GetClientTeam(i); if (cTeam <= 1) { continue; } GetClientName(i, cName, sizeof(cName)); switch (event) { case TeamSwitchEvent_Immediately, TeamSwitchEvent_ToSpec: { Format(buffer, sizeof(buffer), "[%s] %s", (cTeam == 2 ? teamName1 : teamName2), cName); } case TeamSwitchEvent_OnDeath: { Format(buffer, sizeof(buffer), "[%s] [%s] %s", (switchOnDeath[i] ? 'x' : ' '), (cTeam == 2 ? teamName1 : teamName2), cName); } case TeamSwitchEvent_OnRoundEnd: { Format(buffer, sizeof(buffer), "[%s] [%s] %s", (switchOnRoundEnd[i] ? 'x' : ' '), (cTeam == 2 ? teamName1 : teamName2), cName); } } IntToString(i, cBuffer, sizeof(cBuffer)); AddMenuItem(playerMenu, cBuffer, buffer); } } if (item == 0) { DisplayMenu(playerMenu, client, 30); } else { DisplayMenuAtItem(playerMenu, client, item-1, 30); } } public Handle_SwitchImmed(Handle:playerMenu, MenuAction:action, client, target) { Handle_Switch(TeamSwitchEvent_Immediately, playerMenu, action, client, target); } public Handle_SwitchDeath(Handle:playerMenu, MenuAction:action, client, target) { Handle_Switch(TeamSwitchEvent_OnDeath, playerMenu, action, client, target); } public Handle_SwitchRend(Handle:playerMenu, MenuAction:action, client, target) { Handle_Switch(TeamSwitchEvent_OnRoundEnd, playerMenu, action, client, target); } public Handle_SwitchSpec(Handle:playerMenu, MenuAction:action, client, target) { Handle_Switch(TeamSwitchEvent_ToSpec, playerMenu, action, client, target); } void:Handle_Switch(TeamSwitchEvent:event, Handle:playerMenu, MenuAction:action, client, param) { switch( action ) { case MenuAction_Select: { decl String:info[5]; GetMenuItem(playerMenu, param, info, sizeof(info)); new target = StringToInt(info, 10); if (IsClientConnected(target) && IsClientInGame(target)) { switch (event) { case TeamSwitchEvent_Immediately: { PerformSwitch(target); if (colour) { decl String:target_name[64]; if (GetClientName(target, target_name, sizeof(target_name))) { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admin switch", target_name, "ts opposite team"); } else { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admins switch", client, target_name, "ts opposite team"); } } } } } else { decl String:target_name[64]; if (GetClientName(target, target_name, sizeof(target_name))) { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "[SM] %t %s %t", "ts admin switch", target_name, "ts opposite team"); } else { PrintToChat(i, "[SM] %t %s %t", "ts admins switch", client, target_name, "ts opposite team"); } } } } } } case TeamSwitchEvent_OnDeath: { if (IsPlayerAlive(target)) { switchOnDeath[target] = !switchOnDeath[target]; } else { PerformSwitch(target); } if (switchOnDeath[target]) { if (colour) { decl String:target_name[50]; GetClientName(target, target_name, sizeof(target_name)); PrintToChatAll("\x01[SM] \x03%s \x01%t", target_name, "ts will be switch to apposite team on death"); } else { decl String:target_name[50]; GetClientName(target, target_name, sizeof(target_name)); PrintToChatAll("[SM] %s %t", target_name, "ts will be switch to apposite team on death" ); } } else { if (colour) { decl String:target_name[50]; GetClientName(target, target_name, sizeof(target_name)); PrintToChatAll("\x01[SM] \x03%s \x01%t", target_name, "ts will not be switch to apposite team on death");} else { decl String:target_name[50]; GetClientName(target, target_name, sizeof(target_name)); PrintToChatAll("[SM] %s %t", target_name, "ts will not be switch to apposite team on death" ); } } } case TeamSwitchEvent_OnRoundEnd: { switchOnRoundEnd[target] = !switchOnRoundEnd[target]; if (switchOnRoundEnd[target]) { if (colour) { decl String:target_name[50]; GetClientName( target, target_name, sizeof(target_name) ); PrintToChatAll( "\x01[SM] \x03%s \x01%t", target_name, "ts will be switch to apposite team on rounend"); } else { decl String:target_name[50]; GetClientName(target, target_name, sizeof(target_name)); PrintToChatAll( "[SM] %s %t", target_name, "ts will be switch to apposite team on rounend" ); } } else { if (colour) { decl String:target_name[50]; GetClientName(target, target_name, sizeof(target_name)); PrintToChatAll( "\x01[SM] \x03%s \x01%t", target_name, "ts will not be switch to apposite team on rounend"); } else { decl String:target_name[50]; GetClientName(target, target_name, sizeof(target_name)); PrintToChatAll("[SM] %s %t", target_name, "ts will not be switch to apposite team on rounend" ); } } } case TeamSwitchEvent_ToSpec: { PerformSwitch(target, true); if (colour) { decl String:target_name[50]; if (GetClientName(target, target_name, sizeof(target_name))) { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admin switch", target_name, "ts to spectators"); } else { PrintToChat(i, "\x01[SM] \x01%t \x03%s \x01%t", "ts admins switch", client, target_name, "ts to spectators"); } } } } } else { decl String:target_name[50]; if (GetClientName(target, target_name, sizeof(target_name))) { for (new i = 1; i <= MaxClients; i++) { if (IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i)) { if (GetUserFlagBits(i) == 0) { PrintToChat(i, "[SM] %t %s %t", "ts admin switch", target_name, "ts to spectators"); } else { PrintToChat(i, "[SM] %t %s %t", "ts admins switch", client, target_name, "ts to spectators"); } } } } } } } } ShowPlayerSelectionMenu(client, event, target); } case MenuAction_Cancel: { if (param == MenuCancel_ExitBack) { RedisplayAdminMenu(hAdminMenu, client); } } case MenuAction_End: { CloseHandle(playerMenu); } } } void:PerformTimedSwitch(client) { CreateTimer(0.5, Timer_TeamSwitch, GetClientUserId(client)); } public Action:Timer_TeamSwitch(Handle:timer, any:userid) { new client = GetClientOfUserId(userid); if (client != 0 && IsClientConnected(client) && IsClientInGame(client)) { PerformSwitch(client); } return Plugin_Stop; } void:PerformSwitch(client, bool:toSpec = false) { new cTeam = GetClientTeam(client), iTemp, toTeam = ( toSpec ? TEAM_SPEC : TEAM_1 + TEAM_2 - cTeam ); if (cstrikeExtAvail && !toSpec) { CS_SwitchTeam(client, toTeam); if (cTeam == TEAM_2) { SetEntityModel(client, "models/player/t_leet.mdl"); } else { SetEntityModel(client, "models/player/ct_sas.mdl"); } iTemp = GetPlayerWeaponSlot(client, 4); if (iTemp != -1) { CS_DropWeapon(client, iTemp, false, false); } } else { ChangeClientTeam(client, toTeam); } decl String:sName[64]; if (GetClientName(client, sName, sizeof(sName))) { if (colour) { PrintToChatAll("\x01[SM] \x03%s \x01%t", sName, "ts switch by admin" ); } else { PrintToChatAll("[SM] %s %t", sName, "ts switch by admin" ); } } }
Отправить
Загрузил
goshasolomon
2024-06-10 19:14:58
0
14
Установить на сервер
Скачать
Нет оплаченых серверов
Купить сервер CS 1.6
Купить сервер CS:GO
Купить сервер CSS v34
Подключить свой VDS к панели
Данная иконка означает, что плагин был проверен администрацией хостинга на тестовом сервере, и проблем с ним не было выявлено. Рекомендуем ставить исключительно проверенные плагины.
Плагин загружен на сервер, но проверка еще не была проведена.
CSHOST.COM.UA 2012-2024 Хостинг игровых серверов