SA-MP Forums Archive
Help 3DText - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help 3DText (/showthread.php?tid=188348)



Help 3DText - [FeK]HigorOliver - 07.11.2010

Hello everybody my enterprise system is not working well i put 3DText to display the information so that it only shows the first company formed and others not.


pawn Код:
for(new I=0;I<=EmpCount;I++)
{
if(Empresa[I][Owned] == true)
{
format(string1, sizeof(string1), "Empresa Dono: %s\nPreco de Compra Gold: %d\n Preco de Venda Gold: %d",Empresa[I][EmpOwner],Empresa[I][EmpPreco], Empresa[I][EmpVenda]);
EMPC = Create3DTextLabel(string1,COLOR_RED,Empresa[I][PickupXX], Empresa[I][PickupYY], Empresa[I][PickupZZ]+0.75,15,0,1);
}
if(Empresa[I][Owned] == false)
{
format(string1, sizeof(string1), "Empresa Dono: Ninguem\nPreco de Compra Gold: %d\n Preco de Venda Gold: %d",Empresa[I][EmpPreco], Empresa[I][EmpVenda]);
EMPV = Create3DTextLabel(string1,COLOR_RED,Empresa[I][PickupXX], Empresa[I][PickupYY], Empresa[I][PickupZZ]+0.75,15,0,1);
}
return 1;
}



Re: Help 3DText - Rachael - 07.11.2010

at first glance...

Presuming your indentations are correct, and your variables are all defined, that code looks like it should make all the labels. You are using EMPV and EMPC to store the Text3D id's, and they are being overwritten each time the function loops, so all but the last Text3D id's are lost forever. You might want to put them in an array if you want to use them later.


Re: Help 3DText - [FeK]HigorOliver - 07.11.2010

but the data only appears in the company's first company formed not know what happens


Re: Help 3DText - Rachael - 07.11.2010

looks like you put a return inside the loop, if you indent your code properly this will be more obvious

pawn Код:
for(new I=0;I<=EmpCount;I++)
{
     if(Empresa[I][Owned] == true)
     {
           format(string1, sizeof(string1), "Empresa Dono: %s\nPreco de Compra Gold: %d\n Preco de Venda Gold: %d",Empresa[I][EmpOwner],Empresa[I][EmpPreco], Empresa[I][EmpVenda]);
           EMPC = Create3DTextLabel(string1,COLOR_RED,Empresa[I][PickupXX], Empresa[I][PickupYY], Empresa[I][PickupZZ]+0.75,15,0,1);
      } else {
           format(string1, sizeof(string1), "Empresa Dono: Ninguem\nPreco de Compra Gold: %d\n Preco de Venda Gold: %d",Empresa[I][EmpPreco], Empresa[I][EmpVenda]);
           EMPV = Create3DTextLabel(string1,COLOR_RED,Empresa[I][PickupXX], Empresa[I][PickupYY], Empresa[I][PickupZZ]+0.75,15,0,1);
      }
}