Help Mats
#3

Quote:
Originally Posted by dusk
Посмотреть сообщение
Show us /accept mats command.
pawn Код:
else if(strcmp(params, "mats", true) == 0)
        {
            if(GetPVarInt(playerid,  "mID") >= 0)
            {
                new amount, dealer, price;
                amount = GetPVarInt(playerid, "mAmount");
                price = GetPVarInt(playerid, "mPrice");
                dealer = GetPVarInt(playerid, "mID");
                if(IsPlayerConnected(dealer))
                {
                        playerVariables[playerid][pMoney] -= price;
                        playerVariables[playerid][pMaterials] += amount;
                        playerVariables[dealer][pMaterials] -= amount;
                       
                        format(szMessage, sizeof(szMessage), "You have bought %d mats from %s for $%i", amount, playerVariables[dealer][pNormalName], price);
                        SCM(playerid, COLOR_LIGHTBLUE, szMessage);
                       
                        format(szMessage, sizeof(szMessage), "%s has bought %d mats from you, for $%i." , playerVariables[playerid][pNormalName], amount, price);
                        SCM(dealer, COLOR_LIGHTBLUE, szMessage);
                }
                else
                {
                    SCM(playerid, -1, "This player is not connected!");
                    DeletePVar(playerid, "mAmount");
                    DeletePVar(playerid, "mID");
                    DeletePVar(playerid, "mPrice");
                }
            }
            else
            {
                SCM(playerid, -1, "You don't have an active mats offer.");
            }
        }
        else SendClientMessage(playerid, COLOR_GREY, "Invalid item specified.");
Reply


Messages In This Thread
Help Mats - by SHFaCeBook - 25.11.2014, 13:04
Re: Help Mats - by dusk - 25.11.2014, 13:29
Re: Help Mats - by SHFaCeBook - 25.11.2014, 18:31
Re: Help Mats - by SHFaCeBook - 25.11.2014, 19:09
Re: Help Mats - by SHFaCeBook - 26.11.2014, 12:23
Re: Help Mats - by Jonesy96 - 26.11.2014, 12:28

Forum Jump:


Users browsing this thread: 3 Guest(s)