HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* AMX Mod X script.
  2. *
  3. * (c) Copyright 2002-2003, f117bomb
  4. * This file is provided as is (no warranties).
  5. *
  6. * *******************************************************************************
  7. *
  8. * Ported By KingPin( kingpin@onexfx.com ). I take no responsibility
  9. * for this file in any way. Use at your own risk. No warranties of any kind.
  10. *
  11. * *******************************************************************************
  12. *
  13. * Set Cvar 'amx_respawn' 1 or 0
  14. *
  15. */
  16.  
  17. #include <amxmodx>
  18. #include <fun>
  19.  
  20. public TeamSelect(id)
  21. {
  22. if (get_cvar_num("amx_respawn") == 1) {
  23. new sId[2]
  24. sId[0] = id
  25. set_task(10.0,"respawn",0,sId,2)
  26. }
  27. return PLUGIN_CONTINUE
  28. }
  29.  
  30. public death_msg()
  31. {
  32. if (get_cvar_num("amx_respawn") == 1) {
  33. new vIndex = read_data(2)
  34. new svIndex[2]
  35. svIndex[0] = vIndex
  36. set_task(0.5,"respawn",0,svIndex,2)
  37. }
  38. return PLUGIN_CONTINUE
  39. }
  40.  
  41. public respawn(svIndex[])
  42. {
  43. new vIndex = svIndex[0]
  44. if(get_user_team(vIndex) == 3 || is_user_alive(vIndex))
  45. return PLUGIN_CONTINUE
  46. spawn(vIndex)
  47.  
  48. return PLUGIN_CONTINUE
  49. }
  50.  
  51. public plugin_init()
  52. {
  53. register_plugin("amx_respawn","0.9.4","f117bomb")
  54. register_event("DeathMsg","death_msg","a")
  55. register_event("ShowMenu","TeamSelect","b","4&Team_Select")
  56. register_event("VGUIMenu","TeamSelect","b","1=2")
  57. register_cvar("amx_respawn","1")
  58.  
  59. return PLUGIN_CONTINUE
  60. }