hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.17. 11:29



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]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  [7 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Sebesség gyorsító
HozzászólásElküldve:2013.09.16. 13:53 
Offline
Őskövület
Avatar

Csatlakozott:2011.12.28. 00:35
Hozzászólások:2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Hali!

Valaki ebbe bele tudná írni, hogy ne időre menjen a sebesség gyorsító hanem 1 körig:

SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <fakemeta>
  5. #include <zombieplague>
  6.  
  7. #define PLUGIN "[ZP] Extra : Speed Boost"
  8. #define VERSION "1.1.2"
  9. #define AUTHOR "The_Thing"
  10.  
  11. #define BUY_SBOOST ADMIN_LEVEL_B
  12.  
  13. new g_item_name[] = { "Sebesség gyorsító" }
  14. new g_itemid_speed, g_sb_toggle, g_sb_all_player_buy, g_sb_cost, g_sb_maxspeed, g_sb_time
  15. new g_sb_red, g_sb_green, g_sb_blue
  16. new bool:g_hasSpeedBoost[33]
  17.  
  18. public plugin_init()
  19. {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21.  
  22. g_sb_toggle = register_cvar("zp_speed_boost", "1")
  23. g_sb_all_player_buy = register_cvar("zp_sb_all_player_buy", "1")
  24. g_sb_cost = register_cvar("zp_sb_cost", "8")
  25. g_sb_maxspeed = register_cvar("zp_sb_maxspeed", "350.0")
  26. g_sb_time = register_cvar("zp_sb_time", "420.0")
  27. g_sb_red = register_cvar("zp_sb_red_color", "255")
  28. g_sb_green = register_cvar("zp_sb_green_color", "204")
  29. g_sb_blue = register_cvar("zp_sb_blue_color", "0")
  30.  
  31. g_itemid_speed = zp_register_extra_item(g_item_name, get_pcvar_num(g_sb_cost), 0)
  32.  
  33. register_clcmd("say /sboost", "buy_sboost", ADMIN_ALL)
  34. register_clcmd("say_team /sboost", "buy_sboost", ADMIN_ALL)
  35.  
  36. register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
  37.  
  38. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  39. register_event("DeathMsg", "death", "a")
  40. }
  41.  
  42. public client_connect(id)
  43. {
  44. g_hasSpeedBoost[id] = false
  45. }
  46.  
  47. public client_disconnect(id)
  48. {
  49. g_hasSpeedBoost[id] = false
  50. }
  51.  
  52.  
  53. public death()
  54. {
  55. g_hasSpeedBoost[read_data(2)] = false // will be reset after infection or kill
  56. }
  57.  
  58. public event_round_start()
  59. {
  60. for (new i = 1; i <= 32; i++)
  61. g_hasSpeedBoost[i] = false
  62. }
  63.  
  64. public zp_extra_item_selected(player, itemid)
  65. {
  66. if ( itemid == g_itemid_speed )
  67. {
  68. if (!get_pcvar_num(g_sb_all_player_buy) && (!access(player, ADMIN_LEVEL_B)))
  69. return PLUGIN_HANDLED
  70.  
  71. g_hasSpeedBoost[player] = true
  72.  
  73. fm_set_rendering(player, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  74. set_pev(player, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  75. set_task(get_pcvar_float(g_sb_time), "boost_over", player)
  76. print_color(player, "!g[T.B.D.]!t Megvetted a Sebesség Gyorsítót!")
  77. }
  78. return PLUGIN_CONTINUE
  79. }
  80.  
  81. public buy_sboost(id)
  82. {
  83. if (!get_pcvar_num(g_sb_toggle))
  84. return PLUGIN_HANDLED
  85.  
  86. if (!get_pcvar_num(g_sb_all_player_buy) && (!access(id, ADMIN_LEVEL_B)))
  87. return PLUGIN_HANDLED
  88.  
  89. new money = zp_get_user_ammo_packs(id)
  90. new cost = get_pcvar_num(g_sb_cost)
  91.  
  92. if (!is_user_alive(id))
  93. {
  94. print_color(id, "!g[T.B.D.]!t Halott emberek nem vásárolhatják meg a Sebesség Gyorsítót!")
  95. return PLUGIN_HANDLED
  96. }
  97.  
  98. if (g_hasSpeedBoost[id])
  99. {
  100. print_color(id, "!g[T.B.D.]!t Te már megvásároltad a Sebesség Gyorsítót!")
  101. return PLUGIN_HANDLED
  102. }
  103.  
  104. if (money < cost)
  105. {
  106. print_color(id, "!g[T.B.D.]!t Nincs elég lőszercsomagod, hogy megvedd a Sebesség Gyorsitót!", get_pcvar_num(g_sb_cost))
  107. return PLUGIN_HANDLED
  108. }
  109.  
  110. zp_set_user_ammo_packs(id, money - cost)
  111.  
  112. g_hasSpeedBoost[id] = true
  113.  
  114. fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  115. set_pev(id, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  116. set_task(get_pcvar_float(g_sb_time), "boost_over", id)
  117. print_color(id, "!g[T.B.D.]!t Megvetted a Sebesség Gyorsítót!")
  118.  
  119. return 1
  120. }
  121.  
  122. public boost_over(id)
  123. {
  124. g_hasSpeedBoost[id] = false
  125. fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0)
  126. print_color(id, "!g[T.B.D.]!t Sebesség gyorsítás lejárt!")
  127. }
  128.  
  129. public fw_PlayerPreThink(id)
  130. {
  131. if (!is_user_alive(id))
  132. return FMRES_IGNORED
  133.  
  134. if (g_hasSpeedBoost[id])
  135. {
  136. fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  137. set_pev(id, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  138. }
  139. return PLUGIN_CONTINUE
  140. }
  141.  
  142. stock fm_set_user_maxspeed(index, Float:speed = -1.0)
  143. {
  144. engfunc(EngFunc_SetClientMaxspeed, index, speed);
  145. set_pev(index, pev_maxspeed, speed);
  146.  
  147. return 1;
  148. }
  149.  
  150. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  151. {
  152. new Float:RenderColor[3];
  153. RenderColor[0] = float(r);
  154. RenderColor[1] = float(g);
  155. RenderColor[2] = float(b);
  156.  
  157. set_pev(entity, pev_renderfx, fx);
  158. set_pev(entity, pev_rendercolor, RenderColor);
  159. set_pev(entity, pev_rendermode, render);
  160. set_pev(entity, pev_renderamt, float(amount));
  161.  
  162. return 1;
  163. }
  164.  
  165.  
  166. stock print_color(const id, const input[], any:...)
  167. {
  168. new count = 1, players[32]
  169. static msg[191]
  170. vformat(msg, 190, input, 3)
  171.  
  172. replace_all(msg, 190, "!g", "^4")
  173. replace_all(msg, 190, "!y", "^1")
  174. replace_all(msg, 190, "!t", "^3")
  175. replace_all(msg, 190, "á", "á")
  176. replace_all(msg, 190, "é", "Ă©")
  177. replace_all(msg, 190, "í", "Ă­")
  178. replace_all(msg, 190, "ó", "Ăł")
  179. replace_all(msg, 190, "ö", "ö")
  180. replace_all(msg, 190, "ő", "Ĺ‘")
  181. replace_all(msg, 190, "ú", "Ăş")
  182. replace_all(msg, 190, "ü", "ĂĽ")
  183. replace_all(msg, 190, "ű", "ű")
  184. replace_all(msg, 190, "Á", "Á")
  185. replace_all(msg, 190, "É", "É")
  186. replace_all(msg, 190, "Í", "ĂŤ")
  187. replace_all(msg, 190, "Ó", "Ă“")
  188. replace_all(msg, 190, "Ö", "Ă–")
  189. replace_all(msg, 190, "Ő", "Ő")
  190. replace_all(msg, 190, "Ú", "Ăš")
  191. replace_all(msg, 190, "Ü", "Ăś")
  192. replace_all(msg, 190, "Ű", "Ű")
  193.  
  194. if (id) players[0] = id; else get_players(players, count, "ch")
  195. {
  196. for (new i = 0; i < count; i++)
  197. {
  198. if (is_user_connected(players[i]))
  199. {
  200. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  201. write_byte(players[i])
  202. write_string(msg)
  203. message_end()
  204. }
  205. }
  206. }
  207. return PLUGIN_HANDLED
  208. }


Előre is köszi!

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebesség gyorsító
HozzászólásElküldve:2013.09.16. 14:25 
Offline
Minden6ó
Avatar

Csatlakozott:2011.01.19. 12:14
Hozzászólások:4294
Megköszönt másnak: 219 alkalommal
Megköszönték neki: 289 alkalommal
Nem bíztos, hogy jó mert még csak most kezdem tanulgatni a dolgok :)
Edit: Javítva! Ha ez se jó akkor sorry.
SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <fakemeta>
  5. #include <zombieplague>
  6.  
  7. #define PLUGIN "[ZP] Extra : Speed Boost"
  8. #define VERSION "1.1.2"
  9. #define AUTHOR "The_Thing"
  10.  
  11. #define BUY_SBOOST ADMIN_LEVEL_B
  12.  
  13. new g_item_name[] = { "Sebesség gyorsító" }
  14. new g_itemid_speed, g_sb_toggle, g_sb_all_player_buy, g_sb_cost, g_sb_maxspeed, g_sb_oneround
  15. new g_sb_red, g_sb_green, g_sb_blue
  16. new bool:g_hasSpeedBoost[33]
  17.  
  18. public plugin_init()
  19. {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21.  
  22. g_sb_toggle = register_cvar("zp_speed_boost", "1")
  23. g_sb_all_player_buy = register_cvar("zp_sb_all_player_buy", "1")
  24. g_sb_cost = register_cvar("zp_sb_cost", "8")
  25. g_sb_maxspeed = register_cvar("zp_sb_maxspeed", "350.0")
  26. g_sb_oneround = register_cvar("zp_sb_time", "1")
  27. g_sb_red = register_cvar("zp_sb_red_color", "255")
  28. g_sb_green = register_cvar("zp_sb_green_color", "204")
  29. g_sb_blue = register_cvar("zp_sb_blue_color", "0")
  30.  
  31. g_itemid_speed = zp_register_extra_item(g_item_name, get_pcvar_num(g_sb_cost), 0)
  32.  
  33. register_clcmd("say /sboost", "buy_sboost", ADMIN_ALL)
  34. register_clcmd("say_team /sboost", "buy_sboost", ADMIN_ALL)
  35.  
  36. register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
  37.  
  38. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  39. register_event("DeathMsg", "death", "a")
  40. }
  41.  
  42. public client_connect(id)
  43. {
  44. g_hasSpeedBoost[id] = false
  45. }
  46.  
  47. public client_disconnect(id)
  48. {
  49. g_hasSpeedBoost[id] = false
  50. }
  51.  
  52.  
  53. public death()
  54. {
  55. g_hasSpeedBoost[read_data(2)] = false // will be reset after infection or kill
  56. }
  57.  
  58. public event_round_start()
  59. {
  60. for (new i = 1; i <= 32; i++)
  61. g_hasSpeedBoost[i] = false
  62. }
  63.  
  64. public zp_extra_item_selected(player, itemid)
  65. {
  66. if ( itemid == g_itemid_speed )
  67. {
  68. if (!get_pcvar_num(g_sb_all_player_buy) && (!access(player, ADMIN_LEVEL_B)))
  69. return PLUGIN_HANDLED
  70.  
  71. g_hasSpeedBoost[player] = true
  72.  
  73. fm_set_rendering(player, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  74. set_pev(player, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  75. set_task(get_pcvar_float(g_sb_oneround), "boost_over", player)
  76. print_color(player, "!g[T.B.D.]!t Megvetted a Sebesség Gyorsítót!")
  77. }
  78. return PLUGIN_CONTINUE
  79. }
  80.  
  81. public buy_sboost(id)
  82. {
  83. if (!get_pcvar_num(g_sb_toggle))
  84. return PLUGIN_HANDLED
  85.  
  86. if (!get_pcvar_num(g_sb_all_player_buy) && (!access(id, ADMIN_LEVEL_B)))
  87. return PLUGIN_HANDLED
  88.  
  89. new money = zp_get_user_ammo_packs(id)
  90. new cost = get_pcvar_num(g_sb_cost)
  91.  
  92. if (!is_user_alive(id))
  93. {
  94. print_color(id, "!g[T.B.D.]!t Halott emberek nem vásárolhatják meg a Sebesség Gyorsítót!")
  95. return PLUGIN_HANDLED
  96. }
  97.  
  98. if (g_hasSpeedBoost[id])
  99. {
  100. print_color(id, "!g[T.B.D.]!t Te már megvásároltad a Sebesség Gyorsítót!")
  101. return PLUGIN_HANDLED
  102. }
  103.  
  104. if (money < cost)
  105. {
  106. print_color(id, "!g[T.B.D.]!t Nincs elég lőszercsomagod, hogy megvedd a Sebesség Gyorsitót!", get_pcvar_num(g_sb_cost))
  107. return PLUGIN_HANDLED
  108. }
  109.  
  110. zp_set_user_ammo_packs(id, money - cost)
  111.  
  112. g_hasSpeedBoost[id] = true
  113.  
  114. fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  115. set_pev(id, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  116. set_task(get_pcvar_float(g_sb_time), "boost_over", id)
  117. print_color(id, "!g[T.B.D.]!t Megvetted a Sebesség Gyorsítót!")
  118.  
  119. return 1
  120. }
  121.  
  122. public boost_over(id)
  123. {
  124. g_hasSpeedBoost[id] = false
  125. fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0)
  126. print_color(id, "!g[T.B.D.]!t Sebesség gyorsítás lejárt!")
  127. }
  128.  
  129. public fw_PlayerPreThink(id)
  130. {
  131. if (!is_user_alive(id))
  132. return FMRES_IGNORED
  133.  
  134. if (g_hasSpeedBoost[id])
  135. {
  136. fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  137. set_pev(id, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  138. }
  139. return PLUGIN_CONTINUE
  140. }
  141.  
  142. stock fm_set_user_maxspeed(index, Float:speed = -1.0)
  143. {
  144. engfunc(EngFunc_SetClientMaxspeed, index, speed);
  145. set_pev(index, pev_maxspeed, speed);
  146.  
  147. return 1;
  148. }
  149.  
  150. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  151. {
  152. new Float:RenderColor[3];
  153. RenderColor[0] = float(r);
  154. RenderColor[1] = float(g);
  155. RenderColor[2] = float(b);
  156.  
  157. set_pev(entity, pev_renderfx, fx);
  158. set_pev(entity, pev_rendercolor, RenderColor);
  159. set_pev(entity, pev_rendermode, render);
  160. set_pev(entity, pev_renderamt, float(amount));
  161.  
  162. return 1;
  163. }
  164.  
  165.  
  166. stock print_color(const id, const input[], any:...)
  167. {
  168. new count = 1, players[32]
  169. static msg[191]
  170. vformat(msg, 190, input, 3)
  171.  
  172. replace_all(msg, 190, "!g", "^4")
  173. replace_all(msg, 190, "!y", "^1")
  174. replace_all(msg, 190, "!t", "^3")
  175. replace_all(msg, 190, "á", "á")
  176. replace_all(msg, 190, "é", "Ă©")
  177. replace_all(msg, 190, "í", "Ă­")
  178. replace_all(msg, 190, "ó", "Ăł")
  179. replace_all(msg, 190, "ö", "ö")
  180. replace_all(msg, 190, "ő", "Ĺ‘")
  181. replace_all(msg, 190, "ú", "Ăş")
  182. replace_all(msg, 190, "ü", "ĂĽ")
  183. replace_all(msg, 190, "ű", "ű")
  184. replace_all(msg, 190, "Á", "Á")
  185. replace_all(msg, 190, "É", "É")
  186. replace_all(msg, 190, "Í", "ĂŤ")
  187. replace_all(msg, 190, "Ó", "Ă“")
  188. replace_all(msg, 190, "Ö", "Ă–")
  189. replace_all(msg, 190, "Ő", "Ő")
  190. replace_all(msg, 190, "Ú", "Ăš")
  191. replace_all(msg, 190, "Ü", "Ăś")
  192. replace_all(msg, 190, "Ű", "Ű")
  193.  
  194. if (id) players[0] = id; else get_players(players, count, "ch")
  195. {
  196. for (new i = 0; i < count; i++)
  197. {
  198. if (is_user_connected(players[i]))
  199. {
  200. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  201. write_byte(players[i])
  202. write_string(msg)
  203. message_end()
  204. }
  205. }
  206. }
  207. return PLUGIN_HANDLED
  208. }

_________________
<<eb@>>Team Website - Közösség
17Buddies - Általam készített pályák.
GameBanana - Általam készített pályák/vágott hangok.

Kép
Kép


A hozzászólást 2 alkalommal szerkesztették, utoljára norbee.16 2013.09.16. 14:40-kor.

Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebesség gyorsító
HozzászólásElküldve:2013.09.16. 14:34 
Offline
Őskövület
Avatar

Csatlakozott:2011.12.28. 00:35
Hozzászólások:2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Nem jó, mert nem fut le!

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebesség gyorsító
HozzászólásElküldve:2013.09.16. 14:42 
Offline
Minden6ó
Avatar

Csatlakozott:2011.01.19. 12:14
Hozzászólások:4294
Megköszönt másnak: 219 alkalommal
Megköszönték neki: 289 alkalommal
pixxa112 írta:
Nem jó, mert nem fut le!

Javítva! Ha nem jó akkor majd segít majd valami profi ;) De ha nem akkor át nézem még 1x.

_________________
<<eb@>>Team Website - Közösség
17Buddies - Általam készített pályák.
GameBanana - Általam készített pályák/vágott hangok.

Kép
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebesség gyorsító
HozzászólásElküldve:2013.09.16. 16:10 
Offline
Senior Tag

Csatlakozott:2012.07.09. 11:57
Hozzászólások:234
Megköszönt másnak: 20 alkalommal
Megköszönték neki: 12 alkalommal
Ha ezt használod akkor asszem eltűnik ha meghalsz vagy végea a körnek
SMA Forráskód: [ Mindet kijelol ]
  1. set_user_maxspeed(id, 900.0)

_________________
[mozgo]Bogdan for President[/mozgo]
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebesség gyorsító
HozzászólásElküldve:2013.09.16. 17:07 
Offline
Őskövület
Avatar

Csatlakozott:2012.02.27. 09:42
Hozzászólások:2588
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 418 alkalommal
tessék kör elején kikapcsol
SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <fakemeta>
  5. #include <zombieplague>
  6.  
  7. #define PLUGIN "[ZP] Extra : Speed Boost"
  8. #define VERSION "1.1.2"
  9. #define AUTHOR "The_Thing"
  10.  
  11. #define BUY_SBOOST ADMIN_LEVEL_B
  12.  
  13. new g_item_name[] = { "Sebesség gyorsító" }
  14. new g_itemid_speed, g_sb_toggle, g_sb_all_player_buy, g_sb_cost, g_sb_maxspeed
  15. new g_sb_red, g_sb_green, g_sb_blue
  16. new bool:g_hasSpeedBoost[33]
  17.  
  18. public plugin_init()
  19. {
  20. register_plugin(PLUGIN, VERSION, AUTHOR)
  21.  
  22. g_sb_toggle = register_cvar("zp_speed_boost", "1")
  23. g_sb_all_player_buy = register_cvar("zp_sb_all_player_buy", "1")
  24. g_sb_cost = register_cvar("zp_sb_cost", "8")
  25. g_sb_maxspeed = register_cvar("zp_sb_maxspeed", "350.0")
  26. g_sb_red = register_cvar("zp_sb_red_color", "255")
  27. g_sb_green = register_cvar("zp_sb_green_color", "204")
  28. g_sb_blue = register_cvar("zp_sb_blue_color", "0")
  29.  
  30. g_itemid_speed = zp_register_extra_item(g_item_name, get_pcvar_num(g_sb_cost), 0)
  31.  
  32. register_clcmd("say /sboost", "buy_sboost", ADMIN_ALL)
  33. register_clcmd("say_team /sboost", "buy_sboost", ADMIN_ALL)
  34.  
  35. register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
  36.  
  37. register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  38. register_event("DeathMsg", "death", "a")
  39. }
  40.  
  41. public client_connect(id)
  42. {
  43. g_hasSpeedBoost[id] = false
  44. }
  45.  
  46. public client_disconnect(id)
  47. {
  48. g_hasSpeedBoost[id] = false
  49. }
  50.  
  51.  
  52. public death()
  53. {
  54. g_hasSpeedBoost[read_data(2)] = false // will be reset after infection or kill
  55. }
  56.  
  57. public event_round_start()
  58. {
  59. for (new i = 1; i <= 32; i++)
  60. g_hasSpeedBoost[i] = false
  61. }
  62.  
  63. public zp_extra_item_selected(player, itemid)
  64. {
  65. if ( itemid == g_itemid_speed )
  66. {
  67. if (!get_pcvar_num(g_sb_all_player_buy) && (!access(player, ADMIN_LEVEL_B)))
  68. return PLUGIN_HANDLED
  69.  
  70. g_hasSpeedBoost[player] = true
  71.  
  72. fm_set_rendering(player, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  73. set_pev(player, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  74. print_color(player, "!g[T.B.D.]!t Megvetted a Sebesség Gyorsítót!")
  75. }
  76. return PLUGIN_CONTINUE
  77. }
  78.  
  79. public buy_sboost(id)
  80. {
  81. if (!get_pcvar_num(g_sb_toggle))
  82. return PLUGIN_HANDLED
  83.  
  84. if (!get_pcvar_num(g_sb_all_player_buy) && (!access(id, ADMIN_LEVEL_B)))
  85. return PLUGIN_HANDLED
  86.  
  87. new money = zp_get_user_ammo_packs(id)
  88. new cost = get_pcvar_num(g_sb_cost)
  89.  
  90. if (!is_user_alive(id))
  91. {
  92. print_color(id, "!g[T.B.D.]!t Halott emberek nem vásárolhatják meg a Sebesség Gyorsítót!")
  93. return PLUGIN_HANDLED
  94. }
  95.  
  96. if (g_hasSpeedBoost[id])
  97. {
  98. print_color(id, "!g[T.B.D.]!t Te már megvásároltad a Sebesség Gyorsítót!")
  99. return PLUGIN_HANDLED
  100. }
  101.  
  102. if (money < cost)
  103. {
  104. print_color(id, "!g[T.B.D.]!t Nincs elég lőszercsomagod, hogy megvedd a Sebesség Gyorsitót!", get_pcvar_num(g_sb_cost))
  105. return PLUGIN_HANDLED
  106. }
  107.  
  108. zp_set_user_ammo_packs(id, money - cost)
  109.  
  110. g_hasSpeedBoost[id] = true
  111.  
  112. fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  113. set_pev(id, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  114. print_color(id, "!g[T.B.D.]!t Megvetted a Sebesség Gyorsítót!")
  115.  
  116. return 1
  117. }
  118. public fw_PlayerPreThink(id)
  119. {
  120. if (!is_user_alive(id))
  121. return FMRES_IGNORED
  122.  
  123. if (g_hasSpeedBoost[id])
  124. {
  125. fm_set_rendering(id, kRenderFxGlowShell, get_pcvar_num(g_sb_red), get_pcvar_num(g_sb_green), get_pcvar_num(g_sb_blue), kRenderNormal, 255)
  126. set_pev(id, pev_maxspeed, get_pcvar_float(g_sb_maxspeed))
  127. }
  128. return PLUGIN_CONTINUE
  129. }
  130.  
  131. stock fm_set_user_maxspeed(index, Float:speed = -1.0)
  132. {
  133. engfunc(EngFunc_SetClientMaxspeed, index, speed);
  134. set_pev(index, pev_maxspeed, speed);
  135.  
  136. return 1;
  137. }
  138.  
  139. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  140. {
  141. new Float:RenderColor[3];
  142. RenderColor[0] = float(r);
  143. RenderColor[1] = float(g);
  144. RenderColor[2] = float(b);
  145.  
  146. set_pev(entity, pev_renderfx, fx);
  147. set_pev(entity, pev_rendercolor, RenderColor);
  148. set_pev(entity, pev_rendermode, render);
  149. set_pev(entity, pev_renderamt, float(amount));
  150.  
  151. return 1;
  152. }
  153.  
  154.  
  155. stock print_color(const id, const input[], any:...)
  156. {
  157. new count = 1, players[32]
  158. static msg[191]
  159. vformat(msg, 190, input, 3)
  160.  
  161. replace_all(msg, 190, "!g", "^4")
  162. replace_all(msg, 190, "!y", "^1")
  163. replace_all(msg, 190, "!t", "^3")
  164. replace_all(msg, 190, "á", "á")
  165. replace_all(msg, 190, "é", "Ă©")
  166. replace_all(msg, 190, "í", "Ă­")
  167. replace_all(msg, 190, "ó", "Ăł")
  168. replace_all(msg, 190, "ö", "ö")
  169. replace_all(msg, 190, "ő", "Ĺ‘")
  170. replace_all(msg, 190, "ú", "Ăş")
  171. replace_all(msg, 190, "ü", "ĂĽ")
  172. replace_all(msg, 190, "ű", "ű")
  173. replace_all(msg, 190, "Á", "Á")
  174. replace_all(msg, 190, "É", "É")
  175. replace_all(msg, 190, "Í", "ĂŤ")
  176. replace_all(msg, 190, "Ó", "Ă“")
  177. replace_all(msg, 190, "Ö", "Ă–")
  178. replace_all(msg, 190, "Ő", "Ő")
  179. replace_all(msg, 190, "Ú", "Ăš")
  180. replace_all(msg, 190, "Ü", "Ăś")
  181. replace_all(msg, 190, "Ű", "Ű")
  182.  
  183. if (id) players[0] = id; else get_players(players, count, "ch")
  184. {
  185. for (new i = 0; i < count; i++)
  186. {
  187. if (is_user_connected(players[i]))
  188. {
  189. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  190. write_byte(players[i])
  191. write_string(msg)
  192. message_end()
  193. }
  194. }
  195. }
  196. return PLUGIN_HANDLED
  197. }
  198.  

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebesség gyorsító
HozzászólásElküldve:2013.09.16. 22:28 
Offline
Őskövület
Avatar

Csatlakozott:2011.12.28. 00:35
Hozzászólások:2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Köszi, holnap tesztelem és utána megy a köszi gomb : DDD

_________________
****


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  [7 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 37 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