Issue with /time command.
#1

So I'm trying to make a /time command which should show a textdraw displaying the current time. But instead I see a black box. What did I do wrong?

PHP код:
new Text:InfoText[MAX_PLAYERS], DisplayingText[MAX_PLAYERS], TextTiming[MAX_PLAYERS];
stock CreateInfoTextDraw(playerid)
{
    
InfoText[playerid] = TextDrawCreate(319.000000380.000000"");
    
TextDrawAlignment(InfoText[playerid], 2);
    
TextDrawBackgroundColor(InfoText[playerid], 255);
    
TextDrawFont(InfoText[playerid], 1);
    
TextDrawLetterSize(InfoText[playerid], 0.3200001.500000);
    
TextDrawSetProportional(InfoText[playerid], 1);
    
TextDrawSetShadow(InfoText[playerid], 1);
}
stock DisplayInfoTextDraw(playeridstr[], duration)
{
    if(
DisplayingText[playerid])
    {
        
KillTimer(TextTiming[playerid]);
    }
    
TextDrawSetString(InfoText[playerid], str);
    
TextDrawShowForPlayer(playeridInfoText[playerid]);
    
TextTiming[playerid] = SetTimerEx("HideInfoTextDraw"duration *10000"i"playerid);
    
DisplayingText[playerid] = 1;
    return 
1;
}
stock HideInfoTextDraw(playerid)
{
    
TextDrawHideForPlayer(playeridInfoText[playerid]);
    
DisplayingText[playerid] = 0;
    return 
1;
}
stock MonthName(Month)
{
    new 
MonthStr[15];
    switch(
Month)
    {
        case 
1:  MonthStr "January";
        case 
2:  MonthStr "February";
        case 
3:  MonthStr "March";
        case 
4:  MonthStr "April";
        case 
5:  MonthStr "May";
        case 
6:  MonthStr "June";
        case 
7:  MonthStr "July";
        case 
8:  MonthStr "August";
        case 
9:  MonthStr "September";
        case 
10MonthStr "October";
        case 
11MonthStr "November";
        case 
12MonthStr "December";
    }
    return 
MonthStr;
}
CMD:time(playerid,params[])
{
    new 
monthdayyearhourminutesecondstr[500];
    
getdate(yearmonthday);
    
gettime(hourminutesecond);
    if(
Account[playerid][Prison] == 1)
    {
        
format(strsizeof(str), "~y~%02d %s, %d ~w~~n~%02d:%02d:%02d~n~Prison Sentence: %d minutes and %d seconds"dayMonthName(month), yearhourminutesecondAccount[playerid][PrisonTime] / 60Account[playerid][PrisonTime] / 60 60);
    }
    else
    {
        
format(strsizeof(str), "~y~%02d %s, %d ~w~~n~%02d:%02d:%02d"dayMonthName(month), yearhourminutesecond);
    } 
    
DisplayInfoTextDraw(playeridstr8);
    return 
1;

Reply


Messages In This Thread
Issue with /time command. - by Stefhan - 10.04.2019, 21:32
Re: Issue with /time command. - by Freaksken - 10.04.2019, 21:59
Re: Issue with /time command. - by Stefhan - 10.04.2019, 22:02
Re: Issue with /time command. - by Freaksken - 10.04.2019, 22:06
Re: Issue with /time command. - by Stefhan - 10.04.2019, 22:08
Re: Issue with /time command. - by Freaksken - 10.04.2019, 22:16
Re: Issue with /time command. - by Stefhan - 11.04.2019, 21:29

Forum Jump:


Users browsing this thread: 1 Guest(s)