Gang Points
#1



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(pointtime);
public 
PointCaptureTimer(pointtime)
{
    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_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);
    }
    return 
1;

I'm not to sure what's making this happen. Any help would be greatly apprecaited!
Reply
#2

Never mind, fixed it! Thanks anyways!

EDIT: Never mind I DID NOT fix it. Help me out please!
Reply
#3

Ok I didn't fix it evidently. Whenever I move/jump it gives me that error in the CMD. This is the function that counts down from 10-0.

PHP код:
forward PointProgressTimer(pointtime);
public 
PointProgressTimer(pointtime)
{
    if(
PointCapper[point] != INVALID_PLAYER_ID && time 0)
    {
        new 
FloatcCoords[3];
        
GetPlayerPos(PointCapper[point], cCoords[0], cCoords[1], cCoords[2]); //Get the players coordinates
        //If the player moves from the capture point at all, then he/she will lose the capture progress
         
PointTimeLeft[point]--;
        
SendClientMessageEx(PointCapper[point], COLOR_WHITE"Time: %d"PointTimeLeft[point]);
        if(
PointTimeLeft[point] == 0)
        {
            new 
string[84];
            
PointTimeToClaim[point] = gettime();
            
PointTimeLeft[point] = 600;
            
KillTimer(pointTimer);
             
captureTimer SetTimerEx("PointCaptureTimer"10000"dd"GetPointRange(PointCapper[point]), PointTimeLeft[point]);
            
format(stringsizeof(string), "%s is attempting to take over of the %s!"Families[famEnum(PointCapper[point])][fName], Point[GetPointRange(PointCapper[point])][poName]);
            
SendClientMessageToAll(COLOR_REDstring);
        }
    }
    if(
time 0)
    {
        new 
FloatcCoords[3];
        
GetPlayerPos(PointCapper[point], cCoords[0], cCoords[1], cCoords[2]); //Get the players coordinates
        //If the player moves from the capture point at all, then he/she will lose the capture progress
        
if(PointX[point] != cCoords[0] || PointY[point] != cCoords[1] || PointZ[point] != cCoords[2] || Injured[PointCapper[point]] > || !IsLoggedIn[PointCapper[point]] || playerTabbed[PointCapper[point]] == true)
        {
            
KillTimer(pointTimer);
            
//Alert the player that he moved and since doing so, he failed to capture the point
            
SendClientMessage(PointCapper[point], COLOR_GRAD3"You have failed to capture this point since you moved or are injured.");
            
PointX[point] = 0;
            
PointY[point] = 0;
            
PointZ[point] = 0;
            
PointCapper[point] = -1;
            
PointFam[point] = 0;
            
PointID[point] = -1;
            
PointTimeToClaim[point] = 0;
            
PointTimeLeft[point] = 0;
        }
        else
        {
            
pointTimer SetTimerEx("PointProgressTimer"10000"dd"GetPointRange(PointCapper[point]), time 1);
        }
    }
    return 
1;

Reply
#4

Anyone got any ideas? Any help would be greatly appreciated!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)