How to properly use arrays?
#7

pawn Code:
#define MAX_FISHING_AREA 3  // change this if you are going to have more fishing area
new Float:fishingspots[MAX_FISHING_AREA][3] = // 3 means there are 3 floating points (for the coordinates: x,y,z)
{
    //  x = 0   |   y = 1   |   z = 2
    {-1874.6598, -1670.0956, 0.9824}, // fishing area 1 (0)
    {-1885.7527, -1671.0122, 1.0201},       // fishing area 2 (1)
    {x, y, z}       // fishing area 3 (2), change the x, y, z to your coordinates (floating points), notice there is no comma for last area
};
// loop the array number from 0 to 2 (the number in brackets of each fishing area)
for(new i = 0; i < MAX_FISHING_AREA; i++)
{
    Create3DTextLabel("Fishing area.\n/fish ", 0x008080FF,fishingspots[i][0], fishingspots[i][1], fishingspots[i][2], 20.0, 0, 0);
}
Reply


Messages In This Thread
How to properly use arrays? - by rangerxxll - 30.03.2014, 02:07
Re: How to properly use arrays? - by EiresJason - 30.03.2014, 03:00
Re: How to properly use arrays? - by rangerxxll - 30.03.2014, 03:04
Re: How to properly use arrays? - by EiresJason - 30.03.2014, 03:30
Re: How to properly use arrays? - by newbie scripter - 30.03.2014, 03:38
Re: How to properly use arrays? - by rangerxxll - 30.03.2014, 03:38
Re: How to properly use arrays? - by RoboN1X - 30.03.2014, 03:43
Re: How to properly use arrays? - by EiresJason - 30.03.2014, 03:44
Re: How to properly use arrays? - by rangerxxll - 30.03.2014, 03:50
Re: How to properly use arrays? - by RoboN1X - 30.03.2014, 03:52

Forum Jump:


Users browsing this thread: 1 Guest(s)