15.12.2013, 14:11
Create textdraw using iPLEOMAX / Zamaroth TD editor, or whatever else.
Assing textdraw to some id so you can use it later in some parts.
Ex.
Assing textdraw to some id so you can use it later in some parts.
Ex.
pawn Код:
new Text: timeLeft;
timeLeft = TextDrawCreate(299.5 ,400 , " ");
TextDrawFont(timeLeft , 1);
TextDrawLetterSize(timeLeft , 1, 7);
TextDrawColor(timeLeft , 0xed37b3FF);
TextDrawSetOutline(timeLeft , false);
TextDrawSetProportional(timeLeft , true);
TextDrawSetShadow(timeLeft , 0);
forward UpdateJailText()
public UpdateJailText()
{
foreach(Player, i)
{
if(GetPVarInt(i, "Jailed") >= 1)
{
new string[32];
format(string, sizeof string, "Time left in jail: %d minutes!", GetPVarInt(i, "Jailed"));
TextDrawSetString(timeLeft, string);
TextDrawShowForPlayer(playerid, timeLeft);
}
if(GetPVarInt(i, "Jailed") == 0)
{
TextDrawHideForPlayer(playerid, timeLeft);
}
}
}
// at the top
new timlf_tm;
// on game mode init
timlf_tm = SetTimer(UpdateJailText, 5000, true);
// gmx
KillTimer(timlf_tm);