HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*
  2.  
  3. Napalm Grenades
  4.  
  5. *Ignites Players Injured By Greandes
  6.  
  7. */
  8.  
  9.  
  10. #include <sourcemod>
  11. #include <sdktools_functions>
  12.  
  13. #define VERSION "0.4"
  14.  
  15. new Handle:Switch;
  16. new String:Weapon[30];
  17.  
  18. public Plugin:myinfo =
  19. {
  20. name = "Napalm Granat",
  21. author = "Peoples Army",
  22. description = "Meggyullad az ellenfel tolle! (HE granat) ",
  23. version = VERSION,
  24. url = "www.sourcemod.net"
  25. };
  26.  
  27. // create convars and hook event
  28.  
  29. public OnPluginStart()
  30. {
  31. Switch = CreateConVar("napalm_nades_on","1","Plugin be/ki(1/0) kapcsolasa",FCVAR_NOTIFY);
  32. HookEvent("player_hurt",DamageEvent);
  33. HookEvent("player_death",DeathEvent);
  34. }
  35.  
  36. //hook the player_hurt event and look for nade damge
  37.  
  38. public DamageEvent(Handle:event,const String:name[],bool:dontBroadcast)
  39. {
  40. GetEventString(event,"weapon",Weapon,30);
  41. new DmgDone = GetEventInt(event,"dmg_health");
  42. new clientid = GetEventInt(event,"userid");
  43. new client = GetClientOfUserId(clientid);
  44.  
  45. // if plugin is on and nade was found then ignite client
  46.  
  47. if(StrEqual(Weapon,"hegrenade")== true && GetConVarInt(Switch))
  48. {
  49. PrintToChat(client,"Meggyulladtal egy Napalm Granattol!!!");
  50.  
  51. if(DmgDone <= 30)
  52. {
  53. IgniteEntity(client,12.0);
  54. }else if(DmgDone > 71)
  55. {
  56. IgniteEntity(client,9.0);
  57. }else if(DmgDone > 51)
  58. {
  59. IgniteEntity(client,6.0);
  60. }else if (DmgDone >= 31)
  61. {
  62. IgniteEntity(client,3.0);
  63. }
  64. }
  65. }
  66.  
  67. // extinguihs player on death event to stop eternal ignite sound bug
  68.  
  69. public DeathEvent(Handle:event,const String:name[],bool:dontBroadcast)
  70. {
  71. new clientid = GetEventInt(event,"userid");
  72. new client = GetClientOfUserId(clientid);
  73.  
  74. ExtinguishEntity(client);
  75. }
  76.  
  77. public OnClientDisconnect(client)
  78. {
  79. if(IsClientInGame(client)== true)
  80. {
  81. ExtinguishEntity(client);
  82. }
  83. }
  84.  
  85. public bool:OnClientConnect(client)
  86. {
  87. if(IsClientInGame(client)== true)
  88. {
  89. ExtinguishEntity(client);
  90. }
  91. return true;
  92. }