hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.24. 03:01



Jelenlévő felhasználók

Jelenleg 473 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 473 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  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Előtag+zöld írás
HozzászólásElküldve: 2013.07.11. 15:57 
Offline
Fanatikus
Avatar

Csatlakozott: 2013.04.10. 13:11
Hozzászólások: 161
Megköszönt másnak: 31 alkalommal
Megköszönték neki: 7 alkalommal
Sziasztok...

Ezt a plugin valaki összeírná az admin_chat_colorsal?
http://amxmodx.crys.hu/site/?p=pluginz& ... dminprefix

Köszönöm...

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Előtag+zöld írás
HozzászólásElküldve: 2013.07.11. 16:00 
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
Joke írta:
Sziasztok...

Ezt a plugin valaki összeírná az admin_chat_colorsal?
http://amxmodx.crys.hu/site/?p=pluginz& ... dminprefix

Köszönöm...


ehhez admin chat colors vagy mi nem kell

_________________
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ás témája: Re: Előtag+zöld írás
HozzászólásElküldve: 2013.07.11. 16:46 
Offline
Felfüggesztve
Avatar

Csatlakozott: 2013.06.09. 18:47
Hozzászólások: 2004
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 220 alkalommal
Joke írta:
Sziasztok...

Ezt a plugin valaki összeírná az admin_chat_colorsal?
http://amxmodx.crys.hu/site/?p=pluginz& ... dminprefix

Köszönöm...



Alapból egybe van írva!

http://img291.imageshack.us/img291/6964/dedust2long0000u.png

De ha nagyon akarod.... :P

SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2. #include < amxmisc >
  3.  
  4. #define PLUGIN "Admin Tag and Colors"
  5. #define VERSION "2.0"
  6. #define AUTHOR "Arion"
  7.  
  8. #define ACCESS_ADMIN ADMIN_BAN
  9. #define ADMIN_LISTEN ADMIN_LEVEL_C
  10.  
  11. new message[192]
  12. new sayText
  13. new teamInfo
  14. new maxPlayers
  15.  
  16. new g_MessageColor
  17. new g_NameColor
  18. new g_AdminListen
  19.  
  20. new strName[191]
  21. new strText[191]
  22. new alive[11]
  23.  
  24. public plugin_init()
  25. {
  26. register_plugin (PLUGIN, VERSION, AUTHOR)
  27.  
  28. g_MessageColor = register_cvar ("amx_color", "2") // Message colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red
  29. g_NameColor = register_cvar ("amx_namecolor", "6") // Name colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-color
  30. g_AdminListen = register_cvar ("amx_listen", "1") // Set whether admins see or not all messages (Alive, dead and team-only)
  31.  
  32.  
  33. sayText = get_user_msgid ("SayText")
  34. teamInfo = get_user_msgid ("TeamInfo")
  35. maxPlayers = get_maxplayers()
  36.  
  37.  
  38. register_message (sayText, "avoid_duplicated")
  39.  
  40. register_clcmd ("amx_color", "set_color", ACCESS_ADMIN, "<color>")
  41. register_clcmd ("amx_namecolor", "set_name_color", ACCESS_ADMIN, "<color>")
  42. register_clcmd ("amx_listen", "set_listen", ACCESS_ADMIN, "<1 | 0>")
  43.  
  44. register_clcmd ("say", "hook_say")
  45. register_clcmd ("say_team", "hook_teamsay")
  46. }
  47.  
  48.  
  49. public avoid_duplicated (msgId, msgDest, receiver)
  50. {
  51. return PLUGIN_HANDLED
  52. }
  53.  
  54.  
  55. public hook_say(id)
  56. {
  57. read_args (message, 191)
  58. remove_quotes (message)
  59.  
  60. if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
  61. // Gungame commands and empty messages
  62. return PLUGIN_CONTINUE
  63.  
  64.  
  65. new name[32]
  66. get_user_name (id, name, 31)
  67.  
  68. new bool:admin = false
  69.  
  70. if (is_user_admin(id))
  71. admin = true
  72.  
  73.  
  74.  
  75.  
  76. new isAlive
  77.  
  78. if (is_user_alive (id))
  79. {
  80. isAlive = 1
  81. alive = "^x01"
  82. }
  83. else
  84. {
  85. isAlive = 0
  86. alive = "^x01*DEAD* "
  87. }
  88.  
  89. static color[10]
  90.  
  91.  
  92.  
  93. if (admin)
  94. {
  95. // Name
  96. switch (get_pcvar_num (g_NameColor))
  97. {
  98. case 1:
  99. format (strName, 191, "^x04[ADMIN] %s%s", alive, name)
  100.  
  101. case 2:
  102. format (strName, 191, "^x04[ADMIN] %s^x04%s ", alive, name)
  103.  
  104. case 3:
  105. {
  106. color = "SPECTATOR"
  107. format (strName, 191, "^x04[ADMIN] %s^x03%s ", alive, name)
  108. }
  109.  
  110. case 4:
  111. {
  112. color = "CT"
  113. format (strName, 191, "^x04[ADMIN] %s^x03%s", alive, name)
  114. }
  115.  
  116. case 5:
  117. {
  118. color = "TERRORIST"
  119. format (strName, 191, "^x04[ADMIN] %s^x03%s", alive, name)
  120. }
  121.  
  122. case 6:
  123. {
  124. get_user_team (id, color, 9)
  125.  
  126. format (strName, 191, "^x04[ADMIN] %s^x03%s", alive, name)
  127. }
  128. }
  129.  
  130.  
  131. // Message
  132. switch (get_pcvar_num (g_MessageColor))
  133. {
  134. case 1: // Yellow
  135. format (strText, 191, "%s", message)
  136.  
  137. case 2: // Green
  138. format (strText, 191, "^x04%s", message)
  139.  
  140. case 3: // White
  141. {
  142. copy (color, 9, "SPECTATOR")
  143. format (strText, 191, "^x03%s", message)
  144. }
  145.  
  146. case 4: // Blue
  147. {
  148. copy (color, 9, "CT")
  149. format (strText, 191, "^x03%s", message)
  150. }
  151.  
  152. case 5: // Red
  153. {
  154. copy (color, 9, "TERRORIST")
  155. format (strText, 191, "^x03%s", message)
  156. }
  157. }
  158. }
  159.  
  160. else // Player is not admin. Team-color name : Yellow message
  161. {
  162. get_user_team (id, color, 9)
  163.  
  164. format (strName, 191, "%s^x03%s", alive, name)
  165.  
  166. format (strText, 191, "%s", message)
  167. }
  168.  
  169. format (message, 191, "%s^x01 : %s", strName, strText)
  170.  
  171. sendMessage (color, isAlive) // Sends the colored message
  172.  
  173. return PLUGIN_CONTINUE
  174. }
  175.  
  176.  
  177. public hook_teamsay(id)
  178. {
  179. new playerTeam = get_user_team(id)
  180. new playerTeamName[19]
  181.  
  182. switch (playerTeam) // Team names which appear on team-only messages
  183. {
  184. case 1:
  185. copy (playerTeamName, 11, "Terrorists")
  186.  
  187. case 2:
  188. copy (playerTeamName, 18, "Counter-Terrorists")
  189.  
  190. default:
  191. copy (playerTeamName, 9, "Spectator")
  192. }
  193.  
  194. read_args (message, 191)
  195. remove_quotes (message)
  196.  
  197. if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,
  198. // Gungame commands and empty messages
  199. return PLUGIN_CONTINUE
  200.  
  201.  
  202. new name[32]
  203. get_user_name (id, name, 31)
  204.  
  205. new bool:admin = false
  206.  
  207. if (is_user_admin(id))
  208. admin = true
  209.  
  210.  
  211. new isAlive
  212.  
  213. if (is_user_alive (id))
  214. {
  215. isAlive = 1
  216. alive = "^x01"
  217. }
  218. else
  219. {
  220. isAlive = 0
  221. alive = "^x01*DEAD* "
  222. }
  223.  
  224. static color[10]
  225.  
  226.  
  227.  
  228. if (admin)
  229. {
  230. // Name
  231. switch (get_pcvar_num (g_NameColor))
  232. {
  233. case 1:
  234. format (strName, 191, "%s(%s)^x04[ADMIN] %s", alive, playerTeamName, name)
  235.  
  236. case 2:
  237. format (strName, 191, "%s(%s)^x04[ADMIN] ^x04%s", alive, playerTeamName, name)
  238.  
  239. case 3:
  240. {
  241. color = "SPECTATOR"
  242. format (strName, 191, "%s(%s)^x04[ADMIN] ^x03%s", alive, playerTeamName, name)
  243. }
  244.  
  245. case 4:
  246. {
  247. color = "CT"
  248. format (strName, 191, "%s(%s)^x04[ADMIN] ^x03%s", alive, playerTeamName, name)
  249. }
  250.  
  251. case 5:
  252. {
  253. color = "TERRORIST"
  254. format (strName, 191, "%s(%s)^x04[ADMIN] ^x03%s", alive, playerTeamName, name)
  255. }
  256.  
  257. case 6:
  258. {
  259. get_user_team (id, color, 9)
  260.  
  261. format (strName, 191, "%s(%s)^x04[ADMIN] ^x03%s", alive, playerTeamName, name)
  262. }
  263. }
  264.  
  265.  
  266. // Message
  267. switch (get_pcvar_num (g_MessageColor))
  268. {
  269. case 1: // Yellow
  270. format (strText, 191, "%s", message)
  271.  
  272. case 2: // Green
  273. format (strText, 191, "^x04%s", message)
  274.  
  275. case 3: // White
  276. {
  277. copy (color, 9, "SPECTATOR")
  278. format (strText, 191, "^x03%s", message)
  279. }
  280.  
  281. case 4: // Blue
  282. {
  283. copy (color, 9, "CT")
  284. format (strText, 191, "^x03%s", message)
  285. }
  286.  
  287. case 5: // Red
  288. {
  289. copy (color, 9, "TERRORIST")
  290. format (strText, 191, "^x03%s", message)
  291. }
  292. }
  293. }
  294. else // Player is not admin. Team-color name : Yellow message
  295. {
  296. get_user_team (id, color, 9)
  297.  
  298. format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)
  299.  
  300. format (strText, 191, "%s", message)
  301. }
  302.  
  303. format (message, 191, "%s ^x01: %s", strName, strText)
  304.  
  305. sendTeamMessage (color, isAlive, playerTeam) // Sends the colored message
  306.  
  307. return PLUGIN_CONTINUE
  308. }
  309.  
  310.  
  311. public set_color (id, level, cid)
  312. {
  313. if (!cmd_access(id, level, cid, 2))
  314. return PLUGIN_HANDLED
  315.  
  316. new arg[1], newColor
  317. read_argv (1, arg, 1)
  318.  
  319. newColor = str_to_num (arg)
  320.  
  321. if (newColor >= 1 && newColor <= 5)
  322. {
  323. set_cvar_num ("amx_color", newColor)
  324. set_pcvar_num (g_MessageColor, newColor)
  325.  
  326. if (get_pcvar_num (g_NameColor) != 1 &&
  327. ((newColor == 3 && get_pcvar_num (g_NameColor) != 3)
  328. || (newColor == 4 && get_pcvar_num (g_NameColor) != 4)
  329. || (newColor == 5 && get_pcvar_num (g_NameColor) != 5)))
  330. {
  331. set_cvar_num ("amx_namecolor", 2)
  332. set_pcvar_num (g_NameColor, 2)
  333. }
  334. }
  335.  
  336. return PLUGIN_HANDLED
  337. }
  338.  
  339.  
  340. public set_name_color (id, level, cid)
  341. {
  342. if (!cmd_access(id, level, cid, 2))
  343. return PLUGIN_HANDLED
  344.  
  345. new arg[1], newColor
  346. read_argv (1, arg, 1)
  347.  
  348. newColor = str_to_num (arg)
  349.  
  350. if (newColor >= 1 && newColor <= 6)
  351. {
  352. set_cvar_num ("amx_namecolor", newColor)
  353. set_pcvar_num (g_NameColor, newColor)
  354.  
  355. if ((get_pcvar_num (g_MessageColor) != 1
  356. && ((newColor == 3 && get_pcvar_num (g_MessageColor) != 3)
  357. || (newColor == 4 && get_pcvar_num (g_MessageColor) != 4)
  358. || (newColor == 5 && get_pcvar_num (g_MessageColor) != 5)))
  359. || get_pcvar_num (g_NameColor) == 6)
  360. {
  361. set_cvar_num ("amx_color", 2)
  362. set_pcvar_num (g_MessageColor, 2)
  363. }
  364. }
  365.  
  366. return PLUGIN_HANDLED
  367. }
  368.  
  369.  
  370. public set_listen (id, level, cid)
  371. {
  372. if (!cmd_access(id, level, cid, 2))
  373. return PLUGIN_HANDLED
  374.  
  375. new arg[1], newListen
  376. read_argv(1, arg, 1)
  377.  
  378. newListen = str_to_num (arg)
  379.  
  380. set_cvar_num ("amx_listen", newListen)
  381. set_pcvar_num (g_AdminListen, newListen)
  382.  
  383. return PLUGIN_HANDLED
  384. }
  385.  
  386.  
  387. public sendMessage (color[], alive)
  388. {
  389. new teamName[10]
  390.  
  391. for (new player = 1; player < maxPlayers; player++)
  392. {
  393. if (!is_user_connected(player))
  394. continue
  395.  
  396. if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
  397. {
  398. get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message
  399.  
  400. changeTeamInfo (player, color) // Changes user's team according to color choosen
  401.  
  402. writeMessage (player, message) // Writes the message on player's chat
  403.  
  404. changeTeamInfo (player, teamName) // Changes user's team back to original
  405. }
  406. }
  407. }
  408.  
  409.  
  410. public sendTeamMessage (color[], alive, playerTeam)
  411. {
  412. new teamName[10]
  413.  
  414. for (new player = 1; player < maxPlayers; player++)
  415. {
  416. if (!is_user_connected(player))
  417. continue
  418.  
  419. if (get_user_team(player) == playerTeam || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
  420. {
  421. if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)
  422. {
  423. get_user_team (player, teamName, 9) // Stores user's team name to change back after sending the message
  424.  
  425. changeTeamInfo (player, color) // Changes user's team according to color choosen
  426.  
  427. writeMessage (player, message) // Writes the message on player's chat
  428.  
  429. changeTeamInfo (player, teamName) // Changes user's team back to original
  430. }
  431. }
  432. }
  433. }
  434.  
  435.  
  436. public changeTeamInfo (player, team[])
  437. {
  438. message_begin (MSG_ONE, teamInfo, _, player) // Tells to to modify teamInfo (Which is responsable for which time player is)
  439. write_byte (player) // Write byte needed
  440. write_string (team) // Changes player's team
  441. message_end() // Also Needed
  442. }
  443.  
  444.  
  445. public writeMessage (player, message[])
  446. {
  447. message_begin (MSG_ONE, sayText, {0, 0, 0}, player) // Tells to modify sayText (Which is responsable for writing colored messages)
  448. write_byte (player) // Write byte needed
  449. write_string (message) // Effectively write the message, finally, afterall
  450. message_end () // Needed as always
  451. }
  452.  


KÖSZÖNÖM GOMB =>

_________________
Ha elnyerte valamelyik témában a hozzászólásom a tetszésedet melyet olvastál, akkor egy egyszerű gombnyomással kifejezheted, hogy tetszett.


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  [ 3 hozzászólás ] 


Ki van itt

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