Position bug in my Dynamic Business System
#1

Hi there, I am making a business system, just did the first test and everything except one things works fine.
The restocking.

It tells me that im not near a business when I try to restock it,

VIDEO to explain:

[ame="http://www.youtube.com/watch?v=GTyQv-beBBk"]CLICK[/ame]


Restocking code:

pawn Код:
CMD:sellprods(playerid, params[])
{
    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(PlayerInfo[playerid][pJob] == pJob_8)
    {
        if(vjob[GetPlayerVehicleID(playerid)] == 8)
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0,  BizzInfo[b][benx],BizzInfo[b][beny], BizzInfo[b][benz]))
            {
                new ammount;
                 if(!sscanf(params, "i", ammount))
                 {
                    new price;
                    price = ammount * 8;
                    if(PlayerInfo[playerid][Prods] >= ammount)
                    {
                        if(ammount + BizzInfo[b][bprods] <= 300)
                        {
                            new string[128];
                            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);
                        }
                        else return SendClientMessage(playerid, COLOR_GREY, "Business can not have more then 300 products!");
                    }
                    else return SendClientMessage(playerid, COLOR_GREY, "You do not have enough products for that!");
                }
                else return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellprods [ammount]");
            }
            else return SendClientMessage(playerid, COLOR_GREY, "You are not near a business!");
        }
        else return SendClientMessage(playerid, COLOR_GREY, "You must be in a delivery truck!");
    }
    else return SendClientMessage(playerid, COLOR_GREY, "You must be a trucker to do this!");
    }
    return 1;
}
Anyone has any idea?
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)