Problem with function under OnGameModeInit - 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)
+--- Thread: Problem with function under OnGameModeInit (
/showthread.php?tid=481410)
Problem with function under OnGameModeInit -
AA9 - 15.12.2013
So, i have a couple of functions under ongamemodeinit. They should load data from MySQL. Everyone works excpet one. When i put it last, it loads only 10 faction vehicles and when i put it first, then it load too only 10 faction vehicles & the following functions doest work, it says Gamemode is loaded. I apperciate, when somebody can solve this. MySQL debug file is also fine, there arent any errors.
OnGameModeInit
pawn Код:
LoadGrupeeringumasinad();
LoadCars();
LoadBusinesses();
LoadHouses();
LoadTexts();
LoadFactions();
LoadP66sad();
Function LoadGrupeeringumasinad
pawn Код:
stock LoadGrupeeringumasinad()
{
new query[600], savingstring[24];
for(new i = 1; i < MAX_VEHICLES; i++)
{
format(query, sizeof(query), "SELECT * FROM grupeeringusхidukid WHERE MysqlID = %i", i);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query, "|"))
{
mysql_fetch_field_row(savingstring, "GVEH1");fInfo[i][Model] = strval(savingstring);
mysql_fetch_field_row(savingstring, "GVEHcolor1");fInfo[i][AutoV2rv1] = strval(savingstring);
mysql_fetch_field_row(savingstring, "GVEHcolor2");fInfo[i][AutoV2rv2] = strval(savingstring);
mysql_fetch_field_row(savingstring, "ID");fInfo[i][faID] = strval(savingstring);
mysql_fetch_field_row(savingstring, "kvX");fInfo[i][kvX] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "kvY");fInfo[i][kvY] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "kvZ");fInfo[i][kvZ] = floatstr(savingstring);
mysql_fetch_field_row(savingstring, "kvA");fInfo[i][kvA] = floatstr(savingstring);
fvehicles_created++;
}
mysql_free_result();
fInfo[i][Auto] = CreateVehicle(fInfo[i][Model],fInfo[i][kvX],fInfo[i][kvY],fInfo[i][kvZ],fInfo[i][kvA],fInfo[i][AutoV2rv1],fInfo[i][AutoV2rv2],-1);
}
printf("Kokku laeti %d grupeeringu sхidukit; ",fvehicles_created);
}