hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.12. 18:21



Jelenlévő felhasználók

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

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó 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  [ 15 hozzászólás ]  Oldal Előző 1 2
Szerző Üzenet
 Hozzászólás témája: Re: Színezés!
HozzászólásElküldve: 2014.10.25. 10:13 
Offline
Félisten
Avatar

Csatlakozott: 2013.12.30. 12:26
Hozzászólások: 987
Megköszönt másnak: 34 alkalommal
Megköszönték neki: 133 alkalommal
spice írta:
Az sma.ja ennyiből áll. :cry:
SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * Admin Help Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. * originally developed by tcquest78
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at
  13. * your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software Foundation,
  22. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. * In addition, as a special exception, the author gives permission to
  25. * link the code of this program with the Half-Life Game Engine ("HL
  26. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. * respects for all of the code used other than the HL Engine and MODs
  29. * from Valve. If you modify this file, you may extend this exception
  30. * to your version of the file, but you are not obligated to do so. If
  31. * you do not wish to do so, delete this exception statement from your
  32. * version.
  33. */
  34.  
  35. #include <amxmodx>
  36.  
  37. #define DISPLAY_MSG // Comment to disable message on join
  38. #define HELPAMOUNT 10 // Number of commands per page
  39.  
  40.  
  41. enum ChatColor
  42. {
  43. CHATCOLOR_NORMAL = 1,
  44. CHATCOLOR_GREEN,
  45. CHATCOLOR_TEAM_COLOR,
  46. CHATCOLOR_GREY,
  47. CHATCOLOR_RED,
  48. CHATCOLOR_BLUE,
  49. }
  50.  
  51.  
  52. public plugin_init()
  53. {
  54. register_plugin("Admin Help", AMXX_VERSION_STR, "AMXX Dev Team")
  55. register_dictionary("adminhelp.txt")
  56. register_concmd("amx_help", "cmdHelp", 0, "<page> [nr of cmds (only for server)] - displays this help")
  57. }
  58.  
  59. #if defined DISPLAY_MSG
  60. public client_putinserver(id)
  61. {
  62. if (is_user_bot(id))
  63. return
  64.  
  65. set_task(15.0, "dispInfo", id)
  66. }
  67.  
  68. public client_disconnect(id)
  69. {
  70. remove_task(id)
  71. }
  72. #endif
  73.  
  74. public cmdHelp(id, level, cid)
  75. {
  76. new arg1[8], flags = get_user_flags(id)
  77. new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
  78. new lHelpAmount = HELPAMOUNT
  79.  
  80. // HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
  81. if (flags > 0 && !(flags & ADMIN_USER))
  82. {
  83. flags |= ADMIN_ADMIN;
  84. }
  85.  
  86. if (id == 0 && read_argc() == 3)
  87. lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : HELPAMOUNT
  88.  
  89. if (--start < 0)
  90. start = 0
  91.  
  92. new clcmdsnum = get_concmdsnum(flags, id)
  93.  
  94. if (start >= clcmdsnum)
  95. start = clcmdsnum - 1
  96.  
  97. console_print(id, "^n----- %L -----", id, "HELP_COMS")
  98.  
  99. new info[128], cmd[32], eflags
  100. new end = start + lHelpAmount // HELPAMOUNT
  101.  
  102. if (end > clcmdsnum)
  103. end = clcmdsnum
  104.  
  105. for (new i = start; i < end; i++)
  106. {
  107. get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
  108. console_print(id, "%3d: %s %s", i + 1, cmd, info)
  109. }
  110.  
  111. console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, clcmdsnum)
  112.  
  113. if (end < clcmdsnum)
  114. console_print(id, "----- %L -----", id, "HELP_USE_MORE", end + 1)
  115. else
  116. console_print(id, "----- %L -----", id, "HELP_USE_BEGIN")
  117.  
  118. return PLUGIN_HANDLED
  119. }
  120.  
  121. #if defined DISPLAY_MSG
  122. public dispInfo(id)
  123. {
  124. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TYPE_HELP")
  125.  
  126. new nextmap[32]
  127. get_cvar_string("amx_nextmap", nextmap, 31)
  128.  
  129. if (get_cvar_float("mp_timelimit"))
  130. {
  131. new timeleft = get_timeleft()
  132.  
  133. if (timeleft > 0)
  134. {
  135. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TIME_INFO_1", timeleft / 60, timeleft % 60, nextmap)
  136. } else {
  137. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TIME_INFO_2", nextmap)
  138. }
  139. }
  140. }
  141. #endif
  142.  
  143. colorChat(id, ChatColor:color, const msg[], {Float,Sql,Result,_}:...)
  144. {
  145. new team, index, MSG_Type
  146. new bool:teamChanged = false
  147. static message[192]
  148.  
  149. switch(color)
  150. {
  151. case CHATCOLOR_NORMAL: // Normal
  152. {
  153. message[0] = 0x01;
  154. }
  155. case CHATCOLOR_GREEN: // Green
  156. {
  157. message[0] = 0x04;
  158. }
  159. default: // Grey, Red, Blue
  160. {
  161. message[0] = 0x03;
  162. }
  163. }
  164.  
  165. vformat(message[1], 190, msg, 4);
  166. replace_all(message, 190, "$g", "^x04")
  167. replace_all(message, 190, "$n", "^x01")
  168. replace_all(message, 190, "$t", "^x03")
  169.  
  170. if(id == 0)
  171. {
  172. index = findAnyPlayer()
  173. MSG_Type = MSG_ALL;
  174. }
  175. else
  176. {
  177. index = id;
  178. MSG_Type = MSG_ONE;
  179. }
  180. if(index != 0)
  181. {
  182. team = get_user_team(index);
  183. if(color == CHATCOLOR_RED && team != 1)
  184. {
  185. messageTeamInfo(index, MSG_Type, "TERRORIST")
  186. teamChanged = true
  187. }
  188. else
  189. if(color == CHATCOLOR_BLUE && team != 2)
  190. {
  191. messageTeamInfo(index, MSG_Type, "CT")
  192. teamChanged = true
  193. }
  194. else
  195. if(color == CHATCOLOR_GREY && team != 0)
  196. {
  197. messageTeamInfo(index, MSG_Type,"")
  198. teamChanged = true
  199. }
  200. messageSayText(index, MSG_Type, message);
  201. if(teamChanged)
  202. {
  203. messageTeamInfo(index, MSG_Type, "SPECTATOR") // yayaya fuck this
  204. }
  205. }
  206. }
  207.  
  208. messageSayText(id, type, message[])
  209. {
  210. message_begin(type, get_user_msgid("SayText"), _, id)
  211. write_byte(id)
  212. write_string(message)
  213. message_end()
  214. }
  215.  
  216. messageTeamInfo(id, type, team[])
  217. {
  218. message_begin(type, get_user_msgid("TeamInfo"), _, id)
  219. write_byte(id)
  220. write_string(team)
  221. message_end()
  222. }
  223.  
  224. findAnyPlayer()
  225. {
  226. static players[32], inum, pid
  227.  
  228. get_players(players, inum, "ch")
  229.  
  230. for (new a = 0; a < inum; a++)
  231. {
  232. pid = players[a]
  233. if(is_user_connected(pid))
  234. return pid
  235. }
  236.  
  237. return 0
  238. }
  239.  

ennek a végére amit mester írt és aztán langban tudod ezekkel színezni: !g !y !t

_________________
Kép
Pár pluginom:
LCAW Frag Bolt
S E C R E T (78%...)
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Színezés!
HozzászólásElküldve: 2014.10.25. 10:24 
xXlederXxHUN írta:
spice írta:
Az sma.ja ennyiből áll. :cry:
SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * Admin Help Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. * originally developed by tcquest78
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at
  13. * your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software Foundation,
  22. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. * In addition, as a special exception, the author gives permission to
  25. * link the code of this program with the Half-Life Game Engine ("HL
  26. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. * respects for all of the code used other than the HL Engine and MODs
  29. * from Valve. If you modify this file, you may extend this exception
  30. * to your version of the file, but you are not obligated to do so. If
  31. * you do not wish to do so, delete this exception statement from your
  32. * version.
  33. */
  34.  
  35. #include <amxmodx>
  36.  
  37. #define DISPLAY_MSG // Comment to disable message on join
  38. #define HELPAMOUNT 10 // Number of commands per page
  39.  
  40.  
  41. enum ChatColor
  42. {
  43. CHATCOLOR_NORMAL = 1,
  44. CHATCOLOR_GREEN,
  45. CHATCOLOR_TEAM_COLOR,
  46. CHATCOLOR_GREY,
  47. CHATCOLOR_RED,
  48. CHATCOLOR_BLUE,
  49. }
  50.  
  51.  
  52. public plugin_init()
  53. {
  54. register_plugin("Admin Help", AMXX_VERSION_STR, "AMXX Dev Team")
  55. register_dictionary("adminhelp.txt")
  56. register_concmd("amx_help", "cmdHelp", 0, "<page> [nr of cmds (only for server)] - displays this help")
  57. }
  58.  
  59. #if defined DISPLAY_MSG
  60. public client_putinserver(id)
  61. {
  62. if (is_user_bot(id))
  63. return
  64.  
  65. set_task(15.0, "dispInfo", id)
  66. }
  67.  
  68. public client_disconnect(id)
  69. {
  70. remove_task(id)
  71. }
  72. #endif
  73.  
  74. public cmdHelp(id, level, cid)
  75. {
  76. new arg1[8], flags = get_user_flags(id)
  77. new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
  78. new lHelpAmount = HELPAMOUNT
  79.  
  80. // HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
  81. if (flags > 0 && !(flags & ADMIN_USER))
  82. {
  83. flags |= ADMIN_ADMIN;
  84. }
  85.  
  86. if (id == 0 && read_argc() == 3)
  87. lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : HELPAMOUNT
  88.  
  89. if (--start < 0)
  90. start = 0
  91.  
  92. new clcmdsnum = get_concmdsnum(flags, id)
  93.  
  94. if (start >= clcmdsnum)
  95. start = clcmdsnum - 1
  96.  
  97. console_print(id, "^n----- %L -----", id, "HELP_COMS")
  98.  
  99. new info[128], cmd[32], eflags
  100. new end = start + lHelpAmount // HELPAMOUNT
  101.  
  102. if (end > clcmdsnum)
  103. end = clcmdsnum
  104.  
  105. for (new i = start; i < end; i++)
  106. {
  107. get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
  108. console_print(id, "%3d: %s %s", i + 1, cmd, info)
  109. }
  110.  
  111. console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, clcmdsnum)
  112.  
  113. if (end < clcmdsnum)
  114. console_print(id, "----- %L -----", id, "HELP_USE_MORE", end + 1)
  115. else
  116. console_print(id, "----- %L -----", id, "HELP_USE_BEGIN")
  117.  
  118. return PLUGIN_HANDLED
  119. }
  120.  
  121. #if defined DISPLAY_MSG
  122. public dispInfo(id)
  123. {
  124. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TYPE_HELP")
  125.  
  126. new nextmap[32]
  127. get_cvar_string("amx_nextmap", nextmap, 31)
  128.  
  129. if (get_cvar_float("mp_timelimit"))
  130. {
  131. new timeleft = get_timeleft()
  132.  
  133. if (timeleft > 0)
  134. {
  135. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TIME_INFO_1", timeleft / 60, timeleft % 60, nextmap)
  136. } else {
  137. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TIME_INFO_2", nextmap)
  138. }
  139. }
  140. }
  141. #endif
  142.  
  143. colorChat(id, ChatColor:color, const msg[], {Float,Sql,Result,_}:...)
  144. {
  145. new team, index, MSG_Type
  146. new bool:teamChanged = false
  147. static message[192]
  148.  
  149. switch(color)
  150. {
  151. case CHATCOLOR_NORMAL: // Normal
  152. {
  153. message[0] = 0x01;
  154. }
  155. case CHATCOLOR_GREEN: // Green
  156. {
  157. message[0] = 0x04;
  158. }
  159. default: // Grey, Red, Blue
  160. {
  161. message[0] = 0x03;
  162. }
  163. }
  164.  
  165. vformat(message[1], 190, msg, 4);
  166. replace_all(message, 190, "$g", "^x04")
  167. replace_all(message, 190, "$n", "^x01")
  168. replace_all(message, 190, "$t", "^x03")
  169.  
  170. if(id == 0)
  171. {
  172. index = findAnyPlayer()
  173. MSG_Type = MSG_ALL;
  174. }
  175. else
  176. {
  177. index = id;
  178. MSG_Type = MSG_ONE;
  179. }
  180. if(index != 0)
  181. {
  182. team = get_user_team(index);
  183. if(color == CHATCOLOR_RED && team != 1)
  184. {
  185. messageTeamInfo(index, MSG_Type, "TERRORIST")
  186. teamChanged = true
  187. }
  188. else
  189. if(color == CHATCOLOR_BLUE && team != 2)
  190. {
  191. messageTeamInfo(index, MSG_Type, "CT")
  192. teamChanged = true
  193. }
  194. else
  195. if(color == CHATCOLOR_GREY && team != 0)
  196. {
  197. messageTeamInfo(index, MSG_Type,"")
  198. teamChanged = true
  199. }
  200. messageSayText(index, MSG_Type, message);
  201. if(teamChanged)
  202. {
  203. messageTeamInfo(index, MSG_Type, "SPECTATOR") // yayaya fuck this
  204. }
  205. }
  206. }
  207.  
  208. messageSayText(id, type, message[])
  209. {
  210. message_begin(type, get_user_msgid("SayText"), _, id)
  211. write_byte(id)
  212. write_string(message)
  213. message_end()
  214. }
  215.  
  216. messageTeamInfo(id, type, team[])
  217. {
  218. message_begin(type, get_user_msgid("TeamInfo"), _, id)
  219. write_byte(id)
  220. write_string(team)
  221. message_end()
  222. }
  223.  
  224. findAnyPlayer()
  225. {
  226. static players[32], inum, pid
  227.  
  228. get_players(players, inum, "ch")
  229.  
  230. for (new a = 0; a < inum; a++)
  231. {
  232. pid = players[a]
  233. if(is_user_connected(pid))
  234. return pid
  235. }
  236.  
  237. return 0
  238. }
  239.  

ennek a végére amit mester írt és aztán langban tudod ezekkel színezni: !g !y !t


És a stockal Működni fog ? mert csak írtam vmit nem voltam benne bíztos :D


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Színezés!
HozzászólásElküldve: 2014.11.12. 20:16 
Offline
Beavatott

Csatlakozott: 2014.05.23. 18:32
Hozzászólások: 68
Megköszönt másnak: 88 alkalommal
Megköszönték neki: 2 alkalommal
Nem működik ám! :/


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Színezés!
HozzászólásElküldve: 2014.11.12. 20:19 
Most már tudod színezni a langot de csak ezt:
Kód:
rj 'amx_help' -t a konzolba hogy lathasd a parancsokat


SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * Admin Help Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. * originally developed by tcquest78
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at
  13. * your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software Foundation,
  22. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. * In addition, as a special exception, the author gives permission to
  25. * link the code of this program with the Half-Life Game Engine ("HL
  26. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. * respects for all of the code used other than the HL Engine and MODs
  29. * from Valve. If you modify this file, you may extend this exception
  30. * to your version of the file, but you are not obligated to do so. If
  31. * you do not wish to do so, delete this exception statement from your
  32. * version.
  33. */
  34.  
  35. #include <amxmodx>
  36.  
  37. #define DISPLAY_MSG // Comment to disable message on join
  38. #define HELPAMOUNT 10 // Number of commands per page
  39.  
  40.  
  41. enum ChatColor
  42. {
  43. CHATCOLOR_NORMAL = 1,
  44. CHATCOLOR_GREEN,
  45. CHATCOLOR_TEAM_COLOR,
  46. CHATCOLOR_GREY,
  47. CHATCOLOR_RED,
  48. CHATCOLOR_BLUE,
  49. }
  50.  
  51.  
  52. public plugin_init()
  53. {
  54. register_plugin("Admin Help", AMXX_VERSION_STR, "AMXX Dev Team")
  55. register_dictionary("adminhelp.txt")
  56. register_concmd("amx_help", "cmdHelp", 0, "<page> [nr of cmds (only for server)] - displays this help")
  57. }
  58.  
  59. #if defined DISPLAY_MSG
  60. public client_putinserver(id)
  61. {
  62. if (is_user_bot(id))
  63. return
  64.  
  65. set_task(15.0, "dispInfo", id)
  66. }
  67.  
  68. public client_disconnect(id)
  69. {
  70. remove_task(id)
  71. }
  72. #endif
  73.  
  74. public cmdHelp(id, level, cid)
  75. {
  76. new arg1[8], flags = get_user_flags(id)
  77. new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
  78. new lHelpAmount = HELPAMOUNT
  79.  
  80. // HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
  81. if (flags > 0 && !(flags & ADMIN_USER))
  82. {
  83. flags |= ADMIN_ADMIN;
  84. }
  85.  
  86. if (id == 0 && read_argc() == 3)
  87. lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : HELPAMOUNT
  88.  
  89. if (--start < 0)
  90. start = 0
  91.  
  92. new clcmdsnum = get_concmdsnum(flags, id)
  93.  
  94. if (start >= clcmdsnum)
  95. start = clcmdsnum - 1
  96.  
  97. console_print(id, "^n----- %L -----", id, "HELP_COMS")
  98.  
  99. new info[128], cmd[32], eflags
  100. new end = start + lHelpAmount // HELPAMOUNT
  101.  
  102. if (end > clcmdsnum)
  103. end = clcmdsnum
  104.  
  105. for (new i = start; i < end; i++)
  106. {
  107. get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
  108. console_print(id, "%3d: %s %s", i + 1, cmd, info)
  109. }
  110.  
  111. console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, clcmdsnum)
  112.  
  113. if (end < clcmdsnum)
  114. console_print(id, "----- %L -----", id, "HELP_USE_MORE", end + 1)
  115. else
  116. console_print(id, "----- %L -----", id, "HELP_USE_BEGIN")
  117.  
  118. return PLUGIN_HANDLED
  119. }
  120.  
  121. #if defined DISPLAY_MSG
  122. public dispInfo(id)
  123. {
  124. print_color(id, CHATCOLOR_NORMAL, "%L", id, "TYPE_HELP")
  125.  
  126. new nextmap[32]
  127. get_cvar_string("amx_nextmap", nextmap, 31)
  128.  
  129. if (get_cvar_float("mp_timelimit"))
  130. {
  131. new timeleft = get_timeleft()
  132.  
  133. if (timeleft > 0)
  134. {
  135. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TIME_INFO_1", timeleft / 60, timeleft % 60, nextmap)
  136. } else {
  137. colorChat(id, CHATCOLOR_NORMAL, "%L", id, "TIME_INFO_2", nextmap)
  138. }
  139. }
  140. }
  141. #endif
  142.  
  143. colorChat(id, ChatColor:color, const msg[], {Float,Sql,Result,_}:...)
  144. {
  145. new team, index, MSG_Type
  146. new bool:teamChanged = false
  147. static message[192]
  148.  
  149. switch(color)
  150. {
  151. case CHATCOLOR_NORMAL: // Normal
  152. {
  153. message[0] = 0x01;
  154. }
  155. case CHATCOLOR_GREEN: // Green
  156. {
  157. message[0] = 0x04;
  158. }
  159. default: // Grey, Red, Blue
  160. {
  161. message[0] = 0x03;
  162. }
  163. }
  164.  
  165. vformat(message[1], 190, msg, 4);
  166. replace_all(message, 190, "$g", "^x04")
  167. replace_all(message, 190, "$n", "^x01")
  168. replace_all(message, 190, "$t", "^x03")
  169.  
  170. if(id == 0)
  171. {
  172. index = findAnyPlayer()
  173. MSG_Type = MSG_ALL;
  174. }
  175. else
  176. {
  177. index = id;
  178. MSG_Type = MSG_ONE;
  179. }
  180. if(index != 0)
  181. {
  182. team = get_user_team(index);
  183. if(color == CHATCOLOR_RED && team != 1)
  184. {
  185. messageTeamInfo(index, MSG_Type, "TERRORIST")
  186. teamChanged = true
  187. }
  188. else
  189. if(color == CHATCOLOR_BLUE && team != 2)
  190. {
  191. messageTeamInfo(index, MSG_Type, "CT")
  192. teamChanged = true
  193. }
  194. else
  195. if(color == CHATCOLOR_GREY && team != 0)
  196. {
  197. messageTeamInfo(index, MSG_Type,"")
  198. teamChanged = true
  199. }
  200. messageSayText(index, MSG_Type, message);
  201. if(teamChanged)
  202. {
  203. messageTeamInfo(index, MSG_Type, "SPECTATOR") // yayaya fuck this
  204. }
  205. }
  206. }
  207.  
  208. messageSayText(id, type, message[])
  209. {
  210. message_begin(type, get_user_msgid("SayText"), _, id)
  211. write_byte(id)
  212. write_string(message)
  213. message_end()
  214. }
  215.  
  216. messageTeamInfo(id, type, team[])
  217. {
  218. message_begin(type, get_user_msgid("TeamInfo"), _, id)
  219. write_byte(id)
  220. write_string(team)
  221. message_end()
  222. }
  223.  
  224. findAnyPlayer()
  225. {
  226. static players[32], inum, pid
  227.  
  228. get_players(players, inum, "ch")
  229.  
  230. for (new a = 0; a < inum; a++)
  231. {
  232. pid = players[a]
  233. if(is_user_connected(pid))
  234. return pid
  235. }
  236.  
  237. return 0
  238. }
  239. stock print_color(const id, const input[], any:...)
  240. {
  241. new count = 1, players[32]
  242. static msg[191]
  243. vformat(msg, 190, input, 3)
  244.  
  245. replace_all(msg, 190, "!g", "^4")
  246. replace_all(msg, 190, "!y", "^1")
  247. replace_all(msg, 190, "!t", "^3")
  248.  
  249. if (id) players[0] = id; else get_players(players, count, "ch")
  250. {
  251. for (new i = 0; i < count; i++)
  252. {
  253. if (is_user_connected(players[i]))
  254. {
  255. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  256. write_byte(players[i])
  257. write_string(msg)
  258. message_end()
  259. }
  260. }
  261. }
  262. return PLUGIN_HANDLED
  263. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Színezés!
HozzászólásElküldve: 2014.11.20. 21:35 
Offline
Veterán
Avatar

Csatlakozott: 2013.03.26. 20:20
Hozzászólások: 1846
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 120 alkalommal
Az nem elég, hogy berakod a stock-ot.

Megkell keresned ezeket:
SMA Forráskód: [ Mindet kijelol ]client_print(id, print_chat, ...)

Írd át ezekre:
Kód:
print_color(id,


Színezés:
Kód:
!g zöld
!y sárga
!t csapatszín

_________________
Projektem:

[CSO2] Ghost Mod
CSO2 GamePlay video: https://www.youtube.com/watch?feature=p ... iOS4Ik1Yrk


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  [ 15 hozzászólás ]  Oldal Előző 1 2


Ki van itt

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