It is currently 18 Nov 2018 10:59



Forum rules


Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .



This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
 Plugin HPK 
Author Message
Membru, skill +1
Membru, skill +1

Joined: 11 Oct 2014 18:18
Posts: 231
Location: Alba Iulia
Detinator Steam: Da
Detinator server CS: cs.enjoygame.ro
Fond eXtream: 0
Am nevoie de un plugin HPK (high ping kicker) cu comenzi colorate si funtional. Am tot incercat diferite pluginuri de pe net, dar nu merg... Vreau ceva sa mearga pe toti jucatorii indiferent daca e steam on sau off.

Ms :)


17 Sep 2018 23:46
Profile multumesc YIM WWW
Membru, skill 0
Membru, skill 0

Joined: 16 Sep 2018 18:18
Posts: 6
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
diavolu111 wrote:
Am nevoie de un plugin HPK (high ping kicker) cu comenzi colorate si funtional. Am tot incercat diferite pluginuri de pe net, dar nu merg... Vreau ceva sa mearga pe toti jucatorii indiferent daca e steam on sau off.

Ms :)


| Afiseaza codul
Code:
*
            Plugin For ExtreamCs.Com
         Plugin Facut de FireW@ll, original facut de OLO
            
   Puneti in amxx.cfg sau server.cfg urmatoarele cvaruri:
   
   ^ Cvarurile pentru kick:
   * hpk_ping 99
   * hpk_check 10
   * hpk_tests 2
   * hpk_delay 35
   * hpk_mode 1 - kick; 2 - redirect; 3 -ban player

   ^ Redirect cvars:
   * hpk_ip_server "localhost"
   * hpk_port_server "27015"
   
   ^ Ban cvars:
   * hpk_ban_time "2" // in minute
   * hpk_ban_mode "1" // 1- by ip; 2- by steamid
   
   Cvarurile le modificati cum vreti...

   Cei cu imunitate nu vor fi scanati...
   
   
 */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "High Ping Mode"
#define VERSION "0.2"
#define AUTHOR "FireW@ll"

new ipserver, portserver;
new Ping[33], exemple[33], hpk_tests, hpk_delay, hpk_check, hpk_ping, hpk_mode, hpk_ban_minute, hpk_ban_mode;


public plugin_init()
{
   
   register_plugin(PLUGIN,VERSION,AUTHOR);
   
   hpk_ping = register_cvar("hpk_ping","200");
   hpk_check = register_cvar("hpk_check","2");
   hpk_tests = register_cvar("hpk_tests","2");
   hpk_delay = register_cvar("hpk_delay","20");
   hpk_mode = register_cvar("hpk_mode","1");
   
   // redirect cvars
   ipserver = register_cvar("hpk_ip_server","localhost");
   portserver = register_cvar("hpk_port_server","27015");
   
   // ban cvars
   hpk_ban_minute = register_cvar("hpk_ban_time","2");
   hpk_ban_mode = register_cvar("hpk_ban_mode","1");
   check()
}

public check()
{
   
   if(get_pcvar_num(hpk_check) < 5)
      set_pcvar_num(hpk_check, 5)
      
   if(get_pcvar_num(hpk_tests) < 3)
      set_pcvar_num(hpk_tests, 3)
}

public client_disconnect(id)
   remove_task(id)


public client_putinserver(id)
{   
   Ping[id] = 0
   exemple[id] = 0

   if(!is_user_bot(id))
   {
      new param[1]
      param[0] = id
      set_task(12.0, "mesaj", id, param, 1)
   
      if(get_pcvar_num(hpk_tests) != 0)
      {
         set_task(float(get_pcvar_num(hpk_delay)), "taskSetting", id, param , 1)
      }
      else
      {      
         set_task(float(get_pcvar_num(hpk_tests)), "checkPing", id, param, 1, "b")
      }
   }
}

public mesaj(param[])
   ColorChat(param[0], GREEN, "[CS]^x03 Cei cu lagul peste %d vor primi^x04 kick", get_pcvar_num(hpk_ping))


   
public taskSetting(param[])
{
   static name[32];
   get_user_name(param[0], name, 31)
   set_task(float(get_pcvar_num(hpk_tests)), "checkPing", param[0], param, 1, "b")
}


public checkPing(param[])
{
   new id = param[0]
   
   if(get_user_flags(id) & ADMIN_IMMUNITY)
   {
      ColorChat(id, GREEN, "[CS]^x03 Nu vei fi scanat de lag.", id, "IMMUNITY");
      remove_task(id);
      return 0;
   }
   
   static ip[32], p, l;
   
   get_user_ip(id, ip, 31);
   get_user_ping(id ,p ,l );
   
   Ping[id] += p
   
   ++exemple[id]
   if((exemple[id] > get_pcvar_num(hpk_tests)) && (Ping[id] / exemple[id] > get_pcvar_num(hpk_ping)))
   
   switch(get_pcvar_num(hpk_mode))
   {
      case 1:   kickPlayer(id);
      case 2:   RedirectPlayer(id);
      case 3: BanPlayer(id);
         
   }
   return 0;
}


kickPlayer(id)
{
   static name[32], ip[32];
   
   new userid = get_user_userid(id);
   
   get_user_name(id, name, 31);
   get_user_ip(id, ip, 31);
   
   ColorChat(0, GREEN, "[CS]^x03 Userul^x04 %s^x03 a primit kick pentru lag excesiv.", name, ip);
   
   server_cmd("kick #%d", userid);
   
   log_amx("%L", 0, "LOG_KICK", name, get_user_userid(id), ip, (Ping[id] / exemple[id]));
}


RedirectPlayer(id)
{
   static name[32], ip[32], ip_[64], port_[64];
   
   new userid = get_user_userid(id);
   
   get_user_name(id, name, 31);
   get_user_ip(id, ip, 31);
   
   get_pcvar_string(ipserver, ip_, 63);
   get_pcvar_string(portserver, port_, 63);
   
   client_print(0, print_chat,"%L", LANG_PLAYER, "REDIRECTPLAYER" ,name, ip,  (Ping[id] / exemple[id]), get_pcvar_num(hpk_ping), ip_, port_)
   
   client_cmd(id,"connect %s:%s",ip_, port_)
   
   log_amx("%L", 0,"LOG_REDIRECT", name, userid, ip, (Ping[id] / exemple[id]), ip_, port_)
}

BanPlayer(id)
{
   static ip[32], name[32], steamid[32];
   
   new userid = get_user_userid(id);
   new minute = get_pcvar_num(hpk_ban_minute);
   
   get_user_name(id, name, 31)
   get_user_ip(id, ip, 31);
   get_user_authid(id, steamid, 31);
   
   client_print(0, print_chat,"%L", LANG_PLAYER,"BANPLAYER", name, ip, (Ping[id] / exemple[id]), get_pcvar_num(hpk_ping), minute);
   
   switch(get_pcvar_num(hpk_ban_mode))
   {
      case 1:   server_cmd("kick #%d addip ^"%s^" ^"%s^";wait;writeip", userid, minute, ip)
      case 2:   server_cmd("kick #%d banid ^"%s^" ^"%s^";wait;writeid", userid, minute,  steamid)
   }
   log_amx("%L", 0,"LOG_BAN", name, userid, ip, (Ping[id] / exemple[id]))
}

/************************************** End Of Plugin **********************************************/


sursa: https://www.extreamcs.com/forum/cereri-pluginuri/cerere-plugin-hpk-colorat-t179341.html


18 Sep 2018 00:59
Profile multumesc WWW
Membru, skill +1
Membru, skill +1

Joined: 11 Oct 2014 18:18
Posts: 231
Location: Alba Iulia
Detinator Steam: Da
Detinator server CS: cs.enjoygame.ro
Fond eXtream: 0
Aveti careva versiune 0.5?

edit: se poate da tc, o sa fac o cerere la editare pluginuri


18 Sep 2018 01:09
Profile multumesc YIM WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 71 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

În cazul în care aveți probleme cu contul trimiteți un email sau mesaj la servicii_extream[arond]yahoo[punct]com

Powered by phpBB® Forum Software © phpBB Group