10.03.2010, 08:26
Zinglish's Basic Clock plus Access 2
(ZBCplusAccess2)
(ZBCplusAccess2)
| Source: ZBCplusAccess2 |
| |
/ \
/ \
/----------------------Preview----------------------\
Style 0
Style 1
IDEA: ducati09
\-------------------------------------------------/
| |
/ \
/-------------------------About-------------------------\
ZBCplus is an upgraded version of ZBC
It's very basic and clean yet very effective
It features a basic clock and a digital day counter
It's very basic and clean yet very effective
It features a basic clock and a digital day counter
\------------------------------------------------------/
| |
| |
| |
| |
/ \
/------------------Commands------------------\
ZBCplus is easy to use
SetHour(Hour);
SetDay(Day);
GetHour();
GetDay();
public OnZBCTimeTick()
public OnZBCDayChange()
SetHour(Hour);
SetDay(Day);
GetHour();
GetDay();
public OnZBCTimeTick()
public OnZBCDayChange()
\--------------------------------------------/
| |
| |
| |
| |
/ \
/------------------Download------------------\
\-------------------/
_________________________________________________o What is ZBCplusAccess?
ZBCplusAccess is a digital clock and day counter
It can be used to do many things that are linked to the days or even hours of ZBC
Example: Player's can only race on Tuesdays between 6:00 and 17:00
o Installing ZBCplusAccess
- Copy ZBCplusAccess.inc to \Pawno\includes\
- Script additions:
- Top of script
Code:
#include <ZBCplusAccess>
- Style is from 0 - 1 (For now)
- See previews for style references
Code:
InitializeZBC(style);
Code:
public OnZBCTimeTick() { } public OnZBCDayChange() { }
Code:
LoadZBCText(playerid);
o ZBCplusAccess callbacks and stocks
SetHour(Hour); // To set the hour
SetDay(Day); // To set the day
GetHour(); // Returns the current hour
GetDay(); // Returns the current day
public OnZBCTimeTick() // Called when the seconds on the clock changes
public OnZBCDayChange() // Called when the day changes
o Using ZBCplusAccess
There is no direct way for using ZBCplusAccess, so here are a few example lines
A checkpoint appears only on Mondays
Code:
public OnZBCDayChange() { if(GetDay() == ZBC_MONDAY) { for(new i=0;i<MAX_PLAYERS;i++) { SetPlayerCheckpoint(i, 0.0, 0.0, 0.0, 5.0); } } }
Code:
public OnPlayerEnterCheckpoint(playerid) { if(GetHour() > 5 && GetHour() < 15) { SendClientMessage(playerid, COLOR_RED, "You may race"); } else { SendClientMessage(playerid, COLOR_RED, "Come back between 5:00 and 15:00"); } return 1; }