18.02.2012, 22:41
Like, this is my /enter cmd with House AND business.
Aint this just what I said? It works perfect.
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;
}