Quote:
Originally Posted by dominik523
You would do something like this:
pawn Код:
for(new idx=1; idx<MAX_BIZ; idx++) { if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ])) // these are the coordinates from your business enum { // set player position to the interior of the business and the rest } }
So this code searches for the nearest business that the player is from.
|
There is another trick, you don't need to re-code it :P
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if( newkeys & KEY_SECONDARY_ATTACK )
return OnPlayerCommandText(playerid, "/enter");
return true;
}