Counter-Strike 1.6 Download Forum

Counter-Strike Server RSS Feed atom+xml Counter-Strike Server RSS Feed Counter-Strike Server CsBesTiaL Top 100 BesTiaL Autentificare Inregistrare Profil Mesaje private FAQ Grupuri Counter-Strike
 Servere-le de Counter-Strike CsBesTiaL sunt Pornite
cs bestial
Custom Search
Get our toolbar! Download Counter-Strike 1.6 andoird application
Ultimele harti jucate + timpul hartilor rulate
Du-te la pagina despre counter-strike
 
Creaza un subiect nou   Raspunde la subiect
Mesaj
InFiNiTy
Admin CsBesTiaL
Admin CsBesTiaL
cs

Data Inscrierii: 30/Iun/2009
Mesaje: 1570
Locatie: Galati

Mesaj

2012-08-28    cstrike Ultimele harti jucate + timpul hartilor rulate


Acest plugin afiseaza ultimele 5 harti jucate. (sau mai multe daca modificati define LAST_MAPS_SAVE 5 )
Daca sunt mai mult de 5 harti jucate, acestea vor aparea pe 2 linii, etc.

Counter-Strike Cs BesTiaL

Folositi colorchat.inc, daca aveti probleme la compilare. (este atasat mai jos, se pune in folderul scripting/include)


Textul ultimele_harti.sma este mai jos... el trebuie doar compilat ... si dupa preferinte modificat

Cod:
]#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define LAST_MAPS_SAVE 5

new gSaveFile[64];
new gLastMapName[LAST_MAPS_SAVE][32];
new gLastMapTime[LAST_MAPS_SAVE];
new gNumLastMaps;

public plugin_init() {
    register_plugin("Ultimele 5 Harti", "1.0", "cs.eforienett.ro");
     
    register_clcmd("say /harti", "CmdLastMaps");
     
    get_datadir(gSaveFile, charsmax(gSaveFile));
    add(gSaveFile, charsmax(gSaveFile), "/ultimeleharti.txt");
     
    new f = fopen(gSaveFile, "rt");
     
    if(f) {
        new line[64], minutes[12];
         
        while(!feof(f) && gNumLastMaps < LAST_MAPS_SAVE) {
            fgets(f, line, charsmax(line));
            trim(line);
             
            if(line[0]) {
                parse(line, gLastMapName[gNumLastMaps], charsmax(gLastMapName[]), minutes, charsmax(minutes));
                gLastMapTime[gNumLastMaps++] = str_to_num(minutes);
            }
        }
         
        fclose(f);
    }
}

public plugin_end() {
    new minutes = floatround(get_gametime() / 60.0, floatround_ceil);
     
    new map[32];
    get_mapname(map, charsmax(map));
     
    new f = fopen(gSaveFile, "wt");
     
    fprintf(f, "^"%s^" %d", map, minutes);
     
    if(gNumLastMaps == LAST_MAPS_SAVE) {
        gNumLastMaps--;
    }
     
    for(new i = 0; i < gNumLastMaps; i++) {
        fprintf(f, "^n^"%s^" %d", gLastMapName[i], gLastMapTime[i]);
    }
     
    fclose(f);
}

public CmdLastMaps(id) {
    if(gNumLastMaps) {
        ColorChat(id, NORMAL, "^4*^1 Ultimele harti jucate sunt:");
         
        new maps[192], len;
        for(new i = 0; i < gNumLastMaps; i++) {
            if(i && !(i % 3)) {
                ColorChat(id, NORMAL, "^4*^1 %s", maps);
                len = 0;
            }
             
            len += formatex(maps[len], charsmax(maps) - len, "%s%s (^4%d min^1)", len ¿ ", " : "", gLastMapName[i], gLastMapTime[i]);
        }
         
        if(len) {
            ColorChat(id, NORMAL, "^4*^1 %s", maps);
        }
    } else {
        client_print(id, print_chat, "* Scuze, nu exista harti jucate in loguri.");
    }



stock chat_color(const id, const input[], any:...)
{
    new count = 1, players[32]
    static msg[191]
    vformat(msg, 190, input, 3)
     
    replace_all(msg, 190, "!g", "^4")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!team", "^3")
    replace_all(msg, 190, "!team2", "^0")
     
    if (id) players[0] = id; else get_players(players, count, "ch")
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players[i]))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
                write_byte(players[i]);
                write_string(msg);
                message_end();
            }
        }
    }
}

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


colorchat.inc

Cod:
/* Fun functions
*
* by Numb
*
* This file is provided as is (no warranties).
*/

#if defined _colorchat_included
  #endinput
#endif
#define _colorchat_included

enum Color
{
   NORMAL = 1, // clients scr_concolor cvar color
   GREEN, // Green Color
   TEAM_COLOR, // Red, grey, blue
   GREY, // grey
   RED, // Red
   BLUE, // Blue
}

new const TeamName[][] =
{
   "",
   "TERRORIST",
   "CT",
   "SPECTATOR"
}

ColorChat(id, Color:type, const msg[], any:...)
{
   new message[256];

   switch(type)
   {
      case NORMAL: // clients scr_concolor cvar color
      {
         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, ColorChange, index, MSG_Type;
   
   if(id)
   {
      MSG_Type = MSG_ONE_UNRELIABLE;
      index = id;
   } else {
      index = FindPlayer();
      MSG_Type = MSG_BROADCAST;
   }
   
   team = get_user_team(index);
   ColorChange = ColorSelection(index, MSG_Type, type);

   ShowColorMessage(index, MSG_Type, message);
      
   if(ColorChange)
   {
      Team_Info(index, MSG_Type, TeamName[team]);
   }
}

ShowColorMessage(id, type, message[])
{
   static msgSayText;
   if(!msgSayText)
   {
      msgSayText = get_user_msgid("SayText");
   }
   message_begin(type, msgSayText, _, id);
   write_byte(id)      
   write_string(message);
   message_end();   
}

Team_Info(id, type, team[])
{
   static msgTeamInfo;
   if(!msgTeamInfo)
   {
      msgTeamInfo = get_user_msgid("TeamInfo");
   }
   message_begin(type, msgTeamInfo, _, id);
   write_byte(id);
   write_string(team);
   message_end();

   return 1;
}

ColorSelection(index, type, Color:Type)
{
   switch(Type)
   {
      case RED:
      {
         return Team_Info(index, type, TeamName[1]);
      }
      case BLUE:
      {
         return Team_Info(index, type, TeamName[2]);
      }
      case GREY:
      {
         return Team_Info(index, type, TeamName[0]);
      }
   }

   return 0;
}

FindPlayer()
{
   new i = -1;

   while(i <= get_maxplayers())
   {
      if(is_user_connected(++i))
         return i;
   }

   return -1;
}
Cs Forum
Vezi profilul utilizatorului Expediaza mesaj privat
WwW.PlacePuB.Ro
WwW.PlacePuB.Ro
placepub




Mesaj

2012-08-28    cstrike




Cs Forum
Afiseaza mesajele despre Counter-Strike pentru a le previzualiza:    
Creaza un subiect nou   Raspunde la subiect    Counter Strike Forum - Tutoriale Counter-Strike 1.6 download -> Pluginuri Counter - Strike 1.6 cstrike Ora este GMT + 2 ore
Du-te la pagina despre counter-strike
Pagina 1 din 0

 
Mergi direct la pagina de counter-strike 1.6:  
Nu puteti crea un subiect nou In acest forum despre counter-strike
Nu puteti raspunde In subiectele acestui forum despre counter-strike
Nu puteti modifica mesajele proprii din acest forum despre counter-strike
Nu puteti sterge mesajele proprii din acest forum despre counter-strike
Nu puteti vota In chestionarele din acest forum despre counter-strike

Privacy Policy | Politica de Confidentialitate



 Safe Site

By Bogdan Maxim. Published in the Counter-strike 1.6 Download category