Hi everyone, I am writing a function for detect bank locations and ATMs. In this moment, I have got this:
main.nut
another_one.nut
In the wiki say that the arguments are two floats (player.Pos) and an string / array / floats, but fails.
main.nut
Code Select
// BANK LOCATIONS
banks <- [
"-921.229, -355.514, -928.713, -326.602, -901.457, -326.602, -901.457, -355.519", // elBancoCorruptoGrande
"357.028, 1127.34, 356.961, 1132.15, 359.17, 1132.33, 359.462, 1127.27", // atmMall
"6.47041, -949.763, 1.30694, -949.764, 1.51372, -947.378, 6.33632, -947.53", // atmWashingtonMallRightSide
"1.44156, -928.274, 6.39117, -928.274, 6.37502, -930.697, 1.46436, -930.314" // atmWashingtonMallLeftSide
]
another_one.nut
Code Select
function isPlayerIntoBank(player) {
local found = false;
for(local i = 0; i < banks.len() && !found; i++) {
if(InPoly(player.Pos.x, player.Pos.y, banks[i]))
found = true;
}
return found;
}
In the wiki say that the arguments are two floats (player.Pos) and an string / array / floats, but fails.