PDA

View Full Version : stock IsPlayerInBusiness ?


Osamakurdi
08/02/2018, 11:37 AM
Anyone give me stock that check is player in any buisness ?

jasperschellekens
08/02/2018, 11:39 AM
Uhm?
Do you realize that every business system in different? Show your code and i can help you create a isplayerinbusiness

PepsiCola23
08/02/2018, 12:42 PM
IsPlayerInRangeOfPoint and use the coordinates of the biz [ your biz info,i dont know how you have it ,maybe bizposX,bizposY,bizposZ for example,but it depends

solstice_
08/02/2018, 03:23 PM
IsPlayerInRangeOfPoint and use the coordinates of the biz [ your biz info,i dont know how you have it ,maybe bizposX,bizposY,bizposZ for example,but it depends

But how? This is only going to check the coordinates of a business, not many businesses.

Abagail
08/02/2018, 05:36 PM
The best way for accurate detection is a variable set when entering a business. Once they leave it, reset the var (account for other things such as admin teleports as well).

For more accuracy, you could also check something such as the players virtual world (you could also check position but it's redundant in most cases), if its a mismatch, reset the var. If you do this, call IsPlayerInBusiness directly. You can do the same with a "GetPlayersCurrentBusiness" function as well. This assumes the player can only be in a single business at one time.

Ex:

IsPlayerInBusiness(playerid)
{
if(PlayerData[playerid][pd_CurrentBusiness]))
{
if(GetPlayerVirtualWorld(playerid) == BisInfo[PlayerData[playerid][pd_CurrentBusiness]][bbInsideWorld])
return true;

else
PlayerData[playerid][pd_CurrentBusiness] = INVALID_BUSINESS_ID;
}

return false;
}