16.02.2014, 16:07
Hello. I have an interesting problem with setting float to a variable. I dont
understand why, but after 12 id of a loop, float is not set to a variable.
code:
And here it is what i get in server_log.txt
[19:08:27] -2469.639892
[19:08:27] 0
[19:08:27] 606.604003
[19:08:27] 1
[19:08:27] -73.897697
[19:08:27] 2
[19:08:27] -1859.020019
[19:08:27] 3
[19:08:27] -2158.459960
[19:08:27] 4
[19:08:27] 256.148010
[19:08:27] 5
[19:08:27] 2254.129882
[19:08:27] 6
[19:08:27] 1296.910034
[19:08:27] 7
[19:08:27] -191.979995
[19:08:27] 8
[19:08:27] 2632.969970
[19:08:27] 9
[19:08:27] 721.685974
[19:08:27] 10
[19:08:27] 2838.159912
[19:08:27] 11
[19:08:27] -1394.040039
[19:08:27] 12
[19:08:27] -1410.130004
[19:08:27]
Any opinions?
understand why, but after 12 id of a loop, float is not set to a variable.
code:
pawn Код:
#define MAX_ARENAS (216)
enum arenainfo
{
Float:homexa,
Float:homeya,
Float:homeza,
Float:attxa,
Float:attya,
Float:attza,
Float:defxa,
Float:defya,
Float:defza,
interiora,
Float:area1a,
Float:area2a,
Float:area3a,
Float:area4a
}
new ArenaI[MAX_ARENAS][arenainfo];
function LoadMySQLSettings()
{
print("~~~~~ Loading settings from MySQL");
Loop(a,MAX_ARENAS)
{
new Querry[64];
new datastr[16];
format(Querry,sizeof(Querry),"SELECT * FROM `arenas` WHERE `id` =
'%d'",a);
mysql_query(Querry);
mysql_store_result();
mysql_fetch_field("homex", datastr);
printf("%f",floatstr(datastr));
ArenaI[a][homexa] = floatstr(datastr);
printf("%d",a);
}
printf("~ Loaded: %d arenas",MAX_ARENAS);
print("~~~~~ Settings successfuly loaded from MySQL");
return 1;
}
[19:08:27] -2469.639892
[19:08:27] 0
[19:08:27] 606.604003
[19:08:27] 1
[19:08:27] -73.897697
[19:08:27] 2
[19:08:27] -1859.020019
[19:08:27] 3
[19:08:27] -2158.459960
[19:08:27] 4
[19:08:27] 256.148010
[19:08:27] 5
[19:08:27] 2254.129882
[19:08:27] 6
[19:08:27] 1296.910034
[19:08:27] 7
[19:08:27] -191.979995
[19:08:27] 8
[19:08:27] 2632.969970
[19:08:27] 9
[19:08:27] 721.685974
[19:08:27] 10
[19:08:27] 2838.159912
[19:08:27] 11
[19:08:27] -1394.040039
[19:08:27] 12
[19:08:27] -1410.130004
[19:08:27]
Any opinions?