how to make a textdraw...
#5

It's a pretty big "function", so I whipped you up a quick filterscript:

pawn Код:
/* Zezombia
   Welcome TextDraw Test */


#include <a_samp>

forward WelcomeTimer(playerid);

new Text:Textdraw;

public OnFilterScriptInit()
{
    Textdraw = TextDrawCreate(100, 100, "Welcome"); //hint, edit position here
    //hint, add more ways to visualize the TextDraw here
    return 1;
}

public OnFilterScriptExit()
{
    TextDrawDestroy(Textdraw);
    return 1;
}

public OnPlayerConnect(playerid)
{
    SetPVarInt(playerid, "Timer", SetTimerEx("WelcomeTimer", 1000, 1, "i", playerid));
    return 1;
}

public WelcomeTimer(playerid)
{
    new string[128];
   
    switch(GetPVarInt(playerid, "TimerVar"))
    {
        case 0:
        {
            strpack(string, "~r~W");
            TextDrawSetString(Textdraw, string);
            TextDrawShowForPlayer(playerid, Textdraw);
        }
        case 1:
        {
            strpack(string, "~r~W~b~e");
            TextDrawSetString(Textdraw, string);
            TextDrawShowForPlayer(playerid, Textdraw);
        }
        case 2:
        {
            strpack(string, "~r~W~b~e~g~l");
            TextDrawSetString(Textdraw, string);
            TextDrawShowForPlayer(playerid, Textdraw);
        }
        case 3:
        {
            //hint, add more cases
        }
        case 7:
        {
            TextDrawHideForPlayer(playerid, Textdraw);
            KillTimer(GetPVarInt(playerid, "Timer"));
            SetPVarInt(playerid, "TimerVar", 0);
            return 1;
        }
    }
   
    SetPVarInt(playerid, "TimerVar", GetPVarInt(playerid, "TimerVar") + 1);
    return 0;
}
That is not complete, you still have to make the textdraw look correct and put it in the correct position, and I got you as far as "W e l", you have to do the ending "c o m e".

You can find the colors here:
https://sampwiki.blast.hk/wiki/TextDraw_Text_Codes

You can find all the TextDraw functions here:
https://sampwiki.blast.hk/wiki/TextDrawCreate
(just scroll down)

I would do the rest but I don't think you learn anything like that :P. Just study the code and you'll see how it works, it fairly simple.
Reply


Messages In This Thread
how to make a textdraw... - by iJumbo - 14.07.2010, 17:11
Re: how to make a textdraw... - by iJumbo - 14.07.2010, 17:21
Re: how to make a textdraw... - by Nonameman - 14.07.2010, 20:06
Re: how to make a textdraw... - by ikey07 - 14.07.2010, 20:11
Re: how to make a textdraw... - by Zezombia - 14.07.2010, 20:27
Re: how to make a textdraw... - by IanDaCJ - 14.07.2010, 22:45
Re: how to make a textdraw... - by iJumbo - 15.07.2010, 12:56

Forum Jump:


Users browsing this thread: 2 Guest(s)