stock IsPlayerInBusiness ?
#1

Anyone give me stock that check is player in any buisness ?
Reply
#2

Uhm?
Do you realize that every business system in different? Show your code and i can help you create a isplayerinbusiness
Reply
#3

PHP код:
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
Reply
#4

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
PHP код:
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.
Reply
#5

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:
PHP код:
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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)