08.08.2010, 16:51
(
Последний раз редактировалось ihatetn931; 11.08.2010 в 20:19.
)
Ok, i got it to write the values, but when i do /henter [houseid] [level] [price] It inserts in to the database but when i go to add a second houses it writes the values from the first house, The ids are diffrent but it's got the same values
What is written in the database when i do /henter 2x
pawn Код:
forward SaveHouses();
public SaveHouses()
{
new sql[512];
new idx;
//new coordsstring[512];
//format(coordsstring, sizeof(coordsstring), "%s|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
//format(sql, sizeof(sql), "INSERT INTO property (Howner,Enterx,Enterz,Enterz,Exitx,Exity,Exitz,Hint,Hworld,Hprice,Rentprice,Hrentable,Hlocked,Hdrugs,Hmats,Hgun1,Hammo1,Hgun2,Hammo2,Hgun3,Hammo3,Hmoney,Howned,Hlevel) VALUES ('%s','$f','$f','$f','$f','$f','$f','%d,'%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
format(sql, sizeof(sql), "INSERT INTO houses(Howner,Enterx,Entery,Enterz,Exitx,Exity,Exitz,Hint,Hworld,Hprice,Rentprice,Hrentable,Hlocked,Hdrugs,Hmats,Hgun1,Hammo1,Hgun2,Hammo2,Hgun3,Hammo3,Hmoney,Howned,Hlevel) VALUES ('%s','%f','%f','%f','%f','%f','%f',%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",
//format(sql, sizeof(HouseInfo), "UPDATE houses SET Howner='%s', Enterx='%f', Entery='%f', Enterz='%f', Exitx='%f', Exity='%f',Exitz='%f',Hint=%d,Hworld=%d,Hprice=%d,Rentprice=%d,Hrentable=%d,Hlocked='%d',Hdrugs='%d',Hmats=%d,Hgun1=%d,Hammo1=%d,Hgun2=%d,Hammo2=%d,Hgun3=%d,Hammo3=%d,Hmoney=%d,Howned=%d,Hlevel=%d WHERE id=%d",
HouseInfo[idx][hOwner],
HouseInfo[idx][hEnterX],
HouseInfo[idx][hEnterY],
HouseInfo[idx][hEnterZ],
HouseInfo[idx][hExitX],
HouseInfo[idx][hExitY],
HouseInfo[idx][hExitZ],
HouseInfo[idx][EnterInterior],
HouseInfo[idx][EnterWorld],
HouseInfo[idx][hPrice],
HouseInfo[idx][hRentPrice],
HouseInfo[idx][hRentable],
HouseInfo[idx][hLocked],
HouseInfo[idx][hDrugs],
HouseInfo[idx][hMaterials],
HouseInfo[idx][hGun1],
HouseInfo[idx][hGunAmmo1],
HouseInfo[idx][hGun2],
HouseInfo[idx][hGunAmmo2],
HouseInfo[idx][hGun3],
HouseInfo[idx][hGunAmmo3],
HouseInfo[idx][hMoney],
HouseInfo[idx][hOwned],
HouseInfo[idx][hLevel]);
idx++;
mysql_query(sql);
// return 1;
}
Код:
5 1739.51794 -1857.72742 13.41406 0.00000 0.00000 0.00000 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 4 1739.51794 -1857.72742 13.41406 0.00000 0.00000 0.00000 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1