Problem with a job
#2

pawn Код:
CMD:getmats(playerid, params[])
{
    new string[128], packages;
    if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 100) packages = 5;
    else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 300) packages = 10;
    else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 700) packages = 15;
    else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] < 1200) packages = 20;
    else if(PlayerInfo[playerid][pJobSkill][JOB_WSMUGGLER] >= 1200) packages = 25;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pMPackages]) return SendClientMessage(playerid, COLOR_GREY, "You already have packages.");
    if(!IsPlayerInRangeOfPoint(playerid, 3, -172.3404,1022.7706,19.7422)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the Materials Pickup.");
    if(PlayerInfo[playerid][pMoney] < packages*25) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you.");
    PlayerInfo[playerid][pMPackages] = 1;
    GiveZaiatMoney(playerid, -(packages*25));
    if(PointInfo[3][pOwner])
    {
        new idx = PointInfo[3][pOwner];
        FamInfo[idx][fMoney] += packages*25;
        PointInfo[3][pProfit] += packages*25;
    }
    format(string, sizeof(string), "* %s has loaded %d materials 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 materials{33CCFF} packages for {FF6347}$%d{33CCFF}, deliver them to the Materials Dropoff. (Checkpoint)", packages, packages*25);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SetPlayerCheckpoint(playerid,-21.4871,1159.8158,19.3902,3);
    AntiTPTimer[playerid] = SetTimerEx("AntiTPHacks", 30000, false, "d", playerid);
    return 1;
}
will work perfectly fine!
Reply


Messages In This Thread
Problem with a job - by Oscii - 11.11.2012, 14:45
Re: Problem with a job - by XtremeR - 11.11.2012, 15:01
Re: Problem with a job - by Oscii - 11.11.2012, 15:26

Forum Jump:


Users browsing this thread: 1 Guest(s)