Thank you! It looks really complicated, once I get the hang of it, will it be easier? I was never good with art but here it's only syntax so it should be better, right?
|
new fades[15][10] =
{
{0x000000EE},
{0x000000DD},
{0x000000CC},
{0x000000BB},
{0x000000AA},
{0x00000099},
{0x00000088},
{0x00000077},
{0x00000066},
{0x00000055},
{0x00000044},
{0x00000033},
{0x00000022},
{0x00000011},
{0x00000000}
};
CMD:fade(playerid, params[])
{
if(FadeTDTimer [playerid] == 0)
{
TextDrawShowForPlayer(playerid, WholeScreen);
// We obviously have to show the TextDraw we want to fade..
FadeTDTimer[ playerid ] = 1;
Fade(playerid, 0);
}
else return SendClientMessage( playerid, -1, "You are already fading!" );
return true;
}
forward Fade(playerid, times);
public Fade(playerid, times)
{
TextDrawBoxColor(WholeScreen, fades[times][0]);
switch(times) // This is faster than an 'if statement'
{
case 0 .. 12: SetTimerEx("Fade", 50, false, "ii", playerid, times+1);
case 13: FadeTDTimer[playerid] = SetTimerEx("Fade", 50, false, "ii", playerid, times+1);
case 14:
{
TextDrawBoxColor(WholeScreen, fades[times][0]);
KillTimer(FadeTDTimer [playerid]);
TextDrawHideForPlayer( playerid, WholeScreen );
// Hide the transparent TextDraw.
return true;
}
}
TextDrawHideForPlayer(playerid, WholeScreen);
TextDrawShowForPlayer(playerid, WholeScreen);
return 1;
// Every time the function is called, the TextDraw is refreshed (Hidden & then re-shown and their ScreenStatus goes up 1.
}