Materials Error
#2

Try this (some indentation fucked up )
pawn Код:
if(strcmp(cmd, "/getmats", true) == 0)
  {
    if(PlayerToPoint(3.0,playerid,GunJob[BuyPackagesX],GunJob[BuyPackagesY],GunJob[BuyPackagesZ]))
      {
        if(MatsHolding[playerid] >= 10)return SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not hold any more packages");
       
            tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "[Usages:] /getmats [amount]");

            new moneys;
            moneys = strval(tmp);
            if(moneys < 1 || moneys > 10) return SendClientMessage(playerid, COLOR_GREY, "[Error:] Maximum number of packages is 10");

            new price = moneys * 100;
            if(GetPlayerCash(playerid) > price)
            {
                format(string, sizeof(string), "[Info:] You got %d materials packages - Cost: $%d", moneys, price);
              SendClientMessage(playerid, COLOR_WHITE, string);
              GivePlayerCash(playerid, - price);
              MatsHolding[playerid] = moneys;
            }
            else
            {
                format(string, sizeof(string), "[Error:] You do not have $%d", price);
            SendClientMessage(playerid, COLOR_GREY, string);
            }
            else return SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials package place");
        }
        return true;
    }
   
    if(strcmp(cmd, "/sellmats", true) == 0)
  {
    if(PlayerToPoint(3.0,playerid,GunJob[DeliverX],GunJob[DeliverY],GunJob[DeliverZ]))
    {
        if(MatsHolding[playerid] > 0)
            {
            new payout = (50)*(MatsHolding[playerid]);
            format(string, sizeof(string), "[Info:] Materials packages delivered, you got %d materials", payout);
              SendClientMessage(playerid, COLOR_WHITE, string);
                PlayerInfo[playerid][pMaterials] += payout;
            MatsHolding[playerid] = 0;
        }
        else SendClientMessage(playerid, COLOR_GREY, "[Error:] You do not have any packages");
            else SendClientMessage(playerid, COLOR_GREY, "[Error:] You are not at the materials dropoff place");
            else SendClientMessage(playerid, COLOR_GREY, "[Error:] Invalid usage");
            }
        }
        return 1;
    }
Reply


Messages In This Thread
Materials Error - by keujh - 06.12.2009, 06:35
Re: Materials Error - by Abernethy - 06.12.2009, 06:46
Re: Materials Error - by keujh - 06.12.2009, 06:55
Re: Materials Error - by Abernethy - 06.12.2009, 06:56
Re: Materials Error - by keujh - 06.12.2009, 07:02
Re: Materials Error - by Abernethy - 06.12.2009, 07:09
Re: Materials Error - by Joe Staff - 06.12.2009, 07:10
Re: Materials Error - by keujh - 06.12.2009, 07:14
Re: Materials Error - by keujh - 06.12.2009, 07:20
Re: Materials Error - by Joe Staff - 06.12.2009, 07:25

Forum Jump:


Users browsing this thread: 2 Guest(s)