public OnGameModeInit()
{
...
new MySQL:connection = mysql_init(LOG_ONLY_ERRORS, 1);
ConnectToDB();
...
LoadProperty();
...
}
public LoadProperty()
{
mysql_query("SELECT * FROM `property`");
mysql_store_result();
if(mysql_num_rows() > 0)
{
new buffer[256];
new field[33][256];
new idx;
while(mysql_fetch_row(buffer))
{
split(buffer, field);
idx = strval(field[0]);
HouseInfo[idx][hEntrancex] = floatstr(field[1]);
HouseInfo[idx][hEntrancey] = floatstr(field[2]);
HouseInfo[idx][hEntrancez] = floatstr(field[3]);
HouseInfo[idx][hExitx] = floatstr(field[4]);
HouseInfo[idx][hExity] = floatstr(field[5]);
HouseInfo[idx][hExitz] = floatstr(field[6]);
HouseInfo[idx][hHealthx] = strval(field[7]);
HouseInfo[idx][hHealthy] = strval(field[8]);
HouseInfo[idx][hHealthz] = strval(field[9]);
HouseInfo[idx][hArmourx] = strval(field[10]);
HouseInfo[idx][hArmoury] = strval(field[11]);
HouseInfo[idx][hArmourz] = strval(field[12]);
//printf("HouseInfo hEntrancez %f",HouseInfo[idx][hEntrancez]);
strmid(HouseInfo[idx][hOwner], field[12], 0, strlen(field[13]), 255);
strmid(HouseInfo[idx][hDiscription], field[13], 0, strlen(field[14]), 255);
HouseInfo[idx][hValue] = strval(field[15]);
HouseInfo[idx][hHel] = strval(field[16]);
HouseInfo[idx][hArm] = strval(field[17]);
HouseInfo[idx][hInt] = strval(field[18]);
HouseInfo[idx][hLock] = strval(field[19]);
HouseInfo[idx][hOwned] = strval(field[20]);
HouseInfo[idx][hRooms] = strval(field[21]);
HouseInfo[idx][hRent] = strval(field[22]);
HouseInfo[idx][hRentabil] = strval(field[23]);
HouseInfo[idx][hTakings] = strval(field[24]);
HouseInfo[idx][hVec] = strval(field[25]);
if(HouseInfo[idx][hVec] == 457)
{
HouseInfo[idx][hVec] = 411;
}
HouseInfo[idx][hVcol1] = strval(field[26]);
HouseInfo[idx][hVcol2] = strval(field[27]);
HouseInfo[idx][hDate] = strval(field[28]);
HouseInfo[idx][hLevel] = strval(field[29]);
HouseInfo[idx][hWorld] = strval(field[30]);
HouseInfo[idx][hSetted] = strval(field[31]);
//printf("HouseInfo:%d Owner:%s hTakings %d hVec %d",idx,HouseInfo[idx][hOwner],HouseInfo[idx][hTakings],HouseInfo[idx][hVec]);
}
printf("[SCRIPT]: Loaded %d Houses from Database", idx);
}
mysql_free_result();
return 1;
}
Header size: 16252 bytes Code size: 3278728 bytes Data size: 16190088 bytes Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion Total requirements:19501452 bytes
Header size: 16252 bytes Code size: 3278728 bytes Data size: 16190088 bytes Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion Total requirements:19501452 bytes
Код:
Header size: 16252 bytes Code size: 3278728 bytes Data size: 16190088 bytes Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion Total requirements:19501452 bytes |