SA-MP Forums Archive
Some errors .. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Some errors .. (/showthread.php?tid=486769)



Some errors .. - Kyance - 10.01.2014

Eh, I'm creating some special "timers" for the team that owns the Train-Station, but i get these errors:

Код:
test2.pwn(2135) : error 028: invalid subscript (not an array or too many subscripts): "RSTimer"
test2.pwn(2135) : warning 215: expression has no effect
test2.pwn(2135) : error 001: expected token: ";", but found "]"
test2.pwn(2135) : error 029: invalid expression, assumed zero
test2.pwn(2135) : fatal error 107: too many error messages on one line
The code:

pawn Код:
if(gTeam[playerid] == USArmy)
        {
            GangZoneShowForAll(Zone[CAPZONE], US_COLOR);
            SetTimerEx("USTimer", 180000, true, "i", playerid);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] != gTeam[playerid])
                {
                    KillTimer(RSTimer[i]); //Error line
                    KillTimer(CHTimer[i]);
                    KillTimer(SPTimer[i]);
                    KillTimer(NLTimer[i]);
                }
            }
        }
Do i need to create something for the "KillTimer"?


Re: Some errors .. - newbie scripter - 10.01.2014

Where did u use this code? the callback?


Re: Some errors .. - Kyance - 11.01.2014

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
here did u use this code? the callback?
Its placed in a stock for a capture zone

pawn Код:
stock CAPZONECaptured(playerid)
{
    if( Capturing{ playerid } )
    {
        Captured[playerid][CAPZONE] = 1;
        UnderAttack[CAPZONE] = 0;
        KillTimer(timer[playerid][CAPZONE]);
        CountVar[playerid][CAPZONE] = 25;
        GivePlayerScore(playerid, 3);
        GivePlayerMoney(playerid, 5000);
        GameTextForPlayer(playerid, "~g~Captured!~n~~g~+3 ~w~score~n~~w~+5'000~g~$", 5500, 3);
        //==========================================================================
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            IsPlayerCapturing[i][CAPZONE] = 0;
            if(gTeam[i] == gTeam[playerid])
            {
                if(playerid != i)
                {
                    SendClientMessage(i, 0xFFFFFFFF,"[NOTE] - Your team has captured the Train-Station! You received +1 score for it!");
                    GivePlayerScore(i, 1);
                }
            }
        }
        //==========================================================================
        tCP[CAPZONE] = gTeam[playerid];
        GangZoneStopFlashForAll(Zone[CAPZONE]);
        //==========================================================================
        if(gTeam[playerid] == USArmy)
        {
            GangZoneShowForAll(Zone[CAPZONE], US_COLOR);
            /*SetTimerEx("USTimer", 180000, true, "i", playerid);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] != gTeam[playerid])
                {
                    KillTimer(RSTimer[i]);
                    KillTimer(CHTimer[i]);
                    KillTimer(SPTimer[i]);
                    KillTimer(NLTimer[i]);
                }
            }*/

        }
        else if(gTeam[playerid] == RussianSpetsnaz)
        {
            GangZoneShowForAll(Zone[CAPZONE], COLOR_RED);
            /*SetTimerEx("RSTimer", 180000, true, "i", playerid);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] != gTeam[playerid])
                {
                    KillTimer(USTimer[i]);
                    KillTimer(CHTimer[i]);
                    KillTimer(SPTimer[i]);
                    KillTimer(NLTimer[i]);
                }
            }*/

        }
        else if(gTeam[playerid] == China)
        {
            GangZoneShowForAll(Zone[CAPZONE], China_COLOR);
            /*SetTimerEx("CHTimer", 180000, true, "i", playerid);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] != gTeam[playerid])
                {
                    KillTimer(RSTimer[i]);
                    KillTimer(USTimer[i]);
                    KillTimer(SPTimer[i]);
                    KillTimer(NLTimer[i]);
                }
            }*/

        }
        else if(gTeam[playerid] == Spain)
        {
            GangZoneShowForAll(Zone[CAPZONE], Spain_COLOR);
            /*SetTimerEx("SPTimer", 180000, true, "i", playerid);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] != gTeam[playerid])
                {
                    KillTimer(RSTimer[i]);
                    KillTimer(CHTimer[i]);
                    KillTimer(USTimer[i]);
                    KillTimer(NLTimer[i]);
                }
            }*/

        }
        else if(gTeam[playerid] == Netherlands)
        {
            GangZoneShowForAll(Zone[CAPZONE], NL_COLOR);
            /*SetTimerEx("NLTimer", 180000, true, "i", playerid);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(gTeam[i] != gTeam[playerid])
                {
                    KillTimer(RSTimer[i]);
                    KillTimer(CHTimer[i]);
                    KillTimer(USTimer[i]);
                    KillTimer(SPTimer[i]);
                }
            }*/

        }
        //==========================================================================
        new str[128];
        format(str, sizeof(str),"* %s has captured the Train-Station!", GetName(playerid));
        SendClientMessageToAll(COLOR_ORANGE, str);
    }
    return 1;
}



Re: Some errors .. - Kyance - 13.01.2014

fixed