#1

I need a looping item that will check every second for 10 minutes straight. I need it done every second, also will this loop do any damage to my server, resource wise? This will be for points and I need some kind of countdown system and various checks for it to work. I have no idea where to start for this part. Any help will be appreciated!
Reply
#2

post it in Script Request Thread (https://sampforum.blast.hk/showthread.php?tid=187229)
Reply
#3

I have my own timer system but it seems that it's breaking when someone moves around and jumps. I have no idea why, here's what the Command Prompt displays:

Reply
#4

first two [debug] lines are saying that you are accessing array with negative element (ex. a[-1])
Reply
#5

PHP код:
forward PointCaptureTimer(pointtime);
public 
PointCaptureTimer(pointtime)
{
    new 
string[124];
    
printf("Time1: %d"PointTimeLeft[point]);
    if(
PointFam[point] != 0)
    {
         
printf("Time2: %d"PointTimeLeft[point]);
         
PointTimeLeft[point]--;
          if(
PointTimeLeft[point] == 0)
        {
               
Point[point][poFid] = PointFam[point];
               
format(Point[point][poCapper], MAX_PLAYER_NAMEpNameEx(PointCapper[point]));
            
Point[point][poDate] = gettime();
            
format(stringsizeof(string), "%s has successfully captured \"%s\"."Families[famEnum(Point[point][poCapper])][fName], Point[GetPointRange(Point[point][poCapper])][poName]);
            
ProxDetector(70.0Point[point][poCapper], stringCOLOR_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"10000"dd"GetPointRange(PointCapper[point]), time 1);
        
printf("Timer: %d"time);
    }
    return 
1;

The timer starts at 600 seconds and counts down from there. It doesn't display that error until I begin to move around and what not. I have no idea why it does that.
Reply
#6

Wow never mind I noticed the problem...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)