Timer assistance.
#1

Errors:
pawn Код:
C:\Users\User\Desktop\Folders\Servers\Samp\IBS\gamemodes\IBS.pwn(11503) : error 028: invalid subscript (not an array or too many subscripts): "TruckerTime"
C:\Users\User\Desktop\Folders\Servers\Samp\IBS\gamemodes\IBS.pwn(11503) : warning 215: expression has no effect
C:\Users\User\Desktop\Folders\Servers\Samp\IBS\gamemodes\IBS.pwn(11503) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\Folders\Servers\Samp\IBS\gamemodes\IBS.pwn(11503) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\Folders\Servers\Samp\IBS\gamemodes\IBS.pwn(11503) : fatal error 107: too many error messages on one line

pawn Код:
CMD:deliverpackages(playerid, params[])
{
    new string[128], packages, oldj, newj, price;
    // L1: 0 | L2: 100 | L3: 300 | L4: 700 | L5: 1200
    if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 100) packages = 5;
    else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 300) packages = 10;
    else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 700) packages = 15;
    else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] < 1200) packages = 20;
    else if(PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] >= 1200) packages = 25;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pJob] != JOB_TRUCKER && PlayerInfo[playerid][pVIPJob] != JOB_TRUCKER) return SendClientMessage(playerid, COLOR_GREY, "You are not a Trucker.");
    if(!PlayerInfo[playerid][pTPackages]) return SendClientMessage(playerid, COLOR_GREY, "You have no packages on you.");
    if(PlayerInfo[playerid][pDeliverTruck] != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_GREY, "This is not the vehicle that your packages were loaded to.");
    if(!IsPlayerInRangeOfPoint(playerid, 5, 553.6295,-1765.6705,5.7703)) return SendClientMessage(playerid, COLOR_GREY, "You are not near a packages dropoff.");
    if(Products >= 10000) return SendClientMessage(playerid, COLOR_GREY, "The dropoff can't hold anymore products at the moment.");
    TruckerTime[playerid] = 15;//Line 11503
    SetTimerEx("TruckerTime", 1500, false, "i", playerid);
    return 1;
}

pawn Код:
forward TruckerTime(playerid);
public TruckerTime(playerid)
{
    if(IsPlayerLoggedIn(playerid))
    {
        new string[128];
        if(TruckerTime[playerid] > 0)
        {
            format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Delivery Time: ~w~%d ~r~seconds", TruckerTime[playerid]);
            GameTextForPlayer(playerid, string,1500, 3);
            HospitalTime[playerid] --;
            HospitalCountDown[playerid] = SetTimerEx("HospitalTimer", 1000, false, "d", playerid);
        }
        else if(TruckerTime[playerid] <= 0)
        {
            oldj = strval(RPJL(playerid,JOB_TRUCKER));
            PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] ++;
            if(DayRespectEnd >= 1)
            {
            PlayerInfo[playerid][pJobSkill][JOB_TRUCKER] ++;
            }
            Products += packages;
            if(Products > 10000) Products = 10000;
            newj = strval(RPJL(playerid,JOB_TRUCKER));
            if(PlayerInfo[playerid][pTPackages] == 1) {price = packages*500;}
            else if(PlayerInfo[playerid][pTPackages] == 2) {price = packages*600;}
            GiveDodMoney(playerid, price);
            PlayerInfo[playerid][pDeliverTruck] = -1;
            TruckPackages[GetPlayerVehicleID(playerid)] = -1;
            format(string, sizeof(string), "* %s has delivered %d electronic crates from the pickup.", RPN(playerid), packages);
            SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
            format(string, sizeof(string), "You have delievered %d Electronic Crates", packages);
            SendClientMessage(playerid, STATSGG, string);
            if(oldj < newj)
            {
                format(string, sizeof(string), "** Your Trucker level is now %d, you can now carry %d packages. **", newj, newj*5);
                SendClientMessage(playerid, COLOR_YELLOW, string);
            }
            format(string, sizeof(string), "Electronics Dropoff\n{FFFF00}/deliverpackages to deliver crates\nAvailable Products: %d/10000", Products);
            UpdateDynamic3DTextLabelText(ProductsText, COLOR_RED, string);
            PlayerInfo[playerid][pTPackages] = 0;
            }
        }
    }
    return 1;
}
Reply
#2

Try changing your function name to a different one instead of the exact same name as your 'TruckerTime' variable.
pawn Код:
// on command
SetTimerEx("TruckerTimeEx", 1500, false, "i", playerid);

// outside
forward TruckerTimeEx(playerid);
public TruckerTimeEx(playerid)
Reply
#3

Quote:
Originally Posted by Loot
Посмотреть сообщение
Try changing your function name to a different one instead of the exact same name as your 'TruckerTime' variable.
pawn Код:
// on command
SetTimerEx("TruckerTimeEx", 1500, false, "i", playerid);

// outside
forward TruckerTimeEx(playerid);
public TruckerTimeEx(playerid)
That didnt work

Still same error
Reply
#4

How did you defined 'TruckerTime'?
Reply
#5

With the public truckertime
Reply
#6

You're not making much sense.. How did you defined the 'TruckerTime' variable?
i.e
pawn Код:
new TruckerTime;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)