22.03.2009, 00:24
Im making a Cops And Robbers and i want to have a clock with the time and day, im using the toggleplayerclock and i got this function from lvrcr
but every time the time hits 13:00 it resets to 12:00 why is this happening, and how can i fix it?
also the timer is:
Thanks in advance!
pawn Код:
public TimeWorld()
{
if(gametime == 23 && gameday == 7)
gametime++;
if(gametime >= 24) {
gametime =0;
}
if(gametime == 0 && gameday <= 7) {
gameday ++;
}
for(new i=0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetPlayerTime(i,gametime,0);
}
}
new string[30];
SetWorldTime(gametime);
format(string, sizeof(string), "Game Time: %d:00", gametime);
SendClientMessageToAll(0x5F9EA0AA, string);
if(gametime == 0 && gameday == 1) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Monday");
}
if(gametime == 0 && gameday == 2) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Tuesday");
}
if(gametime == 0 && gameday == 3) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Wednesday");
}
if(gametime == 0 && gameday == 4) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Thursday");
}
if(gametime == 0 && gameday == 5) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Friday");
}
if(gametime == 0 && gameday == 6) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Saturday");
}
if(gametime == 0 && gameday == 7) {
SendClientMessageToAll(0x5F9EA0AA,"Game Day: Sunday");
}
if(gametime == 23 && gameday == 7) {
SendClientMessageToAll(0x2587CEAA,"*Game Day: This week is over.");
SendClientMessageToAll(0x2587CEAA,"*AutoAdmin: Don't forget to visit our website at ");
}
}
also the timer is:
pawn Код:
SetTimer("TimeWorld",60000,1);