15.12.2010, 18:18
try this, if you aren't using BlueG's i suggest to switch to his
pawn Код:
public LoadInts()
{
new line[1024], Intvar[4], Float:Intfloat[6], Intstr[1][100];
format(query, sizeof(query), "SELECT * FROM `interiors` ORDER BY `id`;");
mysql_query(query);
mysql_store_result();
printf("\nSQL Table loads (NOT PLAYERS)");
print("------------------------------------");
if(mysql_num_rows() > 0)
{
if(mysql_fetch_row(intdata))
{
sscanf(line, "p<|>ddddffffffs[100]",Intvar[0],Intvar[1],Intvar[2],Intvar[3],Intfloat[0],Intfloat[1],Intfloat[2],Intfloat[3],Intfloat[4],Intfloat[5],Intstr[0]));
InteriorInfo[iID] = Intvar[0];
InteriorInfo[iInt] = Intvar[1];
InteriorInfo[iVirtual] = Intvar[2];
InteriorInfo[iPickup] = Intvar[3];
InteriorInfo[iX] = Intfloat[0];
InteriorInfo[iY] = Intfloat[1];
InteriorInfo[iZ] = Intfloat[2];
InteriorInfo[iEx] = Intfloat[3];
InteriorInfo[iEy] = Intfloat[4];
InteriorInfo[iEz] = Intfloat[5];
format(InteriorInfo[iDesc],100,"%s",Intstr[0]);
CreatePickup(InteriorInfo[iPickup], 1, InteriorInfo[iX], InteriorInfo[iY], InteriorInfo[iZ], 0);
Create3DTextLabel(InteriorInfo[iDesc], COLOR_BRIGHTRED, InteriorInfo[iX], InteriorInfo[iY], InteriorInfo[iZ], 20.0, 0);
format(string, sizeof(string), "%s %f %f %f", InteriorInfo[iDesc], InteriorInfo[iX], InteriorInfo[iY], InteriorInfo[iZ]);
print(string);
}
}
format(string, sizeof(string), "[MySQL] Loaded interiors from database, a total of: %d", mysql_num_rows());
printf(string);
return 1;
}