18.12.2012, 13:54
Hi guys!
I need a little help with entering and exiting bizzes.
I've made a system, that teleports u to the right place'n'stuff, but the thing, that I can't figure out is how to get the ID of the closest biz. I need some kind of system to get the closest biz by the biz x, y and z params.
The teleport'n'stuff code:
The thing, that I need, is the id of the closest biz.
It's suposed to be got by the next params:
((Translated from Estonian ))
I need a little help with entering and exiting bizzes.
I've made a system, that teleports u to the right place'n'stuff, but the thing, that I can't figure out is how to get the ID of the closest biz. I need some kind of system to get the closest biz by the biz x, y and z params.
The teleport'n'stuff code:
pawn Код:
public EnterNExitBiz(playerid, bizid)
{
if(PlayerInfo[playerid][InABiz] == 0) // OUT
{
new string[128];
format(string, sizeof(string), "%s", BizInfo[bizid][fName]);
if(BizInfo[firmaid][fClosed] == 1) return GameTextForPlayer(playerid, "~r~Da biz is closed!", 5000, 1);
if(PlayerInfo[playerid][BizKey] == bizid)
{
SetPlayerInterior(playerid, BizInfo[bizid][fInterj88r]);
PlayerInfo[playerid][Int] = BizInfo[bizid][fInterj88r];
SetPlayerPos(playerid, BizInfo[bizid][fIntX], BizInfo[bizid][fIntY], BizInfo[bizid][fIntZ]);
GameTextForPlayer(playerid, string, 5000, 1);
if(bizid == 2) return PlayerInfo[playerid][Riidepoes] = 1; // IGNORE THIS
}
}
return 1;
}
It's suposed to be got by the next params:
pawn Код:
Float:fEntranceX,
Float:fEntranceY,
Float:fEntranceZ,
((Translated from Estonian ))