08.09.2011, 01:39
That if statement is just so messy, why not put all of the co-ordinates in an array and loop through them when you want to check? Although it kinda looks like that's what the original poster was trying to do, he has some weird syntax in his array. Here is an example of how you can do it:
You can see more information about the IsPlayerInRangeOfPoint function here:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
pawn Код:
new Float: station_positions[3][] = {
{1596.0629,2199.1621,10.8203},
{2202.0964,2474.6543,10.8203},
{2114.8044,919.7510,10.8203},
{2640.2517,1106.5508,10.8203},
{2147.6653,2747.9827,10.8203},
{-1471.7313,1864.0991,32.6328}
};
IsPlayerAtFuelStation(playerid)
{
for(new i; i < sizeof(station_positions); i++)
if(IsPlayerInRangeOfPoint(playerid, 5.0, station_positions[0][i], station_positions[1][i], station_positions[2][i])) return 1;
return 0;
}
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint