hlmod.hu
https://hlmod.hu/

random sebzés ki iró
https://hlmod.hu/viewtopic.php?f=9&t=7095
Oldal: 1 / 1

Szerző:  ChaspeR [2013.01.12. 14:52 ]
Hozzászólás témája:  random sebzés ki iró

SMA Forráskód: [ Mindet kijelol ]
  1. /* Copyright © 2009, ConnorMcLeod
  2.  
  3. Bullet Damage is free software;
  4. you can redistribute it and/or modify it under the terms of the
  5. GNU General Public License as published by the Free Software Foundation.
  6.  
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11.  
  12. You should have received a copy of the GNU General Public License
  13. along with Bullet Damage; if not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17.  
  18. #include <amxmodx>
  19.  
  20. #define PLUGIN "Bullet Damage"
  21. #define AUTHOR "ConnorMcLeod"
  22. #define VERSION "0.0.1"
  23.  
  24. #define MAX_PLAYERS 32
  25.  
  26. new const Float:g_flCoords[][] =
  27. {
  28. {0.50, 0.40},
  29. {0.56, 0.44},
  30. {0.60, 0.50},
  31. {0.56, 0.56},
  32. {0.50, 0.60},
  33. {0.44, 0.56},
  34. {0.40, 0.50},
  35. {0.44, 0.44}
  36. }
  37.  
  38. new g_iPlayerPos[MAX_PLAYERS+1]
  39.  
  40. new g_iMaxPlayers
  41. new g_pCvarEnabled
  42.  
  43. public plugin_init()
  44. {
  45. register_plugin(PLUGIN, VERSION, AUTHOR)
  46.  
  47. g_pCvarEnabled = register_cvar("bullet_damage", "1")
  48.  
  49. register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
  50.  
  51. g_iMaxPlayers = get_maxplayers()
  52. }
  53.  
  54. public Event_Damage( iVictim )
  55. {
  56. if( get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
  57. {
  58. new id = get_user_attacker(iVictim)
  59. if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )
  60. {
  61. new iPos = ++g_iPlayerPos[id]
  62. if( iPos == sizeof(g_flCoords) )
  63. {
  64. iPos = g_iPlayerPos[id] = 0
  65. }
  66. set_hudmessage(0, 40, 80, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
  67. show_hudmessage(id, "%d", read_data(2))
  68. }
  69. }
  70. }


meglehetne oldani ,hogy (random) mindig más szint mutasson a sebzés ki iró?!

Szerző:  small [2013.01.12. 14:57 ]
Hozzászólás témája:  Re: random sebzés ki iró

Meg..
SMA Forráskód: [ Mindet kijelol ]
  1. /* Copyright © 2009, ConnorMcLeod
  2.  
  3. Bullet Damage is free software;
  4. you can redistribute it and/or modify it under the terms of the
  5. GNU General Public License as published by the Free Software Foundation.
  6.  
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11.  
  12. You should have received a copy of the GNU General Public License
  13. along with Bullet Damage; if not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA.
  16. */
  17.  
  18. #include <amxmodx>
  19.  
  20. #define PLUGIN "Bullet Damage"
  21. #define AUTHOR "ConnorMcLeod"
  22. #define VERSION "0.0.1"
  23.  
  24. #define MAX_PLAYERS 32
  25.  
  26. new const Float:g_flCoords[][] =
  27. {
  28. {0.50, 0.40},
  29. {0.56, 0.44},
  30. {0.60, 0.50},
  31. {0.56, 0.56},
  32. {0.50, 0.60},
  33. {0.44, 0.56},
  34. {0.40, 0.50},
  35. {0.44, 0.44}
  36. }
  37.  
  38. new g_iPlayerPos[MAX_PLAYERS+1]
  39.  
  40. new g_iMaxPlayers
  41. new g_pCvarEnabled
  42.  
  43. public plugin_init()
  44. {
  45. register_plugin(PLUGIN, VERSION, AUTHOR)
  46.  
  47. g_pCvarEnabled = register_cvar("bullet_damage", "1")
  48.  
  49. register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
  50.  
  51. g_iMaxPlayers = get_maxplayers()
  52. }
  53.  
  54. public Event_Damage( iVictim )
  55. {
  56. if( get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
  57. {
  58. new id = get_user_attacker(iVictim)
  59. if( (1 <= id <= g_iMaxPlayers) && is_user_connected(id) )
  60. {
  61. new iPos = ++g_iPlayerPos[id]
  62. if( iPos == sizeof(g_flCoords) )
  63. {
  64. iPos = g_iPlayerPos[id] = 0
  65. }
  66. new piros = random(256)
  67. new kek = random(256)
  68. new zold = random(256)
  69.  
  70. set_hudmessage(piros, kek, zold, Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 0, 0.1, 2.5, 0.02, 0.02, -1)
  71. show_hudmessage(id, "%d", read_data(2))
  72. }
  73. }
  74. }
  75.  

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/