30.08.2010, 09:00
I know this has already been answered, but why not use an array and a loop for how many "PlayerToPoint" coords there are?
eg,
I havent tested it, but i use something like that on my server for checking whether a player is near a certain door, (eg, theres three doors, but everytime a player types /enter it runs something like the above code to check where they are, and what door there at)
Edit: Sorry Voldermort, we posted at the same time xD
eg,
pawn Код:
enum PTPInfo {Float:Distance, Float:x, Float:y, Float:z}
new PTP[][PTPInfo] = {
{2.5,1277.9015,-1604.4323,-8.9047},
{2.5,1282.3475,-1603.8329,-8.9047},
{2.51246.1376,-1723.2724,-8.9135}
};
//The above could go anywhere in the script, maybe at the top for easy access to add more?
for(new i; i < sizeof(PTP); i++)
{
if(PlayerToPoint(PTP[i][Distance], playerid, PTP[i][x], PTP[i][y], PTP[i][z])
{
//Do you're thing here :)
}
}
Edit: Sorry Voldermort, we posted at the same time xD