/enter command not checking positions.
#10

Like, this is my /enter cmd with House AND business.

pawn Code:
CMD:enter(playerid, params[])
{
    for(new h=0; h<sizeof(House); h++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3, House[h][henx], House[h][heny], House[h][henz]))
    {
        if(IsInHouse[playerid] == 0)
        {
            if(House[h][hlocked] == 0)
            {
                GetPlayerPos(playerid, PP[playerid], PP2[playerid], PP3[playerid]);
                SetPlayerPos(playerid, House[h][hexx], House[h][hexy], House[h][hexz]);
                SetPlayerInterior(playerid, House[h][hint]);
                SetPlayerVirtualWorld(playerid, House[h][hvw]);
                IsInHouse[playerid] = 1;
                IsInHouseID[playerid] = h;
            }
            else return SendClientMessage(playerid, COLOR_GREY, "This house is locked!");
        }
    }
    for(new b = 0; b < sizeof(BizzInfo); b++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 2, BizzInfo[b][benx], BizzInfo[b][beny], BizzInfo[b][benz]))
    {
        if(IsInBizz[playerid] == 0)
        {
            if(BizzInfo[b][bopen] == 1)
            {
                if(BizzInfo[b][bprods] >= 1)
                {
                    if(BizzInfo[b][btype] != 6 && BizzInfo[b][btype] != 7)
                    {
                    GetPlayerPos(playerid, PP[playerid], PP2[playerid], PP3[playerid]);
                    SetPlayerPos(playerid, BizzInfo[b][bexx], BizzInfo[b][bexy], BizzInfo[b][bexz]);
                    SetPlayerInterior(playerid, BizzInfo[b][bint]);
                    SetPlayerVirtualWorld(playerid, BizzInfo[b][bvw]);
                    IsInBizz[playerid] = 1;
                    GivePlayerMinusCash(playerid, BizzInfo[b][bfee]);
                    BizzInfo[b][bbank] = BizzInfo[b][bbank] + BizzInfo[b][bfee];
                    IsInBizzID[playerid] = b;
                    BizzInfo[b][customers] = BizzInfo[b][customers] + 1;
                    IsInBizzType[playerid] = BizzInfo[b][btype];
                    BizzInfo[b][bprods] = BizzInfo[b][bprods] -1;
                    }
                    else return SendClientMessage(playerid, COLOR_GREY, "Can't enter this business!");
                }
                else return SendClientMessage(playerid, COLOR_GREY, "This business is out of stock!");
            }
            else return SendClientMessage(playerid, COLOR_GREY, "Business is Closed!!");
        }
    }
    }
    }
    return 1;
}
Aint this just what I said? It works perfect.
Reply


Messages In This Thread
/enter command not checking positions. - by ricardo178 - 18.02.2012, 22:03
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:10
Re : /enter command not checking positions. - by ricardo178 - 18.02.2012, 22:11
Re: /enter command not checking positions. - by Vince - 18.02.2012, 22:22
Re: /enter command not checking positions. - by IceCube! - 18.02.2012, 22:24
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:27
Re: /enter command not checking positions. - by Kwarde - 18.02.2012, 22:34
Re: /enter command not checking positions. - by Vince - 18.02.2012, 22:38
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:39
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:41

Forum Jump:


Users browsing this thread: 1 Guest(s)