Just can't fix it, help please!
#1

I got 2 error when I compile my gamemode:

pawn Код:
C:\DOCUME~1\Fmfan\Desktop\Server\GAMEMO~1\tdm.pwn(780) : error 076: syntax error in the expression, or invalid function call
C:\DOCUME~1\Fmfan\Desktop\Server\GAMEMO~1\tdm.pwn(801) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Line 780
pawn Код:
KillTimer(BombBoom);
and 801
pawn Код:
KillTimer(BombBoom);
Reply
#2

Where and how are you setting the timer ? Can we see the code ?
Reply
#3

when player enters checkpoint timer starts

pawn Код:
SetTimer("BombBoom",120000,0);
pawn Код:
public BombBoom()
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(Planted == 1)
        {
            CreateExplosion(2005.4860,-131.8112,19.1708,10,10.0);
            CreateExplosion(2005.4860+4,-131.8112,19.1708,10,10.0);
            CreateExplosion(2005.4860-4,-131.8112,19.1708,10,10.0);
            CreateExplosion(2005.4860,-131.8112+4,19.1708,10,10.0);
            CreateExplosion(2005.4860,-131.8112-4,19.1708,10,10.0);
            CreateExplosion(2005.4860,-131.8112,19.1708+4,10,10.0);
            DestroyObject(Bomb);
            SendClientMessageToAll(COLOR_YELLOW,"BOMB: Rangers base has been destroyed! Terrorists have won this round!");
            SendClientMessageToAll(COLOR_RED,"HINT: New round starting in 10 seconds!");
            KillsTerroristTeam++;
            TogglePlayerControllable(i,0);
            SetTimer("SelectClass",10000,0);
        }
        if(Planted == 2)
        {
            CreateExplosion(1903.6765,-568.5011,32.6676,10,10.0);
            CreateExplosion(1903.6765+4,-568.5011,32.6676,10,10.0);
            CreateExplosion(1903.6765-4,-568.5011,32.6676,10,10.0);
            CreateExplosion(1903.6765,-568.5011+4,32.6676,10,10.0);
            CreateExplosion(1903.6765,-568.5011-4,32.6676,10,10.0);
            CreateExplosion(1903.6765,-568.5011,32.6676+4,10,10.0);
            DestroyObject(Bomb);
            SendClientMessageToAll(COLOR_YELLOW,"BOMB: Terrorist base has been destroyed! Rangers have won this round!");
            SendClientMessageToAll(COLOR_RED,"HINT: New round starting in 10 seconds!");
            KillsRangerTeam++;
            TogglePlayerControllable(i,0);
            SetTimer("SelectClass",10000,0);
        }
    }
    return 1;
}
Reply
#4

KillTimer(ID);


ID
= ID returned by SetTimer or SetTimerEx.


Pozdrawiam!.



Replace the loops on foreach , will be faster.
Reply
#5

To kill a timer is like this
pawn Код:
new
      SCTimer;

SCTimer = SetTimer("SelectClass",10000,0);
KillTimer(SCTimer);
Reply
#6

Quote:
Originally Posted by Fmfan
Посмотреть сообщение
when player enters checkpoint timer starts

pawn Код:
public BombBoom()
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(Planted == 1)
        {
            CreateExplosion(2005.4860,-131.8112,19.1708,10,10.0);
            CreateExplosion(2005.4860+4,-131.8112,19.1708,10,10.0);
            CreateExplosion(2005.4860-4,-131.8112,19.1708,10,10.0);
            CreateExplosion(2005.4860,-131.8112+4,19.1708,10,10.0);
            CreateExplosion(2005.4860,-131.8112-4,19.1708,10,10.0);
            CreateExplosion(2005.4860,-131.8112,19.1708+4,10,10.0);
            DestroyObject(Bomb);
            SendClientMessageToAll(COLOR_YELLOW,"BOMB: Rangers base has been destroyed! Terrorists have won this round!");
            SendClientMessageToAll(COLOR_RED,"HINT: New round starting in 10 seconds!");
            KillsTerroristTeam++;
            TogglePlayerControllable(i,0);
            SetTimer("SelectClass",10000,0);
        }
        if(Planted == 2)
        {
            CreateExplosion(1903.6765,-568.5011,32.6676,10,10.0);
            CreateExplosion(1903.6765+4,-568.5011,32.6676,10,10.0);
            CreateExplosion(1903.6765-4,-568.5011,32.6676,10,10.0);
            CreateExplosion(1903.6765,-568.5011+4,32.6676,10,10.0);
            CreateExplosion(1903.6765,-568.5011-4,32.6676,10,10.0);
            CreateExplosion(1903.6765,-568.5011,32.6676+4,10,10.0);
            DestroyObject(Bomb);
            SendClientMessageToAll(COLOR_YELLOW,"BOMB: Terrorist base has been destroyed! Rangers have won this round!");
            SendClientMessageToAll(COLOR_RED,"HINT: New round starting in 10 seconds!");
            KillsRangerTeam++;
            TogglePlayerControllable(i,0);
            SetTimer("SelectClass",10000,0);
        }
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/KillTimer

Read this link, look on how the timer is set up and then killed.
Reply
#7

Thanks, now it works
Reply
#8

I explained him ....
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)