18.06.2012, 03:49
I have just created a function that is suppose to return 1 if the player is near an atm.
^^ the locations of the ATM's
now the function
So far it only returns 1 if the player is near the first co ordinates, "1928.62145996,-1780.08044434,13.18977451".
I'm sure there is a very simple way around this problem, but I cannot figure it out.
If anyone could help me I will appreciate it.
pawn Code:
new Float:ATM[][3] =
{
{1928.62145996,-1780.08044434,13.18977451},
{928.42968750,-1385.49902344,12.98833847},
{1343.94079590,-1587.08764648,13.18079376},
{2241.16918945,-1722.89660645,13.19229412},
{304.12026978,-1557.89233398,35.68196106}
};
now the function
pawn Code:
stock IsPlayerNearATM(playerid)
{
for(new i; i < 5; i++)
{
if(IsPlayerInRangeOfPoint(playerid,2,ATM[i][0],ATM[i][1],ATM[i][2]))
{
return 1;
}
}
return 0;
}
I'm sure there is a very simple way around this problem, but I cannot figure it out.
If anyone could help me I will appreciate it.