14.07.2010, 17:11
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
lol my bad english understand plz
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);
/* 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;
}