pingfaker

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
MarveLL
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 21 Jun 2009, 20:19
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 3 times

17 Dec 2009, 16:14

salut
am si io un server de cs
amxmodx 1.8.1
- la care am adaugat si pluginul pingfaker. merge , totul e bine si frumos , dar lagul fals care l-am setat ramane acelasi.(daca pun lag 1 , doar 1 arata)
acu cateva luni , inainte sa-mi reinstalez windosul am folosit aces plugin , dar atunci lagul oscila (era 18 - 20 -15 - 17 -18) , si asta e problema ... cum sa fac ca sa-mi oscileze
ms
Kekshost
User avatar
H3adShoT
Membru, skill +3
Membru, skill +3
Posts: 1254
Joined: 03 May 2009, 19:19
Detinator Steam: Da
CS Status: Nu mai incercati sa-mi furati contul!
Detinator server CS: Nimic
SteamID: PM
Reputatie: Restrictie moderator
Location: Hunedoara
Has thanked: 47 times
Been thanked: 92 times
Contact:

17 Dec 2009, 16:30

spunemi intre ce valori vrei sa arate
Retras din activitate.
MarveLL
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 21 Jun 2009, 20:19
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 3 times

17 Dec 2009, 16:33

15 - 20
+ si sa nu mai deschid alt topic ... o intrebare ! se poate face 2 sau mai multe pluginuri intrunul ? ... adica sa nu fie asa multe pluginuri sa faca lag ... sa pui 3 pluginuir in unu :)
User avatar
FouNd
Membru, skill +3
Membru, skill +3
Posts: 1311
Joined: 22 Aug 2008, 16:32
Detinator Steam: Da
CS Status: Ferea!!!!!!!!!
SteamID: xxlbastard
Reputatie: Fost moderator
Fost detinator HNS.eXtreamCS.com
Has thanked: 14 times
Been thanked: 51 times
Contact:

17 Dec 2009, 19:38

MarveLL wrote:15 - 20
+ si sa nu mai deschid alt topic ... o intrebare ! se poate face 2 sau mai multe pluginuri intrunul ? ... adica sa nu fie asa multe pluginuri sa faca lag ... sa pui 3 pluginuir in unu :)
da se poate :)
Image Multumeste-mi cand te ajut daca vrei sa-ti multumesc cand ma vei ajuta Image
Un blog din care ai ce sa inveti,INFORMEAZA-TE http://roinfo.wordpress.com/
Pe usa scria clar "femei" si cand am intrat,culmea numai WC-uri.
User avatar
VINTYLA #
Membru, skill +4
Membru, skill +4
Posts: 1548
Joined: 05 Apr 2009, 00:48
Detinator Steam: Da
CS Status: Do more !
Detinator server CS: CS.EXTREAM.RO
SteamID: VINTILA23
Location: Craiova !
Has thanked: 114 times
Been thanked: 87 times

19 Dec 2009, 00:36

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new const FAKEPINGS_FILE[] = "fakepings.ini"
const TASK_ARGUMENTS = 100

new cvar_enable, cvar_ping, cvar_flux, cvar_target, cvar_flags, cvar_bots, cvar_multiplier
new g_enable, g_ping, g_flux, g_target, g_flags, g_bots, Float:g_multiplier, g_maxplayers
new g_connected[33], g_isbot[33], g_offset[33][2], g_argping[33][3], g_hasflags[33]
new g_loaded_counter, cvar_showactivity, g_pingoverride[33] = { -1, ... }
new Array:g_loaded_authid, Array:g_loaded_ping

public plugin_init()
{
   register_plugin("Ping Faker", "1.4", "MeRcyLeZZ")
   
   cvar_enable = register_cvar("pingfake_enable", "1")
   cvar_ping = register_cvar("pingfake_ping", "20")
   cvar_flux = register_cvar("pingfake_flux", "15")
   cvar_target = register_cvar("pingfake_target", "1")
   cvar_flags = register_cvar("pingfake_flags", "")
   cvar_bots = register_cvar("pingfake_bots", "0")
   cvar_multiplier = register_cvar("pingfake_multiplier", "0.0")
   cvar_showactivity = get_cvar_pointer("amx_show_activity")
   
   g_maxplayers = get_maxplayers()
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_UpdateClientData, "fw_UpdateClientData")
   
   register_concmd("amx_fakeping", "cmd_fakeping", ADMIN_KICK, "<target> <ping> - Toggle fake ping override on player (-1 to disable)")
   
   g_loaded_authid = ArrayCreate(32, 1)
   g_loaded_ping = ArrayCreate(1, 1)
   
   load_pings_from_file()
}

public plugin_cfg()
{
   // Cache CVARs after configs are loaded
   set_task(0.5, "event_round_start")
}

public event_round_start()
{
   // Cache CVAR values
   g_ping = get_pcvar_num(cvar_ping)
   g_flux = abs(get_pcvar_num(cvar_flux))
   g_target = get_pcvar_num(cvar_target)
   g_enable = get_pcvar_num(cvar_enable)
   g_bots = get_pcvar_num(cvar_bots)
   g_multiplier = get_pcvar_float(cvar_multiplier)
   
   // Calculate weird argument values based on target ping
   calculate_arguments()
   
   // Calculate them regularly if also faking ping fluctuations or if faking a multiple of the real ping
   remove_task(TASK_ARGUMENTS)
   if (g_flux || g_multiplier > 0.0) set_task(2.0, "calculate_arguments", TASK_ARGUMENTS, _, _, "b")
   
   // Cache flags
   new flags[6]
   get_pcvar_string(cvar_flags, flags, sizeof flags - 1)
   g_flags = read_flags(flags)
   
   // Check flags again for all players
   for (new id = 1; id <= g_maxplayers; id++)
      if (g_connected[id]) check_flags(id)
}

public client_authorized(id)
{
   check_for_loaded_pings(id)
   check_flags(id)
}

public client_infochanged(id)
{
   check_flags(id)
}

public client_putinserver(id)
{
   g_connected[id] = true
   if (is_user_bot(id)) g_isbot[id] = true
}

public client_disconnect(id)
{
   g_connected[id] = false
   g_isbot[id] = false
   g_pingoverride[id] = -1
   g_hasflags[id] = 0
}

public fw_UpdateClientData(id)
{
   // Ping faking disabled?
   if (!g_enable) return;
   
   // Scoreboard key being pressed?
   if (!(pev(id, pev_button) & IN_SCORE) && !(pev(id, pev_oldbuttons) & IN_SCORE))
      return;
   
   // Send fake player's pings
   static player, sending
   sending = 0
   for (player = 1; player <= g_maxplayers; player++)
   {
      // Player not in game?
      if (!g_connected[player])
          continue;
      
      // Fake latency for its target too?
      if (!g_target && id == player)
         continue;
      
      // Only do these checks if not overriding ping for player
      if (g_pingoverride[player] < 0)
      {
         // Is this a bot?
         if (g_isbot[player])
         {
            // Bots setting disabled?
            if (!g_bots) continue;
         }
         else
         {
            // Bots only setting?
            if (g_bots == 2) continue;
            
            // Need to have specific flags?
            if (g_flags && !(g_hasflags[player]))
               continue;
         }
      }
      
      // Send message with the weird arguments
      switch (sending)
      {
         case 0:
         {
            // Start a new message
            message_begin(MSG_ONE_UNRELIABLE, SVC_PINGS, _, id)
            write_byte((g_offset[player][0] * 64) + (1 + 2 * (player - 1)))
            write_short(g_argping[player][0])
            sending++
         }
         case 1:
         {
            // Append additional data
            write_byte((g_offset[player][1] * 128) + (2 + 4 * (player - 1)))
            write_short(g_argping[player][1])
            sending++
         }
         case 2:
         {
            // Append additional data and end message
            write_byte((4 + 8 * (player - 1)))
            write_short(g_argping[player][2])
            write_byte(0)
            message_end()
            sending = 0
         }
      }
   }
   
   // End message if not yet sent
   if (sending)
   {
      write_byte(0)
      message_end()
   }
}

public cmd_fakeping(id, level, cid)
{
   // Check for access flag
   if (!cmd_access(id, level, cid, 3))
      return PLUGIN_HANDLED;
   
   // Retrieve arguments
   static arg[32], player, ping
   read_argv(1, arg, sizeof arg - 1)
   player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF)
   read_argv(2, arg, sizeof arg - 1)
   ping = str_to_num(arg)
   
   // Invalid target
   if (!player) return PLUGIN_HANDLED;
   
   // Update ping overrides for player
   g_pingoverride[player] = min(ping, 4095)
   calculate_arguments()
   
   // Get player's name for displaying/logging activity
   static name1[32], name2[32]
   get_user_name(id, name1, sizeof name1 - 1)
   get_user_name(player, name2, sizeof name2 - 1)
   
   // Negative value means disable fakeping
   if (ping < 0)
   {
      // Show activity?
      switch (get_pcvar_num(cvar_showactivity))
      {
         case 1: client_print(0, print_chat, "ADMIN - fake ping override disabled on %s", name2)
         case 2: client_print(0, print_chat, "ADMIN %s - fake ping override disabled on %s", name1, name2)
      }
      
      // Log activity
      static logdata[100], authid[32], ip[16]
      get_user_authid(id, authid, sizeof authid - 1)
      get_user_ip(id, ip, sizeof ip - 1, 1)
      formatex(logdata, sizeof logdata - 1, "ADMIN %s <%s><%s> - fake ping override disabled on %s", name1, authid, ip, name2)
      log_amx(logdata)
   }
   else
   {
      // Show activity?
      switch (get_pcvar_num(cvar_showactivity))
      {
         case 1: client_print(0, print_chat, "ADMIN - fake ping override of %d enabled on %s", ping, name2)
         case 2: client_print(0, print_chat, "ADMIN %s - fake ping override of %d enabled on %s", name1, ping, name2)
      }
      
      // Log activity
      static logdata[100], authid[32], ip[16]
      get_user_authid(id, authid, sizeof authid - 1)
      get_user_ip(id, ip, sizeof ip - 1, 1)
      formatex(logdata, sizeof logdata - 1, "ADMIN %s <%s><%s> - fake ping override of %d enabled on %s", name1, authid, ip, ping, name2)
      log_amx(logdata)
   }
   
   return PLUGIN_HANDLED;
}

public calculate_arguments()
{
   static player, ping, loss
   for (player = 1; player <= g_maxplayers; player++)
   {
      // Calculate target ping (clamp if out of bounds)
      if (g_pingoverride[player] < 0)
      {
         if (g_multiplier > 0.0)
         {
            get_user_ping(player, ping, loss)
            ping = clamp(floatround(ping * g_multiplier), 0, 4095)
         }
         else
            ping = clamp(g_ping + random_num(-g_flux, g_flux), 0, 4095)
      }
      else
         ping = g_pingoverride[player]
      
      // First argument's ping
      for (g_offset[player][0] = 0; g_offset[player][0] < 4; g_offset[player][0]++)
      {
         if ((ping - g_offset[player][0]) % 4 == 0)
         {
            g_argping[player][0] = (ping - g_offset[player][0]) / 4
            break;
         }
      }
      // Second argument's ping
      for (g_offset[player][1] = 0; g_offset[player][1] < 2; g_offset[player][1]++)
      {
         if ((ping - g_offset[player][1]) % 2 == 0)
         {
            g_argping[player][1] = (ping - g_offset[player][1]) / 2
            break;
         }
      }
      // Third argument's ping
      g_argping[player][2] = ping
   }
}

load_pings_from_file()
{
   // Build file path
   new path[64]
   get_configsdir(path, sizeof path - 1)
   format(path, sizeof path - 1, "%s/%s", path, FAKEPINGS_FILE)
   
   // File not present, skip loading
   if (!file_exists(path)) return;
   
   // Open file for reading
   new linedata[40], authid[32], ping[8], file = fopen(path, "rt")
   
   while (file && !feof(file))
   {
      // Read one line at a time
      fgets(file, linedata, sizeof linedata - 1)
      
      // Replace newlines with a null character to prevent headaches
      replace(linedata, sizeof linedata - 1, "^n", "")
      
      // Blank line or comment
      if (!linedata[0] || linedata[0] == ';') continue;
      
      // Get authid and ping
      strbreak(linedata, authid, sizeof authid - 1, ping, sizeof ping -1)
      remove_quotes(ping)
      
      // Store data into global arrays
      ArrayPushString(g_loaded_authid, authid)
      ArrayPushCell(g_loaded_ping, clamp(str_to_num(ping), 0, 4095))
      
      // Increase loaded data counter
      g_loaded_counter++
   }
   if (file) fclose(file)
}

check_for_loaded_pings(id)
{
   // Nothing to check for
   if (g_loaded_counter <= 0) return;
   
   // Get steamid and ip
   static authid[32], ip[16], i, buffer[32]
   get_user_authid(id, authid, sizeof authid - 1)
   get_user_ip(id, ip, sizeof ip - 1, 1)
   
   for (i = 0; i < g_loaded_counter; i++)
   {
      // Retrieve authid
      ArrayGetString(g_loaded_authid, i, buffer, sizeof buffer - 1)
      
      // Compare it with this player's steamid and ip
      if (equali(buffer, authid) || equal(buffer, ip))
      {
         // We've got a match!
         g_pingoverride[id] = ArrayGetCell(g_loaded_ping, i)
         calculate_arguments()
         break;
      }
   }
}

check_flags(id)
{
   g_hasflags[id] = get_user_flags(id) & g_flags
}
Ping intre 15 si 20!
STIINTA NU MOARE !
User avatar
H3adShoT
Membru, skill +3
Membru, skill +3
Posts: 1254
Joined: 03 May 2009, 19:19
Detinator Steam: Da
CS Status: Nu mai incercati sa-mi furati contul!
Detinator server CS: Nimic
SteamID: PM
Reputatie: Restrictie moderator
Location: Hunedoara
Has thanked: 47 times
Been thanked: 92 times
Contact:

19 Dec 2009, 02:00

MarveLL wrote:15 - 20
+ si sa nu mai deschid alt topic ... o intrebare ! se poate face 2 sau mai multe pluginuri intrunul ? ... adica sa nu fie asa multe pluginuri sa faca lag ... sa pui 3 pluginuir in unu :)
posteaza ce pluginuri vrei sa le combin
si vintyla ce ai pus tu arata lag fals intre 5-35
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new const FAKEPINGS_FILE[] = "fakepings.ini"
const TASK_ARGUMENTS = 100

new cvar_enable, cvar_ping, cvar_flux, cvar_target, cvar_flags, cvar_bots, cvar_multiplier
new g_enable, g_ping, g_flux, g_target, g_flags, g_bots, Float:g_multiplier, g_maxplayers
new g_connected[33], g_isbot[33], g_offset[33][2], g_argping[33][3], g_hasflags[33]
new g_loaded_counter, cvar_showactivity, g_pingoverride[33] = { -1, ... }
new Array:g_loaded_authid, Array:g_loaded_ping

public plugin_init()
{
   register_plugin("Ping Faker", "1.4", "MeRcyLeZZ")
   
   cvar_enable = register_cvar("pingfake_enable", "1")
   cvar_ping = register_cvar("pingfake_ping", "17")
   cvar_flux = register_cvar("pingfake_flux", "3")
   cvar_target = register_cvar("pingfake_target", "1")
   cvar_flags = register_cvar("pingfake_flags", "")
   cvar_bots = register_cvar("pingfake_bots", "0")
   cvar_multiplier = register_cvar("pingfake_multiplier", "0.0")
   cvar_showactivity = get_cvar_pointer("amx_show_activity")
   
   g_maxplayers = get_maxplayers()
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_UpdateClientData, "fw_UpdateClientData")
   
   register_concmd("amx_fakeping", "cmd_fakeping", ADMIN_KICK, "<target> <ping> - Toggle fake ping override on player (-1 to disable)")
   
   g_loaded_authid = ArrayCreate(32, 1)
   g_loaded_ping = ArrayCreate(1, 1)
   
   load_pings_from_file()
}

public plugin_cfg()
{
   // Cache CVARs after configs are loaded
   set_task(0.5, "event_round_start")
}

public event_round_start()
{
   // Cache CVAR values
   g_ping = get_pcvar_num(cvar_ping)
   g_flux = abs(get_pcvar_num(cvar_flux))
   g_target = get_pcvar_num(cvar_target)
   g_enable = get_pcvar_num(cvar_enable)
   g_bots = get_pcvar_num(cvar_bots)
   g_multiplier = get_pcvar_float(cvar_multiplier)
   
   // Calculate weird argument values based on target ping
   calculate_arguments()
   
   // Calculate them regularly if also faking ping fluctuations or if faking a multiple of the real ping
   remove_task(TASK_ARGUMENTS)
   if (g_flux || g_multiplier > 0.0) set_task(2.0, "calculate_arguments", TASK_ARGUMENTS, _, _, "b")
   
   // Cache flags
   new flags[6]
   get_pcvar_string(cvar_flags, flags, sizeof flags - 1)
   g_flags = read_flags(flags)
   
   // Check flags again for all players
   for (new id = 1; id <= g_maxplayers; id++)
      if (g_connected[id]) check_flags(id)
}

public client_authorized(id)
{
   check_for_loaded_pings(id)
   check_flags(id)
}

public client_infochanged(id)
{
   check_flags(id)
}

public client_putinserver(id)
{
   g_connected[id] = true
   if (is_user_bot(id)) g_isbot[id] = true
}

public client_disconnect(id)
{
   g_connected[id] = false
   g_isbot[id] = false
   g_pingoverride[id] = -1
   g_hasflags[id] = 0
}

public fw_UpdateClientData(id)
{
   // Ping faking disabled?
   if (!g_enable) return;
   
   // Scoreboard key being pressed?
   if (!(pev(id, pev_button) & IN_SCORE) && !(pev(id, pev_oldbuttons) & IN_SCORE))
      return;
   
   // Send fake player's pings
   static player, sending
   sending = 0
   for (player = 1; player <= g_maxplayers; player++)
   {
      // Player not in game?
      if (!g_connected[player])
          continue;
      
      // Fake latency for its target too?
      if (!g_target && id == player)
         continue;
      
      // Only do these checks if not overriding ping for player
      if (g_pingoverride[player] < 0)
      {
         // Is this a bot?
         if (g_isbot[player])
         {
            // Bots setting disabled?
            if (!g_bots) continue;
         }
         else
         {
            // Bots only setting?
            if (g_bots == 2) continue;
            
            // Need to have specific flags?
            if (g_flags && !(g_hasflags[player]))
               continue;
         }
      }
      
      // Send message with the weird arguments
      switch (sending)
      {
         case 0:
         {
            // Start a new message
            message_begin(MSG_ONE_UNRELIABLE, SVC_PINGS, _, id)
            write_byte((g_offset[player][0] * 64) + (1 + 2 * (player - 1)))
            write_short(g_argping[player][0])
            sending++
         }
         case 1:
         {
            // Append additional data
            write_byte((g_offset[player][1] * 128) + (2 + 4 * (player - 1)))
            write_short(g_argping[player][1])
            sending++
         }
         case 2:
         {
            // Append additional data and end message
            write_byte((4 + 8 * (player - 1)))
            write_short(g_argping[player][2])
            write_byte(0)
            message_end()
            sending = 0
         }
      }
   }
   
   // End message if not yet sent
   if (sending)
   {
      write_byte(0)
      message_end()
   }
}

public cmd_fakeping(id, level, cid)
{
   // Check for access flag
   if (!cmd_access(id, level, cid, 3))
      return PLUGIN_HANDLED;
   
   // Retrieve arguments
   static arg[32], player, ping
   read_argv(1, arg, sizeof arg - 1)
   player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF)
   read_argv(2, arg, sizeof arg - 1)
   ping = str_to_num(arg)
   
   // Invalid target
   if (!player) return PLUGIN_HANDLED;
   
   // Update ping overrides for player
   g_pingoverride[player] = min(ping, 4095)
   calculate_arguments()
   
   // Get player's name for displaying/logging activity
   static name1[32], name2[32]
   get_user_name(id, name1, sizeof name1 - 1)
   get_user_name(player, name2, sizeof name2 - 1)
   
   // Negative value means disable fakeping
   if (ping < 0)
   {
      // Show activity?
      switch (get_pcvar_num(cvar_showactivity))
      {
         case 1: client_print(0, print_chat, "ADMIN - fake ping override disabled on %s", name2)
         case 2: client_print(0, print_chat, "ADMIN %s - fake ping override disabled on %s", name1, name2)
      }
      
      // Log activity
      static logdata[100], authid[32], ip[16]
      get_user_authid(id, authid, sizeof authid - 1)
      get_user_ip(id, ip, sizeof ip - 1, 1)
      formatex(logdata, sizeof logdata - 1, "ADMIN %s <%s><%s> - fake ping override disabled on %s", name1, authid, ip, name2)
      log_amx(logdata)
   }
   else
   {
      // Show activity?
      switch (get_pcvar_num(cvar_showactivity))
      {
         case 1: client_print(0, print_chat, "ADMIN - fake ping override of %d enabled on %s", ping, name2)
         case 2: client_print(0, print_chat, "ADMIN %s - fake ping override of %d enabled on %s", name1, ping, name2)
      }
      
      // Log activity
      static logdata[100], authid[32], ip[16]
      get_user_authid(id, authid, sizeof authid - 1)
      get_user_ip(id, ip, sizeof ip - 1, 1)
      formatex(logdata, sizeof logdata - 1, "ADMIN %s <%s><%s> - fake ping override of %d enabled on %s", name1, authid, ip, ping, name2)
      log_amx(logdata)
   }
   
   return PLUGIN_HANDLED;
}

public calculate_arguments()
{
   static player, ping, loss
   for (player = 1; player <= g_maxplayers; player++)
   {
      // Calculate target ping (clamp if out of bounds)
      if (g_pingoverride[player] < 0)
      {
         if (g_multiplier > 0.0)
         {
            get_user_ping(player, ping, loss)
            ping = clamp(floatround(ping * g_multiplier), 0, 4095)
         }
         else
            ping = clamp(g_ping + random_num(-g_flux, g_flux), 0, 4095)
      }
      else
         ping = g_pingoverride[player]
      
      // First argument's ping
      for (g_offset[player][0] = 0; g_offset[player][0] < 4; g_offset[player][0]++)
      {
         if ((ping - g_offset[player][0]) % 4 == 0)
         {
            g_argping[player][0] = (ping - g_offset[player][0]) / 4
            break;
         }
      }
      // Second argument's ping
      for (g_offset[player][1] = 0; g_offset[player][1] < 2; g_offset[player][1]++)
      {
         if ((ping - g_offset[player][1]) % 2 == 0)
         {
            g_argping[player][1] = (ping - g_offset[player][1]) / 2
            break;
         }
      }
      // Third argument's ping
      g_argping[player][2] = ping
   }
}

load_pings_from_file()
{
   // Build file path
   new path[64]
   get_configsdir(path, sizeof path - 1)
   format(path, sizeof path - 1, "%s/%s", path, FAKEPINGS_FILE)
   
   // File not present, skip loading
   if (!file_exists(path)) return;
   
   // Open file for reading
   new linedata[40], authid[32], ping[8], file = fopen(path, "rt")
   
   while (file && !feof(file))
   {
      // Read one line at a time
      fgets(file, linedata, sizeof linedata - 1)
      
      // Replace newlines with a null character to prevent headaches
      replace(linedata, sizeof linedata - 1, "^n", "")
      
      // Blank line or comment
      if (!linedata[0] || linedata[0] == ';') continue;
      
      // Get authid and ping
      strbreak(linedata, authid, sizeof authid - 1, ping, sizeof ping -1)
      remove_quotes(ping)
      
      // Store data into global arrays
      ArrayPushString(g_loaded_authid, authid)
      ArrayPushCell(g_loaded_ping, clamp(str_to_num(ping), 0, 4095))
      
      // Increase loaded data counter
      g_loaded_counter++
   }
   if (file) fclose(file)
}

check_for_loaded_pings(id)
{
   // Nothing to check for
   if (g_loaded_counter <= 0) return;
   
   // Get steamid and ip
   static authid[32], ip[16], i, buffer[32]
   get_user_authid(id, authid, sizeof authid - 1)
   get_user_ip(id, ip, sizeof ip - 1, 1)
   
   for (i = 0; i < g_loaded_counter; i++)
   {
      // Retrieve authid
      ArrayGetString(g_loaded_authid, i, buffer, sizeof buffer - 1)
      
      // Compare it with this player's steamid and ip
      if (equali(buffer, authid) || equal(buffer, ip))
      {
         // We've got a match!
         g_pingoverride[id] = ArrayGetCell(g_loaded_ping, i)
         calculate_arguments()
         break;
      }
   }
}

check_flags(id)
{
   g_hasflags[id] = get_user_flags(id) & g_flags
}
ti-am pus intre 14-20 deoarece intre 15-20 nu se poate
Retras din activitate.
MarveLL
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 21 Jun 2009, 20:19
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 3 times

19 Dec 2009, 09:59

amx_who (idiferent cate rankuri sunt) cu amx_showip si join_ip
User avatar
VINTYLA #
Membru, skill +4
Membru, skill +4
Posts: 1548
Joined: 05 Apr 2009, 00:48
Detinator Steam: Da
CS Status: Do more !
Detinator server CS: CS.EXTREAM.RO
SteamID: VINTILA23
Location: Craiova !
Has thanked: 114 times
Been thanked: 87 times

19 Dec 2009, 11:57

Credeam ca trb modificate astea 2 pentru lag!

Code: Select all

 cvar_ping = register_cvar("pingfake_ping", "20")
   cvar_flux = register_cvar("pingfake_flux", "15")
Nu prea le am...incercam doar sa ajut! :D
STIINTA NU MOARE !
User avatar
H3adShoT
Membru, skill +3
Membru, skill +3
Posts: 1254
Joined: 03 May 2009, 19:19
Detinator Steam: Da
CS Status: Nu mai incercati sa-mi furati contul!
Detinator server CS: Nimic
SteamID: PM
Reputatie: Restrictie moderator
Location: Hunedoara
Has thanked: 47 times
Been thanked: 92 times
Contact:

19 Dec 2009, 13:58

vintyla wrote:Credeam ca trb modificate astea 2 pentru lag!

Code: Select all

 cvar_ping = register_cvar("pingfake_ping", "20")
   cvar_flux = register_cvar("pingfake_flux", "15")
Nu prea le am...incercam doar sa ajut! :D
da acealea 2
dar sti cum se calculeaza intre ce valori sa arate lag fals ?
aduni si scazi cele 2 valori si tu cum ai 20 si 15 vine 20-15=5 si 20+15=35 deci arata lag fals intre 5-35
MarveLL wrote:amx_who (idiferent cate rankuri sunt) cu amx_showip si join_ip
posteaza sma-urile
Retras din activitate.
MarveLL
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 21 Jun 2009, 20:19
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 3 times

19 Dec 2009, 14:48

Code: Select all

#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
	register_plugin("Showip", "1.0", "Unknown & mut2nt")
	register_clcmd("amx_showip", "cmdshowip", -1)
}

public cmdshowip(id)
{
	static name[64], buffor[3000]
	new players[32], num
	new userip[16], temp[150]
	get_players(players,num)

	client_print(id,print_console,"Ip-urile celor de pe server sunt:")

	for(new i = 0; i < num; ++i) 
	{
		temp=""
		get_user_ip(players[i],userip,16,1)
		get_user_name(players[i],name,64)

		if (strlen(name)>20) 
		{
			copy(name,17,name)
			add(name,64,"...")
		}

		new IPD[32]
		findip(userip,IPD)
		format(temp,150,"%-25.24s %-16.15s",name,userip)
		add(buffor,3000,temp)
		client_print(id,print_console,"%-32.31s %-16.15s",name,userip)
	}
	return PLUGIN_HANDLED
}

public findip(sip[16],sdesc[32])
{
	new ipsubnet[16], RValue=0, uip[16], ippart1[12], ippart2[12], ippart3[12], ippart4[12]

	copy(uip, 16, sip) 
	while(replace(uip, 16, ".", " ")){}
	parse(uip, ippart1,12,ippart2,12,ippart3,12,ippart4,12) 
	ipsubnet=""
	add(ipsubnet,16,ippart1)
	add(ipsubnet,16,".")
	add(ipsubnet,16,ippart2)
	add(ipsubnet,16,".")
	add(ipsubnet,16,ippart3)

	return RValue
}

Code: Select all

#include <amxmodx>
#include <amxmisc>

#define MAX_GROUPS 5

new g_groupNames[MAX_GROUPS][] = {
"Leu",
"Tigru",
"Leopard",
"Motan",
"Hamster"
}

new g_groupFlags[MAX_GROUPS][] = {
"abcdefghijklmnopqrstu",
"abcdefhijklmnopqrstu",
"abcdefijnop",
"abcdefijno",
"b"
}

new g_groupFlagsValue[MAX_GROUPS]

public plugin_init() {
register_plugin("amx_who Like AdminMod", "1.2", "ScaRba")
register_concmd("amx_who", "cmdWho", 0)
for(new i = 0; i < MAX_GROUPS; i++) {
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
}
}

public cmdWho(id) {
new players[32], inum, player, name[32], i, a
get_players(players, inum)
console_print(id, "Addons creat de Gyuky www.eXtreamCS.com")
for(i = 0; i < MAX_GROUPS; i++) {
console_print(id, "----- [%d]%s -----", i+1, g_groupNames[i])
for(a = 0; a < inum; ++a) {
player = players[a]
get_user_name(player, name, 31)
if(get_user_flags(player) == g_groupFlagsValue[i]) {
console_print(id, "%s", name)
}
}
}
console_print(id, "Addons creat de Gyuky www.eXtreamCS.com")
return PLUGIN_HANDLED


}

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <geoip>
#define MAXPLAYER 32

enum Color
{
	YELLOW = 1, // Yellow
	GREEN, // Green Color
	TEAM_COLOR, // Red, grey, blue
	GREY, // grey
	RED, // Red
	BLUE, // Blue
}

new TeamInfo;
new SayText;
new MaxSlots;

new TERRORIST[] = "TERRORIST";
new CT[] = "CT";
new NOTHING[] = "";
new SPEC[] = "SPECTATOR";

new bool:IsConnected[MAXPLAYER + 1];

new g_szSoundFile[] = "buttons/blip1.wav";

public plugin_init()
{
	register_plugin("Join notice color", "1.0", "kp_uparrow");

	register_cvar("amx_joinmsg", "1") //1=connected only,2=connecting + connected,3=connecting connected disconnected

	TeamInfo = get_user_msgid("TeamInfo");
	SayText = get_user_msgid("SayText");
	MaxSlots = get_maxplayers();
}
public plugin_precache()
{
	precache_sound(g_szSoundFile);
}
public client_putinserver(player)
{
	IsConnected[player] = true;
	if(get_cvar_num("amx_joinmsg") >= 1) {
	new authid[35],user[32],ip[32],Country[33]
	get_user_name(player,user,31)
	get_user_ip(player,ip,31,1)
	get_user_authid(player,authid,34)
	geoip_country(ip,Country)

	ColorChat(0, RED, "^x04%s ^x01(^x03%s^x01) (^x03%s^x01) a intrat (^x03%s^x01).",user,ip,authid,Country);
	client_cmd(0,"hud_saytext_time 8")
	client_cmd(0,"hud_deathnotice_time 8") //lol just my own remove if needed
	client_cmd(0, "spk %s", g_szSoundFile)
	}
}

public client_disconnect(player)
{
	if(get_cvar_num("amx_joinmsg") >= 3) {
	IsConnected[player] = false;
	new authid[35],user[32],ip[32],Country[33]
	get_user_name(player,user,31)
	get_user_ip(player,ip,31,1)
	get_user_authid(player,authid,34)
	geoip_country(ip,Country)

	ColorChat(0, RED, "^x04%s ^x01(^x03%s^x01) (^x03%s^x01) a iesit (^x03%s^x01).",user,ip,authid,Country);
	}
}
public client_authorized(player)
{
	IsConnected[player] = false;
	if(get_cvar_num("amx_joinmsg") >= 2) {
	new authid[35],user[32],ip[32],Country[33]
	get_user_name(player,user,31)
	get_user_ip(player,ip,31,1)
	get_user_authid(player,authid,34)
	geoip_country(ip,Country)

	ColorChat(0, RED, "^x04%s ^x01(^x03%s^x01) (^x03%s^x01) se conecteaza (^x03%s^x01).",user,ip,authid,Country);
	}
}


public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	static message[256];

	switch(type)
	{
		case YELLOW: // Yellow
		{
			message[0] = 0x01;
		}
		case GREEN: // Green
		{
			message[0] = 0x04;
		}
		default: // White, Red, Blue
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	// Make sure message is not longer than 192 character. Will crash the server.
	message[192] = '^0';

	new team, did;

	if(id && IsConnected[id])
	{
		team = get_user_team(id);

		did = color_selection(id, type);
		show_message(id, id, MSG_ONE, message);

		if(did)
		{
			TeamSelection(id, team);
		}
	} else {
		new index = FindPlayer();

		if(index != -1)
		{
			team = get_user_team(index);

			did = color_selection(index, type);
			show_message(index, 0, MSG_ALL, message);

			if(did)
			{
				TeamSelection(index, team);
			}
		}
	}
}

show_message(id, index, type, message[])
{
	message_begin(type, SayText, {0, 0, 0}, index);
	write_byte(id);
	write_string(message);
	message_end();
}

Team_Info(id, team[])
{
	message_begin(MSG_ALL, TeamInfo);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

color_selection(index, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, TERRORIST);
		}
		case BLUE:
		{
			return Team_Info(index, CT);
		}
		case GREY:
		{
			return Team_Info(index, NOTHING);
		}
	}

	return 0;
}

TeamSelection(index, team)
{
	switch(team)
	{
		case 0:
		{
			Team_Info(index, NOTHING);
		}
		case 1:
		{
			Team_Info(index, TERRORIST);
		}
		case 2:
		{
			Team_Info(index, CT);
		}
		case 3:
		{
			Team_Info(index, SPEC);
		}
	}
}

FindPlayer()
{
	new i = -1;

	while(i <= MaxSlots)
	{
		if(IsConnected[++i])
		{
			return i;
		}
	}

	return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: Semrush [Bot], Yandex [Bot] and 2 guests