28.03.2013, 19:11
This is the code I have:
And the enum:
When loading, the X,Y and Z positions are always 0 and I have no idea why
pawn Код:
new Query[80];
for(new i=0; i < MAX_BIZ; i++)
{
format(Query, sizeof(Query), "SELECT * FROM `Business` WHERE 'bID' = '%d' ",i);
mysql_query(Query);
mysql_store_result();
mysql_fetch_row_format(Query, "|");
sscanf(Query, "e<p<|>iiis[24]iiiffffffffiiiiiis[128]>", BusinessInfo[i]);
BusinessInfo[i][bOutsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[i][bEntranceX], BusinessInfo[i][bEntranceY], BusinessInfo[i][bEntranceZ], BusinessInfo[i][bWorld]); //Creates a pickup at the business entrance.
BusinessInfo[i][bInsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ], BusinessInfo[i][bInsideWorld]); //Creates a pickup at the exit(Inside the interior)
printf("EntranceX: %f\nEntranceY: %f\nEntranceZ: %f",BusinessInfo[i][bEntranceX],BusinessInfo[i][bEntranceY],BusinessInfo[i][bEntranceZ]);
mysql_free_result();
}
pawn Код:
enum bInfo {
bID,
bOwned,
bPrice,
bOwner[MAX_PLAYER_NAME],
bType,
bLocked,
bMoney,
Float:bEntranceX,
Float:bEntranceY,
Float:bEntranceZ,
Float:bEntranceA,
Float:bExitX,
Float:bExitY,
Float:bExitZ,
Float:bExitA,
bInt,
bWorld,
bInsideInt,
bInsideWorld,
bInsideIcon,
bOutsideIcon,
bName[128]
}