Position bug in my Dynamic Business System
#3

pawn Код:
CMD:sellprods(playerid, params[])
{
    new ammount;
    new price;
    new string[128];
    for(new b= 0; b < sizeof(BizzInfo); b++)
    {
        format(file6, sizeof(file6), "realityrp/bizzes/%d.ini", b);
        BizzInfo[b][benx] = dini_Float(file6, "benx");
        BizzInfo[b][beny] = dini_Float(file6, "beny");
        BizzInfo[b][benz] = dini_Float(file6, "benz");
        if(sscanf(params, "i", ammount)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellprods [ammount]");
        if(PlayerInfo[playerid][pJob] != pJob_8) return SendClientMessage(playerid, COLOR_GREY, "You must be a trucker to do this!");
        if(vjob[GetPlayerVehicleID(playerid)] != 8) return SendClientMessage(playerid, COLOR_GREY, "You must be in a delivery truck!");
        if(!IsPlayerInRangeOfPoint(playerid, 15.0,  BizzInfo[b][benx],BizzInfo[b][beny], BizzInfo[b][benz])) return SendClientMessage(playerid, COLOR_GREY, "You are not near a business!");
        if(PlayerInfo[playerid][Prods] <= ammount) return SendClientMessage(playerid, COLOR_GREY, "You do not have enough products for that!");
        if(ammount + BizzInfo[b][bprods] >= 300) return SendClientMessage(playerid, COLOR_GREY, "Business can not have more then 300 products!");
        price = ammount * 8;
        GivePlayerCash(playerid, price);
        BizzInfo[b][bprods] = BizzInfo[b][bprods] + ammount;
        PlayerInfo[playerid][Prods] = PlayerInfo[playerid][Prods] - ammount;
        format(string, sizeof(string), "You just sold %d products for $%d!", ammount, price);
        SendClientMessage(playerid, COLOR_ORANGE, string);
    }
    return 1;
}
Reply


Messages In This Thread
Position bug in my Dynamic Business System - by milanosie - 07.02.2012, 19:46
Re: Position bug in my Dynamic Business System - by milanosie - 07.02.2012, 22:03
Re: Position bug in my Dynamic Business System - by Tanush123 - 07.02.2012, 22:23
Re : Position bug in my Dynamic Business System - by ricardo178 - 07.02.2012, 22:26
Re: Position bug in my Dynamic Business System - by milanosie - 08.02.2012, 06:29
Re: Position bug in my Dynamic Business System - by milanosie - 08.02.2012, 06:55

Forum Jump:


Users browsing this thread: 2 Guest(s)