HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #define PLUGIN "Szteroid"
  2. #define VERSION "1.0"
  3. #define AUTHOR "sNaiL"
  4.  
  5. #include <amxmodx>
  6. #include <amxmisc>
  7. #include <fun>
  8. #include <cstrike>
  9.  
  10. new bool:st_birtokos[33]
  11. new ar_cvar
  12. new ido_cvar
  13. new sebesseg_cvar
  14. new gravitacio_cvar
  15.  
  16. public plugin_init()
  17. {
  18. register_plugin(PLUGIN, VERSION, AUTHOR)
  19. register_clcmd("say /szteroid","say_cmd_handle")
  20. register_clcmd("say /steroid","say_cmd_handle")
  21.  
  22. ar_cvar = register_cvar("st_ar","1600")
  23. ido_cvar = register_cvar("st_ido","25.0")
  24. sebesseg_cvar = register_cvar("st_sebesseg","600.0")
  25. gravitacio_cvar = register_cvar("st_gravitacio","0.5")
  26.  
  27. register_event("CurWeapon","curweap","be")
  28. register_dictionary("szteroid.txt")
  29.  
  30. }
  31.  
  32. public curweap(id)
  33. {
  34. if(is_user_alive(id) && st_birtokos[id])
  35. {
  36. client_cmd(id,"cl_forwardspeed 400;cl_backspeed 400;cl_sidespeed 400")
  37. set_user_maxspeed(id,get_pcvar_float(sebesseg_cvar))
  38. }
  39. }
  40.  
  41. public client_connect(id) st_birtokos[id]=false
  42. public client_disconnect(id) st_birtokos[id]=false
  43.  
  44. public say_cmd_handle(id)
  45. {
  46. if(!is_user_alive(id))
  47. {
  48. client_print(id,print_chat,"[SZTEROID] %L",id,"MSG_HALOTT_VAGY")
  49. }
  50. else if(st_birtokos[id])
  51. {
  52. client_print(id,print_chat,"[SZTEROID] %L",id,"MSG_MAR_VAN")
  53. }
  54. else if(cs_get_user_money(id)<get_pcvar_num(ar_cvar))
  55. {
  56. set_hudmessage(255, 255, 255, -1.0, 0.8, 0, 6.0, 12.0)
  57. show_hudmessage(id, "[SZTEROID] %L",id,"MSG_CSORO_VAGY",get_pcvar_num(ar_cvar))
  58. }
  59. else
  60. {
  61. cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(ar_cvar),1)
  62. st_birtokos[id]=true
  63. set_task(get_pcvar_float(ido_cvar),"szteroid_pub",id)
  64. set_task(1.0,"plus_hp",id,"",0,"b")
  65. set_user_gravity(id,get_pcvar_float(gravitacio_cvar))
  66. set_user_maxspeed(id,get_pcvar_float(sebesseg_cvar))
  67. set_hudmessage(255, 255, 255, -1.0, 0.8, 0, 6.0, 12.0)
  68. show_hudmessage(id, "[SZTEROID] %L",id,"MSG_SZTEROID1")
  69. }
  70. }
  71.  
  72. public plus_hp(id)
  73. {
  74. if(st_birtokos[id]) set_user_health(id,get_user_health(id)+1)
  75. }
  76.  
  77. public szteroid_pub(id)
  78. {
  79. if(is_user_connected(id))
  80. {
  81. st_birtokos[id]=false
  82. set_hudmessage(255, 255, 255, -1.0, 0.8, 0, 6.0, 12.0)
  83. show_hudmessage(id, "[SZTEROID] %L",id,"MSG_SZTEROID_KIKAPCS")
  84. set_user_gravity(id,1.0)
  85. set_user_maxspeed(id,320.0)
  86. set_user_gravity(id,1.0)
  87. remove_task(id)
  88. }
  89. }
  90. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  91. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  92. */
  93.