Clock blocked +
#1

I have this
PHP код:
#define FILTERSCRIPT
#include <a_samp>
#define SDATE_COL 0x7458C1FF
#define STIME_COL 0x1E90FFFF
new Text:ServerDate;
new 
Text:ServerTime;
public 
OnFilterScriptInit()
{
        print(
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        print(
" Sample Clock Filter Script SA:MP by Wiper has successfully loaded.");
        print(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
        
SetTimer("TimeSet"1000true);
        
ServerDate TextDrawCreate(544.513.00"--");
        
ServerTime TextDrawCreate(547.525.33"--");
        
TextDrawFont(ServerDate1);
        
TextDrawFont(ServerTime3);
        
TextDrawColor(ServerDateSDATE_COL);
        
TextDrawColor(ServerTimeSTIME_COL);
        
TextDrawLetterSize(ServerDate0.5501.414);
        
TextDrawLetterSize(ServerTime0.6001.614);
        
TextDrawSetShadow(ServerDate0);
        
TextDrawSetShadow(ServerTime0);
        
TextDrawSetOutline(ServerDate1);
        
TextDrawSetOutline(ServerTime1);
        
TextDrawShowForAll(ServerDate);
        
TextDrawShowForAll(ServerTime);
        return 
1;
}
public 
OnFilterScriptExit()
{
        print(
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
        print(
" Sample Clock Filter Script SA:MP by Wiper unloaded.");
        print(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
        
TextDrawHideForAll(ServerDate);
        
TextDrawHideForAll(ServerTime);
        
TextDrawDestroy(ServerDate);
        
TextDrawDestroy(ServerTime);
        return 
1;
}
public 
OnPlayerConnect(playerid)
{
        
TextDrawShowForPlayer(playeridServerDate);
        
TextDrawShowForPlayer(playeridServerTime);
        return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
        
TextDrawHideForPlayer(playeridServerDate);
        
TextDrawHideForPlayer(playeridServerTime);
        return 
1;
}
forward TimeSet( );
public 
TimeSet( )
{
        new 
String[2][12];
        new 
y,m,d,h,mi,s;
        new 
MonthName[12][] =
        {
                
"January""February""March""April""May""June",
                
"July""August""September""October""November""December"
        
};
        
getdate(y,m,d);
        
gettime(h,mi,s);
        
format(String[0], 18"%d %s"dMonthName[m-1]);
        
format(String[1], 18"%02d:%02d"h,m);
        
TextDrawSetString(ServerDateString[0]);
        
TextDrawSetString(ServerTimeString[1]);
        return 
1;

But clock is blocked to 1:06.
Reply
#2

You're setting the minutes to the month number. This stresses the importance of variable naming. Use proper names instead of one letter variables.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)