HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* AMXX Mod script.
  2. *
  3. * (c) Copyright 2004, dkészítõ: Geesu
  4. * Ez a fájl csak tájékoztató! ( Nincs garancia ).
  5. *
  6. * Változásnapló
  7. * 1.1:
  8. * Hozzáadva a /respawn parancs, ha a játékos halott.
  9. * Hozzáadva egy plugin cvar.
  10. * 1.0:
  11. * Pisztoly ad a játékosoknak, amikor újraélednek.
  12. * sv_checkpistols cvar hozzáadva, ha a plugint scoutknivez_ vagy ka_ mapokon akarják használni.
  13. * sv_respart cvar hozzáadva, hogy ki/be lehessen a plugint kapcsolni.
  14. */
  15.  
  16. new const VERZIO[] = "1.1"
  17.  
  18. #include <amxmodx>
  19. #include <fun>
  20. #include <cstrike>
  21.  
  22. #define DISABLE_CS 0
  23.  
  24. // team ids
  25. #define UNASSIGNED 0
  26. #define TS 1
  27. #define CTS 2
  28. #define AUTO_TEAM 5
  29.  
  30. new bool:g_PistolsDisabled = false
  31.  
  32. public plugin_init(){
  33.  
  34. register_plugin("Respawn Forever", VERZIO, "Pimp Daddy (OoTOAoO)")
  35.  
  36. register_event("DeathMsg","on_Death","a")
  37.  
  38. register_cvar("sv_checkpistols", "1")
  39. register_cvar("sv_respawn", "1")
  40. register_cvar("respawn_forever_version", VERZIO, FCVAR_SERVER)
  41.  
  42. register_clcmd("say","on_Chat")
  43. register_clcmd("say_team","on_Chat")
  44. }
  45.  
  46. public on_Chat(id)
  47. {
  48. if ( !get_cvar_num("sv_respawn") )
  49. {
  50. client_print(id, print_chat, "* Respawn plugin kikapcsolva!")
  51. return PLUGIN_CONTINUE
  52. }
  53.  
  54. new szSaid[32]
  55. read_args(szSaid, 31)
  56.  
  57. if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^"") || equali(szSaid,"^"/ujra^""))
  58. {
  59. spawn_func(id)
  60. }
  61. return PLUGIN_HANDLED;
  62. }
  63.  
  64. public check_pistols()
  65. {
  66. /* Determine if we should give players a pistol or not */
  67. if ( get_cvar_num("sv_checkpistols") )
  68. {
  69. set_task(1.0, "check_pistols")
  70. new mapname[32]
  71. get_mapname(mapname,31)
  72. if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
  73. g_PistolsDisabled = true
  74. }
  75. }
  76.  
  77. public spawn_func(id)
  78. {
  79. new parm[1]
  80. parm[0]=id
  81.  
  82. /* Spawn the player twice to avoid the HL engine bug */
  83. set_task(0.5,"player_spawn",72,parm,1)
  84. set_task(0.7,"player_spawn",72,parm,1)
  85. set_task(0.9, "hud", id)
  86.  
  87. /* Then give them a suit and a knife */
  88. set_task(0.9,"player_giveitems",72,parm,1)
  89. }
  90.  
  91. public hud( id )
  92. {
  93. set_hudmessage(0, 255, 255, -1.0, 0.67, 0, 6.0, 6.0)
  94. show_hudmessage(id, "Sikeresen Ujraledtel!")
  95. }
  96. public on_Death()
  97. {
  98. if ( !get_cvar_num("sv_respawn") )
  99. return PLUGIN_CONTINUE
  100.  
  101. new victim_id = read_data(2)
  102.  
  103. spawn_func( victim_id )
  104.  
  105. return PLUGIN_CONTINUE
  106. }
  107.  
  108. public player_giveitems(parm[1])
  109. {
  110. new id = parm[0]
  111.  
  112. give_item(id, "item_suit")
  113. give_item(id, "weapon_knife")
  114.  
  115. give_item(id, "weapon_flashbang")
  116.  
  117. return PLUGIN_CONTINUE
  118. }
  119.  
  120. public player_spawn(parm[1])
  121. {
  122. spawn(parm[0])
  123. }
  124.