loadpackages dont work
#3

1. Please dont Bump the threads by double posting.

2. Tried to fix your command a bit. Just changed some stuff. Try using it. [UNTESTED]

pawn Code:
CMD:loadpackages(playerid, params[])
{
    if(IsTruckerVehicle(GetPlayerVehicleID(playerid))) {
    new string[128], packages;
    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] == 2) return SendClientMessage(playerid, COLOR_GREY, "You already have overloaded packages.");
     return SendClientMessage(playerid, COLOR_GREY, "You are not in a Trucker vehicle.");
    if(!IsPlayerInRangeOfPoint(playerid, 5, 844.6911,-598.9043,18.4219)) return SendClientMessage(playerid, COLOR_GREY, "You are not near a packages pickup.");
    if(PlayerInfo[playerid][pMoney] < packages*5) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you.");
    PlayerInfo[playerid][pTPackages] ++;
    GiveZaiatMoney(playerid, -(packages*5));
    PlayerInfo[playerid][pDeliverTruck] = GetPlayerVehicleID(playerid);
    TruckPackages[GetPlayerVehicleID(playerid)] = playerid;
    format(string, sizeof(string), "* %s has loaded %d products packages 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 loaded {FF6347}%d products{33CCFF} packages for {FF6347}$%d{33CCFF}, deliver them to the dropoff. (Checkpoint)", packages, packages*5);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    if(PlayerInfo[playerid][pTPackages] != 2)
    {
        SendClientMessage(playerid, COLOR_WHITE, "You can overload packages by typing /loadpackages again, cops will be notified though.");
    }
    SetPlayerCheckpoint(playerid, 2222.5107,-2682.7368,13.5409, 2);
    if(PlayerInfo[playerid][pTPackages] == 2)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "* You have overloaded packages, the Police Department has been notified as a result.");
        SendCopMessage(COLOR_BLUE, "Products Depot: A truck has overloaded packages and is on it way to the dropoff now.");
    }
    }
    return SendClientMessage(playerid, COLOR_LIGHTRED, "<!> You need to be in a Trucker vehicle to use this command!");
    return 1;
}
Reply


Messages In This Thread
loadpackages dont work - by hulitubolies - 14.07.2012, 14:59
Re: loadpackages dont work - by hulitubolies - 14.07.2012, 15:10
Re: loadpackages dont work - by Ballu Miaa - 14.07.2012, 17:33
Re: loadpackages dont work - by hulitubolies - 14.07.2012, 17:52
Re: loadpackages dont work - by hulitubolies - 14.07.2012, 18:36
Re: loadpackages dont work - by Ballu Miaa - 14.07.2012, 18:52
Re: loadpackages dont work - by hulitubolies - 14.07.2012, 18:58
Re: loadpackages dont work - by Ballu Miaa - 14.07.2012, 19:06
Re: loadpackages dont work - by hulitubolies - 14.07.2012, 19:10
Re: loadpackages dont work - by hulitubolies - 14.07.2012, 19:19

Forum Jump:


Users browsing this thread: 1 Guest(s)