Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #pragma newdecls required
- #include <sourcemod>
- #include <sdktools>
- #include <cstrike>
- public void OnPluginStart()
- {
- LoadTranslations("common.phrases");
- RegAdminCmd("sm_spec", Command_Spectator, ADMFLAG_GENERIC, "sm_spec <#userid|name>");
- RegAdminCmd("sm_t", Command_Terrorist, ADMFLAG_GENERIC, "sm_t <#userid|name>");
- RegAdminCmd("sm_ct", Command_CounterTerrorist, ADMFLAG_GENERIC, "sm_ct <#userid|name>");
- }
- public Action Command_Spectator(int client, int args)
- {
- if (args < 1)
- {
- ReplyToCommand(client, "{SM] Usage: sm_spectator <#userid|name>");
- return Plugin_Handled;
- }
- char arg[256];
- GetCmdArgString(arg, sizeof(arg));
- int target = FindTarget(client, arg, false, true);
- if (target == -1)
- {
- return Plugin_Handled;
- }
- if (GetClientTeam(target) == CS_TEAM_SPECTATOR)
- {
- ReplyToCommand(client, "{SM] This command cannot be used on spectators.");
- return Plugin_Handled;
- }
- if (IsPlayerAlive(target))
- {
- ForcePlayerSuicide(target);
- }
- ChangeClientTeam(target, CS_TEAM_SPECTATOR);
- PrintToChatAll("[SM] ADMIN: Moved %N to Spectators", target);
- return Plugin_Handled;
- }
- public Action Command_Terrorist(int client, int args)
- {
- if (args < 1)
- {
- ReplyToCommand(client, "{SM] Usage: sm_t <#userid|name>");
- return Plugin_Handled;
- }
- char arg[256];
- GetCmdArgString(arg, sizeof(arg));
- int target = FindTarget(client, arg);
- if (target == -1)
- {
- return Plugin_Handled;
- }
- if (GetClientTeam(target) == CS_TEAM_T)
- {
- ReplyToCommand(client, "{SM] This command cannot be used on terrorists.");
- return Plugin_Handled;
- }
- if (IsPlayerAlive(target))
- {
- ForcePlayerSuicide(target);
- }
- ChangeClientTeam(target, CS_TEAM_T);
- PrintToChatAll("[SM] ADMIN: Moved %N to Terrorists", target);
- return Plugin_Handled;
- }
- public Action Command_CounterTerrorist(int client, int args)
- {
- if (args < 1)
- {
- ReplyToCommand(client, "{SM] Usage: sm_ct <#userid|name>");
- return Plugin_Handled;
- }
- char arg[256];
- GetCmdArgString(arg, sizeof(arg));
- int target = FindTarget(client, arg);
- if (target == -1)
- {
- return Plugin_Handled;
- }
- if (GetClientTeam(target) == CS_TEAM_CT)
- {
- ReplyToCommand(client, "{SM] This command cannot be used on CT.");
- return Plugin_Handled;
- }
- if (IsPlayerAlive(target))
- {
- ForcePlayerSuicide(target);
- }
- ChangeClientTeam(target, CS_TEAM_CT);
- PrintToChatAll("[SM] ADMIN: Moved %N to CT", target);
- return Plugin_Handled;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement