Jail Time
#6

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.
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);
Reply


Messages In This Thread
Jail Time - by AnonScripter - 15.12.2013, 13:12
Re: Jail Time - by Dawno - 15.12.2013, 13:25
Re: Jail Time - by AnonScripter - 15.12.2013, 13:34
Re: Jail Time - by SilentSoul - 15.12.2013, 13:36
Re: Jail Time - by Jankingston - 15.12.2013, 13:41
Re: Jail Time - by erminpr0 - 15.12.2013, 14:11
Re: Jail Time - by AnonScripter - 15.12.2013, 14:27
Re: Jail Time - by SilentSoul - 15.12.2013, 14:33
Re: Jail Time - by AnonScripter - 15.12.2013, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)