hlmod.hu
https://hlmod.hu/

Ping színesen
https://hlmod.hu/viewtopic.php?f=10&t=4965
Oldal: 1 / 1

Szerző:  pixxa112 [2012.06.29. 18:39 ]
Hozzászólás témája:  Ping színesen

Helló.

Hogy lehet meg csinálni a magas ping kickelőt színesre?

És igy kéne:
A szöveg amit ír az csapat színű legyen(kék/piros)
A játékosnak a neve(zöld) A játkos akit kickel a szerver magas ping miatt.

Valaki tudna ebben segiteni?? Nagyon fontos..

Szerző:  VirTuaL ~` [2012.06.29. 18:41 ]
Hozzászólás témája:  Re: Ping színesen

Áthelyezve.

Szerző:  oroszrulett [2012.06.29. 20:01 ]
Hozzászólás témája:  Re: Ping színesen

Ez a sajátom:
Kód:
  1. /* AMX Mod script

  2.  


  3.  

  4. *

  5. * (c) 2002-2003, DynAstY

  6. * This file is provided as is (no warranties).

  7. *

  8. * Players with immunity won't be checked

  9. */

  10.  

  11. #include <amxmodx>

  12. #include <colorchat>

  13.  

  14. new const gName[] = "^x04 [eb@-Info]^x01 ";

  15.  

  16. new HIGHPING_MAX = 110 // set maximal acceptable ping

  17. new HIGHPING_TIME = 5  // set in seconds frequency of ping checking

  18. new HIGHPING_TESTS = 4  // minimal number of checks before doing anything

  19.  

  20. new iNumTests[33]

  21.  

  22. public plugin_init() {

  23.         register_plugin("High Ping Kicker","1.2.0","DynAstY")

  24.         if (HIGHPING_TIME < 15) HIGHPING_TIME = 15

  25.         if (HIGHPING_TESTS < 4) HIGHPING_TESTS = 4

  26.         return PLUGIN_CONTINUE

  27. }

  28.  

  29. public client_disconnect(id) {

  30.         remove_task(id)

  31.         return PLUGIN_CONTINUE

  32. }

  33.        

  34. public client_putinserver(id) {

  35.         iNumTests[id] = 0

  36.         if (!is_user_bot(id)) {

  37.                 new param[1]

  38.                 param[0] = id

  39.                 set_task(30.0, "showWarn", id, param, 1)

  40.         }

  41.         return PLUGIN_CONTINUE

  42. }

  43.  

  44. kickPlayer(id) {

  45.         new name[32]

  46.         get_user_name(id, name, 31)

  47.         new uID = get_user_userid(id)

  48.         server_cmd("banid 1 #%d", uID)

  49.         client_cmd(id, "echo ^"[s] Lecsatlakozva, a magas ping miatt!^"; disconnect")

  50.         ColorChat(0, GREEN, "%s^x03 %s^x01 lecsatlakoztatva nagy ping miatt.", gName, name)

  51.         return PLUGIN_CONTINUE

  52. }

  53.  

  54. public checkPing(param[]) {

  55.         new id = param[0]

  56.         if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {

  57.                 remove_task(id)

  58.                 ColorChat(id, GREEN, "%s Ping Ellenorzes Letiltva Inmunissag Miatt!", gName)

  59.                 return PLUGIN_CONTINUE

  60.         }

  61.         new p, l

  62.         get_user_ping(id, p, l)

  63.         if (p > HIGHPING_MAX)

  64.                 ++iNumTests[id]

  65.         else

  66.                 if (iNumTests[id] > 0) --iNumTests[id]

  67.         if (iNumTests[id] > HIGHPING_TESTS)

  68.                 kickPlayer(id)

  69.         return PLUGIN_CONTINUE

  70. }

  71.  

  72. public showWarn(param[]) {

  73.         ColorChat(param[0], GREEN, "%s A szerveren a pinghatar ^x04 %dms. ^x01 Aki atlepi, azt a szerver kickeli.", gName, HIGHPING_MAX)

  74.         set_task(float(HIGHPING_TIME), "checkPing", param[0], param, 1, "b")

  75.         return PLUGIN_CONTINUE

  76. }

  77.  

  78.  

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