Help this cmd half works half not
#1

Pls Pls Pls Help me here is cmd
pawn Код:
CMD:getmats(playerid, params[])
{
    if (PlayerInfo[playerid][pJob] != 9 && PlayerInfo[playerid][pJob2] != 9 && PlayerInfo[playerid][pJob] != 18 && PlayerInfo[playerid][pJob2] != 18)
    {
        SendClientMessageEx(playerid,COLOR_GREY,"   You are not an Arms Dealer or Craftsman!");
        return 1;
    }
    if(GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
        return 1;
    }

    new mypoint = -1;
    new mypointex = -1;
    new mydeliver = 0;

    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    for (new i=0; i<MAX_POINTS; i++)
    {
        if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && Points[i][Type] == 1)
        {
            mypoint = i;
            mypointex = i;
            mydeliver = Points[i][MatPoint];
        }
    }
    if (IsPlayerInRangeOfPoint(playerid, 10.0, 2102.71, -103.97, 2.28)) // Matrun 3
    {
        new vehicle = GetPlayerVehicleID(playerid);
        if(IsABoat(vehicle))
        {
            if(GetPVarInt(playerid, "Packages") >= 10) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must deliver your packages first.");

            if(PlayerInfo[playerid][pDonateRank] == 1)
            {
                if(GetPlayerCash(playerid) < 1125)
                {
                    SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1125!");
                    return 1;
                }
                GivePlayerCash(playerid, -1125);
                SetPVarInt(playerid, "Packages", 23);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 23 Materials Packages for $1125.");
                SendClientMessageEx(playerid, COLOR_YELLOW,"Bronze VIP: You received 1.5x more packages, which will get you 1.5x more materials.");
            }
            else if(PlayerInfo[playerid][pDonateRank] == 2 || PlayerInfo[playerid][pDonateRank] == 3)
            {
                if(GetPlayerCash(playerid) < 1500)
                {
                    SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1500!");
                    return 1;
                }
                GivePlayerCash(playerid, -1500);
                SetPVarInt(playerid, "Packages", 30);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 30 Materials Packages for $1500.");
                SendClientMessageEx(playerid, COLOR_YELLOW,"Silver & Gold VIP: You received 2x more packages, which will get you 2x more materials.");
            }
            else if(PlayerInfo[playerid][pDonateRank] >= 4)
            {
                if(GetPlayerCash(playerid) < 1875)
                {
                    SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1875!");
                    return 1;
                }
                GivePlayerCash(playerid, -1875);
                SetPVarInt(playerid, "Packages", 38);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 38 Materials Packages for $1875.");
                SendClientMessageEx(playerid, COLOR_YELLOW,"Platinum VIP: You received 2.5x more packages, which will get you 2.5x more materials.");
            }
            else
            {
                if(GetPlayerCash(playerid) < 750)
                {
                    SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $750!");
                    return 1;
                }
                GivePlayerCash(playerid, -750);
                SetPVarInt(playerid, "Packages", 15);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 15 Materials Packages for $750.");
            }

            SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Follow the river to the West to get to the factory and deliver your Materials Packages.");
            SetPVarInt(playerid, "MatDeliver", 333);
            SetPVarInt(playerid, "tpMatRunTimer", 15);
            SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPMATRUNTIMER);
            SetPlayerCheckpoint(playerid, -330.44, -467.54, 0.85, 5);
            return 1;
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY," You are not in a boat!");
        }
        return 1;
    }
    if (IsPlayerInRangeOfPoint(playerid, 4.0, -1816.528686, -179.502624, 9.398437)) // Matrun 4
    {
        if(GetPVarInt(playerid, "Packages") >= 10) return SendClientMessageEx(playerid, COLOR_GRAD2, "You must deliver your packages first.");

        if(PlayerInfo[playerid][pDonateRank] == 1)
        {
            if(GetPlayerCash(playerid) < 900)
            {
                SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $900!");
                return 1;
            }
            GivePlayerCash(playerid, -900);
            SetPVarInt(playerid, "Packages", 18);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 18 Materials Packages for $900.");
            SendClientMessageEx(playerid, COLOR_YELLOW,"Bronze VIP: You received 1.5x more packages, which will get you 1.5x more materials.");
        }
        else if(PlayerInfo[playerid][pDonateRank] == 2 || PlayerInfo[playerid][pDonateRank] == 3)
        {
            if(GetPlayerCash(playerid) < 1200)
            {
                SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1200!");
                return 1;
            }
            GivePlayerCash(playerid, -1200);
            SetPVarInt(playerid, "Packages", 24);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 24 Materials Packages for $1200.");
            SendClientMessageEx(playerid, COLOR_YELLOW,"Silver & Gold VIP: You received 2x more packages, which will get you 2x more materials.");
        }
        else if(PlayerInfo[playerid][pDonateRank] >= 4)
        {
            if(GetPlayerCash(playerid) < 1500)
            {
                SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1500!");
                return 1;
            }
            GivePlayerCash(playerid, -1500);
            SetPVarInt(playerid, "Packages", 30);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 30 Materials Packages for $1500.");
            SendClientMessageEx(playerid, COLOR_YELLOW,"Platinum VIP: You received 2.5x more packages, which will get you 2.5x more materials.");
        }
        else
        {
            if(GetPlayerCash(playerid) < 600)
            {
                SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $600!");
                return 1;
            }
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 12 Materials Packages for $600.");
            GivePlayerCash(playerid, -600);
            SetPVarInt(playerid, "Packages", 12);
        }

        SetPVarInt(playerid, "MatDeliver", 444);
        SetPVarInt(playerid, "tpMatRunTimer", 12);
        SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPMATRUNTIMER);
        SetPlayerCheckpoint(playerid, -1872.879760, 1416.312500, 7.180089, 5);
        return 1;
    }
    if (mypoint == -1)
    {
        SendClientMessageEx(playerid, COLOR_GREY, " You are not at a Materials Pickup!");
        return 1;
    }
    mypoint = -1;
    for (new i=0; i<MAX_POINTS; i++)
    {
        if (Points[i][MatPoint] == mydeliver && Points[i][Type] == 2)
        {
            mypoint = i;
        }
    }
    if(PlayerInfo[playerid][pDonateRank] == 1)
    {
        if(GetPlayerCash(playerid) < 750)
        {
            SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $750!");
            return 1;
        }
        GivePlayerCash(playerid, -750);
        SetPVarInt(playerid, "Packages", 15);
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 15 Materials Packages for $750.");
        SendClientMessageEx(playerid, COLOR_YELLOW,"Bronze VIP: You received 1.5x more packages, which will get you 1.5x more materials.");
    }
    else if(PlayerInfo[playerid][pDonateRank] == 2 || PlayerInfo[playerid][pDonateRank] == 3)
    {
        if(GetPlayerCash(playerid) < 1000)
        {
            SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1000!");
            return 1;
        }
        GivePlayerCash(playerid, -1000);
        SetPVarInt(playerid, "Packages", 20);
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 20 Materials Packages for $1000.");
        SendClientMessageEx(playerid, COLOR_YELLOW,"Silver & Gold VIP: You received 2x more packages, which will get you 2x more materials.");
    }
    else if(PlayerInfo[playerid][pDonateRank] >= 4)
    {
        if(GetPlayerCash(playerid) < 1250)
        {
            SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1250!");
            return 1;
        }
        GivePlayerCash(playerid, -1250);
        SetPVarInt(playerid, "Packages", 25);
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 25 Materials Packages for $1250.");
        SendClientMessageEx(playerid, COLOR_YELLOW,"Platinum VIP: You received 2.5x more packages, which will get you 2.5x more materials.");
    }
    else
    {
        if(GetPlayerCash(playerid) < 500)
        {
            SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $500!");
            return 1;
        }
        GivePlayerCash(playerid, -500);
        SetPVarInt(playerid, "Packages", 10);
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought 10 Materials Packages for $500.");
    }

    SetPVarInt(playerid, "MatDeliver", mydeliver);
    SetPVarInt(playerid, "tpMatRunTimer", 10);
    SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPMATRUNTIMER);
    SetPlayerCheckpoint(playerid, 2172.942382, -2263.941894, 13.342558, 0);
    for(new i = 0; i < sizeof(FamilyInfo); i++)
    {
        if(strcmp(Points[mypointex][Owner], FamilyInfo[i][FamilyName], true) == 0)
        {
            FamilyInfo[i][FamilyBank] = FamilyInfo[i][FamilyBank]+125;
            //SendClientMessageEx(playerid, COLOR_WHITE, " Family owner recieved 50 percent of the cost.");
        }
    }
    SetPlayerCheckpoint(playerid, Points[mypoint][Pointx], Points[mypoint][Pointy], Points[mypoint][Pointz], 5);
    return 1;
}
Reply
#2

Explain a lil more and read:

https://sampforum.blast.hk/showthread.php?tid=283306
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)