a 3d label is not created.
#1

The 3d label of the first index is not shown while it woks fine with other indices.

PHP код:
public loadtrees()
{
    print(
"Loading trees");
    for(new 
1MAX_TREESg++)
    {
        new 
LoadString[256];
        
format(LoadStringsizeof(LoadString), "/Trees/%d.dini.save"g);
        if(
dini_Exists(LoadString))
        {
            
treeData[g][tID] = g;
            
treeData[g][tX] = dini_Float(LoadString,"tX");
            
treeData[g][tY] = dini_Float(LoadString,"tY");
            
treeData[g][tZ] = dini_Float(LoadString,"tZ");
            
treeData[g][tObject] = CreateObject(617treeData[g][tX], treeData[g][tY], treeData[g][tZ], 0.00000.00000.0000); // tree
            
treeData[g][woodReady] = false;
            
treeData[g][tHealth] = 100;
                new 
string2[80];
            
format(string2sizeof(string2), "{ffff00}Tree\n/cuttree\nHealth: %i"treeData[g][tHealth]);
                
treeData[g][tLabel] = Create3DTextLabel(string2COLOR_YELLOWtreeData[g][tX], treeData[g][tY], treeData[g][tZ] + 0.2 3.11177.500);
                
treeData[g][tStatus] = true;
        }
    }
    return 
1;

the 3d label of tree id 1 is not shown while it's fine with {2,...,max_trees} ( the object of tree id 1 is created )

I gave it a try and changed the function to:
PHP код:
forward loadtrees();
public 
loadtrees()
{
    print(
"Loading trees");
    for(new 
1MAX_TREESg++)
    {
        new 
LoadString[256];
        
format(LoadStringsizeof(LoadString), "/Trees/%d.dini.save"g);
        if(
dini_Exists(LoadString))
        {
            
treeData[g][tID] = g;
            
treeData[g][tX] = dini_Float(LoadString,"tX");
            
treeData[g][tY] = dini_Float(LoadString,"tY");
            
treeData[g][tZ] = dini_Float(LoadString,"tZ");
            
treeData[g][tObject] = CreateObject(617treeData[g][tX], treeData[g][tY], treeData[g][tZ], 0.00000.00000.0000); // tree
            
treeData[g][woodReady] = false;
            
treeData[g][tHealth] = 100;
                new 
string2[40];
            
format(string2sizeof(string2), "{ffff00}Tree\n/cuttree\nHealth: %i"treeData[g][tHealth]);
                
treeData[g][tLabel] = Create3DTextLabel(string2COLOR_YELLOWtreeData[g][tX], treeData[g][tY], treeData[g][tZ] + 0.2 3.11177.500);
                
treeData[g][tStatus] = true;
        }
    }
    new 
str[40];
    
format(strsizeof(str), "{ffff00}Tree\n/cuttree\nHealth: %i"treeData[1][tHealth]);
    
treeData[1][tLabel] = Create3DTextLabel(strCOLOR_YELLOWtreeData[1][tX], treeData[1][tY], treeData[1][tZ] + 0.2 3.11177.500);
    return 
1;

( I created a custom 3d text label for the first index but i'm not satisfied by this solution :v)

-Thanks
Reply


Messages In This Thread
a 3d label is not created. - by Kincaid - 24.01.2019, 14:54
Re: a 3d label is not created. - by Florin48 - 24.01.2019, 15:00
Re: a 3d label is not created. - by Kincaid - 24.01.2019, 15:05
Re: a 3d label is not created. - by Florin48 - 24.01.2019, 15:17
Re: a 3d label is not created. - by Kincaid - 24.01.2019, 15:25
Re: a 3d label is not created. - by codExpert - 24.01.2019, 15:42
Re: a 3d label is not created. - by Kincaid - 24.01.2019, 15:48
Re: a 3d label is not created. - by Kincaid - 24.01.2019, 20:26
Re: a 3d label is not created. - by codExpert - 24.01.2019, 20:32
Re: a 3d label is not created. - by Jeffry - 25.01.2019, 16:01
Re: a 3d label is not created. - by Kincaid - 01.02.2019, 23:39

Forum Jump:


Users browsing this thread: 2 Guest(s)