PDA

View Full Version : Problem bucle


YazukiAkira
12/08/2014, 09:13 AM
My PlayerTextDraws:
PlayerTextDrawShow(playerid, skin_0);
PlayerTextDrawShow(playerid, skin_1);
PlayerTextDrawShow(playerid, skin_2);


for (new p = 0; p < 2; p++)
{
PlayerTextDrawShow(playerid, skin_p); // <- use var "p"...
}

CutX
12/08/2014, 09:22 AM
dont know if i got u right but,
if "skin" is an array holding textdraw id's
then you would do it like this to show them all:

for (new p = 0; p < 2; p++)
{
PlayerTextDrawShow(playerid, skin[p]);
}

YazukiAkira
12/08/2014, 09:36 AM
dont know if i got u right but,
if "skin" is an array holding textdraw id's
then you would do it like this to show them all:

for (new p = 0; p < 2; p++)
{
PlayerTextDrawShow(playerid, skin[p]);
}

Error: error 017: undefined symbol "skin"

Patrick
12/08/2014, 09:53 AM
basically declare it as an array like this.


new skin[3];


and access it like this

for (new p = 0; p < 2; p++)
{
PlayerTextDrawShow(playerid, skin[p]);
}


or


PlayerTextDrawShow(playerid, skin[0]);
PlayerTextDrawShow(playerid, skin[1]);
PlayerTextDrawShow(playerid, skin[2]);