System update
#1

Hello. I want make /systemupdate. But i need peoples help.

Explain of /systemupdate:

If i write /systemupdate, then showing screen text (All players):

SYSTEM UPDATE:
01:00

(Minutes:Seconds)

Usually is 1 minute.

And he countdowning 01:00 to 00:00, if 00:00, then Rcon Command Text "Exit".

How do make it and code please thanks.
Reply
#2

http://forum.sa-mp.com/index.php?top...9227#msg949227

And there where KillTimer(Time) stands, just add what you want.

Ask if you have any quiestions.
Reply
#3

Quote:
Originally Posted by Jeffry
http://forum.sa-mp.com/index.php?top...9227#msg949227

And there where KillTimer(Time) stands, just add what you want.

Ask if you have any quiestions.
Where is that position? I need right > down also position.
And that is, see what it countdowning 1 minutes?
How do i make, it starting if i type /systemupdate.

Is that correct?:
Код:
#include <a_samp>

new Time, TimeM, TimeS;
new Text:Textdraw0;

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
//------------------------------------------------------------------------------
	Textdraw0 = TextDrawCreate(17.000000, 429.000000, "20:00");
	TextDrawBackgroundColor(Textdraw0, 65535);
	TextDrawFont(Textdraw0, 1);
	TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
	TextDrawColor(Textdraw0, 16777215);
	TextDrawSetOutline(Textdraw0, 1);
	TextDrawSetProportional(Textdraw0, 1);
	TimeM = 20;
	TimeS = 0;
	Time = SetTimer("UpdateTime", 1000, true);
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/systemupdate", cmdtext, true, 10) == 0)
	{
	  TextDrawShowForAll(Textdraw0);
 		return 1;
	}
	return 0;
}

forward UpdateTime();
public UpdateTime()
{
  new Str[34];
  TimeS --;
  if(TimeM == 0 && TimeS == 0)
  {
    KillTimer(Time);
  }
  if(TimeS == -1)
  {
    TimeM--;
    TimeS = 59;
  }
  if(TimeS<10)
  {
    format(Str, sizeof(Str), "%d:0%d", TimeM, TimeS);
  }
  if(TimeS>9)
  {
    format(Str, sizeof(Str), "%d:%d", TimeM, TimeS);
  }
  TextDrawSetString(Textdraw0, Str);
  return 1;
}
Edit:: That works, but wrong position
Reply
#4

Change this coords:
Just try a bit.

pawn Код:
TextDrawCreate(500.000000, 450.000000, "20:00"); // X(640) x Y(480) is the screen
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)