02.09.2018, 00:57
The way you are using SetPlayerMapIcon is invalid, because you would set all map icon in each iteration.
First solution:
- You can put all X, Y and Z data in one multidimensional array and use it in only one line of for loop. For example:
Second solution:
- Forget the loop and create all lines with SetPlayerMapIcon and without i variable
First solution:
- You can put all X, Y and Z data in one multidimensional array and use it in only one line of for loop. For example:
PHP код:
//Declaring the array
new Float:Coords[5][3] = {
{1.0, 2.0, 3.0},
{1.0, 2.0, 3.0},
{1.0, 2.0, 3.0},
{1.0, 2.0, 3.0},
{1.0, 2.0, 3.0}
};
//Iteration
for(new i = 0; i < 5; i++)
quest_MapIcon[playerid][i] = SetPlayerMapIcon(playerid, i, Coords[i][0], Coords[i][1], Coords[i][2], 56, -1, MAPICON_GLOBAL);
- Forget the loop and create all lines with SetPlayerMapIcon and without i variable