hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.06.05. 12:51



Jelenlévő felhasználók

Jelenleg 215 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 215 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Kezdövédelem
HozzászólásElküldve: 2013.05.04. 16:54 
Offline
Újonc

Csatlakozott: 2012.08.31. 14:38
Hozzászólások: 7
Hello

Az lenne a kérésem hogy ezt a plugin kezdövédelmet csak a kör kezdetekor dolgozzon.
Azaz amikor elindul a kör attol 5 mpt dolgozzon és mar akik ujra élednek azoknak ne legyen kezdö védelem.
SMA Forráskód: [ Mindet kijelol ]
  1. //----------------------------------------------------------//
  2. /* CREDITS :
  3.   Thanks to Xeroblood, JJkiller, KingPin for helping me make
  4.   this plugin and Firestorm for helping adding a lot of things
  5.  
  6.   INSTALLING :
  7.   Download .SMA to Scripting folder, run compiler, copy the
  8.   file from Compiled folder and paste in Plugins folder, add the plugin name
  9.   in the Amxx plugins.ini ie : spawnprotection.amxx
  10.  
  11.   DESCRIPTION :
  12.   Protects players when the spawn from being killed
  13.  
  14.   CHANGELOG :
  15.   Version 1.0 - First Release
  16.   Version 2.0 - Fixed godmode cvar problems
  17.   Version 3.0 - Added message time control cvar
  18.   Version 4.0 - Fixed errors
  19.   Version 5.0 - Added message control cvar
  20.   Version 6.0 - Fixed errors - THANKS VEN!
  21.   Version 7.0 - Cleaned up plugin and fixed errors - THANKS
  22.   AVALANCHE, VEN and SubStream!
  23. */
  24. //----------------------------------------------------------//
  25. #include <amxmodx>
  26. #include <amxmisc>
  27. #include <fun>
  28. //----------------------------------------------------------//
  29. public plugin_init()
  30. {
  31. register_plugin("Spawn Protection", "7.0", "Peli") // Plugin Information
  32. register_concmd("amx_sptime", "cmd_sptime", ADMIN_CVAR, "1 through 10 to set Spawn Protection time") // Concmd (Console Command) for the CVAR time
  33. register_concmd("amx_spmessage", "cmd_spmessage", ADMIN_CVAR, "1 = Turn Spawn Protection Message on , 0 = Turn Spawn Protection message off") // Concmd for the CVAR message
  34. register_concmd("amx_spshellthickness", "cmd_spshellthickness", ADMIN_CVAR, "1 through 100 to set Glow Shellthickness") // Concmd for the shellthickness
  35. register_cvar("sv_sp", "1") // Cvar (Command Variable) for the plugin on/off
  36. register_cvar("sv_sptime", "5") // Cvar for controlling the message time (1-10 seconds)
  37. register_cvar("sv_spmessage", "1") // Cvar for controlling the message on/off
  38. register_cvar("sv_spshellthick", "25") // Cvar for controlling the glow shell thickness
  39. register_event("ResetHUD", "sp_on", "be")
  40. register_clcmd("fullupdate", "clcmd_fullupdate")
  41. }
  42. //----------------------------------------------------------//
  43. public client_disconnect(id)
  44. {
  45. remove_task(id)
  46. return PLUGIN_HANDLED
  47. }
  48. //----------------------------------------------------------//
  49. public cmd_sptime(id, level, cid) // This is the function for the cvar time control
  50. {
  51. if(!cmd_access(id, level, cid, 2))
  52. return PLUGIN_HANDLED
  53.  
  54. new arg_str[3]
  55. read_argv(1, arg_str, 3)
  56. new arg = str_to_num(arg_str)
  57.  
  58. if(arg > 10 || arg < 1)
  59. {
  60. client_print(id, print_chat, "You have to set the Spawn Protection time between 1 and 10 seconds")
  61. return PLUGIN_HANDLED
  62. }
  63.  
  64. else if (arg > 0 || arg < 11)
  65. {
  66. set_cvar_num("sv_sptime", arg)
  67. client_print(id, print_chat, "You have set the Spawn Protection time to %d second(s)", arg)
  68. return PLUGIN_HANDLED
  69. }
  70. return PLUGIN_CONTINUE
  71. }
  72. //----------------------------------------------------------//
  73. public cmd_spmessage(id, level, cid) // This is the function for the cvar message control
  74. {
  75. if (!cmd_access(id, level, cid, 2))
  76. {
  77. return PLUGIN_HANDLED
  78. }
  79.  
  80. new sp[3]
  81. read_argv(1, sp, 2)
  82.  
  83. if (sp[0] == '1')
  84. {
  85. set_cvar_num("amx_spmessage", 1)
  86. }
  87.  
  88. else if (sp[0] == '0')
  89. {
  90. set_cvar_num("amx_spmessage", 0)
  91. }
  92.  
  93. else if (sp[0] != '1' || sp[0] != '0')
  94. {
  95. console_print(id, "Usage : amx_spmessage 1 = Messages ON | 0 = Messages OFF")
  96. return PLUGIN_HANDLED
  97. }
  98.  
  99. return PLUGIN_HANDLED
  100. }
  101. //----------------------------------------------------------//
  102. public cmd_spshellthickness(id, level, cid)
  103. {
  104. if(!cmd_access(id, level, cid, 2))
  105. return PLUGIN_HANDLED
  106.  
  107. new arg_str[3]
  108. read_argv(1, arg_str, 3)
  109. new arg = str_to_num(arg_str)
  110.  
  111. if(arg > 100 || arg < 1)
  112. {
  113. client_print(id, print_chat, "You have to set the Glow Shellthickness between 1 and 100")
  114. return PLUGIN_HANDLED
  115. }
  116.  
  117. else if (arg > 0 || arg < 101)
  118. {
  119. set_cvar_num("sv_spshellthickness", arg)
  120. client_print(id, print_chat, "You have set the Glow Shellthickness to %d", arg)
  121. return PLUGIN_HANDLED
  122. }
  123. return PLUGIN_CONTINUE
  124. }
  125. //----------------------------------------------------------//
  126. public sp_on(id) // This is the function for the event godmode
  127. {
  128. if(get_cvar_num("sv_sp") == 1)
  129. {
  130. set_task(0.1, "protect", id)
  131. }
  132.  
  133. return PLUGIN_CONTINUE
  134. }
  135. //----------------------------------------------------------//
  136. public protect(id) // This is the function for the task_on godmode
  137. {
  138. new Float:SPTime = get_cvar_float("sv_sptime")
  139. new SPSecs = get_cvar_num("sv_sptime")
  140. new FTime = get_cvar_num("mp_freezetime")
  141. new SPShell = get_cvar_num("sv_spshellthick")
  142. set_user_godmode(id, 1)
  143.  
  144. if(get_user_team(id) == 1)
  145. {
  146. set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, SPShell)
  147. }
  148.  
  149. if(get_user_team(id) == 2)
  150. {
  151. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, SPShell)
  152. }
  153.  
  154. if(get_cvar_num("sv_spmessage") == 1)
  155. {
  156. set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, SPTime+FTime, 0.1, 0.2, 4)
  157. show_hudmessage(id, "Spawn Protection is enabled for %d second(s)", SPSecs)
  158. }
  159.  
  160. set_task(SPTime+FTime, "sp_off", id)
  161. return PLUGIN_HANDLED
  162. }
  163. //----------------------------------------------------------//
  164. public sp_off(id) // This is the function for the task_off godmode
  165. {
  166. new SPShell = get_cvar_num("sv_spshellthick")
  167. if(!is_user_connected(id))
  168. {
  169. return PLUGIN_HANDLED
  170. }
  171.  
  172. else
  173. {
  174. set_user_godmode(id, 0)
  175. set_user_rendering(id, kRenderFxGlowShell, 0, 0,0, kRenderNormal, SPShell)
  176. return PLUGIN_HANDLED
  177. }
  178.  
  179. return PLUGIN_HANDLED
  180. }
  181. //----------------------------------------------------------//
  182. public clcmd_fullupdate(id)
  183. {
  184. return PLUGIN_HANDLED
  185. }
  186. //----------------------------------------------------------//


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Kezdövédelem
HozzászólásElküldve: 2013.05.08. 17:49 
Offline
Őskövület
Avatar

Csatlakozott: 2011.09.17. 17:54
Hozzászólások: 2350
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 57 alkalommal
39. sort:
SMA Forráskód: [ Mindet kijelol ]
  1. register_event("ResetHUD", "sp_on", "be")

cseréld le erre:
SMA Forráskód: [ Mindet kijelol ]
  1. register_event("HLTV", "sp_on", "a", "1=0", "2=0")


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Kezdövédelem
HozzászólásElküldve: 2013.05.09. 10:23 
Offline
Félisten
Avatar

Csatlakozott: 2013.03.12. 10:03
Hozzászólások: 859
Megköszönt másnak: 37 alkalommal
Megköszönték neki: 44 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. //----------------------------------------------------------//
  2. /* CREDITS :
  3.   Thanks to Xeroblood, JJkiller, KingPin for helping me make
  4.   this plugin and Firestorm for helping adding a lot of things
  5.  
  6.   INSTALLING :
  7.   Download .SMA to Scripting folder, run compiler, copy the
  8.   file from Compiled folder and paste in Plugins folder, add the plugin name
  9.   in the Amxx plugins.ini ie : spawnprotection.amxx
  10.  
  11.   DESCRIPTION :
  12.   Protects players when the spawn from being killed
  13.  
  14.   CHANGELOG :
  15.   Version 1.0 - First Release
  16.   Version 2.0 - Fixed godmode cvar problems
  17.   Version 3.0 - Added message time control cvar
  18.   Version 4.0 - Fixed errors
  19.   Version 5.0 - Added message control cvar
  20.   Version 6.0 - Fixed errors - THANKS VEN!
  21.   Version 7.0 - Cleaned up plugin and fixed errors - THANKS
  22.   AVALANCHE, VEN and SubStream!
  23. */
  24. //----------------------------------------------------------//
  25. #include <amxmodx>
  26. #include <amxmisc>
  27. #include <fun>
  28. //----------------------------------------------------------//
  29. public plugin_init()
  30. {
  31. register_plugin("Spawn Protection", "7.0", "Peli") // Plugin Information
  32. register_concmd("amx_sptime", "cmd_sptime", ADMIN_CVAR, "1 through 10 to set Spawn Protection time") // Concmd (Console Command) for the CVAR time
  33. register_concmd("amx_spmessage", "cmd_spmessage", ADMIN_CVAR, "1 = Turn Spawn Protection Message on , 0 = Turn Spawn Protection message off") // Concmd for the CVAR message
  34. register_concmd("amx_spshellthickness", "cmd_spshellthickness", ADMIN_CVAR, "1 through 100 to set Glow Shellthickness") // Concmd for the shellthickness
  35. register_cvar("sv_sp", "1") // Cvar (Command Variable) for the plugin on/off
  36. register_cvar("sv_sptime", "5") // Cvar for controlling the message time (1-10 seconds)
  37. register_cvar("sv_spmessage", "1") // Cvar for controlling the message on/off
  38. register_cvar("sv_spshellthick", "25") // Cvar for controlling the glow shell thickness
  39. register_event("HLTV", "sp_on", "a", "1=0", "2=0")
  40. register_clcmd("fullupdate", "clcmd_fullupdate")
  41. }
  42. //----------------------------------------------------------//
  43. public client_disconnect(id)
  44. {
  45. remove_task(id)
  46. return PLUGIN_HANDLED
  47. }
  48. //----------------------------------------------------------//
  49. public cmd_sptime(id, level, cid) // This is the function for the cvar time control
  50. {
  51. if(!cmd_access(id, level, cid, 2))
  52. return PLUGIN_HANDLED
  53.  
  54. new arg_str[3]
  55. read_argv(1, arg_str, 3)
  56. new arg = str_to_num(arg_str)
  57.  
  58. if(arg > 10 || arg < 1)
  59. {
  60. client_print(id, print_chat, "You have to set the Spawn Protection time between 1 and 10 seconds")
  61. return PLUGIN_HANDLED
  62. }
  63.  
  64. else if (arg > 0 || arg < 11)
  65. {
  66. set_cvar_num("sv_sptime", arg)
  67. client_print(id, print_chat, "You have set the Spawn Protection time to %d second(s)", arg)
  68. return PLUGIN_HANDLED
  69. }
  70. return PLUGIN_CONTINUE
  71. }
  72. //----------------------------------------------------------//
  73. public cmd_spmessage(id, level, cid) // This is the function for the cvar message control
  74. {
  75. if (!cmd_access(id, level, cid, 2))
  76. {
  77. return PLUGIN_HANDLED
  78. }
  79.  
  80. new sp[3]
  81. read_argv(1, sp, 2)
  82.  
  83. if (sp[0] == '1')
  84. {
  85. set_cvar_num("amx_spmessage", 1)
  86. }
  87.  
  88. else if (sp[0] == '0')
  89. {
  90. set_cvar_num("amx_spmessage", 0)
  91. }
  92.  
  93. else if (sp[0] != '1' || sp[0] != '0')
  94. {
  95. console_print(id, "Usage : amx_spmessage 1 = Messages ON | 0 = Messages OFF")
  96. return PLUGIN_HANDLED
  97. }
  98.  
  99. return PLUGIN_HANDLED
  100. }
  101. //----------------------------------------------------------//
  102. public cmd_spshellthickness(id, level, cid)
  103. {
  104. if(!cmd_access(id, level, cid, 2))
  105. return PLUGIN_HANDLED
  106.  
  107. new arg_str[3]
  108. read_argv(1, arg_str, 3)
  109. new arg = str_to_num(arg_str)
  110.  
  111. if(arg > 100 || arg < 1)
  112. {
  113. client_print(id, print_chat, "You have to set the Glow Shellthickness between 1 and 100")
  114. return PLUGIN_HANDLED
  115. }
  116.  
  117. else if (arg > 0 || arg < 101)
  118. {
  119. set_cvar_num("sv_spshellthickness", arg)
  120. client_print(id, print_chat, "You have set the Glow Shellthickness to %d", arg)
  121. return PLUGIN_HANDLED
  122. }
  123. return PLUGIN_CONTINUE
  124. }
  125. //----------------------------------------------------------//
  126. public sp_on(id) // This is the function for the event godmode
  127. {
  128. if(get_cvar_num("sv_sp") == 1)
  129. {
  130. set_task(0.1, "protect", id)
  131. }
  132.  
  133. return PLUGIN_CONTINUE
  134. }
  135. //----------------------------------------------------------//
  136. public protect(id) // This is the function for the task_on godmode
  137. {
  138. new Float:SPTime = get_cvar_float("sv_sptime")
  139. new SPSecs = get_cvar_num("sv_sptime")
  140. new FTime = get_cvar_num("mp_freezetime")
  141. new SPShell = get_cvar_num("sv_spshellthick")
  142. set_user_godmode(id, 1)
  143.  
  144. if(get_user_team(id) == 1)
  145. {
  146. set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, SPShell)
  147. }
  148.  
  149. if(get_user_team(id) == 2)
  150. {
  151. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, SPShell)
  152. }
  153.  
  154. if(get_cvar_num("sv_spmessage") == 1)
  155. {
  156. set_hudmessage(255, 1, 1, -1.0, -1.0, 0, 6.0, SPTime+FTime, 0.1, 0.2, 4)
  157. show_hudmessage(id, "Spawn Protection is enabled for %d second(s)", SPSecs)
  158. }
  159.  
  160. set_task(SPTime+FTime, "sp_off", id)
  161. return PLUGIN_HANDLED
  162. }
  163. //----------------------------------------------------------//
  164. public sp_off(id) // This is the function for the task_off godmode
  165. {
  166. new SPShell = get_cvar_num("sv_spshellthick")
  167. if(!is_user_connected(id))
  168. {
  169. return PLUGIN_HANDLED
  170. }
  171.  
  172. else
  173. {
  174. set_user_godmode(id, 0)
  175. set_user_rendering(id, kRenderFxGlowShell, 0, 0,0, kRenderNormal, SPShell)
  176. return PLUGIN_HANDLED
  177. }
  178.  
  179. return PLUGIN_HANDLED
  180. }
  181. //----------------------------------------------------------//
  182. public clcmd_fullupdate(id)
  183. {
  184. return PLUGIN_HANDLED
  185. }
  186. //----------------------------------------------------------//


Parancsolj...Nemtudja Beleírni.

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 3 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 12 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole