A List
#5

I know this has already been answered, but why not use an array and a loop for how many "PlayerToPoint" coords there are?

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 :)
     }
}
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
Reply


Messages In This Thread
A List - by MartinDee - 30.08.2010, 08:05
Re: A List - by iggy1 - 30.08.2010, 08:15
Re: A List - by MartinDee - 30.08.2010, 08:25
Re: A List - by Voldemort - 30.08.2010, 08:54
Re: A List - by Ash. - 30.08.2010, 09:00

Forum Jump:


Users browsing this thread: 1 Guest(s)