16.10.2016, 07:13
i'm moving the code to player_gotobusiness function,but when I compile it,the pawncc crashes
PHP код:
Player_GoToBusiness(playerid, businessid)
{
if(BusinessInteriors[ BusinessData[businessid][Type] ][InteriorName], "Unavailable")) return 0;
SetPVarInt(playerid, "BusinessPickup", gettime() + 8);
InBusiness[playerid] = businessid;
SetPlayerVirtualWorld(playerid, businessid);
new type = BusinessData[businessid][Type];
SetPlayerInterior(playerid, BusinessInteriors[type][InteriorID]);
SetPlayerPos(playerid, BusinessInteriors[type][InteriorX], BusinessInteriors[type][InteriorY], BusinessInteriors[type][InteriorZ]);
if(Player_OwnsBusiness(playerid, businessid))
{
BusinessData[businessid][LastVisited] = gettime();
BusinessData[businessid][Save] = true;
}
Info(playerid, "Use {3498DB}/business {FFFFFF}to open the business menu.");
Info(playerid, "Use {3498DB}/exitbiz {FFFFFF}to leave the business.");
return 1;
}