hlmod.hu

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



Jelenlévő felhasználók

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

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]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  [2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Time reaming!
HozzászólásElküldve:2013.12.11. 18:03 
Offline
Tag
Avatar

Csatlakozott:2013.11.26. 20:08
Hozzászólások:49
Megköszönt másnak: 5 alkalommal
Helló!Hogyan tudom kivenni azt ,hogy ne floodolja a chatben,hogy

Team raming: és,hogy mennyi idő mulva vált?

_________________
[kozep][mozgo]Ha az életben elérhető sikert A-nak vesszük, akkor A=X+Y+Z. X a munka, Y a játék, Z pedig, hogy befogod a szád.[/mozgo][/kozep]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Time reaming!
HozzászólásElküldve:2013.12.11. 22:20 
Offline
Jómunkásember
Avatar

Csatlakozott:2013.10.27. 23:13
Hozzászólások:412
Megköszönt másnak: 21 alkalommal
Megköszönték neki: 68 alkalommal
a idő map váltásig ahhoz timeleft.amxx kell , az meg 100% hogy alapból van szerveren.
De mégse:
SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * TimeLeft Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. * originally developed by OLO
  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. new g_TimeSet[32][2]
  38. new g_LastTime
  39. new g_CountDown
  40. new g_Switch
  41.  
  42. new HandleCvarTimeVoice
  43. new HandleCvarTimeLeft
  44. new HandleCvarTimeLimit
  45.  
  46. public plugin_init()
  47. {
  48. register_plugin("TimeLeft", AMXX_VERSION_STR, "AMXX Dev Team")
  49. register_dictionary("timeleft.txt")
  50.  
  51. HandleCvarTimeVoice = register_cvar( "amx_time_voice", "1" )
  52. HandleCvarTimeLeft = register_cvar( "amx_timeleft", "00:00", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY )
  53.  
  54. HandleCvarTimeLimit = get_cvar_pointer( "mp_timelimit" )
  55.  
  56. register_srvcmd("amx_time_display", "setDisplaying")
  57.  
  58. register_clcmd("say timeleft", "sayTimeLeft", 0, "- displays timeleft")
  59. register_clcmd("say thetime", "sayTheTime", 0, "- displays current time")
  60.  
  61. set_task(0.8, "timeRemain", 8648458, "", 0, "b")
  62. }
  63.  
  64. public sayTheTime(id)
  65. {
  66. if (get_pcvar_num(HandleCvarTimeVoice))
  67. {
  68. new mhours[6], mmins[6], whours[32], wmins[32], wpm[6]
  69.  
  70. get_time("%H", mhours, 5)
  71. get_time("%M", mmins, 5)
  72.  
  73. new mins = str_to_num(mmins)
  74. new hrs = str_to_num(mhours)
  75.  
  76. if (mins)
  77. num_to_word(mins, wmins, 31)
  78. else
  79. wmins[0] = 0
  80.  
  81. if (hrs < 12)
  82. wpm = "am "
  83. else
  84. {
  85. if (hrs > 12) hrs -= 12
  86. wpm = "pm "
  87. }
  88.  
  89. if (hrs)
  90. num_to_word(hrs, whours, 31)
  91. else
  92. whours = "twelve "
  93.  
  94. client_cmd(id, "spk ^"fvox/time_is_now %s_period %s%s^"", whours, wmins, wpm)
  95. }
  96.  
  97. new ctime[64]
  98.  
  99. get_time("%m/%d/%Y - %H:%M:%S", ctime, 63)
  100. client_print(0, print_chat, "%L: %s", LANG_PLAYER, "THE_TIME", ctime)
  101.  
  102. return PLUGIN_CONTINUE
  103. }
  104.  
  105. public sayTimeLeft(id)
  106. {
  107. if (get_pcvar_float(HandleCvarTimeLimit))
  108. {
  109. new a = get_timeleft()
  110.  
  111. if (get_pcvar_num(HandleCvarTimeVoice))
  112. {
  113. new svoice[128]
  114. setTimeVoice(svoice, 127, 0, a)
  115. client_cmd(id, "%s", svoice)
  116. }
  117. client_print(0, print_chat, "%L: %d:%02d", LANG_PLAYER, "TIME_LEFT", (a / 60), (a % 60))
  118. }
  119. else
  120. client_print(0, print_chat, "%L", LANG_PLAYER, "NO_T_LIMIT")
  121.  
  122. return PLUGIN_CONTINUE
  123. }
  124.  
  125. setTimeText(text[], len, tmlf, id)
  126. {
  127. new secs = tmlf % 60
  128. new mins = tmlf / 60
  129.  
  130. if (secs == 0)
  131. formatex(text, len, "%d %L", mins, id, (mins > 1) ? "MINUTES" : "MINUTE")
  132. else if (mins == 0)
  133. formatex(text, len, "%d %L", secs, id, (secs > 1) ? "SECONDS" : "SECOND")
  134. else
  135. formatex(text, len, "%d %L %d %L", mins, id, (mins > 1) ? "MINUTES" : "MINUTE", secs, id, (secs > 1) ? "SECONDS" : "SECOND")
  136. }
  137.  
  138. setTimeVoice(text[], len, flags, tmlf)
  139. {
  140. new temp[7][32]
  141. new secs = tmlf % 60
  142. new mins = tmlf / 60
  143.  
  144. for (new a = 0;a < 7;++a)
  145. temp[a][0] = 0
  146.  
  147. if (secs > 0)
  148. {
  149. num_to_word(secs, temp[4], 31)
  150.  
  151. if (!(flags & 8))
  152. temp[5] = "seconds " /* there is no "second" in default hl */
  153. }
  154.  
  155. if (mins > 59)
  156. {
  157. new hours = mins / 60
  158.  
  159. num_to_word(hours, temp[0], 31)
  160.  
  161. if (!(flags & 8))
  162. temp[1] = "hours "
  163.  
  164. mins = mins % 60
  165. }
  166.  
  167. if (mins > 0)
  168. {
  169. num_to_word(mins, temp[2], 31)
  170.  
  171. if (!(flags & 8))
  172. temp[3] = "minutes "
  173. }
  174.  
  175. if (!(flags & 4))
  176. temp[6] = "remaining "
  177.  
  178. return formatex(text, len, "spk ^"vox/%s%s%s%s%s%s%s^"", temp[0], temp[1], temp[2], temp[3], temp[4], temp[5], temp[6])
  179. }
  180.  
  181. findDispFormat(time)
  182. {
  183. for (new i = 0; g_TimeSet[i][0]; ++i)
  184. {
  185. if (g_TimeSet[i][1] & 16)
  186. {
  187. if (g_TimeSet[i][0] > time)
  188. {
  189. if (!g_Switch)
  190. {
  191. g_CountDown = g_Switch = time
  192. remove_task(8648458)
  193. set_task(1.0, "timeRemain", 34543, "", 0, "b")
  194. }
  195.  
  196. return i
  197. }
  198. }
  199. else if (g_TimeSet[i][0] == time)
  200. {
  201. return i
  202. }
  203. }
  204.  
  205. return -1
  206. }
  207.  
  208. public setDisplaying()
  209. {
  210. new arg[32], flags[32], num[32]
  211. new argc = read_argc() - 1
  212. new i = 0
  213.  
  214. while (i < argc && i < 32)
  215. {
  216. read_argv(i + 1, arg, 31)
  217. parse(arg, flags, 31, num, 31)
  218.  
  219. g_TimeSet[i][0] = str_to_num(num)
  220. g_TimeSet[i][1] = read_flags(flags)
  221.  
  222. i++
  223. }
  224. g_TimeSet[i][0] = 0
  225.  
  226. return PLUGIN_HANDLED
  227. }
  228.  
  229. public timeRemain(param[])
  230. {
  231. new gmtm = get_timeleft()
  232. new tmlf = g_Switch ? --g_CountDown : gmtm
  233. new stimel[12]
  234.  
  235. formatex(stimel, 11, "%02d:%02d", gmtm / 60, gmtm % 60)
  236. set_pcvar_string(HandleCvarTimeLeft, stimel)
  237.  
  238. if (g_Switch && gmtm > g_Switch)
  239. {
  240. remove_task(34543)
  241. g_Switch = 0
  242. set_task(0.8, "timeRemain", 8648458, "", 0, "b")
  243.  
  244. return
  245. }
  246.  
  247. if (tmlf > 0 && g_LastTime != tmlf)
  248. {
  249. g_LastTime = tmlf
  250. new tm_set = findDispFormat(tmlf)
  251.  
  252. if (tm_set != -1)
  253. {
  254. new flags = g_TimeSet[tm_set][1]
  255. new arg[128]
  256.  
  257. if (flags & 1)
  258. {
  259. new players[32], pnum
  260.  
  261. get_players(players, pnum, "c")
  262.  
  263. for (new i = 0; i < pnum; i++)
  264. {
  265. setTimeText(arg, 127, tmlf, players[i])
  266.  
  267. if (flags & 16)
  268. set_hudmessage(255, 255, 255, -1.0, 0.85, 0, 0.0, 1.1, 0.1, 0.5, -1)
  269. else
  270. set_hudmessage(255, 255, 255, -1.0, 0.85, 0, 0.0, 3.0, 0.0, 0.5, -1)
  271.  
  272. show_hudmessage(players[i], "%s", arg)
  273. }
  274. }
  275.  
  276. if (flags & 2)
  277. {
  278. setTimeVoice(arg, 127, flags, tmlf)
  279. client_cmd(0, "%s", arg)
  280. }
  281. }
  282. }
  283. }


Ez meg a *chat spam*
ini-be írhatsz olyat amit ne vegyen spamként.
pl: sokat írt meg minden és nem tudd többet írni 10mp-ig(példa)
és ha beírja /rank akkor egyből mutatja neki.
Érted szerintem.

https://forums.alliedmods.net/showthread.php?t=90414

_________________
Kép


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


Ki van itt

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