Creates the last object only
#1

So i have a loading system that works correctly(at MySQL section)
At Creating the object section though i have stuck. How would be possible to create all the objects the database is loading?

It creates only the last one if even i have one. What the correct loop would be?
PHP код:
                function LoadSprayTags(playerid)
                {
                
                    new 
rowsfieldsIndex tagid[playerid];
                    
cache_get_data(rowsfieldsmysql);
                    for(new 
0rowsi++)
                    {
                        
cache_get_field_content(i"TagName"TagInfo[playerid][Index][TagName], mysql,25);
                        
cache_get_field_content(i"TagOwner"TagInfo[playerid][Index][TagOwner], mysql25);
                        
cache_get_field_content(i"TagFont"TagInfo[playerid][Index][TagFont], mysql20);
                        
TagInfo[playerid][Index][TagX] = cache_get_field_content_float(i"TagX");
                        
TagInfo[playerid][Index][TagY] = cache_get_field_content_float(i"TagY");
                        
TagInfo[playerid][Index][TagZ] = cache_get_field_content_float(i"TagZ");
                        
TagInfo[playerid][Index][TagRX] = cache_get_field_content_float(i"TagRX");
                        
TagInfo[playerid][Index][TagRY] = cache_get_field_content_float(i"TagRY");
                        
TagInfo[playerid][Index][TagRZ] = cache_get_field_content_float(i"TagRZ");
                        
TagInfo[playerid][Index][TagFontSize] = cache_get_field_content_int(i"TagFontSize");
                        
TagInfo[playerid][Index][TagFontColor] = cache_get_field_content_int(i"TagFontColor");
                        
TagInfo[playerid][Index][TagBold] = cache_get_field_content_int(i"TagBold");
                        
                        
TagInfo[playerid][Index][TagObject] = CreateDynamicObject(19482TagInfo[playerid][Index][TagX], TagInfo[playerid][Index][TagY], TagInfo[playerid][Index][TagZ], TagInfo[playerid][Index][TagRX], TagInfo[playerid][Index][TagRY], TagInfo[playerid][Index][TagRZ], -1, -1, -1300.0300.0);
                        
SetDynamicObjectMaterialText(TagInfo[playerid][Index][TagObject], 0TagInfo[playerid][Index][TagName], 70TagInfo[playerid][Index][TagFont], TagInfo[playerid][Index][TagFontSize], 1TagInfo[playerid][Index][TagFontColor], 00);
                            
                        new 
str[90];
                        
                        
format(strsizeof(str)," "COL_LIGHTBLUE"Graffiti Owner:"COL_WHITE" %s \n"COL_LIGHTBLUE"Tag ID:"COL_WHITE" %i"TagInfo[playerid][Index][TagOwner], TagInfo[playerid][Index][TagID]);
                        
TagInfo[playerid][Index][TagAdminInfo] = CreateDynamic3DTextLabel(strCOLOR_YELLOWTagInfo[playerid][Index][TagX], TagInfo[playerid][Index][TagY], TagInfo[playerid][Index][TagZ], 100.0);
                            
                        
printf("Name:%s Owner:%s \n Font:%s X:%f Y:%f Z:%f \n RX:%f RY:%f RZ:%f \nFontSize:%d FontColor:%d Bold: %d"TagInfo[playerid][Index][TagName], TagInfo[playerid][Index][TagOwner], TagInfo[playerid][Index][TagFont],
                        
TagInfo[playerid][Index][TagX], TagInfo[playerid][Index][TagY], TagInfo[playerid][Index][TagZ], TagInfo[playerid][Index][TagRX], TagInfo[playerid][Index][TagRY],TagInfo[playerid][Index][TagRZ],
                        
TagInfo[playerid][Index][TagFontSize], TagInfo[playerid][Index][TagFontColor],TagInfo[playerid][Index][TagBold]);
                    }
                    
                    return 
1;
                } 
Reply


Messages In This Thread
Creates the last object only - by vassilis - 28.10.2016, 10:55
Re: Creates the last object only - by iLearner - 28.10.2016, 10:58
Re: Creates the last object only - by AndySedeyn - 28.10.2016, 11:07
Re: Creates the last object only - by vassilis - 28.10.2016, 11:35
Re: Creates the last object only - by AndySedeyn - 28.10.2016, 11:39
Re: Creates the last object only - by vassilis - 28.10.2016, 12:04

Forum Jump:


Users browsing this thread: 1 Guest(s)