How to Hidethis textdraw with 5 minutes
#2

pawn Код:
static Text:RandNewsText;

    public OnFilterScriptInit()
    {
            print("\n--------------------------------------");
            print("Textdraw MOTD (Message Of The Day) by AiRa LoKa");
            print("--------------------------------------\n");

            RandNewsText = TextDrawCreate(10.000000, 435.000000, " ");
            TextDrawBackgroundColor(RandNewsText, 255);
            TextDrawFont(RandNewsText, 1);
            TextDrawLetterSize(RandNewsText, 0.35, 1.0);
            TextDrawColor(RandNewsText, GREEN);
            TextDrawSetOutline(RandNewsText, 1);
            return 1;
    }

    public OnFilterScriptExit()
    {
            return 1;
    }

    #else

    #endif

    public OnPlayerConnect(playerid)
    {
            new file[128];
            format(file, sizeof(file), "motd.ini");
            if(dini_Exists(file))
                    {
                    new string[256];
                    new thing[256];
                    thing = dini_Get(file, "MOTD");
                    format(string, sizeof(string), "%s", thing);
                    TextDrawSetString(RandNewsText, string);
            }
                    else
                    {
                    dini_Create(file);
                    dini_Set(file, "MOTD", "This is your server MOTD. Change it by signing into RCON and using the command /motd");
                    new string[256];
                    new thing[256];
                    thing = dini_Get(file, "MOTD");
                    format(string, sizeof(string), "%s", thing);
                    TextDrawSetString(RandNewsText, string);
            }
            TextDrawShowForPlayer(playerid, RandNewsText);
            SetTimer("dtextdraws", 300000, false);
            return 1; //Returns
    }
    public OnPlayerCommandText(playerid, cmdtext[])
    {
            new file[128];
            format(file, sizeof(file), "motd.ini");
            if (strcmp("/motd", cmdtext, true, 5) == 0)
            {
                    if(IsPlayerAdmin(playerid))
                    {
                        new string[256];
                        strmid(string, cmdtext, 6, 256);
                        dini_Set(file, "MOTD", string);
                        new thing[256];
                        thing = dini_Get(file, "MOTD");
                        format(string, sizeof(string), "%s", thing);
                        TextDrawSetString(RandNewsText, string);
                    }
                    else
                    {
                    SendClientMessage(playerid, GREEN, "[ERROR]: You are not a RCON administrator!");
                    }
                    return 1;
            }
            return 0;
    }
   
public dtextdraws()
{
    PlayerTextDrawDestroy(playerid, RandNewsText);
}
When player connects starts timer for 5 minutes after 5 minutes it deleted the textdraws
Reply


Messages In This Thread
How to Hidethis textdraw with 5 minutes - by kurniarocki - 12.02.2014, 01:52
Re: How to Hidethis textdraw with 5 minutes - by SwisherSweet - 12.02.2014, 02:59
Re: How to Hidethis textdraw with 5 minutes - by CuervO - 12.02.2014, 06:45
Re: How to Hidethis textdraw with 5 minutes - by kurniarocki - 12.02.2014, 09:53
Re: How to Hidethis textdraw with 5 minutes - by kurniarocki - 12.02.2014, 10:13
Re: How to Hidethis textdraw with 5 minutes - by CuervO - 12.02.2014, 10:21

Forum Jump:


Users browsing this thread: 1 Guest(s)