#include <amxmodx> //polskie miesiace new PLmonth[13][]={ "", "styczen", "luty", "marzec", "kwiecien", "maj", "czerwiec", "lipiec", "sierpien", "wrzesien", "październik", "listopad", "grudzien" } public plugin_init() { register_plugin("Dzien", "1.0", "R3X") register_concmd("dzien","fnDzien"); register_clcmd("say /dzien","fnDzienChat"); } public fnDzien(id){ new year,month,day,buf[50]; date (year, month, day); formatex(buf,49,"%d %s %d",day,PLmonth[month],year); console_print(id,buf); if(id!=0) client_print(id,print_chat,buf); return PLUGIN_HANDLED; } public fnDzienChat(id){ console_cmd(id,"dzien"); return PLUGIN_CONTINUE; }Za pomoc thx
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
Plug say /dzien
Temat rozp.
zer0.
, 09.01.2009 07:15
3 odpowiedzi w tym temacie
#1
Napisano 09.01.2009 07:15
Czy jest możliwość, aby data ( np. 10 grudnia 2009 ) wyświetlała się na kolor zielony ?
#3
Napisano 09.01.2009 15:03
W prawdzie mówiąc próbowałem szeregu rozwiązań, lecz przy każdym mam błąd przy kompilacji .. ;> Nie, że czekam na gotowca, ale mógłby mi ktoś podać 'wersję finalną'.
#4
Napisano 09.01.2009 15:14
#include <amxmodx> #define MAX_PLAYERS 32 //polskie miesiace new PLmonth[13][]={ "", "styczen", "luty", "marzec", "kwiecien", "maj", "czerwiec", "lipiec", "sierpien", "wrzesien", "październik", "listopad", "grudzien" } enum Color { YELLOW = 1, // Yellow GREEN, // Green Color TEAM_COLOR, // Red, grey, blue GREY, // grey RED, // Red BLUE // Blue } new TeamName[][] = { "", "TERRORIST", "CT", "SPECTATOR" } public plugin_init() { register_plugin("Dzien", "1.0", "R3X") register_concmd("dzien","fnDzien"); register_clcmd("say /dzien","fnDzienChat"); } public fnDzien(id){ new year,month,day,buf[50]; date (year, month, day); formatex(buf,49,"%d %s %d",day,PLmonth[month],year); console_print(id,buf); if(id!=0) ColorChat(id, GREEN, buf); return PLUGIN_HANDLED; } public fnDzienChat(id){ console_cmd(id,"dzien"); return PLUGIN_CONTINUE; } 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, ColorChange, index, MSG_Type; if(!id) { index = FindPlayer(); MSG_Type = MSG_ALL; } else { MSG_Type = MSG_ONE; index = id; } 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[]){ message_begin(type, 76, _, id); write_byte(id) write_string(message); message_end(); } Team_Info(id, type, team[]){ message_begin(type, 86, _, 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 <= MAX_PLAYERS) { if(is_user_connected(++i)) { return i; } } return -1; }
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych