-
Bojaa - 26.02.2017
I want ask about this command
PHP код:
CMD:bizlock(playerid, params[])
{
new string[128], lockdone;
if(PlayerInfo[playerid][pBusiness] != INVALID_BIZ_ID)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[PlayerInfo[playerid][pBusiness]][bX], BizInfo[PlayerInfo[playerid][pBusiness]][bY], BizInfo[PlayerInfo[playerid][pBusiness]][bZ]))
{
if(!BizInfo[PlayerInfo[playerid][pBusiness]][bStatus])
{
BizInfo[PlayerInfo[playerid][pBusiness]][bStatus] = 1;
format(string, sizeof(string), "{FFFFFF}%s\nStatus: %s\n{00AAFF}%s\nEntrance Fee: $%d\nOwner: %s\nBusiness ID: %d",BizInfo[PlayerInfo[playerid][pBusiness]][bDescription],RBS(PlayerInfo[playerid][pBusiness]),RBT(PlayerInfo[playerid][pBusiness]),BizInfo[PlayerInfo[playerid][pBusiness]][bBizFee],BizInfo[PlayerInfo[playerid][pBusiness]][bOwner], PlayerInfo[playerid][pBusiness]);
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBusiness]][bText], 0x00AAFFFF, string);
format(string, sizeof(string), "* %s takes out their business keys and unlocks it.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Business Unlocked", 3500, 3);
}
else if(BizInfo[PlayerInfo[playerid][pBusiness]][bStatus])
{
BizInfo[PlayerInfo[playerid][pBusiness]][bStatus] = 0;
format(string, sizeof(string), "{FFFFFF}%s\nStatus: %s\n{00AAFF}%s\nEntrance Fee: $%d\nOwner: %s\nBusiness ID: %d",BizInfo[PlayerInfo[playerid][pBusiness]][bDescription],RBS(PlayerInfo[playerid][pBusiness]),RBT(PlayerInfo[playerid][pBusiness]),BizInfo[PlayerInfo[playerid][pBusiness]][bBizFee],BizInfo[PlayerInfo[playerid][pBusiness]][bOwner], PlayerInfo[playerid][pBusiness]);
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBusiness]][bText], 0x00AAFFFF, string);
format(string, sizeof(string), "* %s takes out their business keys and locks it.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Business Locked", 3500, 3);
}
lockdone = 1;
}
if(!lockdone)
{
SendClientMessage(playerid, COLOR_GREY, "You are not near at your business");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You either don't own a business");
return 1;
}
return 1;
}
When i lock biz and enter still not locked mean any one can enter i dont know what is worng on it?
is ther eany rep here?
, k guys
Re: Simple Help -
nemanjasepa - 26.02.2017
what about /enter cmd? Did you place that no one can enter if business is locked ?
Re: Simple Help -
Bojaa - 26.02.2017
This is the enter cmd
PHP код:
for(new i=1; i<MAX_BUSINESS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[i][bX], BizInfo[i][bY], BizInfo[i][bZ]))
{
if(PlayerInfo[playerid][pBusiness] == i || BizInfo[i][bStatus] == 1)
{
if(GetPlayerCash(playerid) >= BizInfo[i][bBizFee])
{
GivePlayerCash(playerid, - BizInfo[i][bBizFee]);
BizInfo[i][bMoney] += BizInfo[i][bBizFee];
if(PlayerInfo[playerid][pBusiness] == i)
{
if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered the business."); }
else { format(string, sizeof(string), "* %s has entered their business.", GetPlayerNameEx(playerid)); }
ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered %s's business.", BizInfo[i][bOwner]); }
else { format(string, sizeof(string), "* %s has entered %s.", GetPlayerNameEx(playerid), BizInfo[i][bDescription]); }
ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
SetPlayerInterior(playerid,BizInfo[i][bBInteriorWorld]);
PlayerInfo[playerid][pInt] = BizInfo[i][bBInteriorWorld];
PlayerInfo[playerid][pVW] = i+100;
SetPlayerVirtualWorld(playerid, i+100);
PlayerInfo[playerid][InBusiness] = i;
if(BizInfo[i][bCustomInterior] == 1)
{
LoadObjectsForPlayer(playerid);
}
SetPlayerPos(playerid,BizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
SetPlayerFacingAngle(playerid,BizInfo[i][bInteriorA]);
SetCameraBehindPlayer(playerid);
if(PlayerInfo[playerid][pBusiness] == i)
{
GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
}
if(BizInfo[i][bType] > 2 && BizInfo[i][bType] != 5)
{
SendClientMessage(playerid,COLOR_WHITE," Use /buy to purchase something from this business !");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You don't have cash for that Business Entrance Fee");
}
Streamer_UpdateEx(playerid, BizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
}
return 1;
}
}