hlmod.hu
https://hlmod.hu/

bhopp ékezetes betük + szín
https://hlmod.hu/viewtopic.php?f=9&t=7568
Oldal: 1 / 1

Szerző:  theglorious [ 2013.03.02. 13:03 ]
Hozzászólás témája:  bhopp ékezetes betük + szín

Sziasztok ebben van valami hiba?
SMA Forráskód: [ Mindet kijelol ]
  1. /*
  2.  *
  3.  * Author: Cheesy Peteza
  4.  * Date: 22-Apr-2004 (updated 2-March-2005)
  5.  *
  6.  *
  7.  * Description: Enable bunny hopping in Counter-Strike.
  8.  *
  9.  * Cvars:
  10.  * bh_enabled 1 to enable this plugin, 0 to disable.
  11.  * bh_autojump If set to 1 players just need to hold down jump to bunny hop (no skill required)
  12.  * bh_showusage If set to 1 it will inform joining players that bunny hopping has been enabled
  13.  * and how to use it if bh_autojump enabled.
  14.  *
  15.  * Requirements: AMXModX 0.16 or greater
  16.  *
  17.  *
  18.  */
  19.  
  20. #include <amxmodx>
  21. #include <engine>
  22.  
  23. #define FL_WATERJUMP (1<<11) // player jumping out of water
  24. #define FL_ONGROUND (1<<9) // At rest / on the ground
  25.  
  26. public plugin_init() {
  27. register_plugin("Super Bunny Hopper", "1.2", "Cheesy Peteza")
  28. register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)
  29.  
  30. register_cvar("bh_enabled", "1")
  31. register_cvar("bh_autojump", "1")
  32. register_cvar("bh_showusage", "1")
  33. }
  34.  
  35. public client_PreThink(id) {
  36. if (!get_cvar_num("bh_enabled"))
  37. return PLUGIN_CONTINUE
  38.  
  39. entity_set_float(id, EV_FL_fuser2, 0.0) // Disable slow down after jumping
  40.  
  41. if (!get_cvar_num("bh_autojump"))
  42. return PLUGIN_CONTINUE
  43.  
  44. // Code from CBasePlayer::Jump (player.cpp) Make a player jump automatically
  45. if (entity_get_int(id, EV_INT_button) & 2) { // If holding jump
  46. new flags = entity_get_int(id, EV_INT_flags)
  47.  
  48. if (flags & FL_WATERJUMP)
  49. return PLUGIN_CONTINUE
  50. if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
  51. return PLUGIN_CONTINUE
  52. if ( !(flags & FL_ONGROUND) )
  53. return PLUGIN_CONTINUE
  54.  
  55. new Float:velocity[3]
  56. entity_get_vector(id, EV_VEC_velocity, velocity)
  57. velocity[2] += 250.0
  58. entity_set_vector(id, EV_VEC_velocity, velocity)
  59.  
  60. entity_set_int(id, EV_INT_gaitsequence, 6) // Play the Jump Animation
  61. }
  62. return PLUGIN_CONTINUE
  63. }
  64.  
  65. public client_authorized(id)
  66. set_task(30.0, "showUsage", id)
  67.  
  68. public showUsage(id) {
  69. if ( !get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
  70. return PLUGIN_HANDLED
  71.  
  72. if ( !get_cvar_num("bh_autojump") ) {
  73. print_color(id, "!g[Bunny Hopp] !tA nyúlugrás használatához használd a W A S D Space/Hosszú gombokat!")
  74. } else {
  75. print_color(id, "!g[Bunny Hopp] !tAz ugras lenyomva tartásával tudod használni!")
  76. }
  77. }
  78. stock print_color(const id, const input[], any:...)
  79. {
  80. new count = 1, players[32]
  81. static msg[191]
  82. vformat(msg, 190, input, 3)
  83.  
  84. replace_all(msg, 190, "!g", "^4")
  85. replace_all(msg, 190, "!y", "^1")
  86. replace_all(msg, 190, "!t", "^3")
  87. replace_all(msg, 190, "á", "á")
  88. replace_all(msg, 190, "é", "Ă©")
  89. replace_all(msg, 190, "í", "Ă­")
  90. replace_all(msg, 190, "ó", "Ăł")
  91. replace_all(msg, 190, "ö", "ö")
  92. replace_all(msg, 190, "ő", "Ĺ‘")
  93. replace_all(msg, 190, "ú", "Ăş")
  94. replace_all(msg, 190, "ü", "ĂĽ")
  95. replace_all(msg, 190, "ű", "ű")
  96. replace_all(msg, 190, "Á", "Á")
  97. replace_all(msg, 190, "É", "É")
  98. replace_all(msg, 190, "Í", "ĂŤ")
  99. replace_all(msg, 190, "Ó", "Ă“")
  100. replace_all(msg, 190, "Ö", "Ă–")
  101. replace_all(msg, 190, "Ő", "Ő")
  102. replace_all(msg, 190, "Ú", "Ăš")
  103. replace_all(msg, 190, "Ü", "Ăś")
  104. replace_all(msg, 190, "Ű", "Ĺ°")
  105.  
  106. if (id) players[0] = id; else get_players(players, count, "ch")
  107. {
  108. for (new i = 0; i < count; i++)
  109. {
  110. if (is_user_connected(players[i]))
  111. {
  112. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  113. write_byte(players[i])
  114. write_string(msg)
  115. message_end()
  116. }
  117. }
  118. }
  119. return PLUGIN_HANDLED
  120. }

Szerző:  Nandee [ 2013.03.02. 15:35 ]
Hozzászólás témája:  Re: bhopp ékezetes betük + szín

van
client_print(id, print_chat,
ezek helyett:
print_color(id,

Szerző:  theglorious [ 2013.03.02. 21:27 ]
Hozzászólás témája:  Re: bhopp ékezetes betük + szín

Nandee írta:
van
client_print(id, print_chat,
ezek helyett:
print_color(id,

51325faf753f4.sma(77) : warning 209: function "showUsage" should return a value
átalakításnál ezt írja :cry:

Szerző:  Nandee [ 2013.03.02. 21:33 ]
Hozzászólás témája:  Re: bhopp ékezetes betük + szín

SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. #include <amxmodx>
  3. #include <engine>
  4.  
  5. #define FL_WATERJUMP (1<<11) // player jumping out of water
  6. #define FL_ONGROUND (1<<9) // At rest / on the ground
  7.  
  8. public plugin_init() {
  9. register_plugin("Super Bunny Hopper", "1.2", "Cheesy Peteza")
  10. register_cvar("sbhopper_version", "1.2", FCVAR_SERVER)
  11.  
  12. register_cvar("bh_enabled", "1")
  13. register_cvar("bh_autojump", "1")
  14. register_cvar("bh_showusage", "1")
  15. }
  16.  
  17. public client_PreThink(id) {
  18. if (!get_cvar_num("bh_enabled"))
  19. return PLUGIN_CONTINUE
  20.  
  21. entity_set_float(id, EV_FL_fuser2, 0.0) // Disable slow down after jumping
  22.  
  23. if (!get_cvar_num("bh_autojump"))
  24. return PLUGIN_CONTINUE
  25.  
  26. // Code from CBasePlayer::Jump (player.cpp) Make a player jump automatically
  27. if (entity_get_int(id, EV_INT_button) & 2) { // If holding jump
  28. new flags = entity_get_int(id, EV_INT_flags)
  29.  
  30. if (flags & FL_WATERJUMP)
  31. return PLUGIN_CONTINUE
  32. if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
  33. return PLUGIN_CONTINUE
  34. if ( !(flags & FL_ONGROUND) )
  35. return PLUGIN_CONTINUE
  36.  
  37. new Float:velocity[3]
  38. entity_get_vector(id, EV_VEC_velocity, velocity)
  39. velocity[2] += 250.0
  40. entity_set_vector(id, EV_VEC_velocity, velocity)
  41.  
  42. entity_set_int(id, EV_INT_gaitsequence, 6) // Play the Jump Animation
  43. }
  44. return PLUGIN_CONTINUE
  45. }
  46.  
  47. public client_authorized(id)
  48. set_task(30.0, "showUsage", id)
  49.  
  50. public showUsage(id) {
  51. if ( !get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
  52. return PLUGIN_HANDLED
  53.  
  54. if ( !get_cvar_num("bh_autojump") ) {
  55. print_color(id,"!g[Bunny Hopp] !tA nyúlugrás használatához használd a W A S D Space/Hosszú gombokat!")
  56. } else {
  57. print_color(id,"!g[Bunny Hopp] !tAz ugras lenyomva tartásával tudod használni!")
  58. }
  59. return PLUGIN_CONTINUE
  60. }
  61. stock print_color(const id, const input[], any:...)
  62. {
  63. new count = 1, players[32]
  64. static msg[191]
  65. vformat(msg, 190, input, 3)
  66.  
  67. replace_all(msg, 190, "!g", "^4")
  68. replace_all(msg, 190, "!y", "^1")
  69. replace_all(msg, 190, "!t", "^3")
  70. replace_all(msg, 190, "á", "á")
  71. replace_all(msg, 190, "é", "Ă©")
  72. replace_all(msg, 190, "í", "Ă­")
  73. replace_all(msg, 190, "ó", "Ăł")
  74. replace_all(msg, 190, "ö", "ö")
  75. replace_all(msg, 190, "ő", "Ĺ‘")
  76. replace_all(msg, 190, "ú", "Ăş")
  77. replace_all(msg, 190, "ü", "ĂĽ")
  78. replace_all(msg, 190, "ű", "ű")
  79. replace_all(msg, 190, "Á", "Á")
  80. replace_all(msg, 190, "É", "É")
  81. replace_all(msg, 190, "Í", "ĂŤ")
  82. replace_all(msg, 190, "Ó", "Ă“")
  83. replace_all(msg, 190, "Ö", "Ă–")
  84. replace_all(msg, 190, "Ő", "Ő")
  85. replace_all(msg, 190, "Ú", "Ăš")
  86. replace_all(msg, 190, "Ü", "Ăś")
  87. replace_all(msg, 190, "Ű", "Ĺ°")
  88.  
  89. if (id) players[0] = id; else get_players(players, count, "ch")
  90. {
  91. for (new i = 0; i < count; i++)
  92. {
  93. if (is_user_connected(players[i]))
  94. {
  95. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  96. write_byte(players[i])
  97. write_string(msg)
  98. message_end()
  99. }
  100. }
  101. }
  102. return PLUGIN_HANDLED
  103. }


Így jó lesz

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