PDA

View Full Version : Houses SQL


iGetty
19/05/2012, 01:13 AM
Alright, I've got my houses scripted.

One problem.

I get this error:
[02:50:53] [debug] #7 00000031 in OnGameModeInit () from new.amx
[02:50:53] [debug] #6 000003d4 in ?? () from new.amx
[02:50:53] [debug] #5 ???????? in native CallLocalFunction () from samp03svr
[02:50:53] [debug] #4 00000030 in SSCANF_OnGameModeInit () from new.amx
[02:50:53] [debug] #3 000060f8 in ?? () from new.amx
[02:50:53] [debug] #2 ???????? in native CallLocalFunction () from samp03svr
[02:50:53] [debug] #1 0000007c in zcmd_OnGameModeInit () from new.amx
[02:50:53] [debug] #0 0000007c in ?? () from new.amx
[02:50:53] [debug] Backtrace (most recent call first):
[02:50:53] [debug] Server crashed while executing new.amx
[02:50:53] House ID 0 was loaded from the MySQL Database

When I remove "LoadHouses();" from the script, that doesn't happen and it loads perfectly.

Could anybody tell me what the problem is?

The script
LoadHouses()
{
new Query[70], temp[50], i;
format(Query, sizeof(Query), "SELECT * FROM houses");
mysql_query(Query);
mysql_store_result();

CheckMySQL();

while(mysql_fetch_row(Query))
{
mysql_fetch_field_row(HD[i][owner], "owner");
mysql_fetch_field_row(HD[i][hname], "hname");
mysql_fetch_field_row(temp, "ID"); HD[i][ID] = strval(temp);
mysql_fetch_field_row(temp, "hprice"); HD[i][hprice] = strval(temp);
mysql_fetch_field_row(temp, "exteriorX"); HD[i][exteriorX] = floatstr(temp);
mysql_fetch_field_row(temp, "exteriorY"); HD[i][exteriorY] = floatstr(temp);
mysql_fetch_field_row(temp, "exteriorZ"); HD[i][exteriorZ] = floatstr(temp);
mysql_fetch_field_row(temp, "interiorX"); HD[i][interiorX] = floatstr(temp);
mysql_fetch_field_row(temp, "interiorY"); HD[i][interiorY] = floatstr(temp);
mysql_fetch_field_row(temp, "interiorZ"); HD[i][interiorZ] = floatstr(temp);
mysql_fetch_field_row(temp, "interiorInt"); HD[i][interiorInt] = strval(temp);
mysql_fetch_field_row(temp, "locked"); HD[i][locked] = strval(temp);
mysql_fetch_field_row(temp, "gunslot1"); HD[i][gunslot1] = strval(temp);
mysql_fetch_field_row(temp, "locklevel"); HD[i][locklevel] = strval(temp);
mysql_fetch_field_row(temp, "safeamount"); HD[i][safeamount] = strval(temp);

if(strlen(HD[i][owner]) > 0) CreatePickup(1273, 1, HD[i][exteriorX], HD[i][exteriorY], HD[i][exteriorZ], -1);
else CreatePickup(1273, 1, HD[i][exteriorX], HD[i][exteriorY], HD[i][exteriorZ], -1);
Create3DTextLabel(HD[i][hname], 0x000000AA, HD[i][exteriorX], HD[i][exteriorY], HD[i][exteriorZ], 5.0, 0);
printf("House ID %i was loaded from the MySQL Database", i);

++i;
}

mysql_free_result();
}


Thanks!

iGetty
21/05/2012, 08:53 PM
Bump.

Kitten
21/05/2012, 08:55 PM
Do you have crashdetect updated?

iGetty
21/05/2012, 08:57 PM
I do.