13.05.2014, 17:48
Код:
stock LoadHouses() { format(szQuery, sizeof(szQuery), "SELECT * FROM houses"); HRPQuery(szQuery, THREAD_LOAD_HOUSES, INVALID_PLAYER_ID, g_MySQLConnections[0]); return true; } stock SaveHouse(house) { if(HouseInfo[house][hInitiated] == 0) return true; new szOwner[MAX_PLAYER_NAME]; mysql_real_escape_string(HouseInfo[house][hOwner], szOwner, g_MySQLConnections[0]); format(szQuery, sizeof(szQuery), "UPDATE houses SET houseOwned = %d, houseLevel = %d, houseOwner = '%s', houseExteriorX = %f, houseExteriorY = %f, \ houseExteriorZ = %f, houseExteriorA = %f, houseInteriorX = %f, houseInteriorY = %f, houseInteriorZ = %f, houseInteriorA = %f, houseInteriorVW = %d", HouseInfo[house][hOwned], HouseInfo[house][hLevel], szOwner, HouseInfo[house][hExteriorX], HouseInfo[house][hExteriorY], HouseInfo[house][hExteriorZ], HouseInfo[house][hExteriorA], HouseInfo[house][hInteriorX], HouseInfo[house][hInteriorY], HouseInfo[house][hInteriorZ], HouseInfo[house][hInteriorA], HouseInfo[house][hInteriorWorld]); format(szQuery, sizeof(szQuery), "%s, houseLock = %d, houseRentable = %d, houseRentFee = %d, houseValue = %d, houseCash = %d, housePot = %d, houseCrack = %d, houseMaterials = %d, \ houseWeapons0 = %d, houseWeapons1 = %d, houseWeapons2 = %d, houseWeapons3 = %d, houseWeapons4 = %d, houseGunLocker = %d, houseCustomInterior = %d, \ houseCustomExterior = %d WHERE houseID = %d", szQuery, HouseInfo[house][hLock], HouseInfo[house][hRentable], HouseInfo[house][hRentFee], HouseInfo[house][hValue], HouseInfo[house][hCash], HouseInfo[house][hPot], HouseInfo[house][hCrack], HouseInfo[house][hMaterials], HouseInfo[house][hWeapons][0], HouseInfo[house][hWeapons][1], HouseInfo[house][hWeapons][2], HouseInfo[house][hWeapons][3], HouseInfo[house][hWeapons][4], HouseInfo[house][hGLUpgrade], HouseInfo[house][hCustomInterior], HouseInfo[house][hCustomExterior], house); HRPQuery(szQuery, THREAD_NO_RESULT, INVALID_PLAYER_ID, g_MySQLConnections[0]); return true; }