16.01.2016, 12:22
Well it ended up like this now, and it works fine..
This method will take alot of lines if i applied it on the whole script.
PHP код:
public OnGameModeInit()
{
mysql_tquery(ConnectionHandle, "SELECT * FROM interiors", "LoadInteriorData");
return 1;
}
forward LoadInteriorData();
public LoadInteriorData()
{
new rows, fields; cache_get_data(rows, fields, ConnectionHandle);
if(!rows) return 1;
for(new i = 0; i < MAX_INTERIORS; i++)
{
cache_get_field_content(i, "intname", INTInfo[i][INTName], ConnectionHandle, 64);
cache_get_field_content(i, "inttype", INTInfo[i][INTType], ConnectionHandle, 64);
cache_get_field_content(i, "intlocation", INTInfo[i][INTLocation], ConnectionHandle, 64);
INTInfo[i][INTInterior] = cache_get_field_content_int(i, "intinterior");
INTInfo[i][INTIcon] = cache_get_field_content_int(i, "inticon");
INTInfo[i][INTCPOutX] = cache_get_field_content_float(i, "intcpoutx");
INTInfo[i][INTCPOutY] = cache_get_field_content_float(i, "intcpouty");
INTInfo[i][INTCPOutZ] = cache_get_field_content_float(i, "intcpoutz");
INTInfo[i][INTSPInX] = cache_get_field_content_float(i, "intspinx");
INTInfo[i][INTSPInY] = cache_get_field_content_float(i, "intspiny");
INTInfo[i][INTSPInZ] = cache_get_field_content_float(i, "intspinz");
INTInfo[i][INTSPInA] = cache_get_field_content_float(i, "intspina");
INTInfo[i][INTSPOutX] = cache_get_field_content_float(i, "intspoutx");
INTInfo[i][INTSPOutY] = cache_get_field_content_float(i, "intspouty");
INTInfo[i][INTSPOutZ] = cache_get_field_content_float(i, "intspoutz");
INTInfo[i][INTSPOutA] = cache_get_field_content_float(i, "intspouta");
InteriorCP[i] = CreateDynamicCP(INTInfo[i][INTCPOutX], INTInfo[i][INTCPOutY], INTInfo[i][INTCPOutZ], 1.5, 0, 0, -1, 20);
CreateDynamic3DTextLabel(INTInfo[i][INTName], COLOR_YELLOW, INTInfo[i][INTCPOutX], INTInfo[i][INTCPOutY], INTInfo[i][INTCPOutZ], 30);
if(INTInfo[i][INTIcon] != 0) CreateDynamicMapIcon(INTInfo[i][INTCPOutX], INTInfo[i][INTCPOutY], INTInfo[i][INTCPOutZ], INTInfo[i][INTIcon],0,0,0,-1,300.0);
}
return 1;
}