if(BizzEntered[playerid] != 9999) { new i = BizzEntered[playerid]; if (IsPlayerInRangeOfPoint(playerid, 3,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ])) { SafeSetPlayerInterior(playerid,0); SetPlayerVirtualWorld(playerid, 0); OnPlayerExitFood(playerid); SafeSetPlayerPos(playerid,BizzInfo[i][bEntranceX],[bEntranceY],BizzInfo[i][bEntranceZ]); SetPlayerVirtualWorld(playerid, 0); BizzEntered[playerid] = 9999; } }
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 5,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
SafeGivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
BizzInfo[i][bProducts]--;
OnPropUpdate(2,i);
GameTextForPlayer(playerid, string, 5000, 3);
}
PlayerInfo[playerid][pInteriorNr] = BizzInfo[i][bInteriorNr];
SetPlayerVirtualWorld(playerid,BizzInfo[i][bVirWorld]);
SafeSetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SafeSetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
BizzEntered[playerid] = i;
new h,mi,s,y,m,d;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s payed $%d to enter biz %d",d,m,y,h,mi,s, dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
PayLog(string);
if(BizzInfo[i][bVirWorld] == 0 || BizzInfo[i][bVirWorld] == 1)
{
OnPlayerEnterFood(playerid, 1);
}
else if(BizzInfo[i][bVirWorld] == 2 || BizzInfo[i][bVirWorld] == 3)
{
OnPlayerEnterFood(playerid, 2);
}
else if(BizzInfo[i][bVirWorld] == 4 || BizzInfo[i][bVirWorld] == 5)
{
OnPlayerEnterFood(playerid, 3);
}
else if(BizzInfo[i][bVirWorld] == 6)
{
OnPlayerEnterFood(playerid, 4);
}
}
else
{
GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
}
}
}
SafeSetPlayerPos(playerid,BizzInfo[BizzEntered[playerid]][bEntranceX], BizzInfo[BizzEntered[playerid]][bEntranceY],BizzInfo[BizzEntered[playerid]][bEntranceZ]);
pawn Код:
|