04.02.2013, 19:45
For whatever reason the timer is set at 10 minutes (600 seconds) and it only counts down to 596. Here's the code:
PHP код:
forward PointCaptureTimer(point, time);
public PointCaptureTimer(point, time)
{
new string[124];
if(PointCapper[point] != INVALID_PLAYER_ID)
{
PointTimeLeft[point]--;
printf("Time: %d", PointTimeLeft[point]);
if(PointTimeLeft[point] == 0)
{
Point[point][poFid] = PointFam[point];
format(Point[point][poCapper], MAX_PLAYER_NAME, pNameEx(PointCapper[point]));
Point[point][poDate] = gettime();
format(string, sizeof(string), "%s has successfully captured \"%s\".", Families[famEnum(Point[point][poCapper])][fName], Point[GetPointRange(Point[point][poCapper])][poName]);
ProxDetector(70.0, Point[point][poCapper], string, COLOR_RED);
PointX[point] = 0;
PointY[point] = 0;
PointZ[point] = 0;
PointCapper[point] = -1;
PointFam[point] = 0;
PointID[point] = -1;
PointTimeToClaim[point] = 0;
PointTimeLeft[point] = 0;
KillTimer(captureTimer);
}
}
if(time > 0)
{
captureTimer = SetTimerEx("PointCaptureTimer", 1000, 0, "dd", GetPointRange(PointCapper[point]), time - 1);
}
return 1;
}