pawn Код:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
new Text:Textdrawhora;
new Text:Textdrawdata;
forward hora(playerid);
public hora(playerid)
{
new string[128],
string2[128],
year,
month,
day,
hour,
minute,
second;
getdate(year, month, day);
gettime(hour,minute,second);
new mes[12];
if(month == 1) { mes = "01"; }
else if(month == 2) {mes = "02";}
else if(month == 3) {mes = "03";}
else if(month == 4) {mes = "04";}
else if(month == 5) {mes = "05";}
else if(month == 6) {mes = "06";}
else if(month == 7) {mes = "07";}
else if(month == 8) {mes = "08";}
else if(month == 9) {mes = "09";}
else if(month == 10) {mes = "10";}
else if(month == 11) {mes = "11";}
else if(month == 12) {mes= "12";}
format(string, sizeof(string), "%d/%s/%d", day, mes,year);
TextDrawSetString(Text:Textdrawdata, string);
format(string2, sizeof(string2), "%d:%d:%d", hour, minute, second);
TextDrawSetString(Text:Textdrawhora, string2);
}
public OnFilterScriptInit()
{
Textdrawhora = TextDrawCreate(540, 22, "00:00:00");
TextDrawBackgroundColor(Textdrawhora, 255);
TextDrawFont(Textdrawhora, 2);
TextDrawLetterSize(Textdrawhora, 0.500000, 1.000000);
TextDrawColor(Textdrawhora, 0xFFFFFFFF);
TextDrawSetOutline(Textdrawhora, 0);
TextDrawSetProportional(Textdrawhora, 1);
TextDrawSetShadow(Textdrawhora, 1);
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, Textdrawhora);
}
}
Textdrawdata = TextDrawCreate(520, 12, "00/00/00");
TextDrawBackgroundColor(Textdrawdata, 255);
TextDrawFont(Textdrawdata, 2);
TextDrawLetterSize(Textdrawdata, 0.500000, 1.000000);
TextDrawBoxColor(Textdrawdata,0x00000050);
TextDrawColor(Textdrawdata, 0xFF0000FF);
TextDrawSetOutline(Textdrawdata, 0);
TextDrawSetProportional(Textdrawdata, 1);
TextDrawSetShadow(Textdrawdata, 1);
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, Textdrawdata);
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Textdrawhora);
TextDrawShowForPlayer(playerid, Textdrawdata);
return 1;
}
#endif