textdraw bug
#8

pawn Код:
new Text:VClockTD;
new Vhour, Vminute;

stock ToggleVClock(toggle)
{
    if(toggle == 1)
    {
        VClockTD = TextDrawCreate(546.000000,23.000000,"6:30 AM");
        TextDrawAlignment(VClockTD,0);
        TextDrawBackgroundColor(VClockTD,0x000000ff);
        TextDrawFont(VClockTD,3);
        TextDrawLetterSize(VClockTD,0.299999,1.600000);
        TextDrawColor(VClockTD,0xFFFFFFFF);
        TextDrawSetProportional(VClockTD,1);
        TextDrawSetShadow(VClockTD,1);
        TextDrawShowForAll(VClockTD);
        SetTimer("VClock", 30000, true);
        SetWorldTime(6);
        Vhour = 6;
        Vminute = 30;
    }
    return 0;
}

public OnFilterScriptInit()
{
    ToggleVClock(1);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid,VClockTD)
    return 1;
}

forward VClock(playerid);
public VClock(playerid)
{
    Vminute++;
    if(Vminute >= 60)
    {
        Vminute = 0;
        Vhour++;
        if(Vhour >= 24)
        {
            Vhour = 0;
            SetWorldTime(Vhour);
        }
    }
   
    new string[20];
    format(string,sizeof(string),"%d:%.02d %s",Vhour,Vminute,(Vhour >= 12) ? ("PM") : ("AM"));
    TextDrawSetString(VClockTD,string);
    return 1;
}
What happen if you do it ?
Reply


Messages In This Thread
textdraw bug - by stix - 23.12.2010, 00:22
Re: textdraw bug - by Steven82 - 23.12.2010, 00:55
Re: textdraw bug - by stix - 23.12.2010, 00:58
Re: textdraw bug - by Steven82 - 23.12.2010, 00:59
Re: textdraw bug - by stix - 23.12.2010, 01:40
Re: textdraw bug - by Alice[WS] - 23.12.2010, 01:42
Re: textdraw bug - by stix - 23.12.2010, 02:05
Re: textdraw bug - by Alice[WS] - 23.12.2010, 02:26
Re: textdraw bug - by stix - 23.12.2010, 02:34
Re: textdraw bug - by Alice[WS] - 23.12.2010, 03:16

Forum Jump:


Users browsing this thread: 1 Guest(s)