public call back bug bug (server not starting) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: public call back bug bug (server not starting) (
/showthread.php?tid=194808)
public call back bug bug (server not starting) -
Hornet600 - 30.11.2010
I'm coding a vehicle system with mysql but i get stuck with one bug i created one stock to load vehicles and the code looks alright its compiled. I put the LoadVehicles(); at ongamemodeinit and it dont't starts and if i remove it from gamemode init it starts here is my code
pawn Код:
forward LoadVehicles();
public LoadVehicles()
{
new string[256];
for(new i; i < MAX_VEHICLES; i++)
{
format(string, sizeof(string), "SELECT * FROM vehicles WHERE carid=%d", i);
mysql_query(string);
if(mysql_num_rows())
{
new row[128];
new field[13][32]; //
mysql_fetch_row(row, "|");
explode(row, field, "|");
mysql_store_result();
mysql_free_result();
vehicleinfo[i][id] = strval(field[1]);
vehicleinfo[i][Model] = strval(field[2]);
vehicleinfo[i][Color1] = strval(field[3]);
vehicleinfo[i][Color2] = strval(field[4]);
vehicleinfo[i][Locationx] = strval(field[5]);
vehicleinfo[i][Locationy] = strval(field[6]);
vehicleinfo[i][Locationz] = strval(field[7]);
vehicleinfo[i][Angle] = strval(field[8]);
vehicleinfo[i][Owned] = strval(field[9]);
vehicleinfo[i][Owner] = strval(field[10]);
vehicleinfo[i][Type] = strval(field[11]);
vehicleinfo[i][RespawnTime] = strval(field[12]);
CreateVehicle(vehicleinfo[i][Model],vehicleinfo[i][Locationx],vehicleinfo[i][Locationy],vehicleinfo[i][Locationz],vehicleinfo[i][Angle],vehicleinfo[i][Color1],vehicleinfo[i][Color2],vehicleinfo[i][RespawnTime]);
printf(" Cars Loaded ");
}
}
}
Re: public call back bug bug (server not starting) -
Hornet600 - 30.11.2010
Any sugestions to solve this problem?
Re: public call back bug bug (server not starting) -
sjoeppie - 30.11.2010
hmmm i don't know, seems okay to me.
i sometimes had a problem like this too, everything seemed ok, but the server still only restarted every time he loaded everything. try rewriting it, that sometimes worked for me
Re: public call back bug bug (server not starting) -
Ash. - 30.11.2010
Are you sure the database;
a) connects (Print to find out)
b) exists
c) is accessible