Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- _______
- | | | |__ __ __ _ _ __ __ _
- | |_| |\ \ /\ / // _` || `_ \ / _` |
- | _ | \ V V /| (_| || | | || (_| |
- |_| |_| \_/\_/ \__,_||_| |_| \__, |
- |___/
- PAWN Systems
- */
- new Time, TimeM, TimeS;
- new Text:Textdraw0;
- new Text:Textdraw1;
- forward TimeShow(playerid);
- forward OnTimeOut();
- public TimeShow(playerid)
- {
- TextDrawShowForPlayer(playerid, Textdraw0),TextDrawShowForPlayer(playerid, Textdraw1);
- return 1;
- }
- stock TimeINIT(time)
- {
- Textdraw0 = TextDrawCreate(210.000000, 389.000000, "-");
- TextDrawBackgroundColor(Textdraw0, 300);
- TextDrawFont(Textdraw0, 1);
- TextDrawLetterSize(Textdraw0, 16.120025, 8.099998);
- TextDrawColor(Textdraw0, 50);
- TextDrawSetOutline(Textdraw0, 0);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawSetShadow(Textdraw0, 1);
- TextDrawSetSelectable(Textdraw0, 0);
- Textdraw1 = TextDrawCreate(306.000000, 432.000000, "00:00");
- TextDrawBackgroundColor(Textdraw1, 100);
- TextDrawFont(Textdraw1, 1);
- TextDrawLetterSize(Textdraw1, 0.360000, 0.799999);
- TextDrawColor(Textdraw1, -1);
- TextDrawSetOutline(Textdraw1, 0);
- TextDrawSetProportional(Textdraw1, 1);
- TextDrawSetShadow(Textdraw1, 1);
- TimeS = 0;
- Time = SetTimer("UpdateTime", 1000, true);
- TimeM = time;
- return 1;
- }
- forward UpdateTime();
- public UpdateTime()
- {
- new Str[34];
- TimeS --;
- if(TimeM == 0 && TimeS == 0)
- {
- KillTimer(Time);
- OnTimeOut();
- }
- if(TimeS == -1)
- {
- TimeM--;
- TimeS = 59;
- }
- format(Str, sizeof(Str), "%02d:%02d", TimeM, TimeS);
- TextDrawSetString(Textdraw1, Str);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement