18.02.2010, 17:53
This just came out from my mind:
pawn Код:
new
Timer,
Time[MAX_PLAYERS][2];
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/quickly", true) == 0)
{
Timer = SetTimer("Quick", 47, true);
GameTextForAll("~g~24 ~w~seconds day!", 5000, 0);
return 1;
}
return 0;
}
pawn Код:
forward Quick();
public Quick()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TogglePlayerClock(i, 1);
Time[i][0] ++;
if(Time[i][0] == 60)
{
Time[i][0] = 0;
Time[i][1] ++;
}
if(Time[i][1] == 24)
{
Time[i][1] = 0;
Time[i][0] = 0;
KillTimer(Timer);
SendClientMessage(playerid, COLOR_GREEN, "* Have you seen that?");
}
SetPlayerTime(i, Time[i][1], Time[i][0]);
}
}
return 1;
}