25.06.2012, 17:28
Okay, here is where it freezes:
What causes it is this:
OnGameModeInit(); No problem
Here is the "loadbusiness" stock, which contains a stock which crashes it.
This is the "LoadBusinessInfo" stock, which is what ultimately crashes the server.
Any ideas what I am doing wrong?
What causes it is this:
OnGameModeInit(); No problem
pawn Код:
public OnGameModeInit()
{
SetGameModeText("SF-RP v0.1b");
AddPlayerClass(1,-2289.6543,211.1139,35.3125, 0,0,0,0,0,0,0);
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
SetWorldTime(Hour);
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
mysql_debug(1);
DisableInteriorEnterExits();
loadarrowpickups();
loadmaps();
loadbusiness();
loadhouses();
SetTimer("MoneyTimer", 1000, 1);
return 1;
}
pawn Код:
stock loadbusiness()
{
for(new i=0; i<MAX_BUSINESSES; i++)
{
currbusiness += 1;
LoadBusinessInfo(i); // When this is commented out, there is no crash
CreatePickup(1272, 1, BVar[i][bpickupx], BVar[i][bpickupy], BVar[i][bpickupz], 0);
}
print("Buinesses Loaded");
}
pawn Код:
stock LoadBusinessInfo(iBusiness)
{
new Query[700];
mysql_query("SELECT * FROM businessinfo");
while(mysql_fetch_row(Query))
{
sscanf(Query, "e<p<|>dfffs[28]s[24]dddddfff>", BVar[iBusiness][bid], BVar[iBusiness][bpickupx], BVar[iBusiness][bpickupy], BVar[iBusiness][bpickupz], BVar[iBusiness][bname],
BVar[iBusiness][bowner], BVar[iBusiness][bprice], BVar[iBusiness][bpayout], BVar[iBusiness][blocked], BVar[iBusiness][benterable], BVar[iBusiness][binterior],
BVar[iBusiness][bintx], BVar[iBusiness][binty], BVar[iBusiness][bintz], BVar[iBusiness][bInt]);
}
mysql_free_result();
return 1;
}