// ------ Forwards
forward Realtime();
// ------ OnGameModeInit();
SetTimer("Realtime", 1000, 1);
// ------ Public RealTime
public Realtime()
{
new hour, minute, second;
gettime(hour, minute, second);
SetWorldTime(hour);
return 1;
}
// ------ Forwards
forward Realtime();
// ------ OnGameModeInit();
SetTimer("Realtime", 1000, 1);
// ------ Public RealTime
public Realtime()
{
new hour, minute, second;
gettime(hour, minute, second);
SetWorldTime(hour);
if(minute == 00 && second == 00)
{
BLA BLA BLA
}
return 1;
}
I dunno if it would work but you can try doing like this:
pawn Код:
|
Just change time on your PC and you can test it in a minute.
P.S look again at my post I fixed that it wouldn't give payday every second till first minue passes. |
public Realtime(playerid)
{
new hour, minute, second;
gettime(hour, minute, second);
SetWorldTime(hour);
if(minute == 00 && second == 00)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SendClientMessage(i, COLOR_WHITE, "------ PAYDAY");
if(gPlayerInfo[playerid][pLevel] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You received $1000");
GivePlayerMoney(playerid, 1000);
}
else if(gPlayerInfo[playerid][pLevel] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You received $2000");
GivePlayerMoney(playerid, 2000);
}
}
}
return 1;
}
public SyncTime() { new string[64]; new tmphour; new tmpminute; new tmpsecond; gettime(tmphour, tmpminute, tmpsecond); FixHour(tmphour); tmphour = shifthour; if ((tmphour > ghour) || (tmphour == 0 && ghour == 23)) { format(string, sizeof(string), "* The time is now %d:00 hours",tmphour); BroadCast(COLOR_WHITE,string); ghour = tmphour; //here you put your payday or declare a public PayDay(and here put PayDay(); ) if (realtime) { SetWorldTime(tmphour); } } }
public Realtime(playerid)
{
new hour, minute, second;
gettime(hour, minute, second);
SetWorldTime(hour);
if(minute == 00 && second == 00)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SendClientMessage(i, COLOR_WHITE, "------ PAYDAY");
if(gPlayerInfo[playerid][pLevel] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You received $1000");
GivePlayerMoney(playerid, 1000);
}
else if(gPlayerInfo[playerid][pLevel] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "You received $2000");
GivePlayerMoney(playerid, 2000);
}
}
}
}
return 1;
}