The quest problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: The quest problem (
/showthread.php?tid=658283)
The quest problem -
LaurVM - 31.08.2018
When I command /startquest, I do not put my checkpoints on the mini-map, it's only the first one, I want it all.
https://pastebin.com/UbCpEeuP
Re: The quest problem -
LaurVM - 01.09.2018
bump
Re: The quest problem -
iHollyZinhO - 02.09.2018
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:
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);
Second solution:
- Forget the loop and create all lines with SetPlayerMapIcon and without
i variable
Re: The quest problem -
LaurVM - 02.09.2018
Quote:
Originally Posted by iHollyZinhO
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:
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);
Second solution:
- Forget the loop and create all lines with SetPlayerMapIcon and without i variable
|
I do not understand how to put: quest_MapIcon [playerid] [i] = SetPlayerMapIcon (playerid, i, Coords [i] [0], Coords [i] [1], Coords [i] [2], 56 1, MAPICON_GLOBAL);
Should I put it only once? or How many times? Can not you make an example of the code I gave you?