Getting an ID
#2

I am using these codes for my gas station

pawn Код:
NearestGasStation(playerid)
{
    new gasid, Float:distance = 99999.0, Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i = 0; i <MAX_BIZ; i++)
    {
       
            new Float:tempdist;
            tempdist = GetDistance(x, y, z, BizInfo[i][EXTX], BizInfo[i][EXTY], BizInfo[i][EXTZ]);
            if(tempdist < distance)
            {
                distance = tempdist;
                gasid= i;
            }
    }
    return gasid;
}
Reply


Messages In This Thread
Getting an ID - by Luis- - 29.01.2015, 18:06
Re: Getting an ID - by Sime30 - 29.01.2015, 18:10
Re: Getting an ID - by Luis- - 29.01.2015, 18:19
Re: Getting an ID - by Vince - 29.01.2015, 18:20
Re: Getting an ID - by Luis- - 29.01.2015, 19:38

Forum Jump:


Users browsing this thread: 1 Guest(s)