FORUM.ALEXONE.RO - Ofera cele mai bune servere din ROMANIA de CS 1.6 si CS:GO CASUAL si COMPETITIVE 2007-2018

Comunitatea Alexone ofera servere de Counter Strike 1.6, PUBLIC si MIX/WAR 2007-2017 - Counter Strike Global Offensive PUBLIC, COMPETITIVE si MIX/WAR 2007-2018
It is currently March 28th, 2024, 10:34 pm

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 12th, 2012, 5:39 pm 
Offline
Support User
Support User
User avatar

Joined: November 14th, 2012, 7:32 pm
Posts: 55
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, gLastMapTime);
}

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, gLastMapTime);
}

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))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
write_byte(players);
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;
}

_________________
The Righteous stand before the Darkness, and the Maker shall guide their hand.
Image


Report this post
Top
PostPosted: December 12th, 2012, 5:41 pm 
Offline
Support User
Support User
User avatar

Joined: November 14th, 2012, 7:32 pm
Posts: 55
Eu l-am primit,si am zis sa vad parerea voastra.Astept pareri? Daca e bun si daca e folositor.

_________________
The Righteous stand before the Darkness, and the Maker shall guide their hand.
Image


Report this post
Top
PostPosted: December 12th, 2012, 8:27 pm 
Offline
Designer User
Designer User

Joined: September 29th, 2012, 6:04 pm
Posts: 398
Location: Bessarabia
Si mai exact ce face pluginu asta?:)


Report this post
Top
PostPosted: December 13th, 2012, 9:20 pm 
Offline
Designer User
Designer User
User avatar

Joined: April 1st, 2012, 9:53 am
Posts: 500
Location: Romania
Ceva de gen`u ca scrii /maps si iti arata hartile anterioare, sau care inca nu au fost din cate am inteles ..

_________________
Image
Image Image Image Image


Report this post
Top
PostPosted: December 15th, 2012, 9:55 am 
Offline
Support User
Support User
User avatar

Joined: November 14th, 2012, 7:32 pm
Posts: 55
Scrii /harti si iti apare ultimele harti jucate,acum eu nu l-am incercat.

_________________
The Righteous stand before the Darkness, and the Maker shall guide their hand.
Image


Report this post
Top
PostPosted: December 30th, 2012, 6:27 pm 
Offline
Designer User
Designer User

Joined: July 23rd, 2012, 12:08 am
Posts: 350
Location: Buzau
E bun .. !

_________________
8-)


Report this post
Top
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited