SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/02/2013, 06:26 PM   #1
mrtms
Big Clucker
 
Join Date: Jul 2012
Location: WA
Posts: 97
Reputation: 9
Default Timer

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!
mrtms is offline   Reply With Quote
Old 05/02/2013, 06:29 PM   #2
zde5
Little Clucker
 
Join Date: Jul 2009
Location: Croatia
Posts: 48
Reputation: 4
Default Re: Timer

post it in Script Request Thread (http://forum.sa-mp.com/showthread.php?t=187229)
zde5 is offline   Reply With Quote
Old 05/02/2013, 06:32 PM   #3
mrtms
Big Clucker
 
Join Date: Jul 2012
Location: WA
Posts: 97
Reputation: 9
Default Re: Timer

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:

mrtms is offline   Reply With Quote
Old 05/02/2013, 06:35 PM   #4
zde5
Little Clucker
 
Join Date: Jul 2009
Location: Croatia
Posts: 48
Reputation: 4
Default Re: Timer

first two [debug] lines are saying that you are accessing array with negative element (ex. a[-1])
zde5 is offline   Reply With Quote
Old 05/02/2013, 06:38 PM   #5
mrtms
Big Clucker
 
Join Date: Jul 2012
Location: WA
Posts: 97
Reputation: 9
Default Re: Timer

PHP Code:
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.
mrtms is offline   Reply With Quote
Old 05/02/2013, 06:40 PM   #6
mrtms
Big Clucker
 
Join Date: Jul 2012
Location: WA
Posts: 97
Reputation: 9
Default Re: Timer

Wow never mind I noticed the problem...
mrtms is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Timer Help] Score saving timer, should it always be running or should it be killed? Ghost100 Scripting Help 6 08/10/2012 10:12 PM
Timer Countdown [ huge timer's ] RicaNiel Scripting Help 4 28/08/2012 12:43 PM
Timer bartje01 Help Archive 3 15/06/2011 08:42 PM
A timer that loops through all players or a timer for each player? x-cutter Help Archive 2 28/05/2011 03:35 PM
Bug Into The Timer Mr.Obscure Help Archive 12 05/09/2010 11:13 AM


All times are GMT. The time now is 12:09 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.