14.07.2010, 20:27
It's a pretty big "function", so I whipped you up a quick filterscript:
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.
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;
}
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.