Command Saying not enough cash
#8

I don't know if you are even trying to do something - like understanding how your code should look like

pawn Код:
CMD:buyproducts(playerid, params[])
{
    new string2[128];
    if(PlayerInfo[playerid][pBizKey] != INVALID_BIZZ_ID && (IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pBizKey]][IXCoord], BizInfo[PlayerInfo[playerid][pBizKey]][IYCoord], BizInfo[PlayerInfo[playerid][pBizKey]][IZCoord])))
    {
        if(sscanf(params, "i", params[0])) return SendClientMessageEx(playerid, COLOR_GRAD3, "USAGE: /buyproducts [amount]");
        new price = params[0] * 10;
        if(GetPlayerCash(playerid) >= price)
        {
            GivePlayerCash(playerid, -price);
            BizInfo[PlayerInfo[playerid][pBizKey]][Products] += params[0];
            SaveBizInfo(PlayerInfo[playerid][pBizKey]);
            format(string2,sizeof(string2),"You have bought %d amount of business products", params);
            return SendClientMessageEx(playerid, COLOR_GRAD3, string2);
        }
        else return SendClientMessageEx(playerid, COLOR_GRAD2, "You don't own a business, or are not inside one of them.");
    }
    else return SendClientMessageEx(playerid, COLOR_GRAD2, "You don't have 100$ for each product.");
}
Reply


Messages In This Thread
Command Saying not enough cash - by San1 - 15.07.2013, 18:02
Re: Command Saying not enough cash - by Misiur - 15.07.2013, 18:09
Re: Command Saying not enough cash - by JimmyCh - 15.07.2013, 18:10
Re: Command Saying not enough cash - by San1 - 15.07.2013, 18:42
Re: Command Saying not enough cash - by JimmyCh - 15.07.2013, 19:08
Re: Command Saying not enough cash - by San1 - 15.07.2013, 19:14
Re: Command Saying not enough cash - by Boolean - 15.07.2013, 19:17
Re: Command Saying not enough cash - by Misiur - 15.07.2013, 19:18

Forum Jump:


Users browsing this thread: 3 Guest(s)