28.10.2016, 10:55
(
Последний раз редактировалось vassilis; 28.10.2016 в 11:35.
)
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?
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 rows, fields, Index = tagid[playerid];
cache_get_data(rows, fields, mysql);
for(new i = 0; i < rows; i++)
{
cache_get_field_content(i, "TagName", TagInfo[playerid][Index][TagName], mysql,25);
cache_get_field_content(i, "TagOwner", TagInfo[playerid][Index][TagOwner], mysql, 25);
cache_get_field_content(i, "TagFont", TagInfo[playerid][Index][TagFont], mysql, 20);
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(19482, TagInfo[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, -1, 300.0, 300.0);
SetDynamicObjectMaterialText(TagInfo[playerid][Index][TagObject], 0, TagInfo[playerid][Index][TagName], 70, TagInfo[playerid][Index][TagFont], TagInfo[playerid][Index][TagFontSize], 1, TagInfo[playerid][Index][TagFontColor], 0, 0);
new str[90];
format(str, sizeof(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(str, COLOR_YELLOW, TagInfo[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;
}