AcasaAcasa  PortalPortal  FAQFAQ  CautareCautare  InregistrareInregistrare  ConectareConectare  ContactContact  BlogBlog  

Distribuiţi | .
 

 Top 10/15 colorat

Vezi subiectul anterior Vezi subiectul urmator In jos 
AutorMesaj
Vlad
avatar

Data de inscriere : 30/08/2012
Avertismente : Nici unul
Mesaje : 471
Money : 5235
Multumiri : 23
Administrators

MesajSubiect: Top 10/15 colorat   Dum Ian 13, 2013 5:36 am

Autor: Emilian
Versiune: 1.0

Cod:
#include <amxmodx>
#include <csx>

#define NUME_PLUGIN        "Advanced Top+"
#define VERSIUNE_PLUGIN    "1.0"
#define CREATOR_PLUGIN    "Emilian"

new g_sBuffer[2048];

public plugin_init()
{
  register_plugin(NUME_PLUGIN, VERSIUNE_PLUGIN, CREATOR_PLUGIN)
  register_cvar("advanced_top", "0")
  register_cvar("advanced_show_message", "1")
  if(get_cvar_num("advanced_top") != 1) {
  register_clcmd("say /top10", "command_top", 0)
  }
  if(get_cvar_num("advanced_top") != 0) {
  register_clcmd("say /top15", "command_top", 0)
  }

}

Float:accuracy(izStats[8])
{
  if (!izStats[4])
  {
      return (0.0);
  }

  return (100.0 * float(izStats[5]) / float(izStats[4]));
}

Float:effec(izStats[8])
{
  if (!izStats[0])
  {
      return (0.0);
  }

  return (100.0 * float(izStats[0]) / float(izStats[0] + izStats[1]));
}

format_adv_top(sBuffer[2048])
{
  new loc1 = get_statsnum();
  new loc2 = get_statsnum();
  new loc3 = get_statsnum();

  new iMax = get_statsnum();
  new izStats[8], izBody[8], t_sName[32];
  new iLen = 0;

  if(get_cvar_num("advanced_top") != 1)
  {
      iMax = 10;
  }

  if(get_cvar_num("advanced_top") != 0)
  {
      iMax = 15;
  }


  loc1 = 1;
  loc2 = 2;
  loc3 = 3;

  iLen = format(sBuffer, 2047, "<body bgcolor=black><font color=white><pre>");
  if(get_cvar_num("advanced_show_message") != 0)
  {
        iLen += format(sBuffer[iLen], 2047 - iLen, "  <font color=#FFFFFF>Acum joci pe serverul nume.comunitatea-mea.ro^n");
        iLen += format(sBuffer[iLen], 2047 - iLen, "    Daca doresti admin sau slot te rugam sa vizitezi www.nume.ro!</font>^n"); 
        }
  iLen += format(sBuffer[iLen], 2047 - iLen, "%2s %-22.22s %6s %6s %4s %4s %4s^n", "#", "Nume Jucator", "Ucideri", "Decese", "HS", "Eff", "Acc");

  for (new i = 0; i < loc1 && 2047 - iLen > 0; i++)
  {
      get_stats(i, izStats, izBody, t_sName, 31);
      replace_all(t_sName, 31, "<", "[");
      replace_all(t_sName, 31, ">", "]");
      iLen += format(sBuffer[iLen], 2047 - iLen, "<font color=red>%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%%</font>^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats));
  }

  for (new i = 1; i < loc2 && 2047 - iLen > 0; i++)
  {
      get_stats(i, izStats, izBody, t_sName, 31);
      replace_all(t_sName, 31, "<", "[");
      replace_all(t_sName, 31, ">", "]");
      iLen += format(sBuffer[iLen], 2047 - iLen, "<font color=blue>%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%%</font>^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats));
  }

  for (new i = 2; i < loc3 && 2047 - iLen > 0; i++)
  {
      get_stats(i, izStats, izBody, t_sName, 31);
      replace_all(t_sName, 31, "<", "[");
      replace_all(t_sName, 31, ">", "]");
      iLen += format(sBuffer[iLen], 2047 - iLen, "<font color=green>%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%%</font>^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats));
  }


  for (new i = 3; i < iMax && 2047 - iLen > 0; i++)
  {
      get_stats(i, izStats, izBody, t_sName, 31);
      replace_all(t_sName, 31, "<", "[");
      replace_all(t_sName, 31, ">", "]");
      iLen += format(sBuffer[iLen], 2047 - iLen, "%2d %-22.22s %6d %6d %4d %3.0f%% %3.0f%%^n", i + 1, t_sName, izStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats));
  }
}

public command_top(id)
{
  format_adv_top(g_sBuffer)
  if(get_cvar_num("advanced_top") != 1) 
        {
  show_motd(id, g_sBuffer, "Top 10");
        }
  if(get_cvar_num("advanced_top") != 0)
        {
  show_motd(id, g_sBuffer, "Top 15");
        }
  return PLUGIN_HANDLED;
}
Sus In jos
http://tia4all.forumz.ro
Topic: Re:

Top 10/15 colorat

Indisponibil

Ai putin timp? Fa-ti un cont ca sa postezi si tu! sau, continua cautarea pe internet.
Did this helped?





Rang: Inregistrat
Data de inregistrare: 31/01/2012
SusIn jos
Pagina 1 din 1

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
tia4all.wikiforum.ro :: Games - tia4all.forumz.ro :: Counter Strike :: Pluginuri-