29.07.2013, 07:11
you should show us your SCMEX or try this
Код:
CMD:savechars(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessageEx(playerid, COLOR_GREY, "Ban khong duoc phep su dung lenh nay.");
else
{
SaveHouses();
SendClientMessageEx(playerid, COLOR_YELLOW, "Tat ca nha da duoc Cap Nhat Thanh Cong.");
SendClientMessageEx(playerid, COLOR_YELLOW, "Tat ca Nguoi choi da Cap Nhat Thanh Cong.");
}
return 1;
}
stock SaveHouses()
{
for(new i = 0; i < MAX_HOUSES; i++)
{
new string[2048];
format(string, sizeof(string), "UPDATE `houses` SET \
`Owned`=%d, \
`Level`=%d, \
`HInteriorWorld`=%d, \
`Description`='%s', \
`Owner`='%s', \
`ExteriorX`=%f, \
`ExteriorY`=%f, \
`ExteriorZ`=%f, \
`ExteriorR`=%f, \
`InteriorX`=%f, \
`InteriorY`=%f, \
`InteriorZ`=%f, \
`InteriorR`=%f,",
HouseInfo[i][hOwned],
HouseInfo[i][hLevel],
HouseInfo[i][hHInteriorWorld],
HouseInfo[i][hDescription],
HouseInfo[i][hOwner],
HouseInfo[i][hExteriorX],
HouseInfo[i][hExteriorY],
HouseInfo[i][hExteriorZ],
HouseInfo[i][hExteriorR],
HouseInfo[i][hInteriorX],
HouseInfo[i][hInteriorY],
HouseInfo[i][hInteriorZ],
HouseInfo[i][hInteriorR]
);
format(string, sizeof(string), "%s \
`Lock`=%d, \
`Rentable`=%d, \
`RentFee`=%d, \
`Value`=%d, \
`SafeMoney`=%d, \
`Pot`=%d, \
`Crack`=%d, \
`Materials`=%d, \
`Weapons0`=%d, \
`Weapons1`=%d, \
`Weapons2`=%d, \
`Weapons3`=%d, \
`Weapons4`=%d, \
`GLUpgrade`=%d, \
`CustomInterior`=%d, \
`CustomExterior`=%d, \
`ExteriorA`=%f, \
`InteriorA`=%f WHERE `id`=%d",
string,
HouseInfo[i][hLock],
HouseInfo[i][hRentable],
HouseInfo[i][hRentFee],
HouseInfo[i][hValue],
HouseInfo[i][hSafeMoney],
HouseInfo[i][hPot],
HouseInfo[i][hCrack],
HouseInfo[i][hMaterials],
HouseInfo[i][hWeapons][0],
HouseInfo[i][hWeapons][1],
HouseInfo[i][hWeapons][2],
HouseInfo[i][hWeapons][3],
HouseInfo[i][hWeapons][4],
HouseInfo[i][hGLUpgrade],
HouseInfo[i][hCustomInterior],
HouseInfo[i][hCustomExterior],
HouseInfo[i][hExteriorA],
HouseInfo[i][hInteriorA],
houseid+1
); // Array starts from zero, MySQL starts at 1 (this is why we are adding one).
mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
return 1;
}
