Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. #include <tf2_stocks>
  2. #include <tf2>
  3. #include <sourcemod>
  4.  
  5. #define CRAB_BELL "misc/jingle_bells/jingle_bells_nm_01.wav"
  6.  
  7. public Plugin:myinfo =
  8. {
  9. name = "Spycrab",
  10. description = "Server Spycrab Tools",
  11. author = "The Doctor!",
  12. version = "1.2",
  13. url = "http://dcommunity.tk"
  14. }
  15.  
  16. public OnPluginStart()
  17. {
  18. RegAdminCmd("sm_mcon", eventon, ADMFLAG_GENERIC, "Masscrab On");
  19. RegAdminCmd("sm_mcoff", eventoff, ADMFLAG_GENERIC, "Masscrab Off");
  20. RegAdminCmd("sm_playsound", playsound, ADMFLAG_GENERIC, "Emit Crab Bell");
  21.  
  22. PrecacheSound(CRAB_BELL);
  23. }
  24.  
  25. public OnClientPutInServer(client)
  26. {
  27. CreateTimer(0.5, HUD, client, TIMER_REPEAT);
  28. }
  29.  
  30. public Action:HUD(Handle:timer, any:client)
  31. {
  32. if(IsClientConnected(client) && IsClientInGame(client))
  33. {
  34. SetHudTextParams(-1.12, 0.1, 0.5, 255,0,0,255, 0, 6.0, 0.1, 0.2);
  35. ShowHudText(client, -1, "Masscrab mode on!");
  36. }
  37. }
  38.  
  39. public Action:playsound(client, args)
  40. {
  41. EmitSoundToAll("CRAB_BELL", client);
  42. PrintToChat(client, "Crab bell has been emitted to all players!");
  43. }
  44.  
  45. public Action:eventoff(client, args)
  46. {
  47. new Handle:plugin = GetMyHandle(), String:namePlugin[256];
  48. GetPluginFilename(plugin, namePlugin, sizeof(namePlugin));
  49. ServerCommand("sm plugins unload %s", namePlugin);
  50.  
  51. PrintToChat(client, "Masscrab mode disabled!");
  52.  
  53. return Plugin_Handled;
  54. }
  55.  
  56. public Action:eventon(client, args)
  57. {
  58. new Handle:plugin = GetMyHandle(), String:namePlugin[256];
  59. GetPluginFilename(plugin, namePlugin, sizeof(namePlugin));
  60. ServerCommand("sm plugins load %s", namePlugin);
  61.  
  62. PrintToChat(client, "Masscrab mode enabled!");
  63.  
  64. return Plugin_Handled;
  65. }
  66.  
  67. public TF2_OnConditionAdded(client, TFCond:condition)
  68. {
  69. if(TF2_GetPlayerClass(client) == TFClass_Spy && condition == TFCond_Taunting)
  70. {
  71. CreateTimer(3.1, Tauntcheck, client);
  72. }
  73. }
  74.  
  75. public Action:Tauntcheck(Handle:timer, any:client)
  76. {
  77. if(TF2_GetPlayerClass(client) == TFClass_Spy)
  78. {
  79. if(!TF2_IsPlayerInCondition(client, TFCond_Taunting))
  80. {
  81. PrintToChat(client, "Spycrab!")
  82. TF2_RespawnPlayer(client);
  83. }
  84. else
  85. {
  86. PrintToChat(client, "");
  87. }
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement