Help Mats
#1

Hello .

this cmd sellmats , when player is sell mats to player , not get money.

Code:
pawn Код:
CMD:sellmats(playerid, params[])
{
    new target, amount, price;
    if(sscanf(params, "uii", target, amount, price)) return SCM(playerid, -1, "Syntax: /sellmats [playerid] [amount] [price]");
    if(amount <= playerVariables[playerid][pMaterials])
    {
            if(target != INVALID_PLAYER_ID)
            {
                if(playerVariables[target][pMoney] >= price)
                {
                    SetPVarInt(target, "mAmount", amount);
                    SetPVarInt(target, "mPrice", price);
                    SetPVarInt(target, "mID", playerid);
                   
                    format(szMessage, sizeof(szMessage), "** %s wish to sell you %d mats for $%i. Type /accept mats if you wish to accept.", playerVariables[playerid][pNormalName], amount, price);
                    SCM(target, COLOR_LIGHTBLUE, szMessage);
                   
                    format(szMessage, sizeof(szMessage), "** You wish to sell %d mats to %s, for $%i.", amount, playerVariables[target][pNormalName], price);
                    SCM(playerid, COLOR_LIGHTBLUE, szMessage);
                }
                else
                {
                    SCM(playerid, -1, "This player does not have enough money for this mats!");
                }
            }
            else
            {
                SCM(playerid, -1, "Player not connected.");
            }
    }
    else
    {
            SCM(playerid, -1, "You don't have enough mats.");
    }
    return 1;
}
+rep for any helped me, Thanks.
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: 1 Guest(s)