SHARE
TWEET

Untitled

a guest Oct 21st, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma semicolon 1
  2.  
  3. #include <sourcemod>
  4. #include <sdktools>
  5. #include <morecolors>
  6.  
  7. #define PLUGIN_AUTHOR "Zonas"
  8. #define PLUGIN_VERSION "1.00"
  9.  
  10. #define SIZE 255
  11.  
  12. #pragma newdecls required
  13.  
  14. public Plugin myinfo =
  15. {
  16.     name = "[TF2] Hug",
  17.     author = PLUGIN_AUTHOR,
  18.     description = "",
  19.     version = PLUGIN_VERSION,
  20.     url = "id/zonekoisback"
  21. };
  22.  
  23. public void OnPluginStart() {
  24.   LoadTranslations("common.phrases");
  25.   RegConsoleCmd("sm_hug", Command_Hug, "sm_Hug <#userid|name> - Hugs a target.");
  26. }
  27.  
  28. public Action Command_Hug(int client, int args) {
  29.   char arg1[SIZE];
  30.  
  31.   if (!IsValidClient(client)) return Plugin_Handled;
  32.   // Usage
  33.   if (args > 1 || args < 0) {
  34.     CPrintToChat(client, "{FULLRED}[SVH] {TURQUOISE}Usage: {DARKGRAY}sm_hug <#userid|name>");
  35.     return Plugin_Handled;
  36.   } else if (args == 0) {
  37.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N {DARKGRAY}Hugged God!", client);
  38.     return Plugin_Handled;
  39.   }
  40.  
  41.   GetCmdArg(1, arg1, sizeof(arg1));
  42.  
  43.   if (StrEqual(arg1, "@red", false)) {
  44.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N {DARKGRAY}Hugged {TURQUOISE}Red Team{DARKGRAY}! Lovely", client);
  45.     return Plugin_Handled;
  46.   } else if (StrEqual(arg1, "@blue", false)) {
  47.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N {DARKGRAY}Hugged {TURQUOISE}Blu Team{DARKGRAY}! Uh.", client);
  48.     return Plugin_Handled;
  49.   }else if (StrEqual(arg1, "@alive", false)) {
  50.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N {DARKGRAY}Hugged all {TURQUOISE}Alive Players{DARKGRAY}. Life is Beautiful", client);
  51.     return Plugin_Handled;
  52.    }else if (StrEqual(arg1, "@dead", false)) {
  53.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N {DARKGRAY}Hugged all {TURQUOISE}Dead Players{DARKGRAY}. Necrophilia uh.. big bones", client);
  54.     return Plugin_Handled;
  55.    }else if (StrEqual(arg1, "@server", false)) {
  56.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N {DARKGRAY}Hugged {TURQUOISE}The Server {DARKGRAY}! Stay Very Happy guys.", client);
  57.     return Plugin_Handled;
  58.    }else if (StrEqual(arg1, "@me", false)) {
  59.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N{DARKGRAY}, You can't hug {TURQUOISE}YOURSELF {DARKGRAY}LMAO", client);
  60.     return Plugin_Handled;
  61.    }        
  62.  
  63.   int targets[MAXPLAYERS];
  64.   int filter_flag = COMMAND_FILTER_NO_IMMUNITY;
  65.   char target_name[SIZE];
  66.   bool tn_is_ml;
  67.  
  68.   int targets_found = ProcessTargetString(arg1,
  69.                                   client,
  70.                                   targets, sizeof(targets),
  71.                                   filter_flag,
  72.                                   target_name, sizeof(target_name), tn_is_ml);
  73.  
  74.   if (targets_found <= COMMAND_TARGET_NONE) {
  75.     ReplyToTargetError(client, targets_found);
  76.   } else {
  77.     CPrintToChatAll("{FULLRED}[SVH] {TURQUOISE}%N {DARKGRAY}Hugged {TURQUOISE}%s{DARKGRAY}! That's so cute!!", client, target_name);
  78.   }
  79.   return Plugin_Handled;
  80. }
  81.  
  82. bool IsValidClient(int client) {
  83.   return (client > 0 && client <= MaxClients && IsClientInGame(client) && !IsFakeClient(client));
  84. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top