hlmod.hu

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



Jelenlévő felhasználók

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

A legtöbb felhasználó (2883 fő) 2025.07.30. 16:00-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  [15 hozzászólás ]  Oldal12Következő
Szerző Üzenet
 Hozzászólás témája: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:41 
Offline
Újonc

Csatlakozott:2012.01.21. 19:46
Hozzászólások:9
Hali!
Azt szeretném kérdezni hogy: a rate manager pluginba hol lehet átírni a rateket 25000 re? (természetesen az amx re gondolok nem a cvarra mert a cvarnál ha beállitom a 25000 ret akkor a szerver resinél automatán visszarakja az eredetire (9016 ra))
Tudom hogy a smat kell átirni de hol és mit?
előre is köszi


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:42 
Offline
Tiszteletbeli

Csatlakozott:2010.02.04. 19:12
Hozzászólások:3528
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 180 alkalommal
szollosi15 írta:
Hali!
Azt szeretném kérdezni hogy: a rate manager pluginba hol lehet átírni a rateket 25000 re? (természetesen az amx re gondolok nem a cvarra mert a cvarnál ha beállitom a 25000 ret akkor a szerver resinél automatán visszarakja az eredetire (9016 ra))
Tudom hogy a smat kell átirni de hol és mit?
előre is köszi

Helló, melyik rate managert használod?

_________________
http://www.ebateam.eu/


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:48 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Idézet:
(9016 ra))


Az véletlenül nem 9216?
Kód:
  1.  

  2.  

  3. /* AMX Mod script.

  4.  

  5. *

  6.  

  7. *

  8.  

  9. * AMX Rate Manager (rate_manager)

  10.  

  11. *

  12.  

  13. * (c) Copyright 2003 by Marach (marach@phreaker.net, ICQ: 242122535, AIM: marach24, MSN IM: marach24@hotmail.com)

  14.  

  15. *

  16.  

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

  18.  

  19. *

  20.  

  21. *

  22.  

  23. * This plugin will allow you to restrict clients' cl_updaterate and rate CVARs. You can set maximum and minimum

  24.  

  25. * cl_updaterate and rate values a client can use when playing on your server. Plugin checks clients' CVARs and

  26.  

  27. * corrects exceeded CVARs to the limits you set. Local players playing from LAN, players with specific IP and

  28.  

  29. * players with specific steamID can be excluded from plugin calculations (by ping, IP and steamID). Plugin is able

  30.  

  31. * to exclude all players belonging to the same network subnet (192.168.15.x for example) if you want to. Exclusion

  32.  

  33. * by ping, IP and steamID makes it possible to make two groups of clients (excluded clients and normal clients). The

  34.  

  35. * plugin can then use different bandwith limits for each group. Plugin is also able to limit bandwith of dead players

  36.  

  37. * by the percent you set. When a player is dead plugin will lower his CVARs by the set percent and restore them back

  38.  

  39. * when a new round begins. That way you can leave more server's bandwith and CPU power to alive players.

  40.  

  41. *

  42.  

  43. *

  44.  

  45. * Usage:

  46.  

  47. *       - open file addons\amx\admin.cfg

  48.  

  49. *       - add these lines to admin.cfg only if you don't like defaults:

  50.  

  51. *               rm_maxupdr <max cl_updaterate>

  52.  

  53. *               rm_minupdr <min cl_updaterate>

  54.  

  55. *               rm_maxrate <max rate>

  56.  

  57. *               rm_minrate <min rate>

  58.  

  59. *               rm_exclmaxupdr <max cl_updaterate>

  60.  

  61. *               rm_exclminupdr <min cl_updaterate>

  62.  

  63. *               rm_exclmaxrate <max rate>

  64.  

  65. *               rm_exclminrate <min rate>

  66.  

  67. *               rm_delay <delay>

  68.  

  69. *               rm_deadratio <ratio>

  70.  

  71. *               rm_localping <ping>

  72.  

  73. *               rm_ignoreip <IP> [IP] [IP] [IP] ...

  74.  

  75. *               rm_ignoresteamid <steamID> [steamID] [steamID] [steamID] ...

  76.  

  77. *               rm_announce <0 or 1>

  78.  

  79. *               rm_hello <0 or 1>

  80.  

  81. *       - save the changes to file admin.cfg :)

  82.  

  83. *

  84.  

  85. *

  86.  

  87. * CVAR explanation:

  88.  

  89. *       rm_maxupdr - max cl_updaterate a normal client can have (default 36)

  90.  

  91. *       rm_minupdr - min cl_updaterate a normal client can have (default 12)

  92.  

  93. *       rm_maxrate - max rate and cl_rate a normal client can have (default 9216 = 9kb)

  94.  

  95. *       rm_minrate - min rate and cl_rate a normal client can have (default 3072 = 3kb)

  96.  

  97. *       rm_exclmaxupdr - max cl_updaterate an excluded client can have (default 60)

  98.  

  99. *       rm_exclminupdr - min cl_updaterate an excluded client can have (default 24)

  100.  

  101. *       rm_exclmaxrate - max rate and cl_rate an excluded client can have (default 15360 = 15kb)

  102.  

  103. *       rm_exclminrate - min rate and cl_rate an excluded client can have (default 6144 = 6kb)

  104.  

  105. *       rm_delay - delay in seconds between checking clients (default 20 seconds)

  106.  

  107. *       rm_deadratio - lower dead players net setting to this ratio of default net settings (default 0.4 = 40%)

  108.  

  109. *       rm_localping - plugin will exclude clients who have ping equal or lower than this value (default 0)

  110.  

  111. *       rm_ignoreip - plugin will exclude clients whose IP is listed with this command

  112.  

  113. *       rm_ignoresteamid - plugin will exclude clients whose steamID is listen with this command

  114.  

  115. *       rm_announce - toggle announcing plugin actions on and off (default 1 = on)

  116.  

  117. *       rm_hello - toggle displaying plugin info to connecting players (default 1 = on)

  118.  

  119. *

  120.  

  121. * If you leave defaults (you don't add any lines to admin.cfg) then the plugin will check all clients every 20

  122.  

  123. * seconds. Plugin will announce and correct if a normal client has cl_updaterate set below 12 or over 36. Plugin

  124.  

  125. * will do the same if a normal client has rate set below 3072 or over 9216. Excluded clients (either excluded by

  126.  

  127. * ping or IP) can set their cl_updaterate between 24 and 60, and their rate between 6144 and 15360. Plugin will

  128.  

  129. * never announce excluded clients going over set limits. Plugin will lower all dead players' net settings to 40%

  130.  

  131. * of their default net settings and restore them back when new round begins. Example: if a player has cl_updaterate

  132.  

  133. * set to 30 and rate set to 8000, when he dies plugin will set his cl_updaterate to 18 and rate to 4800. On a new

  134.  

  135. * round plugin will restore that particular player's cl_updaterate back to 30 and rate back to 8000. By default,

  136.  

  137. * players with ping 0 will not be calculated (rm_localping default value is 0). By default, plugin will display

  138.  

  139. * info message to all connecting players.

  140.  

  141. *

  142.  

  143. *

  144.  

  145. * Notes:

  146.  

  147. *       - plugin has two parts that can be independently toggled on and off:

  148.  

  149. *               a) net settings restriction - toggle it off by setting rm_delay to 0

  150.  

  151. *               b) dead players bandwith saver - toggle it off by setting rm_deadratio to 1.0

  152.  

  153. *       - set rm_localping to -1 if you want the plugin to take players with ping 0 into calculations

  154.  

  155. *       - using more rm_ignoreip commands adds entries to existing ignore IP list (you steam't make a fresh new list)

  156.  

  157. *       - you can add IP addresses to the ignore IP list using one rm_ignoreip with many IPs specified in one line or

  158.  

  159. *               using more rm_ignoreip commands (to make it more tidy like in below example of custom settings)

  160.  

  161. *       - you can exclude the hole subnet of IPs from plugin calculations by using a letter 'x' when specifying IP

  162.  

  163. *               with rm_ignoreip (look below example of custom settings to see how to do it)

  164.  

  165. *       - player who runs a non-dedicated server and is playing on it can be excluded from plugin calculations by

  166.  

  167. *               adding an entry named 'loopback' to ignore IP list (rm_ignoreip loopback) or by ping

  168.  

  169. *       - using more rm_ignoresteamid commands only adds entries to existing ignore steamID list (you steam't make a fresh

  170.  

  171. *               new list every time use rm_ignoresteamid command)

  172.  

  173. *       - you can add steamIDs to the ignore steamID list using one rm_ignoresteamid with many steamIDs specified in one line

  174.  

  175. *               or using more rm_ignoresteamid commands (to make it more tidy like in below example of custom settings)

  176.  

  177. *

  178.  

  179. *

  180.  

  181. * Example of custom plugin settings (admin.cfg):

  182.  

  183. *       rm_maxupdr 40

  184.  

  185. *       rm_minupdr 20

  186.  

  187. *       rm_maxrate 15000

  188.  

  189. *       rm_minrate 5000

  190.  

  191. *       rm_exclmaxupdr 70

  192.  

  193. *       rm_exclminupdr 30

  194.  

  195. *       rm_exclmaxrate 20000

  196.  

  197. *       rm_exclminrate 10000

  198.  

  199. *       rm_delay 30

  200.  

  201. *       rm_deadratio 0.8

  202.  

  203. *       rm_localping 15

  204.  

  205. *       rm_ignoreip 192.168.4.12 loopback 68.120.14.155

  206.  

  207. *       rm_ignoreip 148.122.5.x 165.12.x.x 195.4.202.15

  208.  

  209. *       rm_ignoresteamid 627543 1945822 122986

  210.  

  211. *       rm_ignoresteamid 445682

  212.  

  213. *       rm_announce 0

  214.  

  215. *       rm_hello 0

  216.  

  217. *

  218.  

  219. * Plugin will check clients every 30 seconds. If plugin finds cl_updaterate set below 20 or over 50, rate set below

  220.  

  221. * 5000 or over 15000 on a normal client then plugin will correct it but will not announce it. Excluded players can

  222.  

  223. * have cl_updaterate set from 30 to 70 and rate set from 10000 to 20000. Dead players will have their cl_updaterate

  224.  

  225. * and rate set to 80% of their default settings and restored back when alive again. Players with ping 15 or less will

  226.  

  227. * not be taken into calculation at all. Players having IP 192.168.4.12, 68.120.14.155, 195.4.202.15 and player playing

  228.  

  229. * from loopback (player who's running a non-dedicated server) will not be calculated. All players whose IPs starts with

  230.  

  231. * 148.122.5. and 165.12. (players belonging to subnets 148.122.5.x and 165.12.x.x) will not be taken into calculation

  232.  

  233. * at all. Players with steamIDs 627543, 1945822, 122986 and 445682 will be excluded too. No plugin info message will be

  234.  

  235. * displayed to connecting players.

  236.  

  237. *

  238.  

  239. *

  240.  

  241. */

  242.  

  243.  

  244.  

  245. #include <amxmod>

  246.  

  247.  

  248.  

  249. new origupdr[33], origrate[33], excl[33]

  250.  

  251. #define MAX_IP 32

  252.  

  253. new ignip[MAX_IP][32], ippos=0

  254.  

  255. #define MAX_steamID 128

  256.  

  257. new ignsteamid[MAX_steamID][32], steamidpos=0

  258.  

  259.  

  260.  

  261. public check_rr() {

  262.  

  263.         new maxupdr=get_cvar_num("rm_maxupdr")

  264.  

  265.         new minupdr=get_cvar_num("rm_minupdr")

  266.  

  267.         new maxrate=get_cvar_num("rm_maxrate")

  268.  

  269.         new minrate=get_cvar_num("rm_minrate")

  270.  

  271.         new announce=get_cvar_num("rm_announce")

  272.  

  273.         new players[32], np, i, playername[32]

  274.  

  275.         new clupdr[8], clrt[16], msg[256]

  276.  

  277.         new tmpupdr, tmprate, cmdexe[32]

  278.  

  279.         get_players(players, np, "ac")

  280.  

  281.         for(i=0; i<np; i++)

  282.  

  283.                 if ((players[i]!=0)&&(!is_user_hltv(players[i]))) {

  284.  

  285.                         get_user_ping(players[i], tmpupdr, tmprate)

  286.  

  287.                         if ((tmpupdr>get_cvar_num("rm_localping"))&&(excl[players[i]]==0)) {

  288.  

  289.                                 get_user_info(players[i], "cl_updaterate", clupdr, 7)

  290.  

  291.                                 get_user_info(players[i], "rate", clrt, 15)

  292.  

  293.                                 tmpupdr=str_to_num(clupdr)

  294.  

  295.                                 tmprate=str_to_num(clrt)

  296.  

  297.                                 if (announce)

  298.  

  299.                                         get_user_name(players[i],playername,31)

  300.  

  301.                                 if (tmpupdr>maxupdr) {

  302.  

  303.                                         origupdr[players[i]]=maxupdr

  304.  

  305.                                         format(cmdexe, 31, "cl_updaterate %i", maxupdr)

  306.  

  307.                                         client_cmd(players[i], cmdexe)

  308.  

  309.                                         if (announce) {

  310.  

  311.                                                 format(msg, 255, "* [AMX_RM] %s set 'cl_updaterate' to '%i' (max '%i') - blocked by plugin !", playername, tmpupdr, maxupdr)

  312.  

  313.                                                 client_print(0, print_chat, msg)

  314.  

  315.                                                 }

  316.  

  317.                                         }

  318.  

  319.                                 if (tmpupdr<minupdr) {

  320.  

  321.                                         origupdr[players[i]]=minupdr

  322.  

  323.                                         format(cmdexe, 31, "cl_updaterate %i", minupdr)

  324.  

  325.                                         client_cmd(players[i], cmdexe)

  326.  

  327.                                         if (announce) {

  328.  

  329.                                                 format(msg, 255, "* [AMX_RM] %s set 'cl_updaterate' to '%i' (min '%i') - blocked by plugin !", playername, tmpupdr, minupdr)

  330.  

  331.                                                 client_print(0, print_chat, msg)

  332.  

  333.                                                 }

  334.  

  335.                                         }

  336.  

  337.                                 if (tmprate>maxrate) {

  338.  

  339.                                         origrate[players[i]]=maxrate

  340.  

  341.                                         format(cmdexe, 31, "rate %i", maxrate)

  342.  

  343.                                         client_cmd(players[i], cmdexe)

  344.  

  345.                                         format(cmdexe, 31, "cl_rate %i", maxrate)

  346.  

  347.                                         client_cmd(players[i], cmdexe)

  348.  

  349.                                         if (announce) {

  350.  

  351.                                                 format(msg, 255, "* [AMX_RM] %s set 'rate' to '%i' (max '%i') - blocked by plugin !", playername, tmprate, maxrate)

  352.  

  353.                                                 client_print(0, print_chat, msg)

  354.  

  355.                                                 }

  356.  

  357.                                         }

  358.  

  359.                                 if (tmprate<minrate) {

  360.  

  361.                                         origrate[players[i]]=minrate

  362.  

  363.                                         format(cmdexe, 31, "rate %i", minrate)

  364.  

  365.                                         client_cmd(players[i], cmdexe)

  366.  

  367.                                         format(cmdexe, 31, "cl_rate %i", minrate)

  368.  

  369.                                         client_cmd(players[i], cmdexe)

  370.  

  371.                                         if (announce) {

  372.  

  373.                                                 format(msg, 255, "* [AMX_RM] %s set 'rate' to '%i' (min '%i') - blocked by plugin !", playername, tmprate, minrate)

  374.  

  375.                                                 client_print(0, print_chat, msg)

  376.  

  377.                                                 }

  378.  

  379.                                         }

  380.  

  381.                                 }

  382.  

  383.                         }

  384.  

  385.         new Float:freq=get_cvar_float("rm_delay")

  386.  

  387.         if (freq > 0.0) set_task(freq, "check_rr")

  388.  

  389.         return PLUGIN_CONTINUE

  390.  

  391. }

  392.  

  393.  

  394.  

  395. public alive_again(id) {

  396.  

  397.         if ((is_user_bot(id))||(is_user_hltv(id)))

  398.  

  399.                 return PLUGIN_CONTINUE

  400.  

  401.         if (excl[id]==1)

  402.  

  403.                 return PLUGIN_CONTINUE

  404.  

  405.         new Float:ratio=get_cvar_float("rm_deadratio")

  406.  

  407.         if (ratio==1.0)

  408.  

  409.                 return PLUGIN_CONTINUE

  410.  

  411.         new ping, loss

  412.  

  413.         get_user_ping(id, ping, loss)

  414.  

  415.         if (ping>get_cvar_num("rm_localping")) {

  416.  

  417.                 new cmdexe[32]

  418.  

  419.                 format(cmdexe, 31, "cl_updaterate %i", origupdr[id])

  420.  

  421.                 client_cmd(id, cmdexe)

  422.  

  423.                 format(cmdexe, 31, "rate %i", origrate[id])

  424.  

  425.                 client_cmd(id, cmdexe)

  426.  

  427.                 format(cmdexe, 31, "cl_rate %i", origrate[id])

  428.  

  429.                 client_cmd(id, cmdexe)

  430.  

  431.                 if (get_cvar_num("rm_announce")) {

  432.  

  433.                         new msg[256]

  434.  

  435.                         format(msg, 255, "* [AMX_RM] Your net settings have been restored : 'cl_updaterate' = '%i', 'rate' = '%i'", origupdr[id], origrate[id])

  436.  

  437.                         client_print(id, print_chat, msg)

  438.  

  439.                         }

  440.  

  441.                 }

  442.  

  443.         return PLUGIN_CONTINUE

  444.  

  445. }

  446.  

  447.  

  448.  

  449. public dead_now() {

  450.  

  451.         new victim=read_data(2)

  452.  

  453.         if ((is_user_bot(victim))||(is_user_hltv(victim)))

  454.  

  455.                 return PLUGIN_CONTINUE

  456.  

  457.         if (excl[victim]==1)

  458.  

  459.                 return PLUGIN_CONTINUE         

  460.  

  461.         new Float:ratio=get_cvar_float("rm_deadratio")

  462.  

  463.         if (ratio==1.0)

  464.  

  465.                 return PLUGIN_CONTINUE

  466.  

  467.         new tmpupdr, tmprate

  468.  

  469.         get_user_ping(victim, tmpupdr, tmprate)

  470.  

  471.         if (tmpupdr>get_cvar_num("rm_localping")) {            

  472.  

  473.                 new cmdexe[32]

  474.  

  475.                 tmpupdr=floatround(float(origupdr[victim])*ratio)

  476.  

  477.                 tmprate=floatround(float(origrate[victim])*ratio)

  478.  

  479.                 format(cmdexe, 31, "cl_updaterate %i", tmpupdr)

  480.  

  481.                 client_cmd(victim, cmdexe)

  482.  

  483.                 format(cmdexe, 31, "rate %i", tmprate)

  484.  

  485.                 client_cmd(victim, cmdexe)

  486.  

  487.                 format(cmdexe, 31, "cl_rate %i", tmprate)

  488.  

  489.                 client_cmd(victim, cmdexe)

  490.  

  491.                 if (get_cvar_num("rm_announce")) {

  492.  

  493.                         new msg[256]

  494.  

  495.                         format(msg, 255, "* [AMX_RM] Your net settings have been lowered : 'cl_updaterate' = '%i', 'rate' = '%i'", tmpupdr, tmprate)

  496.  

  497.                         client_print(victim, print_chat, msg)

  498.  

  499.                         }

  500.  

  501.                 }

  502.  

  503.         return PLUGIN_CONTINUE

  504.  

  505. }

  506.  

  507.  

  508.  

  509. public ignore_ip(id) {

  510.  

  511.         new argc=read_argc()

  512.  

  513.         if (argc<2) {

  514.  

  515.                 console_print(id, "Usage: rm_ignoreip <IP> [IP] [IP] [IP] ...")

  516.  

  517.                 return PLUGIN_CONTINUE

  518.  

  519.                 }

  520.  

  521.         for(new i=1; i<argc; i++)

  522.  

  523.                 if (ippos<MAX_IP) {

  524.  

  525.                         read_argv(i, ignip[ippos], 31)

  526.  

  527.                         ippos++

  528.  

  529.                 }

  530.  

  531.                 else {

  532.  

  533.                         console_print(id, "* [AMX_RM] Too many IP addresses added to the ignore IP list")

  534.  

  535.                         return PLUGIN_CONTINUE

  536.  

  537.                 }

  538.  

  539.         return PLUGIN_CONTINUE

  540.  

  541. }

  542.  

  543.  

  544.  

  545. public ignore_steamid(id) {

  546.  

  547.         new argc=read_argc()

  548.  

  549.         if (argc<2) {

  550.  

  551.                 console_print(id, "Usage: rm_ignoresteamid <steamID> [steamID] [steamID] [steamID] ...")

  552.  

  553.                 return PLUGIN_CONTINUE

  554.  

  555.                 }

  556.  

  557.         new tmp[32]

  558.  

  559.         for(new i=1; i<argc; i++)

  560.  

  561.                 if (steamidpos<MAX_steamID) {

  562.  

  563.                         read_argv(i, tmp, 31)

  564.  

  565.                         copy(ignsteamid[steamidpos], 31, tmp)

  566.  

  567.                         steamidpos++

  568.  

  569.                 }

  570.  

  571.                 else {

  572.  

  573.                         console_print(id, "* [AMX_RM] Too many steamIDs added to the ignore steamID list")

  574.  

  575.                         return PLUGIN_CONTINUE

  576.  

  577.                 }

  578.  

  579.         return PLUGIN_CONTINUE

  580.  

  581. }

  582.  

  583.  

  584.  

  585. public client_connect(id) {

  586.  

  587.         if ((is_user_bot(id))||(is_user_hltv(id)))

  588.  

  589.                 return PLUGIN_CONTINUE

  590.  

  591.         new clupdr[8], clrt[16]

  592.  

  593.         get_user_info(id, "cl_updaterate", clupdr, 7)

  594.  

  595.         get_user_info(id, "rate", clrt, 15)

  596.  

  597.         origupdr[id]=str_to_num(clupdr)

  598.  

  599.         origrate[id]=str_to_num(clrt)

  600.  

  601.         excl[id]=0

  602.  

  603.         new i

  604.  

  605.         if (ippos>0) {

  606.  

  607.                 new userip[32]

  608.  

  609.                 get_user_ip(id, userip, 31)

  610.  

  611.                 copyc(userip, 31, userip, ':')

  612.  

  613.                 new len

  614.  

  615.                 for(i=0; i<ippos; i++) {

  616.  

  617.                         len=containi(ignip[i],".x")

  618.  

  619.                         if (len>-1) {

  620.  

  621.                                 if (equal(userip, ignip[i], len)) {

  622.  

  623.                                         excl[id]=1

  624.  

  625.                                         break

  626.  

  627.                                         }

  628.  

  629.                                 }

  630.  

  631.                         else if (equal(userip, ignip[i])) {

  632.  

  633.                                 excl[id]=1

  634.  

  635.                                 break

  636.  

  637.                                 }

  638.  

  639.                         }

  640.  

  641.                 }

  642.  

  643.         if ((steamidpos>0)&&(excl[id]==0)) {

  644.  

  645.                 new steamid[32]

  646.  

  647.                 get_user_authid(id, steamid, 31)

  648.  

  649.                         for(i=0; i<steamidpos; i++)

  650.  

  651.                                 if (equal(steamid,ignsteamid[i])) {

  652.  

  653.                                         excl[id]=1

  654.  

  655.                                         break

  656.  

  657.                           }

  658.  

  659.         }

  660.  

  661.         if (get_cvar_num("rm_hello")==0)

  662.  

  663.                 return PLUGIN_CONTINUE

  664.  

  665.         new plgver[16]

  666.  

  667.         get_cvar_string("rate_manager", plgver, 15)

  668.  

  669.         client_cmd(id, "echo ======================================================================")

  670.  

  671.         client_cmd(id, "echo ^"* AMX Rate Manager v%s by Marach, marach@phreaker.net, ICQ: 242122535 *^"", plgver)

  672.  

  673.         new Float:freq=get_cvar_float("rm_delay")

  674.  

  675.         if (freq>0.0) {

  676.  

  677.                 new maxupdr=get_cvar_num("rm_maxupdr")

  678.  

  679.                 new minupdr=get_cvar_num("rm_minupdr")

  680.  

  681.                 new maxrate=get_cvar_num("rm_maxrate")

  682.  

  683.                 new minrate=get_cvar_num("rm_minrate")

  684.  

  685.                 client_cmd(id, "echo ^"   - allowed 'cl_updaterate' range : '%i' - '%i', you have '%i'^"", minupdr, maxupdr, origupdr[id])

  686.  

  687.                 client_cmd(id, "echo ^"   - allowed 'rate' range : '%i' - '%i', you have '%i'^"", minrate, maxrate, origrate[id])

  688.  

  689.                 }

  690.  

  691.         new Float:ratio=get_cvar_float("rm_deadratio")

  692.  

  693.         if (ratio<1.0)

  694.  

  695.                 client_cmd(id, "echo ^"   - dead players use %2.0f%%%% of their normal net settings^"", (ratio*100.0))

  696.  

  697.         client_cmd(id, "echo ======================================================================")

  698.  

  699.         return PLUGIN_CONTINUE

  700.  

  701. }

  702.  

  703.  

  704.  

  705. public client_disconnect(id) {

  706.  

  707.         if ((is_user_bot(id))||(is_user_hltv(id)))

  708.  

  709.                 return PLUGIN_CONTINUE

  710.  

  711.         origupdr[id]=get_cvar_num("rm_minupdr")

  712.  

  713.         origrate[id]=get_cvar_num("rm_minrate")

  714.  

  715.         excl[id]=0

  716.  

  717.         return PLUGIN_CONTINUE

  718.  

  719. }

  720.  

  721.  

  722.  

  723. public set_servercvars() {

  724.  

  725.         new tmp[16]

  726.  

  727.         get_cvar_string("rm_exclmaxupdr", tmp, 15)

  728.  

  729.         set_cvar_string("sv_maxupdaterate", tmp)

  730.  

  731.         get_cvar_string("rm_exclminupdr", tmp, 15)

  732.  

  733.         set_cvar_string("sv_minupdaterate", tmp)

  734.  

  735.         get_cvar_string("rm_exclmaxrate", tmp, 15)

  736.  

  737.         set_cvar_string("sv_maxrate", tmp)

  738.  

  739.         get_cvar_string("rm_exclminrate", tmp, 15)

  740.  

  741.         set_cvar_string("sv_minrate", tmp)

  742.  

  743.         if (get_cvar_num("rm_announce"))

  744.  

  745.                 console_print(0, "* [AMX_RM] Bandwith limits for excluded players have been set")

  746.  

  747.         return PLUGIN_CONTINUE

  748.  

  749. }

  750.  

  751.  

  752.  

  753. public plugin_init() {

  754.  

  755.         register_plugin("Rate Manager", "1.2", "Marach")

  756.  

  757.         register_cvar("rate_manager", "1.2", FCVAR_SERVER)

  758.  

  759.         register_event("ResetHUD", "alive_again", "be","1=1")

  760.  

  761.         register_event("DeathMsg","dead_now","a")

  762.  

  763.         register_cvar("rm_maxupdr", "36")

  764.  

  765.         register_cvar("rm_minupdr", "12")

  766.  

  767.         register_cvar("rm_maxrate", "25000")

  768.  

  769.         register_cvar("rm_minrate", "25000")

  770.  

  771.         register_cvar("rm_exclmaxupdr", "60")

  772.  

  773.         register_cvar("rm_exclminupdr", "24")

  774.  

  775.         register_cvar("rm_exclmaxrate", "15360")

  776.  

  777.         register_cvar("rm_exclminrate", "6144")

  778.  

  779.         register_cvar("rm_delay", "20")

  780.  

  781.         register_cvar("rm_deadratio", "0.4")

  782.  

  783.         register_cvar("rm_localping", "0")

  784.  

  785.         register_cvar("rm_announce", "1")

  786.  

  787.         register_cvar("rm_hello", "1")

  788.  

  789.         register_srvcmd("rm_ignoreip", "ignore_ip")

  790.  

  791.         register_srvcmd("rm_ignoresteamid", "ignore_steamid")

  792.  

  793.         new Float:freq=get_cvar_float("rm_delay")

  794.  

  795.         if (freq>0.0) {

  796.  

  797.                 set_task(freq, "check_rr")

  798.  

  799.                 set_task(5.0, "set_servercvars")

  800.  

  801.                 }

  802.  

  803.         return PLUGIN_CONTINUE

  804.  

  805. }

  806.  

  807.  


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:55 
Offline
Újonc

Csatlakozott:2012.01.21. 19:46
Hozzászólások:9
rate_manager.amxx plugint használom


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:56 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Már megkaptad a választ. És ne duplapostolj.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:57 
Offline
Újonc

Csatlakozott:2012.01.21. 19:46
Hozzászólások:9
nem kaptam meg a választ!


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:58 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
AKKOR MI A 3. HSZ? Szerintem a megoldás, de nem vagyok 100%-ig biztos benne.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 20:59 
Offline
Újonc

Csatlakozott:2012.01.21. 19:46
Hozzászólások:9
de nem érted???????

Kód:
  1. /* AMX Mod script.

  2. *

  3. *

  4. * AMX Rate Manager (rate_manager)

  5. *

  6. * (c) Copyright 2003 by Marach (marach@phreaker.net, ICQ: 242122535, AIM: marach24, MSN IM: marach24@hotmail.com)

  7. *

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

  9. *

  10. *

  11. * This plugin will allow you to restrict clients' cl_updaterate and rate CVARs. You can set maximum and minimum

  12. * cl_updaterate and rate values a client can use when playing on your server. Plugin checks clients' CVARs and

  13. * corrects exceeded CVARs to the limits you set. Local players playing from LAN, players with specific IP and

  14. * players with specific steamID can be excluded from plugin calculations (by ping, IP and steamID). Plugin is able

  15. * to exclude all players belonging to the same network subnet (192.168.15.x for example) if you want to. Exclusion

  16. * by ping, IP and steamID makes it possible to make two groups of clients (excluded clients and normal clients). The

  17. * plugin can then use different bandwith limits for each group. Plugin is also able to limit bandwith of dead players

  18. * by the percent you set. When a player is dead plugin will lower his CVARs by the set percent and restore them back

  19. * when a new round begins. That way you can leave more server's bandwith and CPU power to alive players.

  20. *

  21. *

  22. * Usage:

  23. *       - open file addons\amx\admin.cfg

  24. *       - add these lines to admin.cfg only if you don't like defaults:

  25. *               rm_maxupdr <max cl_updaterate>

  26. *               rm_minupdr <min cl_updaterate>

  27. *               rm_maxrate <max rate>

  28. *               rm_minrate <min rate>

  29. *               rm_exclmaxupdr <max cl_updaterate>

  30. *               rm_exclminupdr <min cl_updaterate>

  31. *               rm_exclmaxrate <max rate>

  32. *               rm_exclminrate <min rate>

  33. *               rm_delay <delay>

  34. *               rm_deadratio <ratio>

  35. *               rm_localping <ping>

  36. *               rm_ignoreip <IP> [IP] [IP] [IP] ...

  37. *               rm_ignoresteamid <steamID> [steamID] [steamID] [steamID] ...

  38. *               rm_announce <0 or 1>

  39. *               rm_hello <0 or 1>

  40. *       - save the changes to file admin.cfg :)

  41. *

  42. *

  43. * CVAR explanation:

  44. *       rm_maxupdr - max cl_updaterate a normal client can have (default 36)

  45. *       rm_minupdr - min cl_updaterate a normal client can have (default 12)

  46. *       rm_maxrate - max rate and cl_rate a normal client can have (default 9216 = 9kb)

  47. *       rm_minrate - min rate and cl_rate a normal client can have (default 3072 = 3kb)

  48. *       rm_exclmaxupdr - max cl_updaterate an excluded client can have (default 60)

  49. *       rm_exclminupdr - min cl_updaterate an excluded client can have (default 24)

  50. *       rm_exclmaxrate - max rate and cl_rate an excluded client can have (default 15360 = 15kb)

  51. *       rm_exclminrate - min rate and cl_rate an excluded client can have (default 6144 = 6kb)

  52. *       rm_delay - delay in seconds between checking clients (default 20 seconds)

  53. *       rm_deadratio - lower dead players net setting to this ratio of default net settings (default 0.4 = 40%)

  54. *       rm_localping - plugin will exclude clients who have ping equal or lower than this value (default 0)

  55. *       rm_ignoreip - plugin will exclude clients whose IP is listed with this command

  56. *       rm_ignoresteamid - plugin will exclude clients whose steamID is listen with this command

  57. *       rm_announce - toggle announcing plugin actions on and off (default 1 = on)

  58. *       rm_hello - toggle displaying plugin info to connecting players (default 1 = on)

  59. *

  60. * If you leave defaults (you don't add any lines to admin.cfg) then the plugin will check all clients every 20

  61. * seconds. Plugin will announce and correct if a normal client has cl_updaterate set below 12 or over 36. Plugin

  62. * will do the same if a normal client has rate set below 3072 or over 9216. Excluded clients (either excluded by

  63. * ping or IP) can set their cl_updaterate between 24 and 60, and their rate between 6144 and 15360. Plugin will

  64. * never announce excluded clients going over set limits. Plugin will lower all dead players' net settings to 40%

  65. * of their default net settings and restore them back when new round begins. Example: if a player has cl_updaterate

  66. * set to 30 and rate set to 8000, when he dies plugin will set his cl_updaterate to 18 and rate to 4800. On a new

  67. * round plugin will restore that particular player's cl_updaterate back to 30 and rate back to 8000. By default,

  68. * players with ping 0 will not be calculated (rm_localping default value is 0). By default, plugin will display

  69. * info message to all connecting players.

  70. *

  71. *

  72. * Notes:

  73. *       - plugin has two parts that can be independently toggled on and off:

  74. *               a) net settings restriction - toggle it off by setting rm_delay to 0

  75. *               b) dead players bandwith saver - toggle it off by setting rm_deadratio to 1.0

  76. *       - set rm_localping to -1 if you want the plugin to take players with ping 0 into calculations

  77. *       - using more rm_ignoreip commands adds entries to existing ignore IP list (you steam't make a fresh new list)

  78. *       - you can add IP addresses to the ignore IP list using one rm_ignoreip with many IPs specified in one line or

  79. *               using more rm_ignoreip commands (to make it more tidy like in below example of custom settings)

  80. *       - you can exclude the hole subnet of IPs from plugin calculations by using a letter 'x' when specifying IP

  81. *               with rm_ignoreip (look below example of custom settings to see how to do it)

  82. *       - player who runs a non-dedicated server and is playing on it can be excluded from plugin calculations by

  83. *               adding an entry named 'loopback' to ignore IP list (rm_ignoreip loopback) or by ping

  84. *       - using more rm_ignoresteamid commands only adds entries to existing ignore steamID list (you steam't make a fresh

  85. *               new list every time use rm_ignoresteamid command)

  86. *       - you can add steamIDs to the ignore steamID list using one rm_ignoresteamid with many steamIDs specified in one line

  87. *               or using more rm_ignoresteamid commands (to make it more tidy like in below example of custom settings)

  88. *

  89. *

  90. * Example of custom plugin settings (admin.cfg):

  91. *       rm_maxupdr 40

  92. *       rm_minupdr 20

  93. *       rm_maxrate 15000

  94. *       rm_minrate 5000

  95. *       rm_exclmaxupdr 70

  96. *       rm_exclminupdr 30

  97. *       rm_exclmaxrate 20000

  98. *       rm_exclminrate 10000

  99. *       rm_delay 30

  100. *       rm_deadratio 0.8

  101. *       rm_localping 15

  102. *       rm_ignoreip 192.168.4.12 loopback 68.120.14.155

  103. *       rm_ignoreip 148.122.5.x 165.12.x.x 195.4.202.15

  104. *       rm_ignoresteamid 627543 1945822 122986

  105. *       rm_ignoresteamid 445682

  106. *       rm_announce 0

  107. *       rm_hello 0

  108. *

  109. * Plugin will check clients every 30 seconds. If plugin finds cl_updaterate set below 20 or over 50, rate set below

  110. * 5000 or over 15000 on a normal client then plugin will correct it but will not announce it. Excluded players can

  111. * have cl_updaterate set from 30 to 70 and rate set from 10000 to 20000. Dead players will have their cl_updaterate

  112. * and rate set to 80% of their default settings and restored back when alive again. Players with ping 15 or less will

  113. * not be taken into calculation at all. Players having IP 192.168.4.12, 68.120.14.155, 195.4.202.15 and player playing

  114. * from loopback (player who's running a non-dedicated server) will not be calculated. All players whose IPs starts with

  115. * 148.122.5. and 165.12. (players belonging to subnets 148.122.5.x and 165.12.x.x) will not be taken into calculation

  116. * at all. Players with steamIDs 627543, 1945822, 122986 and 445682 will be excluded too. No plugin info message will be

  117. * displayed to connecting players.

  118. *

  119. *

  120. */

  121.  

  122. #include <amxmod>

  123.  

  124. new origupdr[33], origrate[33], excl[33]

  125. #define MAX_IP 32

  126. new ignip[MAX_IP][32], ippos=0

  127. #define MAX_steamID 128

  128. new ignsteamid[MAX_steamID][32], steamidpos=0

  129.  

  130. public check_rr() {

  131.         new maxupdr=get_cvar_num("rm_maxupdr")

  132.         new minupdr=get_cvar_num("rm_minupdr")

  133.         new maxrate=get_cvar_num("rm_maxrate")

  134.         new minrate=get_cvar_num("rm_minrate")

  135.         new announce=get_cvar_num("rm_announce")

  136.         new players[32], np, i, playername[32]

  137.         new clupdr[8], clrt[16], msg[256]

  138.         new tmpupdr, tmprate, cmdexe[32]

  139.         get_players(players, np, "ac")

  140.         for(i=0; i<np; i++)

  141.                 if ((players[i]!=0)&&(!is_user_hltv(players[i]))) {

  142.                         get_user_ping(players[i], tmpupdr, tmprate)

  143.                         if ((tmpupdr>get_cvar_num("rm_localping"))&&(excl[players[i]]==0)) {

  144.                                 get_user_info(players[i], "cl_updaterate", clupdr, 7)

  145.                                 get_user_info(players[i], "rate", clrt, 15)

  146.                                 tmpupdr=str_to_num(clupdr)

  147.                                 tmprate=str_to_num(clrt)

  148.                                 if (announce)

  149.                                         get_user_name(players[i],playername,31)

  150.                                 if (tmpupdr>maxupdr) {

  151.                                         origupdr[players[i]]=maxupdr

  152.                                         format(cmdexe, 31, "cl_updaterate %i", maxupdr)

  153.                                         client_cmd(players[i], cmdexe)

  154.                                         if (announce) {

  155.                                                 format(msg, 255, "* [AMX_RM] %s set 'cl_updaterate' to '%i' (max '%i') - blocked by plugin !", playername, tmpupdr, maxupdr)

  156.                                                 client_print(0, print_chat, msg)

  157.                                                 }

  158.                                         }

  159.                                 if (tmpupdr<minupdr) {

  160.                                         origupdr[players[i]]=minupdr

  161.                                         format(cmdexe, 31, "cl_updaterate %i", minupdr)

  162.                                         client_cmd(players[i], cmdexe)

  163.                                         if (announce) {

  164.                                                 format(msg, 255, "* [AMX_RM] %s set 'cl_updaterate' to '%i' (min '%i') - blocked by plugin !", playername, tmpupdr, minupdr)

  165.                                                 client_print(0, print_chat, msg)

  166.                                                 }

  167.                                         }

  168.                                 if (tmprate>maxrate) {

  169.                                         origrate[players[i]]=maxrate

  170.                                         format(cmdexe, 31, "rate %i", maxrate)

  171.                                         client_cmd(players[i], cmdexe)

  172.                                         format(cmdexe, 31, "cl_rate %i", maxrate)

  173.                                         client_cmd(players[i], cmdexe)

  174.                                         if (announce) {

  175.                                                 format(msg, 255, "* [AMX_RM] %s set 'rate' to '%i' (max '%i') - blocked by plugin !", playername, tmprate, maxrate)

  176.                                                 client_print(0, print_chat, msg)

  177.                                                 }

  178.                                         }

  179.                                 if (tmprate<minrate) {

  180.                                         origrate[players[i]]=minrate

  181.                                         format(cmdexe, 31, "rate %i", minrate)

  182.                                         client_cmd(players[i], cmdexe)

  183.                                         format(cmdexe, 31, "cl_rate %i", minrate)

  184.                                         client_cmd(players[i], cmdexe)

  185.                                         if (announce) {

  186.                                                 format(msg, 255, "* [AMX_RM] %s set 'rate' to '%i' (min '%i') - blocked by plugin !", playername, tmprate, minrate)

  187.                                                 client_print(0, print_chat, msg)

  188.                                                 }

  189.                                         }

  190.                                 }

  191.                         }

  192.         new Float:freq=get_cvar_float("rm_delay")

  193.         if (freq > 0.0) set_task(freq, "check_rr")

  194.         return PLUGIN_CONTINUE

  195. }

  196.  

  197. public alive_again(id) {

  198.         if ((is_user_bot(id))||(is_user_hltv(id)))

  199.                 return PLUGIN_CONTINUE

  200.         if (excl[id]==1)

  201.                 return PLUGIN_CONTINUE

  202.         new Float:ratio=get_cvar_float("rm_deadratio")

  203.         if (ratio==1.0)

  204.                 return PLUGIN_CONTINUE

  205.         new ping, loss

  206.         get_user_ping(id, ping, loss)

  207.         if (ping>get_cvar_num("rm_localping")) {

  208.                 new cmdexe[32]

  209.                 format(cmdexe, 31, "cl_updaterate %i", origupdr[id])

  210.                 client_cmd(id, cmdexe)

  211.                 format(cmdexe, 31, "rate %i", origrate[id])

  212.                 client_cmd(id, cmdexe)

  213.                 format(cmdexe, 31, "cl_rate %i", origrate[id])

  214.                 client_cmd(id, cmdexe)

  215.                 if (get_cvar_num("rm_announce")) {

  216.                         new msg[256]

  217.                         format(msg, 255, "* [AMX_RM] Your net settings have been restored : 'cl_updaterate' = '%i', 'rate' = '%i'", origupdr[id], origrate[id])

  218.                         client_print(id, print_chat, msg)

  219.                         }

  220.                 }

  221.         return PLUGIN_CONTINUE

  222. }

  223.  

  224. public dead_now() {

  225.         new victim=read_data(2)

  226.         if ((is_user_bot(victim))||(is_user_hltv(victim)))

  227.                 return PLUGIN_CONTINUE

  228.         if (excl[victim]==1)

  229.                 return PLUGIN_CONTINUE         

  230.         new Float:ratio=get_cvar_float("rm_deadratio")

  231.         if (ratio==1.0)

  232.                 return PLUGIN_CONTINUE

  233.         new tmpupdr, tmprate

  234.         get_user_ping(victim, tmpupdr, tmprate)

  235.         if (tmpupdr>get_cvar_num("rm_localping")) {            

  236.                 new cmdexe[32]

  237.                 tmpupdr=floatround(float(origupdr[victim])*ratio)

  238.                 tmprate=floatround(float(origrate[victim])*ratio)

  239.                 format(cmdexe, 31, "cl_updaterate %i", tmpupdr)

  240.                 client_cmd(victim, cmdexe)

  241.                 format(cmdexe, 31, "rate %i", tmprate)

  242.                 client_cmd(victim, cmdexe)

  243.                 format(cmdexe, 31, "cl_rate %i", tmprate)

  244.                 client_cmd(victim, cmdexe)

  245.                 if (get_cvar_num("rm_announce")) {

  246.                         new msg[256]

  247.                         format(msg, 255, "* [AMX_RM] Your net settings have been lowered : 'cl_updaterate' = '%i', 'rate' = '%i'", tmpupdr, tmprate)

  248.                         client_print(victim, print_chat, msg)

  249.                         }

  250.                 }

  251.         return PLUGIN_CONTINUE

  252. }

  253.  

  254. public ignore_ip(id) {

  255.         new argc=read_argc()

  256.         if (argc<2) {

  257.                 console_print(id, "Usage: rm_ignoreip <IP> [IP] [IP] [IP] ...")

  258.                 return PLUGIN_CONTINUE

  259.                 }

  260.         for(new i=1; i<argc; i++)

  261.                 if (ippos<MAX_IP) {

  262.                         read_argv(i, ignip[ippos], 31)

  263.                         ippos++

  264.                 }

  265.                 else {

  266.                         console_print(id, "* [AMX_RM] Too many IP addresses added to the ignore IP list")

  267.                         return PLUGIN_CONTINUE

  268.                 }

  269.         return PLUGIN_CONTINUE

  270. }

  271.  

  272. public ignore_steamid(id) {

  273.         new argc=read_argc()

  274.         if (argc<2) {

  275.                 console_print(id, "Usage: rm_ignoresteamid <steamID> [steamID] [steamID] [steamID] ...")

  276.                 return PLUGIN_CONTINUE

  277.                 }

  278.         new tmp[32]

  279.         for(new i=1; i<argc; i++)

  280.                 if (steamidpos<MAX_steamID) {

  281.                         read_argv(i, tmp, 31)

  282.                         copy(ignsteamid[steamidpos], 31, tmp)

  283.                         steamidpos++

  284.                 }

  285.                 else {

  286.                         console_print(id, "* [AMX_RM] Too many steamIDs added to the ignore steamID list")

  287.                         return PLUGIN_CONTINUE

  288.                 }

  289.         return PLUGIN_CONTINUE

  290. }

  291.  

  292. public client_connect(id) {

  293.         if ((is_user_bot(id))||(is_user_hltv(id)))

  294.                 return PLUGIN_CONTINUE

  295.         new clupdr[8], clrt[16]

  296.         get_user_info(id, "cl_updaterate", clupdr, 7)

  297.         get_user_info(id, "rate", clrt, 15)

  298.         origupdr[id]=str_to_num(clupdr)

  299.         origrate[id]=str_to_num(clrt)

  300.         excl[id]=0

  301.         new i

  302.         if (ippos>0) {

  303.                 new userip[32]

  304.                 get_user_ip(id, userip, 31)

  305.                 copyc(userip, 31, userip, ':')

  306.                 new len

  307.                 for(i=0; i<ippos; i++) {

  308.                         len=containi(ignip[i],".x")

  309.                         if (len>-1) {

  310.                                 if (equal(userip, ignip[i], len)) {

  311.                                         excl[id]=1

  312.                                         break

  313.                                         }

  314.                                 }

  315.                         else if (equal(userip, ignip[i])) {

  316.                                 excl[id]=1

  317.                                 break

  318.                                 }

  319.                         }

  320.                 }

  321.         if ((steamidpos>0)&&(excl[id]==0)) {

  322.                 new steamid[32]

  323.                 get_user_authid(id, steamid, 31)

  324.                         for(i=0; i<steamidpos; i++)

  325.                                 if (equal(steamid,ignsteamid[i])) {

  326.                                         excl[id]=1

  327.                                         break

  328.                           }

  329.         }

  330.         if (get_cvar_num("rm_hello")==0)

  331.                 return PLUGIN_CONTINUE

  332.         new plgver[16]

  333.         get_cvar_string("rate_manager", plgver, 15)

  334.         client_cmd(id, "echo ======================================================================")

  335.         client_cmd(id, "echo ^"* AMX Rate Manager v%s by Marach, marach@phreaker.net, ICQ: 242122535 *^"", plgver)

  336.         new Float:freq=get_cvar_float("rm_delay")

  337.         if (freq>0.0) {

  338.                 new maxupdr=get_cvar_num("rm_maxupdr")

  339.                 new minupdr=get_cvar_num("rm_minupdr")

  340.                 new maxrate=get_cvar_num("rm_maxrate")

  341.                 new minrate=get_cvar_num("rm_minrate")

  342.                 client_cmd(id, "echo ^"   - allowed 'cl_updaterate' range : '%i' - '%i', you have '%i'^"", minupdr, maxupdr, origupdr[id])

  343.                 client_cmd(id, "echo ^"   - allowed 'rate' range : '%i' - '%i', you have '%i'^"", minrate, maxrate, origrate[id])

  344.                 }

  345.         new Float:ratio=get_cvar_float("rm_deadratio")

  346.         if (ratio<1.0)

  347.                 client_cmd(id, "echo ^"   - dead players use %2.0f%%%% of their normal net settings^"", (ratio*100.0))

  348.         client_cmd(id, "echo ======================================================================")

  349.         return PLUGIN_CONTINUE

  350. }

  351.  

  352. public client_disconnect(id) {

  353.         if ((is_user_bot(id))||(is_user_hltv(id)))

  354.                 return PLUGIN_CONTINUE

  355.         origupdr[id]=get_cvar_num("rm_minupdr")

  356.         origrate[id]=get_cvar_num("rm_minrate")

  357.         excl[id]=0

  358.         return PLUGIN_CONTINUE

  359. }

  360.  

  361. public set_servercvars() {

  362.         new tmp[16]

  363.         get_cvar_string("rm_exclmaxupdr", tmp, 15)

  364.         set_cvar_string("sv_maxupdaterate", tmp)

  365.         get_cvar_string("rm_exclminupdr", tmp, 15)

  366.         set_cvar_string("sv_minupdaterate", tmp)

  367.         get_cvar_string("rm_exclmaxrate", tmp, 15)

  368.         set_cvar_string("sv_maxrate", tmp)

  369.         get_cvar_string("rm_exclminrate", tmp, 15)

  370.         set_cvar_string("sv_minrate", tmp)

  371.         if (get_cvar_num("rm_announce"))

  372.                 console_print(0, "* [AMX_RM] Bandwith limits for excluded players have been set")

  373.         return PLUGIN_CONTINUE

  374. }

  375.  

  376. public plugin_init() {

  377.         register_plugin("Rate Manager", "1.2", "Marach")

  378.         register_cvar("rate_manager", "1.2", FCVAR_SERVER)

  379.         register_event("ResetHUD", "alive_again", "be","1=1")

  380.         register_event("DeathMsg","dead_now","a")

  381.         register_cvar("rm_maxupdr", "36")

  382.         register_cvar("rm_minupdr", "12")

  383.         register_cvar("rm_maxrate", "9216")

  384.         register_cvar("rm_minrate", "3072")

  385.         register_cvar("rm_exclmaxupdr", "60")

  386.         register_cvar("rm_exclminupdr", "24")

  387.         register_cvar("rm_exclmaxrate", "15360")

  388.         register_cvar("rm_exclminrate", "6144")

  389.         register_cvar("rm_delay", "20")

  390.         register_cvar("rm_deadratio", "0.4")

  391.         register_cvar("rm_localping", "0")

  392.         register_cvar("rm_announce", "1")

  393.         register_cvar("rm_hello", "1")

  394.         register_srvcmd("rm_ignoreip", "ignore_ip")

  395.         register_srvcmd("rm_ignoresteamid", "ignore_steamid")

  396.         new Float:freq=get_cvar_float("rm_delay")

  397.         if (freq>0.0) {

  398.                 set_task(freq, "check_rr")

  399.                 set_task(5.0, "set_servercvars")

  400.                 }

  401.         return PLUGIN_CONTINUE

  402. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 21:00 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Abban átírtam a cvart!
És megkaptad az második warnodat 5 perc alatt.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Rate manager plugin
HozzászólásElküldve:2012.06.18. 21:03 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Figyelmeztetés például offért, túlzott hülyeségért, káromkodásért.
Ha én adok neked 3-at, akkor ki leszel tiltva.
További offoktól kímélj meg...


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 ]  Oldal12Következő


Ki van itt

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