hlmod.hu
https://hlmod.hu/

Chat/ Üdvözlő és elköszönő üzenet/
https://hlmod.hu/viewtopic.php?f=29&t=16803
Oldal: 1 / 1

Szerző:  hallywood [ 2014.08.04. 20:09 ]
Hozzászólás témája:  Chat/ Üdvözlő és elköszönő üzenet/

Halihó mivel kevesebb lett az az idő amit tudok szánni a gépezésre! ezért azt az időt is configolásra használom elég könnyű amit kérek csak annyi lenne hogy ezt írja ki chatben mikor feljön vagy mikor le megy, olyan színnel amilyen színűen írom le!

[B]asshunter - .:Hallywood:. felcsatlakozott a Szerverre!

[B]asshunter - .:Hallywood:. lecsatlakozott!

Szerző:  mattboy [ 2014.08.04. 20:38 ]
Hozzászólás témája:  Re: Chat/ Üdvözlő és elköszönő üzenet/

A szinezést nem tudom megoldani bocs. Viszont ékezetes.
Tessék:

SMA Forráskód: [ Mindet kijelol ]
  1. #define VERSION "1.1"
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <geoip>
  6.  
  7. #define SHOW_COLOR 1
  8. #define SHOW_CONNECT 2
  9. #define SHOW_DISCONNECT 4
  10. #define PLAY_SOUND_CONNECT 8
  11. #define PLAY_SOUND_DISCONNECT 16
  12.  
  13. new display_type_pcvar
  14.  
  15. new name[33][32]
  16. new authid[33][32]
  17. new country[33][46]
  18. new ip[33][32]
  19.  
  20. new connect_soundfile[64]
  21. new disconnect_soundfile[64]
  22.  
  23. new saytext_msgid
  24.  
  25. public plugin_init()
  26. {
  27. register_plugin("GHW Connect Messages",VERSION,"GHW_Chronic")
  28. display_type_pcvar = register_cvar("cm_flags","31")
  29. register_cvar("cm_connect_string","[B]asshunter - %name (%steamid) Csatlakozott a szerverre! (%country).")
  30. register_cvar("cm_disconnect_string","[B]asshunter - %name (%steamid) Lecsatlakozott a szerverről!(%country).")
  31.  
  32. saytext_msgid = get_user_msgid("SayText")
  33. }
  34.  
  35. public plugin_precache()
  36. {
  37. register_cvar("cm_connect_sound","buttons/bell1.wav")
  38. register_cvar("cm_disconnect_sound","fvox/blip.wav")
  39.  
  40. get_cvar_string("cm_connect_sound",connect_soundfile,63)
  41. get_cvar_string("cm_disconnect_sound",disconnect_soundfile,63)
  42.  
  43. precache_sound(connect_soundfile)
  44. precache_sound(disconnect_soundfile)
  45. }
  46.  
  47. public client_putinserver(id)
  48. {
  49. if(!is_user_bot(id))
  50. {
  51. get_client_info(id)
  52.  
  53. new display_type = get_pcvar_num(display_type_pcvar)
  54. if(display_type & SHOW_CONNECT)
  55. {
  56. new string[200]
  57. get_cvar_string("cm_connect_string",string,199)
  58. format(string,199,"^x01%s",string)
  59.  
  60. if(display_type & SHOW_COLOR)
  61. {
  62. new holder[46]
  63.  
  64. format(holder,45,"^x04%s^x01",name[id])
  65. replace(string,199,"%name",holder)
  66.  
  67. format(holder,45,"^x04%s^x01",authid[id])
  68. replace(string,199,"%steamid",holder)
  69.  
  70. format(holder,45,"^x04%s^x01",country[id])
  71. replace(string,199,"%country",holder)
  72.  
  73. format(holder,45,"^x04%s^x01",ip[id])
  74. replace(string,199,"%ip",holder)
  75. }
  76. else
  77. {
  78. replace(string,199,"%name",name[id])
  79. replace(string,199,"%steamid",authid[id])
  80. replace(string,199,"%country",country[id])
  81. replace(string,199,"%ip",ip[id])
  82. }
  83.  
  84. new num, players[32], player
  85. get_players(players,num,"ch")
  86. for(new i=0;i<num;i++)
  87. {
  88. player = players[i]
  89.  
  90. message_begin(MSG_ONE,saytext_msgid,{0,0,0},player)
  91. write_byte(player)
  92. write_string(string)
  93. message_end()
  94.  
  95. if(display_type & PLAY_SOUND_CONNECT)
  96. {
  97. new stringlen = strlen(connect_soundfile)
  98. if(connect_soundfile[stringlen - 1]=='v' && connect_soundfile[stringlen - 2]=='a' && connect_soundfile[stringlen - 3]=='w') //wav
  99. {
  100. client_cmd(player,"spk ^"sound/%s^"",connect_soundfile)
  101. }
  102. if(connect_soundfile[stringlen - 1]=='3' && connect_soundfile[stringlen - 2]=='p' && connect_soundfile[stringlen - 3]=='m') //wav
  103. {
  104. client_cmd(player,"mp3 play ^"sound/%s^"",connect_soundfile)
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111.  
  112. public get_client_info(id)
  113. {
  114. get_user_name(id,name[id],31)
  115. get_user_authid(id,authid[id],31)
  116.  
  117. get_user_ip(id,ip[id],31)
  118. geoip_country(ip[id],country[id])
  119. if(equal(country[id],"error"))
  120. {
  121. if(contain(ip[id],"192.168.")==0 || equal(ip[id],"127.0.0.1") || contain(ip[id],"10.")==0 || contain(ip[id],"172.")==0)
  122. {
  123. country[id] = "LAN"
  124. }
  125. if(equal(ip[id],"loopback"))
  126. {
  127. country[id] = "ListenServer User"
  128. }
  129. else
  130. {
  131. country[id] = "Unknown Country"
  132. }
  133. }
  134. }
  135.  
  136. public client_infochanged(id)
  137. {
  138. if(!is_user_bot(id))
  139. {
  140. get_user_info(id,"name",name[id],31)
  141. }
  142. }
  143.  
  144. public client_disconnect(id)
  145. {
  146. if(!is_user_bot(id))
  147. {
  148. new display_type = get_pcvar_num(display_type_pcvar)
  149. if(display_type & SHOW_DISCONNECT)
  150. {
  151. new string[200]
  152. get_cvar_string("cm_disconnect_string",string,199)
  153. format(string,199,"^x01%s",string)
  154.  
  155. if(display_type & SHOW_COLOR)
  156. {
  157. new holder[46]
  158.  
  159. format(holder,45,"^x04%s^x01",name[id])
  160. replace(string,199,"%name",holder)
  161.  
  162. format(holder,45,"^x04%s^x01",authid[id])
  163. replace(string,199,"%steamid",holder)
  164.  
  165. format(holder,45,"^x04%s^x01",country[id])
  166. replace(string,199,"%country",holder)
  167.  
  168. format(holder,45,"^x04%s^x01",ip[id])
  169. replace(string,199,"%ip",holder)
  170. }
  171. else
  172. {
  173. replace(string,199,"%name",name[id])
  174. replace(string,199,"%steamid",authid[id])
  175. replace(string,199,"%country",country[id])
  176. replace(string,199,"%ip",ip[id])
  177. }
  178.  
  179. new num, players[32], player
  180. get_players(players,num,"ch")
  181. for(new i=0;i<num;i++)
  182. {
  183. player = players[i]
  184.  
  185. message_begin(MSG_ONE,saytext_msgid,{0,0,0},player)
  186. write_byte(player)
  187. write_string(string)
  188. message_end()
  189.  
  190. new stringlen = strlen(disconnect_soundfile)
  191. if(disconnect_soundfile[stringlen - 1]=='v' && disconnect_soundfile[stringlen - 2]=='a' && disconnect_soundfile[stringlen - 3]=='w') //wav
  192. {
  193. client_cmd(player,"spk ^"sound/%s^"",disconnect_soundfile)
  194. }
  195. if(disconnect_soundfile[stringlen - 1]=='3' && disconnect_soundfile[stringlen - 2]=='p' && disconnect_soundfile[stringlen - 3]=='m') //wav
  196. {
  197. client_cmd(player,"mp3 play ^"sound/%s^"",disconnect_soundfile)
  198. }
  199. }
  200. }
  201. }
  202. }

Szerző:  MeSter [ 2014.08.05. 07:12 ]
Hozzászólás témája:  Re: Chat/ Üdvözlő és elköszönő üzenet/

Szia meg próbáltam kiszínezni nem tudom hogy sikerült :)

SMA Forráskód: [ Mindet kijelol ]
  1. #define VERSION "1.1"
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <geoip>
  6. #include <colorchat>
  7. #define SHOW_COLOR 1
  8. #define SHOW_CONNECT 2
  9. #define SHOW_DISCONNECT 4
  10. #define PLAY_SOUND_CONNECT 8
  11. #define PLAY_SOUND_DISCONNECT 16
  12.  
  13. new display_type_pcvar
  14.  
  15. new name[33][32]
  16. new authid[33][32]
  17. new country[33][46]
  18. new ip[33][32]
  19.  
  20. new connect_soundfile[64]
  21. new disconnect_soundfile[64]
  22.  
  23. new saytext_msgid
  24.  
  25. public plugin_init()
  26. {
  27. register_plugin("GHW Connect Messages",VERSION,"GHW_Chronic")
  28. display_type_pcvar = register_cvar("cm_flags","31")
  29. register_cvar("cm_connect_string",ColorChat(0, RED,"[B]asshunter - ^1%name (%steamid) ^4 Csatlakozott a szerverre! (%country).")
  30. register_cvar("cm_disconnect_string",ColorChat(0, RED,"[B]asshunter - ^1%name (%steamid) ^4 Lecsatlakozott a szerverről!(%country).")
  31.  
  32. saytext_msgid = get_user_msgid("SayText")
  33. }
  34.  
  35. public plugin_precache()
  36. {
  37. register_cvar("cm_connect_sound","buttons/bell1.wav")
  38. register_cvar("cm_disconnect_sound","fvox/blip.wav")
  39.  
  40. get_cvar_string("cm_connect_sound",connect_soundfile,63)
  41. get_cvar_string("cm_disconnect_sound",disconnect_soundfile,63)
  42.  
  43. precache_sound(connect_soundfile)
  44. precache_sound(disconnect_soundfile)
  45. }
  46.  
  47. public client_putinserver(id)
  48. {
  49. if(!is_user_bot(id))
  50. {
  51. get_client_info(id)
  52.  
  53. new display_type = get_pcvar_num(display_type_pcvar)
  54. if(display_type & SHOW_CONNECT)
  55. {
  56. new string[200]
  57. get_cvar_string("cm_connect_string",string,199)
  58. format(string,199,"^x01%s",string)
  59.  
  60. if(display_type & SHOW_COLOR)
  61. {
  62. new holder[46]
  63.  
  64. format(holder,45,"^x04%s^x01",name[id])
  65. replace(string,199,"%name",holder)
  66.  
  67. format(holder,45,"^x04%s^x01",authid[id])
  68. replace(string,199,"%steamid",holder)
  69.  
  70. format(holder,45,"^x04%s^x01",country[id])
  71. replace(string,199,"%country",holder)
  72.  
  73. format(holder,45,"^x04%s^x01",ip[id])
  74. replace(string,199,"%ip",holder)
  75. }
  76. else
  77. {
  78. replace(string,199,"%name",name[id])
  79. replace(string,199,"%steamid",authid[id])
  80. replace(string,199,"%country",country[id])
  81. replace(string,199,"%ip",ip[id])
  82. }
  83.  
  84. new num, players[32], player
  85. get_players(players,num,"ch")
  86. for(new i=0;i<num;i++)
  87. {
  88. player = players[i]
  89.  
  90. message_begin(MSG_ONE,saytext_msgid,{0,0,0},player)
  91. write_byte(player)
  92. write_string(string)
  93. message_end()
  94.  
  95. if(display_type & PLAY_SOUND_CONNECT)
  96. {
  97. new stringlen = strlen(connect_soundfile)
  98. if(connect_soundfile[stringlen - 1]=='v' && connect_soundfile[stringlen - 2]=='a' && connect_soundfile[stringlen - 3]=='w') //wav
  99. {
  100. client_cmd(player,"spk ^"sound/%s^"",connect_soundfile)
  101. }
  102. if(connect_soundfile[stringlen - 1]=='3' && connect_soundfile[stringlen - 2]=='p' && connect_soundfile[stringlen - 3]=='m') //wav
  103. {
  104. client_cmd(player,"mp3 play ^"sound/%s^"",connect_soundfile)
  105. }
  106. }
  107. }
  108. }
  109. }
  110. }
  111.  
  112. public get_client_info(id)
  113. {
  114. get_user_name(id,name[id],31)
  115. get_user_authid(id,authid[id],31)
  116.  
  117. get_user_ip(id,ip[id],31)
  118. geoip_country(ip[id],country[id])
  119. if(equal(country[id],"error"))
  120. {
  121. if(contain(ip[id],"192.168.")==0 || equal(ip[id],"127.0.0.1") || contain(ip[id],"10.")==0 || contain(ip[id],"172.")==0)
  122. {
  123. country[id] = "LAN"
  124. }
  125. if(equal(ip[id],"loopback"))
  126. {
  127. country[id] = "ListenServer User"
  128. }
  129. else
  130. {
  131. country[id] = "Unknown Country"
  132. }
  133. }
  134. }
  135.  
  136. public client_infochanged(id)
  137. {
  138. if(!is_user_bot(id))
  139. {
  140. get_user_info(id,"name",name[id],31)
  141. }
  142. }
  143.  
  144. public client_disconnect(id)
  145. {
  146. if(!is_user_bot(id))
  147. {
  148. new display_type = get_pcvar_num(display_type_pcvar)
  149. if(display_type & SHOW_DISCONNECT)
  150. {
  151. new string[200]
  152. get_cvar_string("cm_disconnect_string",string,199)
  153. format(string,199,"^x01%s",string)
  154.  
  155. if(display_type & SHOW_COLOR)
  156. {
  157. new holder[46]
  158.  
  159. format(holder,45,"^x04%s^x01",name[id])
  160. replace(string,199,"%name",holder)
  161.  
  162. format(holder,45,"^x04%s^x01",authid[id])
  163. replace(string,199,"%steamid",holder)
  164.  
  165. format(holder,45,"^x04%s^x01",country[id])
  166. replace(string,199,"%country",holder)
  167.  
  168. format(holder,45,"^x04%s^x01",ip[id])
  169. replace(string,199,"%ip",holder)
  170. }
  171. else
  172. {
  173. replace(string,199,"%name",name[id])
  174. replace(string,199,"%steamid",authid[id])
  175. replace(string,199,"%country",country[id])
  176. replace(string,199,"%ip",ip[id])
  177. }
  178.  
  179. new num, players[32], player
  180. get_players(players,num,"ch")
  181. for(new i=0;i<num;i++)
  182. {
  183. player = players[i]
  184.  
  185. message_begin(MSG_ONE,saytext_msgid,{0,0,0},player)
  186. write_byte(player)
  187. write_string(string)
  188. message_end()
  189.  
  190. new stringlen = strlen(disconnect_soundfile)
  191. if(disconnect_soundfile[stringlen - 1]=='v' && disconnect_soundfile[stringlen - 2]=='a' && disconnect_soundfile[stringlen - 3]=='w') //wav
  192. {
  193. client_cmd(player,"spk ^"sound/%s^"",disconnect_soundfile)
  194. }
  195. if(disconnect_soundfile[stringlen - 1]=='3' && disconnect_soundfile[stringlen - 2]=='p' && disconnect_soundfile[stringlen - 3]=='m') //wav
  196. {
  197. client_cmd(player,"mp3 play ^"sound/%s^"",disconnect_soundfile)
  198. }
  199. }
  200. }
  201. }
  202. }

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