Advertisement
Diskretor

Untitled

Jun 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4.  
  5. #define PLUGIN_VERSION "1.0"
  6.  
  7. #pragma semicolon 1
  8. #pragma newdecls required
  9.  
  10. public Plugin myinfo =
  11. {
  12. name = "L4D Kick Special Infected",
  13. author = "Alex Dragokas",
  14. description = "Kick Special Infected",
  15. version = "1.0",
  16. url = "https://github.com/dragokas"
  17. };
  18.  
  19. int g_iLoadStatus = false;
  20.  
  21. public void OnPluginStart()
  22. {
  23. g_iLoadStatus = 1;
  24. }
  25. public void OnMapStart()
  26. {
  27. g_iLoadStatus = 1;
  28. }
  29. public void OnMapEnd()
  30. {
  31. g_iLoadStatus = 0;
  32. }
  33. public void Event_RoundEnd(Handle event, const char[] name, bool dontBroadcast)
  34. {
  35. g_iLoadStatus = 0;
  36. }
  37. public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
  38. {
  39. g_iLoadStatus = 1;
  40. }
  41. public void OnPluginEnd()
  42. {
  43. g_iLoadStatus = 0;
  44. }
  45.  
  46. public void OnEntityCreated(int entity, const char[] classname)
  47. {
  48. if( g_iLoadStatus == 0)
  49. return;
  50.  
  51. if( strcmp(classname, "infected") == 0 )
  52. {
  53. SDKHook(entity, SDKHook_SpawnPost, OnSpawnCommon);
  54. }
  55. }
  56.  
  57. public void OnSpawnCommon(int Ent)
  58. {
  59. if (IsSpecialInfected (Ent))
  60. {
  61. PrintToChatAll("Starting kicking...");
  62. }
  63. }
  64.  
  65. bool IsSpecialInfected(int target)
  66. {
  67. if( target > 0 && target <= MaxClients && IsClientInGame(target) && GetClientTeam(target) == 3 )
  68. {
  69. int class = GetEntProp(target, Prop_Send, "m_zombieClass") + 1;
  70. if( class == 9 ) class = 8;
  71.  
  72. PrintToChatAll("Spawned class: %i", class);
  73.  
  74. }
  75. return false;
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement