Timers are getting spammed
#1

So i have a problem with a timer.
The timer works perfectly but after a few times the timer has executed, it will start to spam.
The timer creates a fire scene every 10 minutes and this is how it went.

Log:
Код:
[14:35:21]A fire has reported at the Los Santos Well Stacked Pizza! A waypoint has been set on your map.
[14:45:21]A fire has reported at the Los Santos Police Department! A waypoint has been set on your map.
[14:55:21]A fire has reported at the Los Santos Well Stacked Pizza! A waypoint has been set on your map.
So it gets executed like that correctly for about 3-4 times. And then it will be like this:

Код:
[14:02:21]A fire has reported at the Los Santos Well Stacked Pizza! A waypoint has been set on your map.
[14:02:21]A fire has reported at the Los Santos Well Stacked Pizza! A waypoint has been set on your map.
[14:02:21]A fire has reported at the Los Santos Police Department! A waypoint has been set on your map.
[14:02:21]A fire has reported at the Los Santos Well Stacked Pizza! A waypoint has been set on your map.
What is causing these timers to spam?
Code:
PHP код:
CreateRandomFire()
{
    
SetTimer("CreateRandomFire2"600000true);
}
public 
CreateRandomFire2()
{
    new 
RandomFireSceneID randomEx(1,3);
    if(
RandomFireSceneID == 1)
    {
        
SetTimer("CreateFireScene1"5000false);
        
printf("FireScene ID %d created"RandomFireSceneID);
    }
    else if(
RandomFireSceneID == 2)
    {
        
SetTimer("CreateFireScene2"5000false);
        
printf("FireScene ID %d created"RandomFireSceneID);
    }
    else if(
RandomFireSceneID == 3)
    {
        
SetTimer("CreateFireScene3"5000false);
        
printf("FireScene ID %d created"RandomFireSceneID);
    }
    else{ 
printf("FireScene ID %d created - ERROR: INVALID FIRESCENE ID"RandomFireSceneID); }
}
FireScene1Explosion()
{
    
CreateExplosion(1940.4148,-1766.9110,13.3828,750.0);
    
CreateExplosion(1940.4510,-1767.8013,13.3828,150.0);
    
CreateExplosion(1940.5105,-1769.2581,13.3906,750.0);
    
CreateExplosion(1940.6862,-1773.7482,13.3906,150.0);
    
CreateExplosion(1940.6628,-1774.6421,13.3906,750.0);
    
CreateExplosion(1940.7078,-1775.9058,13.3906,150.0);
    
CreateExplosion(1940.7634,-1777.2809,13.3906,750.0);
    
CreateExplosion(1942.7527,-1779.1779,13.3906,150.0);
    
CreateExplosion(1942.7870,-1777.1068,13.3906,750.0);
    
CreateExplosion(1942.7706,-1776.0867,13.3906,150.0);
}
CreateFireScene1()
{
    
CreateFire(1940.3667,-1765.7322,13.3828);
    
CreateFire(1940.4148,-1766.9110,13.3828);
    
CreateFire(1940.4510,-1767.8013,13.3828);
    
CreateFire(1940.5105,-1769.2581,13.3906);
    
CreateFire(1940.6560,-1772.8573,13.3906);
    
CreateFire(1940.7115,-1780.1647,13.3906);
    
CreateFire(1940.7305,-1780.6343,13.3906);
    
CreateFire(1941.8922,-1780.9696,13.6406);
    
CreateFire(1942.7533,-1775.0256,13.3906);
    
CreateFire(1942.7360,-1773.9657,13.3906);
    
CreateFire(1942.7189,-1772.8800,13.3906);
    
CreateFire(1942.6665,-1766.2865,13.3906);
    
CreateFire(1941.8967,-1768.6536,13.6406);
    
CreateFire(1941.5769,-1777.1378,13.6406);
    
CreateExplosion(1940.4148,-1766.9110,13.3828,750.0);
    
CreateExplosion(1940.4510,-1767.8013,13.3828,150.0);
    
CreateExplosion(1940.5105,-1769.2581,13.3906,750.0);
    
CreateExplosion(1940.6862,-1773.7482,13.3906,150.0);
    
CreateExplosion(1940.6628,-1774.6421,13.3906,750.0);
    
CreateExplosion(1940.7078,-1775.9058,13.3906,150.0);
    
CreateExplosion(1940.7634,-1777.2809,13.3906,750.0);
    
CreateExplosion(1942.7527,-1779.1779,13.3906,150.0);
    
CreateExplosion(1942.7870,-1777.1068,13.3906,750.0);
    
CreateExplosion(1942.7706,-1776.0867,13.3906,150.0);
    for(new 
i=0i<GetMaxPlayers(); i++)
    {
        if(
FireFighterDuty[i] == 1)
        {
            
SetPlayerCheckpoint(i1941.5769,-1777.1378,13.640610);
            
SendClientMessage(iYELLOW"A fire has reported at the Idlewood Gas station! A waypoint has been set on your map.");
            
SetTimer("FireScene1Explosion"300000false);
        }
    }
}
CreateFireScene2()
{
    
CreateFire(2105.4541,-1809.0553,13.5547);
    
CreateFire(2105.4546,-1812.5132,13.5547);
    
CreateFire(2105.4546,-1813.8372,13.5547);
    
CreateFire(2105.4546,-1814.9622,13.5547);
    
CreateFire(2105.4546,-1815.7231,13.5547);
    
CreateFire(2105.4546,-1816.7444,13.5547);
    
CreateFire(2105.0559,-1817.8400,13.5547);
    
CreateFire(2105.0562,-1818.9226,13.5547);
    
CreateFire(2105.0562,-1819.9209,13.5547);
    
CreateFire(2105.0562,-1820.7207,13.5547);
    
CreateFire(2105.0562,-1821.1449,13.5547);
    
CreateFire(2105.4539,-1810.0212,13.5547);
    
CreateFire(2105.4539,-1808.7922,13.5547);
    
CreateFire(2105.4546,-1808.4257,13.5547);
    
CreateFire(2105.4546,-1808.0524,13.5547);
    
CreateFire(2104.6694,-1804.6604,13.5547);
    
CreateFire(2105.4524,-1802.7878,13.5547);
    
CreateFire(2105.0098,-1802.9845,13.5547);
    
CreateFire(2104.4299,-1803.8354,13.5547);
    
CreateFire(2104.5181,-1804.2377,13.5547);
    
CreateFire(2105.4500,-1800.5033,13.5547);
    
CreateFire(2105.4524,-1799.2987,13.5547);
    
CreateFire(2105.4546,-1797.8348,13.5547);
    
CreateFire(2105.4546,-1796.7789,13.5547);
    
CreateFire(2105.0566,-1795.6096,13.5547);
    
CreateFire(2105.0554,-1793.9987,13.5547);
    
CreateFire(2105.0557,-1793.0624,13.5547);
    
CreateFire(2105.0559,-1791.7745,13.5547);
    
CreateFire(2107.2568,-1790.6924,13.5547);
    
CreateFire(2106.5500,-1790.6963,13.5608);
    
CreateFire(2105.5706,-1790.6964,13.5608);
    
CreateFire(2108.6060,-1789.5652,13.5608);
    
CreateFire(2110.8472,-1790.6439,13.5547);
    
CreateFire(2111.2791,-1790.6949,13.5547);
    
CreateFire(2112.2510,-1790.6965,13.5547);
    
CreateFire(2114.2637,-1790.6948,13.5547);
    
CreateFire(2116.3760,-1790.5135,13.5547);
    
CreateFire(2115.7329,-1789.0369,13.5547);
    
CreateFire(2117.8164,-1790.6967,13.5547);
    
CreateFire(2120.2659,-1790.6964,13.5547);
    
CreateFire(2121.8438,-1790.6962,13.5547);
    for(new 
i=0i<GetMaxPlayers(); i++)
    {
        if(
FireFighterDuty[i] == 1)
        {
            
SetPlayerCheckpoint(i2094.0232,-1795.9932,13.382810);
            
SendClientMessage(iYELLOW"A fire has reported at the Los Santos Well Stacked Pizza! A waypoint has been set on your map.");
        }
    }
}
CreateFireScene3()
{
    
CreateFire(1553.4055,-1671.4658,13.5566);
    
CreateFire(1551.3912,-1671.1405,13.5606);
    
CreateFire(1549.9275,-1671.6992,13.5634);
    
CreateFire(1548.0096,-1671.6429,13.5672);
    
CreateFire(1546.2527,-1671.5811,13.5620);
    
CreateFire(1544.8984,-1671.5331,13.5593);
    
CreateFire(1544.0471,-1672.0621,13.5576);
    
CreateFire(1544.0181,-1672.8851,13.5576);
    
CreateFire(1543.9907,-1673.6575,13.5575);
    
CreateFire(1545.5009,-1673.9376,13.5605);
    
CreateFire(1546.7030,-1673.9800,13.5628);
    
CreateFire(1547.9851,-1674.0253,14.3155);
    
CreateFire(1549.0299,-1674.0621,14.7763);
    
CreateFire(1550.0518,-1674.0983,15.2271);
    
CreateFire(1550.8541,-1674.1268,15.5825);
    
CreateFire(1551.5203,-1674.1506,15.8768);
    
CreateFire(1552.2081,-1674.1749,16.1806);
    
CreateFire(1552.0754,-1675.1989,16.1283);
    
CreateFire(1551.3710,-1675.1740,15.8171);
    
CreateFire(1550.6675,-1675.1492,15.5064);
    
CreateFire(1549.8987,-1675.1218,15.1653);
    
CreateFire(1548.9441,-1675.4928,14.7465);
    
CreateFire(1548.5178,-1675.4778,14.5585);
    
CreateFire(1547.8390,-1675.4537,14.2591);
    
CreateFire(1547.4344,-1675.4392,14.0806);
    
CreateFire(1547.0083,-1675.4240,13.8927);
    
CreateFire(1546.6041,-1675.4095,13.5626);
    
CreateFire(1546.0631,-1676.8027,13.5616);
    
CreateFire(1547.5126,-1676.8539,14.1230);
    
CreateFire(1548.9840,-1676.9060,14.7738);
    
CreateFire(1549.3652,-1676.9194,14.9422);
    
CreateFire(1550.0856,-1677.1073,15.2614);
    
CreateFire(1551.0057,-1677.3900,15.6695);
    
CreateFire(1543.9316,-1678.3267,13.5574);
    
CreateFire(1544.7389,-1679.3574,13.5590);
    
CreateFire(1546.1119,-1679.6139,13.5617);
    
CreateFire(1547.3602,-1679.6576,13.5606);
    
CreateFire(1548.7368,-1679.7059,13.5579);
    
CreateFire(1550.4795,-1679.7677,13.5545);
    
CreateFire(1552.4995,-1679.8390,13.5506);
    
CreateFire(1552.9174,-1679.8538,13.5498);
    
CreateFire(1544.3591,-1685.2698,13.9214);
    
CreateFire(1543.8118,-1686.8868,13.9214);
    
CreateFire(1543.8940,-1688.4705,13.9214);
    
CreateFire(1544.4056,-1690.4561,13.9214);
    
CreateFire(1544.3500,-1691.5630,13.9214);
    
CreateFire(1544.5317,-1692.7526,13.9214);
    
CreateFire(1544.6454,-1693.6128,13.9214);
    for(new 
i=0i<GetMaxPlayers(); i++)
    {
        if(
FireFighterDuty[i] == 1)
        {
            
SetPlayerCheckpoint(i1535.7970,-1676.6605,13.382810);
            
SendClientMessage(iYELLOW"A fire has reported at the Los Santos Police Department! A waypoint has been set on your map.");
        }
    }

Reply
#2

bump
Reply
#3

Not really sure, but I think your functions have to be public (and thus must be forwarded).
Reply
#4

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Not really sure, but I think your functions have to be public (and thus must be forwarded).
Thank you for the suggestion, unfortunate this did not work.

any other suggestions?
Reply
#5

Edit: Sorry I didnt look better your codes, have you tried with return 1; at the end of timers?

And where CreateRandomFire(); calls?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)