02.01.2012, 18:55
What could be the problem of this? when i restart server it doesnt load the icon
pawn Код:
stock LoadIcon()
{
new iconcount;
for(new i=1; i<MAX_ICON; i++)
{
format(str,sizeof(str),"SELECT * FROM Mapicon WHERE `ID` = %d LIMIT 1",i);
mysql_query(str);
mysql_store_result();
if(mysql_num_rows() != 0)
{
iconcount ++;
mysql_fetch_row_format(drow, "|");
explode(drow, field, "|");
MapInfo[i][mapicon] = strval(field[1]);
MapInfo[i][mapX] = strval(field[2]);
MapInfo[i][mapY] = strval(field[3]);
MapInfo[i][mapZ] = strval(field[4]);
MapInfo[i][iconspawn] = CreateDynamicMapIcon(MapInfo[i][mapX],MapInfo[i][mapY],MapInfo[i][mapZ],MapInfo[i][mapicon],0,-1,-1,-1,100.0);
mysql_free_result();
}
}
return printf("%d icons loaded",iconcount);
}