hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.27. 11:29



Jelenlévő felhasználók

Jelenleg 529 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 529 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  [ 5 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Chat Rang
HozzászólásElküldve: 2013.05.19. 08:03 
Offline
Senior Tag

Csatlakozott: 2013.03.26. 18:25
Hozzászólások: 232
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 6 alkalommal
Sziasztok lehet nem ebbe a témába tartozik de úgy remélem, hogy ide.
Na szóval van ez a plugin http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=chataddons És most igy irok chatbe: Player: [Administrator]ASD
És én azt szeretném kérni hogy Igy irjak:[Administarator]Player:asd
Tudom hogy van másik plugin erre de én ragaszkodok ehhez mert a többi pluginokba csak egy prefixet lehet irni ebbe meg jó ahogy van :D

_________________
skype:gallzsolt2




Ha segítettem kattints erre:Kép

Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Chat Rang
HozzászólásElküldve: 2013.05.19. 17:30 
Offline
Őstag

Csatlakozott: 2013.01.27. 17:48
Hozzászólások: 1247
Megköszönt másnak: 6 alkalommal
Megköszönték neki: 61 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <cstrike>
  3.  
  4. #define ADMIN_FLAG ADMIN_RCON
  5. #define MODER_FLAG ADMIN_KICK
  6. #define VIP_FLAG ADMIN_RESERVATION
  7.  
  8. #define ADMIN_TAG "[Administrator]"
  9. #define MODER_TAG "[Moderator]"
  10. #define VIP_TAG "[VIP]"
  11.  
  12. #define MAX_LANG_ARGS 5
  13.  
  14. enum
  15. {
  16. PRINT_COLOR_GREY,
  17. PRINT_COLOR_RED,
  18. PRINT_COLOR_BLUE,
  19. PRINT_COLOR_PLAYERTEAM
  20. }
  21.  
  22. static const g_aszTeamNames[][] =
  23. {
  24. "UNASSIGNED",
  25. "TERRORIST",
  26. "CT",
  27. "SPECTATOR"
  28. }
  29.  
  30. new g_maxplayers, admin_see, moder_see
  31.  
  32. public plugin_init()
  33. {
  34. register_plugin("Chat", "0.1", "Chaiker")
  35.  
  36. admin_see = register_cvar("chat_adminsee", "1")
  37. moder_see = register_cvar("chat_modersee", "1")
  38.  
  39. g_maxplayers = get_maxplayers()
  40.  
  41. register_clcmd("say", "cmdsay")
  42. register_clcmd("say_team", "cmdteamsay")
  43. }
  44.  
  45. public cmdsay(id)
  46. {
  47. if(get_user_flags(id) & ADMIN_FLAG)
  48. {
  49. new Arg[128], name[32], Temp = '"', Finded = false
  50. get_user_name(id, name, 31)
  51. read_args(Arg, 127)
  52. for(new i = 127; 0 < i <= 127; i--)
  53. {
  54. if(Finded)
  55. continue
  56. if(Arg[i] == Temp)
  57. {
  58. //server_print("%s - %c", Arg[i], Temp)
  59. Arg[i] = 0
  60. Finded = true
  61. continue
  62. }
  63. //server_print("%d - %s", i, Arg[i])
  64. }
  65. if(is_user_alive(id))
  66. {
  67. for(new i = 1; i <= g_maxplayers; i++)
  68. {
  69. if(!is_user_connected(i))
  70. continue
  71. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  72. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y%s !t%s : %s", ADMIN_TAG, name, Arg[1])
  73. }
  74. } else
  75. {
  76. for(new i = 1; i <= g_maxplayers; i++)
  77. {
  78. if(!is_user_connected(i))
  79. continue
  80. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  81. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !y%s !t%s : %s", ADMIN_TAG, name, Arg[1])
  82. }
  83. }
  84. return PLUGIN_HANDLED
  85. } else if(get_user_flags(id) & MODER_FLAG)
  86. {
  87. new Arg[128], name[32], Temp = '"', Finded = false
  88. get_user_name(id, name, 31)
  89. read_args(Arg, 127)
  90. for(new i = 127; 0 < i <= 127; i--)
  91. {
  92. if(Finded)
  93. continue
  94. if(Arg[i] == Temp)
  95. {
  96. //server_print("%s - %c", Arg[i], Temp)
  97. Arg[i] = 0
  98. Finded = true
  99. continue
  100. }
  101. //server_print("%d - %s", i, Arg[i])
  102. }
  103. if(is_user_alive(id))
  104. {
  105. for(new i = 1; i <= g_maxplayers; i++)
  106. {
  107. if(!is_user_connected(i))
  108. continue
  109. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  110. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y%s !t%s : %s", MODER_TAG, name, Arg[1])
  111. }
  112. } else
  113. {
  114. for(new i = 1; i <= g_maxplayers; i++)
  115. {
  116. if(!is_user_connected(i))
  117. continue
  118. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  119. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !y%s !t%s : %s", MODER_TAG, name, Arg[1])
  120. }
  121. }
  122. return PLUGIN_HANDLED
  123. } else if(get_user_flags(id) & VIP_FLAG)
  124. {
  125. new Arg[128], name[32], Temp = '"', Finded = false
  126. get_user_name(id, name, 31)
  127. read_args(Arg, 127)
  128. for(new i = 127; 0 < i <= 127; i--)
  129. {
  130. if(Finded)
  131. continue
  132. if(Arg[i] == Temp)
  133. {
  134. //server_print("%s - %c", Arg[i], Temp)
  135. Arg[i] = 0
  136. Finded = true
  137. continue
  138. }
  139. //server_print("%d - %s", i, Arg[i])
  140. }
  141. if(is_user_alive(id))
  142. {
  143. for(new i = 1; i <= g_maxplayers; i++)
  144. {
  145. if(!is_user_connected(i))
  146. continue
  147. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  148. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y%s !t%s : %s", VIP_TAG, name, Arg[1])
  149. }
  150. } else
  151. {
  152. for(new i = 1; i <= g_maxplayers; i++)
  153. {
  154. if(!is_user_connected(i))
  155. continue
  156. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  157. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !y%s !t%s : %s", VIP_TAG, name, Arg[1])
  158. }
  159. }
  160. return PLUGIN_HANDLED
  161. } else
  162. {
  163. new Arg[128], name[32], Temp = '"', Finded = false
  164. get_user_name(id, name, 31)
  165. read_args(Arg, 127)
  166. for(new i = 127; 0 < i <= 127; i--)
  167. {
  168. if(Finded)
  169. continue
  170. if(Arg[i] == Temp)
  171. {
  172. //server_print("%s - %c", Arg[i], Temp)
  173. Arg[i] = 0
  174. Finded = true
  175. continue
  176. }
  177. //server_print("%d - %s", i, Arg[i])
  178. }
  179. if(is_user_alive(id))
  180. {
  181. for(new i = 1; i <= g_maxplayers; i++)
  182. {
  183. if(!is_user_connected(i))
  184. continue
  185. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  186. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  187. else if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  188. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  189. else if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  190. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  191. }
  192. } else
  193. {
  194. for(new i = 1; i <= g_maxplayers; i++)
  195. {
  196. if(!is_user_connected(i))
  197. continue
  198. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  199. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !t%s !y: %s", name, Arg[1])
  200. else if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  201. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !t%s !y: %s", name, Arg[1])
  202. else if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  203. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  204. }
  205. }
  206. }
  207. return PLUGIN_HANDLED
  208. }
  209.  
  210. public cmdteamsay(id)
  211. {
  212. if(get_user_flags(id) & ADMIN_FLAG)
  213. {
  214. new Arg[128], name[32], Temp = '"', Finded = false
  215. get_user_name(id, name, 31)
  216. read_args(Arg, 127)
  217. for(new i = 127; 0 < i <= 127; i--)
  218. {
  219. if(Finded)
  220. continue
  221. if(Arg[i] == Temp)
  222. {
  223. //server_print("%s - %c", Arg[i], Temp)
  224. Arg[i] = 0
  225. Finded = true
  226. continue
  227. }
  228. //server_print("%d - %s", i, Arg[i])
  229. }
  230. if(cs_get_user_team(id) == CS_TEAM_CT)
  231. {
  232. if(is_user_alive(id))
  233. {
  234. for(new i = 1; i <= g_maxplayers; i++)
  235. {
  236. if(!is_user_connected(i))
  237. continue
  238. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  239. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  240. }
  241. } else
  242. {
  243. for(new i = 1; i <= g_maxplayers; i++)
  244. {
  245. if(!is_user_connected(i))
  246. continue
  247. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  248. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  249. }
  250. }
  251. }
  252. if(cs_get_user_team(id) == CS_TEAM_T)
  253. {
  254. if(is_user_alive(id))
  255. {
  256. for(new i = 1; i <= g_maxplayers; i++)
  257. {
  258. if(!is_user_connected(i))
  259. continue
  260. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  261. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  262. }
  263. } else
  264. {
  265. for(new i = 1; i <= g_maxplayers; i++)
  266. {
  267. if(!is_user_connected(i))
  268. continue
  269. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  270. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  271. }
  272. }
  273. }
  274. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  275. {
  276. for(new i = 1; i <= g_maxplayers; i++)
  277. if(is_user_connected(i))
  278. if(cs_get_user_team(i) == CS_TEAM_SPECTATOR || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  279. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  280. }
  281. return PLUGIN_HANDLED
  282. } else if(get_user_flags(id) & MODER_FLAG)
  283. {
  284. new Arg[128], name[32], Temp = '"', Finded = false
  285. get_user_name(id, name, 31)
  286. read_args(Arg, 127)
  287. for(new i = 127; 0 < i <= 127; i--)
  288. {
  289. if(Finded)
  290. continue
  291. if(Arg[i] == Temp)
  292. {
  293. //server_print("%s - %c", Arg[i], Temp)
  294. Arg[i] = 0
  295. Finded = true
  296. continue
  297. }
  298. //server_print("%d - %s", i, Arg[i])
  299. }
  300. if(cs_get_user_team(id) == CS_TEAM_CT)
  301. {
  302. if(is_user_alive(id))
  303. {
  304. for(new i = 1; i <= g_maxplayers; i++)
  305. {
  306. if(!is_user_connected(i))
  307. continue
  308. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  309. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  310. }
  311. } else
  312. {
  313. for(new i = 1; i <= g_maxplayers; i++)
  314. {
  315. if(!is_user_connected(i))
  316. continue
  317. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  318. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  319. }
  320. }
  321. }
  322. if(cs_get_user_team(id) == CS_TEAM_T)
  323. {
  324. if(is_user_alive(id))
  325. {
  326. for(new i = 1; i <= g_maxplayers; i++)
  327. {
  328. if(!is_user_connected(i))
  329. continue
  330. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  331. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  332. }
  333. } else
  334. {
  335. for(new i = 1; i <= g_maxplayers; i++)
  336. {
  337. if(!is_user_connected(i))
  338. continue
  339. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  340. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  341. }
  342. }
  343. }
  344. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  345. {
  346. for(new i = 1; i <= g_maxplayers; i++)
  347. if(is_user_connected(i))
  348. if(cs_get_user_team(i) == CS_TEAM_SPECTATOR || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  349. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  350. }
  351. return PLUGIN_HANDLED
  352. } else if(get_user_flags(id) & VIP_FLAG)
  353. {
  354. new Arg[128], name[32], Temp = '"', Finded = false
  355. get_user_name(id, name, 31)
  356. read_args(Arg, 127)
  357. for(new i = 127; 0 < i <= 127; i--)
  358. {
  359. if(Finded)
  360. continue
  361. if(Arg[i] == Temp)
  362. {
  363. //server_print("%s - %c", Arg[i], Temp)
  364. Arg[i] = 0
  365. Finded = true
  366. continue
  367. }
  368. //server_print("%d - %s", i, Arg[i])
  369. }
  370. if(cs_get_user_team(id) == CS_TEAM_CT)
  371. {
  372. if(is_user_alive(id))
  373. {
  374. for(new i = 1; i <= g_maxplayers; i++)
  375. {
  376. if(!is_user_connected(i))
  377. continue
  378. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  379. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  380. }
  381. } else
  382. {
  383. for(new i = 1; i <= g_maxplayers; i++)
  384. {
  385. if(!is_user_connected(i))
  386. continue
  387. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  388. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  389. }
  390. }
  391. }
  392. if(cs_get_user_team(id) == CS_TEAM_T)
  393. {
  394. if(is_user_alive(id))
  395. {
  396. for(new i = 1; i <= g_maxplayers; i++)
  397. {
  398. if(!is_user_connected(i))
  399. continue
  400. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  401. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  402. }
  403. } else
  404. {
  405. for(new i = 1; i <= g_maxplayers; i++)
  406. {
  407. if(!is_user_connected(i))
  408. continue
  409. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  410. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  411. }
  412. }
  413. }
  414. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  415. {
  416. for(new i = 1; i <= g_maxplayers; i++)
  417. if(is_user_connected(i))
  418. if(cs_get_user_team(i) == CS_TEAM_SPECTATOR || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  419. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  420. }
  421. return PLUGIN_HANDLED
  422. } else
  423. {
  424. new Arg[128], name[32], Temp = '"', Finded = false
  425. get_user_name(id, name, 31)
  426. read_args(Arg, 127)
  427. for(new i = 127; 0 < i <= 127; i--)
  428. {
  429. if(Finded)
  430. continue
  431. if(Arg[i] == Temp)
  432. {
  433. //server_print("%s - %c", Arg[i], Temp)
  434. Arg[i] = 0
  435. Finded = true
  436. continue
  437. }
  438. //server_print("%d - %s", i, Arg[i])
  439. }
  440. if(is_user_alive(id))
  441. {
  442. for(new i = 1; i <= g_maxplayers; i++)
  443. {
  444. if(!is_user_connected(i))
  445. continue
  446. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T && cs_get_user_team(id) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  447. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y: %s", name, Arg[1])
  448. else if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT && cs_get_user_team(id) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  449. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y: %s", name, Arg[1])
  450. else if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR && cs_get_user_team(id) == CS_TEAM_SPECTATOR) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  451. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y: %s", name, Arg[1])
  452. }
  453. } else
  454. {
  455. for(new i = 1; i <= g_maxplayers; i++)
  456. {
  457. if(!is_user_connected(i))
  458. continue
  459. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T && cs_get_user_team(id) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  460. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y: %s", name, Arg[1])
  461. else if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT && cs_get_user_team(id) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  462. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y: %s", name, Arg[1])
  463. else if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR && cs_get_user_team(id) == CS_TEAM_SPECTATOR) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  464. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y: %s", name, Arg[1])
  465. }
  466. }
  467. }
  468. return PLUGIN_HANDLED
  469. }
  470.  
  471. stock PrintChatColor(pReceiver, iColor = PRINT_COLOR_PLAYERTEAM, const szMessage[], any:...)
  472. {
  473. new szBuffer[256]
  474. new iArgs = numargs()
  475.  
  476. if(pReceiver)
  477. {
  478. for(new iArg = 3; iArg < iArgs; iArg++)
  479. {
  480. if(getarg(iArg) != LANG_PLAYER)
  481. continue
  482.  
  483. setarg(iArg, _, pReceiver)
  484. }
  485.  
  486. vformat(szBuffer, 255, szMessage, 4)
  487.  
  488. while (replace(szBuffer, 255, "!y", "^1")) {}
  489. while (replace(szBuffer, 255, "!t", "^3")) {}
  490. while (replace(szBuffer, 255, "!g", "^4")) {}
  491.  
  492. if (iColor >= PRINT_COLOR_PLAYERTEAM)
  493. UTIL_SayText(MSG_ONE, _, pReceiver, (iColor > PRINT_COLOR_PLAYERTEAM) ? iColor - PRINT_COLOR_PLAYERTEAM : pReceiver, szBuffer)
  494. else
  495. {
  496. new iTeam = _:cs_get_user_team(pReceiver)
  497.  
  498. if(iTeam % 3 == iColor)
  499. UTIL_SayText(MSG_ONE, _, pReceiver, pReceiver, szBuffer)
  500. else
  501. {
  502. UTIL_TeamInfo(MSG_ONE, _, pReceiver, pReceiver, g_aszTeamNames[iColor])
  503. UTIL_SayText(MSG_ONE, _, pReceiver, pReceiver, szBuffer)
  504. UTIL_TeamInfo(MSG_ONE, _, pReceiver, pReceiver, g_aszTeamNames[iTeam])
  505. }
  506. }
  507. }
  508. else
  509. {
  510. new aiChangeArgs[MAX_LANG_ARGS]
  511. new iChangeArgs, iArg
  512.  
  513. for(iArg = 3; iArg < iArgs; iArg++)
  514. {
  515. if(getarg(iArg) != LANG_PLAYER)
  516. continue
  517.  
  518. aiChangeArgs[iChangeArgs++] = iArg
  519.  
  520. if (iChangeArgs == MAX_LANG_ARGS)
  521. break
  522. }
  523.  
  524. new apPlayers[32]
  525. new iPlayers
  526. new pPlayer
  527.  
  528. get_players(apPlayers, iPlayers)
  529.  
  530. for(new i = 0; i < iPlayers; i++)
  531. {
  532. pPlayer = apPlayers[i]
  533.  
  534. for(iArg = 0; iArg < iChangeArgs; iArg++)
  535. setarg(aiChangeArgs[iArg], _, pPlayer)
  536.  
  537. vformat(szBuffer, 255, szMessage, 4)
  538.  
  539. while (replace(szBuffer, 255, "!y", "^1")) {}
  540. while (replace(szBuffer, 255, "!t", "^3")) {}
  541. while (replace(szBuffer, 255, "!g", "^4")) {}
  542.  
  543. if(iColor >= PRINT_COLOR_PLAYERTEAM)
  544. UTIL_SayText(MSG_ONE, _, pPlayer, (iColor > PRINT_COLOR_PLAYERTEAM) ? iColor - PRINT_COLOR_PLAYERTEAM : pPlayer, szBuffer)
  545. else
  546. {
  547. new iTeam = _:cs_get_user_team(pPlayer);
  548.  
  549. if(iTeam % 3 == iColor)
  550. UTIL_SayText(MSG_ONE, _, pPlayer, pPlayer, szBuffer)
  551. else
  552. {
  553. UTIL_TeamInfo(MSG_ONE, _, pPlayer, pPlayer, g_aszTeamNames[iColor])
  554. UTIL_SayText(MSG_ONE, _, pPlayer, pPlayer, szBuffer)
  555. UTIL_TeamInfo(MSG_ONE, _, pPlayer, pPlayer, g_aszTeamNames[iTeam])
  556. }
  557. }
  558. }
  559. }
  560. }
  561.  
  562. stock UTIL_SayText(iDest, const vecOrigin[3] = {0, 0, 0}, pEntity, pSender, const szMessage[], const szArg1[] = "", const szArg2[] = "")
  563. {
  564. static msgSayText
  565.  
  566. if(!msgSayText)
  567. msgSayText = get_user_msgid("SayText")
  568.  
  569. message_begin(iDest, msgSayText, vecOrigin, pEntity)
  570. write_byte(pSender)
  571. write_string(szMessage)
  572. if(szArg1[0])
  573. {
  574. write_string(szArg1)
  575.  
  576. if(szArg2[0])
  577. write_string(szArg2)
  578. }
  579. message_end()
  580. }
  581.  
  582. stock UTIL_TeamInfo(iDest, const vecOrigin[3] = { 0, 0, 0 }, pEntity, pPlayer, const szTeamName[])
  583. {
  584. static msgTeamInfo
  585.  
  586. if(!msgTeamInfo)
  587. msgTeamInfo = get_user_msgid("TeamInfo")
  588.  
  589. message_begin(iDest, msgTeamInfo, vecOrigin, pEntity)
  590. write_byte(pPlayer)
  591. write_string(szTeamName)
  592. message_end()
  593. }

_________________
banned user

Ők köszönték meg JoGoBeLLa nek ezt a hozzászólást: Zsoltiaz_HUN (2013.05.19. 20:49)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Chat Rang
HozzászólásElküldve: 2013.05.19. 22:31 
Offline
Senior Tag

Csatlakozott: 2013.03.26. 18:25
Hozzászólások: 232
Megköszönt másnak: 40 alkalommal
Megköszönték neki: 6 alkalommal
Jó csak a prefixet nem zöldel irja valaki kijavitja?

_________________
skype:gallzsolt2




Ha segítettem kattints erre:Kép

Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Chat Rang
HozzászólásElküldve: 2013.05.22. 15:46 
Offline
Jómunkásember
Avatar

Csatlakozott: 2012.08.24. 19:42
Hozzászólások: 320
Megköszönt másnak: 11 alkalommal
Megköszönték neki: 30 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. !y -> !g


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Chat Rang
HozzászólásElküldve: 2013.05.22. 18:43 
Offline
SM Fejlesztő
Avatar

Csatlakozott: 2012.10.18. 15:58
Hozzászólások: 2486
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 132 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <cstrike>
  3.  
  4. #define ADMIN_FLAG ADMIN_RCON
  5. #define MODER_FLAG ADMIN_KICK
  6. #define VIP_FLAG ADMIN_RESERVATION
  7.  
  8. #define ADMIN_TAG "[Administrator]"
  9. #define MODER_TAG "[Moderator]"
  10. #define VIP_TAG "[VIP]"
  11.  
  12. #define MAX_LANG_ARGS 5
  13.  
  14. enum
  15. {
  16. PRINT_COLOR_GREY,
  17. PRINT_COLOR_RED,
  18. PRINT_COLOR_BLUE,
  19. PRINT_COLOR_PLAYERTEAM
  20. }
  21.  
  22. static const g_aszTeamNames[][] =
  23. {
  24. "UNASSIGNED",
  25. "TERRORIST",
  26. "CT",
  27. "SPECTATOR"
  28. }
  29.  
  30. new g_maxplayers, admin_see, moder_see
  31.  
  32. public plugin_init()
  33. {
  34. register_plugin("Chat", "0.1", "Chaiker")
  35.  
  36. admin_see = register_cvar("chat_adminsee", "1")
  37. moder_see = register_cvar("chat_modersee", "1")
  38.  
  39. g_maxplayers = get_maxplayers()
  40.  
  41. register_clcmd("say", "cmdsay")
  42. register_clcmd("say_team", "cmdteamsay")
  43. }
  44.  
  45. public cmdsay(id)
  46. {
  47. if(get_user_flags(id) & ADMIN_FLAG)
  48. {
  49. new Arg[128], name[32], Temp = '"', Finded = false
  50. get_user_name(id, name, 31)
  51. read_args(Arg, 127)
  52. for(new i = 127; 0 < i <= 127; i--)
  53. {
  54. if(Finded)
  55. continue
  56. if(Arg[i] == Temp)
  57. {
  58. //server_print("%s - %c", Arg[i], Temp)
  59. Arg[i] = 0
  60. Finded = true
  61. continue
  62. }
  63. //server_print("%d - %s", i, Arg[i])
  64. }
  65. if(is_user_alive(id))
  66. {
  67. for(new i = 1; i <= g_maxplayers; i++)
  68. {
  69. if(!is_user_connected(i))
  70. continue
  71. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  72. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!g%s !t%s : %s", ADMIN_TAG, name, Arg[1])
  73. }
  74. } else
  75. {
  76. for(new i = 1; i <= g_maxplayers; i++)
  77. {
  78. if(!is_user_connected(i))
  79. continue
  80. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  81. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !g%s !t%s : %s", ADMIN_TAG, name, Arg[1])
  82. }
  83. }
  84. return PLUGIN_HANDLED
  85. } else if(get_user_flags(id) & MODER_FLAG)
  86. {
  87. new Arg[128], name[32], Temp = '"', Finded = false
  88. get_user_name(id, name, 31)
  89. read_args(Arg, 127)
  90. for(new i = 127; 0 < i <= 127; i--)
  91. {
  92. if(Finded)
  93. continue
  94. if(Arg[i] == Temp)
  95. {
  96. //server_print("%s - %c", Arg[i], Temp)
  97. Arg[i] = 0
  98. Finded = true
  99. continue
  100. }
  101. //server_print("%d - %s", i, Arg[i])
  102. }
  103. if(is_user_alive(id))
  104. {
  105. for(new i = 1; i <= g_maxplayers; i++)
  106. {
  107. if(!is_user_connected(i))
  108. continue
  109. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  110. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!g%s !t%s : %s", MODER_TAG, name, Arg[1])
  111. }
  112. } else
  113. {
  114. for(new i = 1; i <= g_maxplayers; i++)
  115. {
  116. if(!is_user_connected(i))
  117. continue
  118. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  119. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !g%s !t%s : %s", MODER_TAG, name, Arg[1])
  120. }
  121. }
  122. return PLUGIN_HANDLED
  123. } else if(get_user_flags(id) & VIP_FLAG)
  124. {
  125. new Arg[128], name[32], Temp = '"', Finded = false
  126. get_user_name(id, name, 31)
  127. read_args(Arg, 127)
  128. for(new i = 127; 0 < i <= 127; i--)
  129. {
  130. if(Finded)
  131. continue
  132. if(Arg[i] == Temp)
  133. {
  134. //server_print("%s - %c", Arg[i], Temp)
  135. Arg[i] = 0
  136. Finded = true
  137. continue
  138. }
  139. //server_print("%d - %s", i, Arg[i])
  140. }
  141. if(is_user_alive(id))
  142. {
  143. for(new i = 1; i <= g_maxplayers; i++)
  144. {
  145. if(!is_user_connected(i))
  146. continue
  147. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  148. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!g%s !t%s : %s", VIP_TAG, name, Arg[1])
  149. }
  150. } else
  151. {
  152. for(new i = 1; i <= g_maxplayers; i++)
  153. {
  154. if(!is_user_connected(i))
  155. continue
  156. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  157. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !g%s !t%s : %s", VIP_TAG, name, Arg[1])
  158. }
  159. }
  160. return PLUGIN_HANDLED
  161. } else
  162. {
  163. new Arg[128], name[32], Temp = '"', Finded = false
  164. get_user_name(id, name, 31)
  165. read_args(Arg, 127)
  166. for(new i = 127; 0 < i <= 127; i--)
  167. {
  168. if(Finded)
  169. continue
  170. if(Arg[i] == Temp)
  171. {
  172. //server_print("%s - %c", Arg[i], Temp)
  173. Arg[i] = 0
  174. Finded = true
  175. continue
  176. }
  177. //server_print("%d - %s", i, Arg[i])
  178. }
  179. if(is_user_alive(id))
  180. {
  181. for(new i = 1; i <= g_maxplayers; i++)
  182. {
  183. if(!is_user_connected(i))
  184. continue
  185. if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  186. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  187. else if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  188. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  189. else if(is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  190. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  191. }
  192. } else
  193. {
  194. for(new i = 1; i <= g_maxplayers; i++)
  195. {
  196. if(!is_user_connected(i))
  197. continue
  198. if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  199. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !t%s !y: %s", name, Arg[1])
  200. else if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  201. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* !t%s !y: %s", name, Arg[1])
  202. else if(!is_user_alive(i) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  203. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!t%s !y: %s", name, Arg[1])
  204. }
  205. }
  206. }
  207. return PLUGIN_HANDLED
  208. }
  209.  
  210. public cmdteamsay(id)
  211. {
  212. if(get_user_flags(id) & ADMIN_FLAG)
  213. {
  214. new Arg[128], name[32], Temp = '"', Finded = false
  215. get_user_name(id, name, 31)
  216. read_args(Arg, 127)
  217. for(new i = 127; 0 < i <= 127; i--)
  218. {
  219. if(Finded)
  220. continue
  221. if(Arg[i] == Temp)
  222. {
  223. //server_print("%s - %c", Arg[i], Temp)
  224. Arg[i] = 0
  225. Finded = true
  226. continue
  227. }
  228. //server_print("%d - %s", i, Arg[i])
  229. }
  230. if(cs_get_user_team(id) == CS_TEAM_CT)
  231. {
  232. if(is_user_alive(id))
  233. {
  234. for(new i = 1; i <= g_maxplayers; i++)
  235. {
  236. if(!is_user_connected(i))
  237. continue
  238. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  239. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  240. }
  241. } else
  242. {
  243. for(new i = 1; i <= g_maxplayers; i++)
  244. {
  245. if(!is_user_connected(i))
  246. continue
  247. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  248. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  249. }
  250. }
  251. }
  252. if(cs_get_user_team(id) == CS_TEAM_T)
  253. {
  254. if(is_user_alive(id))
  255. {
  256. for(new i = 1; i <= g_maxplayers; i++)
  257. {
  258. if(!is_user_connected(i))
  259. continue
  260. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  261. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  262. }
  263. } else
  264. {
  265. for(new i = 1; i <= g_maxplayers; i++)
  266. {
  267. if(!is_user_connected(i))
  268. continue
  269. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  270. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  271. }
  272. }
  273. }
  274. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  275. {
  276. for(new i = 1; i <= g_maxplayers; i++)
  277. if(is_user_connected(i))
  278. if(cs_get_user_team(i) == CS_TEAM_SPECTATOR || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  279. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y%s : %s", name, ADMIN_TAG, Arg[1])
  280. }
  281. return PLUGIN_HANDLED
  282. } else if(get_user_flags(id) & MODER_FLAG)
  283. {
  284. new Arg[128], name[32], Temp = '"', Finded = false
  285. get_user_name(id, name, 31)
  286. read_args(Arg, 127)
  287. for(new i = 127; 0 < i <= 127; i--)
  288. {
  289. if(Finded)
  290. continue
  291. if(Arg[i] == Temp)
  292. {
  293. //server_print("%s - %c", Arg[i], Temp)
  294. Arg[i] = 0
  295. Finded = true
  296. continue
  297. }
  298. //server_print("%d - %s", i, Arg[i])
  299. }
  300. if(cs_get_user_team(id) == CS_TEAM_CT)
  301. {
  302. if(is_user_alive(id))
  303. {
  304. for(new i = 1; i <= g_maxplayers; i++)
  305. {
  306. if(!is_user_connected(i))
  307. continue
  308. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  309. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  310. }
  311. } else
  312. {
  313. for(new i = 1; i <= g_maxplayers; i++)
  314. {
  315. if(!is_user_connected(i))
  316. continue
  317. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  318. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  319. }
  320. }
  321. }
  322. if(cs_get_user_team(id) == CS_TEAM_T)
  323. {
  324. if(is_user_alive(id))
  325. {
  326. for(new i = 1; i <= g_maxplayers; i++)
  327. {
  328. if(!is_user_connected(i))
  329. continue
  330. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  331. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  332. }
  333. } else
  334. {
  335. for(new i = 1; i <= g_maxplayers; i++)
  336. {
  337. if(!is_user_connected(i))
  338. continue
  339. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  340. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  341. }
  342. }
  343. }
  344. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  345. {
  346. for(new i = 1; i <= g_maxplayers; i++)
  347. if(is_user_connected(i))
  348. if(cs_get_user_team(i) == CS_TEAM_SPECTATOR || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  349. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y%s : %s", name, MODER_TAG, Arg[1])
  350. }
  351. return PLUGIN_HANDLED
  352. } else if(get_user_flags(id) & VIP_FLAG)
  353. {
  354. new Arg[128], name[32], Temp = '"', Finded = false
  355. get_user_name(id, name, 31)
  356. read_args(Arg, 127)
  357. for(new i = 127; 0 < i <= 127; i--)
  358. {
  359. if(Finded)
  360. continue
  361. if(Arg[i] == Temp)
  362. {
  363. //server_print("%s - %c", Arg[i], Temp)
  364. Arg[i] = 0
  365. Finded = true
  366. continue
  367. }
  368. //server_print("%d - %s", i, Arg[i])
  369. }
  370. if(cs_get_user_team(id) == CS_TEAM_CT)
  371. {
  372. if(is_user_alive(id))
  373. {
  374. for(new i = 1; i <= g_maxplayers; i++)
  375. {
  376. if(!is_user_connected(i))
  377. continue
  378. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  379. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  380. }
  381. } else
  382. {
  383. for(new i = 1; i <= g_maxplayers; i++)
  384. {
  385. if(!is_user_connected(i))
  386. continue
  387. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  388. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  389. }
  390. }
  391. }
  392. if(cs_get_user_team(id) == CS_TEAM_T)
  393. {
  394. if(is_user_alive(id))
  395. {
  396. for(new i = 1; i <= g_maxplayers; i++)
  397. {
  398. if(!is_user_connected(i))
  399. continue
  400. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  401. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  402. }
  403. } else
  404. {
  405. for(new i = 1; i <= g_maxplayers; i++)
  406. {
  407. if(!is_user_connected(i))
  408. continue
  409. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  410. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  411. }
  412. }
  413. }
  414. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  415. {
  416. for(new i = 1; i <= g_maxplayers; i++)
  417. if(is_user_connected(i))
  418. if(cs_get_user_team(i) == CS_TEAM_SPECTATOR || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  419. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y%s : %s", name, VIP_TAG, Arg[1])
  420. }
  421. return PLUGIN_HANDLED
  422. } else
  423. {
  424. new Arg[128], name[32], Temp = '"', Finded = false
  425. get_user_name(id, name, 31)
  426. read_args(Arg, 127)
  427. for(new i = 127; 0 < i <= 127; i--)
  428. {
  429. if(Finded)
  430. continue
  431. if(Arg[i] == Temp)
  432. {
  433. //server_print("%s - %c", Arg[i], Temp)
  434. Arg[i] = 0
  435. Finded = true
  436. continue
  437. }
  438. //server_print("%d - %s", i, Arg[i])
  439. }
  440. if(is_user_alive(id))
  441. {
  442. for(new i = 1; i <= g_maxplayers; i++)
  443. {
  444. if(!is_user_connected(i))
  445. continue
  446. if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T && cs_get_user_team(id) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  447. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Terrorist) !t%s !y: %s", name, Arg[1])
  448. else if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT && cs_get_user_team(id) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  449. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Counter-Terrorist) !t%s !y: %s", name, Arg[1])
  450. else if((is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR && cs_get_user_team(id) == CS_TEAM_SPECTATOR) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  451. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y: %s", name, Arg[1])
  452. }
  453. } else
  454. {
  455. for(new i = 1; i <= g_maxplayers; i++)
  456. {
  457. if(!is_user_connected(i))
  458. continue
  459. if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T && cs_get_user_team(id) == CS_TEAM_T) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  460. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Terrorist) !t%s !y: %s", name, Arg[1])
  461. else if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT && cs_get_user_team(id) == CS_TEAM_CT) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  462. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y*DEAD* (Counter-Terrorist) !t%s !y: %s", name, Arg[1])
  463. else if((!is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR && cs_get_user_team(id) == CS_TEAM_SPECTATOR) || (get_pcvar_num(moder_see) && get_user_flags(i) & MODER_FLAG) || (get_pcvar_num(admin_see) && get_user_flags(i) & ADMIN_FLAG))
  464. PrintChatColor(i, PRINT_COLOR_PLAYERTEAM + id, "!y(Spectator) !t%s !y: %s", name, Arg[1])
  465. }
  466. }
  467. }
  468. return PLUGIN_HANDLED
  469. }
  470.  
  471. stock PrintChatColor(pReceiver, iColor = PRINT_COLOR_PLAYERTEAM, const szMessage[], any:...)
  472. {
  473. new szBuffer[256]
  474. new iArgs = numargs()
  475.  
  476. if(pReceiver)
  477. {
  478. for(new iArg = 3; iArg < iArgs; iArg++)
  479. {
  480. if(getarg(iArg) != LANG_PLAYER)
  481. continue
  482.  
  483. setarg(iArg, _, pReceiver)
  484. }
  485.  
  486. vformat(szBuffer, 255, szMessage, 4)
  487.  
  488. while (replace(szBuffer, 255, "!y", "^1")) {}
  489. while (replace(szBuffer, 255, "!t", "^3")) {}
  490. while (replace(szBuffer, 255, "!g", "^4")) {}
  491.  
  492. if (iColor >= PRINT_COLOR_PLAYERTEAM)
  493. UTIL_SayText(MSG_ONE, _, pReceiver, (iColor > PRINT_COLOR_PLAYERTEAM) ? iColor - PRINT_COLOR_PLAYERTEAM : pReceiver, szBuffer)
  494. else
  495. {
  496. new iTeam = _:cs_get_user_team(pReceiver)
  497.  
  498. if(iTeam % 3 == iColor)
  499. UTIL_SayText(MSG_ONE, _, pReceiver, pReceiver, szBuffer)
  500. else
  501. {
  502. UTIL_TeamInfo(MSG_ONE, _, pReceiver, pReceiver, g_aszTeamNames[iColor])
  503. UTIL_SayText(MSG_ONE, _, pReceiver, pReceiver, szBuffer)
  504. UTIL_TeamInfo(MSG_ONE, _, pReceiver, pReceiver, g_aszTeamNames[iTeam])
  505. }
  506. }
  507. }
  508. else
  509. {
  510. new aiChangeArgs[MAX_LANG_ARGS]
  511. new iChangeArgs, iArg
  512.  
  513. for(iArg = 3; iArg < iArgs; iArg++)
  514. {
  515. if(getarg(iArg) != LANG_PLAYER)
  516. continue
  517.  
  518. aiChangeArgs[iChangeArgs++] = iArg
  519.  
  520. if (iChangeArgs == MAX_LANG_ARGS)
  521. break
  522. }
  523.  
  524. new apPlayers[32]
  525. new iPlayers
  526. new pPlayer
  527.  
  528. get_players(apPlayers, iPlayers)
  529.  
  530. for(new i = 0; i < iPlayers; i++)
  531. {
  532. pPlayer = apPlayers[i]
  533.  
  534. for(iArg = 0; iArg < iChangeArgs; iArg++)
  535. setarg(aiChangeArgs[iArg], _, pPlayer)
  536.  
  537. vformat(szBuffer, 255, szMessage, 4)
  538.  
  539. while (replace(szBuffer, 255, "!y", "^1")) {}
  540. while (replace(szBuffer, 255, "!t", "^3")) {}
  541. while (replace(szBuffer, 255, "!g", "^4")) {}
  542.  
  543. if(iColor >= PRINT_COLOR_PLAYERTEAM)
  544. UTIL_SayText(MSG_ONE, _, pPlayer, (iColor > PRINT_COLOR_PLAYERTEAM) ? iColor - PRINT_COLOR_PLAYERTEAM : pPlayer, szBuffer)
  545. else
  546. {
  547. new iTeam = _:cs_get_user_team(pPlayer);
  548.  
  549. if(iTeam % 3 == iColor)
  550. UTIL_SayText(MSG_ONE, _, pPlayer, pPlayer, szBuffer)
  551. else
  552. {
  553. UTIL_TeamInfo(MSG_ONE, _, pPlayer, pPlayer, g_aszTeamNames[iColor])
  554. UTIL_SayText(MSG_ONE, _, pPlayer, pPlayer, szBuffer)
  555. UTIL_TeamInfo(MSG_ONE, _, pPlayer, pPlayer, g_aszTeamNames[iTeam])
  556. }
  557. }
  558. }
  559. }
  560. }
  561.  
  562. stock UTIL_SayText(iDest, const vecOrigin[3] = {0, 0, 0}, pEntity, pSender, const szMessage[], const szArg1[] = "", const szArg2[] = "")
  563. {
  564. static msgSayText
  565.  
  566. if(!msgSayText)
  567. msgSayText = get_user_msgid("SayText")
  568.  
  569. message_begin(iDest, msgSayText, vecOrigin, pEntity)
  570. write_byte(pSender)
  571. write_string(szMessage)
  572. if(szArg1[0])
  573. {
  574. write_string(szArg1)
  575.  
  576. if(szArg2[0])
  577. write_string(szArg2)
  578. }
  579. message_end()
  580. }
  581.  
  582. stock UTIL_TeamInfo(iDest, const vecOrigin[3] = { 0, 0, 0 }, pEntity, pPlayer, const szTeamName[])
  583. {
  584. static msgTeamInfo
  585.  
  586. if(!msgTeamInfo)
  587. msgTeamInfo = get_user_msgid("TeamInfo")
  588.  
  589. message_begin(iDest, msgTeamInfo, vecOrigin, pEntity)
  590. write_byte(pPlayer)
  591. write_string(szTeamName)
  592. message_end()
  593. }

_________________
www.akosvagyok.hu


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


Ki van itt

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