06.11.2014, 19:57
Hello, Ive created a script where it loads houses from db. so hares the part of the script that doesnt work.
So, it doesnt load the pickup, why is that i wonder, I think its eather the pickup doesnt create cuz of wrong command, or cuz of something wrong getting the mysql data, tables are correct. any ideas?
Код:
stock LoadHouses() { new Str[255], hID, Float:intX, Float:intY, Float:intZ, Float:exitX, Float:exitY, Float:exitZ, hOwner[24], hWorld, hPrice, hIntID, hLocked; mysql_query("SELECT * FROM `houses`"); mysql_store_result(); new haI = 1; if(mysql_num_rows() > 0) { while(mysql_fetch_row(Str)) { sscanf(Str, "p<|>is[128]s[24]ffffffiiii", hID, intX, intY, intZ, exitX, exitY, exitZ, hOwner, hWorld, hPrice, hIntID, hLocked); HousePickup[hID] = CreatePickup(1273, 1, exitX, exitY, exitZ, 0); iHos[haI][haID] = haI; iHos[haI][haExitX] = exitX; iHos[haI][haExitY] = exitY; iHos[haI][haExitZ] = exitZ; iHos[haI][haIntX] = intX; iHos[haI][haIntY] = intY; iHos[haI][haIntZ] = intZ; iHos[haI][haIntID] = hIntID; iHos[haI][haPrice] = hPrice; iHos[haI][haLocked] = hLocked; iHos[haI][haWorld] = hWorld; format(iHos[haI][haOwner], 24, "%s", hOwner); haI++; hTotal++; } } mysql_free_result(); printf("** %i\t<->\tHouses Loaded from\t<->\tMySQL\t\t **", hTotal); return 1; }