RSSy MYGO.pl Opublikowano Czerwiec 24, 2021 o 17:59 RSSy Udostępnij Opublikowano Czerwiec 24, 2021 o 17:59 I have such a plugin, it forbids changing teams. I want players to be able to switch back to their old teams after switching to the spectator team. But they cannot move to another team. Example: I Switched From T Team to Audience Team I Can't Switch To CT Team. I have to go back to T-Team. Plugin won't allow me to Switch to Spec Team while in a Team. Let him. It would be great if it could be added in immunity for admins. I'm sorry for my bad english. Code: #include <sourcemod> #include <cstrike> #include <sdktools> public OnPluginStart() { RegAdminCmd("sm_spectate", command_switchSpec, ADMFLAG_CUSTOM6, "Switch to specatate"); RegAdminCmd("sm_spec", command_switchSpec, ADMFLAG_CUSTOM6, "Switch to specatate"); AddCommandListener(altJoin, "jointeam"); } public Action:command_switchSpec(client, args) { switch(GetClientTeam(client)) { case CS_TEAM_CT, CS_TEAM_T: { ChangeClientTeam(client, CS_TEAM_SPECTATOR); return Plugin_Handled; } case CS_TEAM_SPECTATOR: { ChangeClientTeam(client, CS_TEAM_T); return Plugin_Handled; } } return Plugin_Handled; } public Action:altJoin(Client, const String:command[], argc) { if(!IsClientInGame(Client) || argc < 1) { return Plugin_Handled; } decl String:arg[8]; GetCmdArg(1, arg, sizeof(arg)); new teamJoin = StringToInt(arg); new teamLeave = GetClientTeam(Client); if(teamLeave == teamJoin || IsFakeClient(Client)) { return Plugin_Continue; } else { // ignore switches between T/CT team if((teamLeave == CS_TEAM_CT && teamJoin == CS_TEAM_T) || (teamLeave == CS_TEAM_T && teamJoin == CS_TEAM_CT)) { return Plugin_Handled; } } return Plugin_Handled; } Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi