how to make a textdraw...
#1

how to make a textdraw presentation like W(in red)(wait 1 sec)E(in blue)(wait 1 sec)L ..... C ..... o .....M.....E ?
lol my bad english understand plz
Reply
#2

......... Helppppppppp xd
Reply
#3

Quote:
Originally Posted by gigi1223
Посмотреть сообщение
how to make a textdraw presentation like W(in red)(wait 1 sec)E(in blue)(wait 1 sec)L ..... C ..... o .....M.....E ?
lol my bad english understand plz
Sorry but I cannot understand what do you want.
Wanna make a simple textdraw?
Reply
#4

Like this?

pawn Код:
new Text:Text1;

    Text1 = TextDrawCreate(360.0,370.0,"~r~W ~w~1 sec ~b~E");
    TextDrawFont(Text1,1);
    TextDrawColor(Text1,0xFFFFFFFF);
    TextDrawSetShadow(Text1,2);
    TextDrawLetterSize(Text1,0.5,2.0);
    TextDrawAlignment(Text1,2);
    TextDrawTextSize(Text1,200,400);
Reply
#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
#6

use these infront of the words..
~b~ for Blue
~g~ for Green
~l~ for Black
~p~ for Pink
~r~ for Red
~w~ for White
~y~ for Yellow
~n~ for a New line
Reply
#7

thx all
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)