24.08.2010, 16:19
У меня на сервере при коннекте высвечиваеться TextDraw с информацией, как сделать, чтоб он исчез через 10 секунд после появления?
Public TextDrawInv(textdrawid) { TextSec--; if(TextSec==8) Осветление текстдрава; if(TextSec==4) Более Осветление текстдрава; if(TextSec==0) Полнре исчезновение текстдрава; TextTimer = SetTimer("TextDrawInv",1000,0); return 1; }
new Text:BlackScreen[MAX_PLAYERS],BlackScreenTimer[MAX_PLAYERS];
forward OnPlayerBlackScreen(playerid,bool:type,aaa,speed);
public OnPlayerBlackScreen(playerid,bool:type,aaa,speed)
{
if(BlackScreenTimer[playerid] != -1)
{
KillTimer(BlackScreenTimer[playerid]);
BlackScreenTimer[playerid] = -1;
}
if(type)
{
if(aaa == 0)
{
BlackScreen[playerid] = TextDrawCreate(0.0, 0.0, "_");
TextDrawFont(BlackScreen[playerid], 1);
TextDrawLetterSize(BlackScreen[playerid], 0.0, 50.0);
TextDrawUseBox(BlackScreen[playerid], true);
TextDrawColor(BlackScreen[playerid], 0);
TextDrawBoxColor(BlackScreen[playerid], aaa);
TextDrawShowForPlayer(playerid,BlackScreen[playerid]);
aaa += 1;
}
else if(aaa < 255)
{
TextDrawHideForPlayer(playerid,BlackScreen[playerid]);
TextDrawBoxColor(BlackScreen[playerid], aaa);
TextDrawShowForPlayer(playerid,BlackScreen[playerid]);
aaa += 1;
}
else if(254 < aaa < 265)
{
aaa += 1;
}
else if(aaa == 265)
{
type = false;
aaa = 255;
return 1;
}
BlackScreenTimer[playerid] = SetTimerEx("OnPlayerBlackScreen",speed,0,"dddd",playerid,type,aaa,speed);
}
else
{
if(aaa > 0)
{
TextDrawHideForPlayer(playerid,BlackScreen[playerid]);
TextDrawBoxColor(BlackScreen[playerid], aaa);
TextDrawShowForPlayer(playerid,BlackScreen[playerid]);
aaa -= 1;
BlackScreenTimer[playerid] = SetTimerEx("OnPlayerBlackScreen",speed,0,"dddd",playerid,type,aaa,speed);
}
else if(aaa <= 0)
{
TextDrawHideForPlayer(playerid,BlackScreen[playerid]);
TextDrawDestroy(BlackScreen[playerid]);
}
}
return 1;
}