27.11.2013, 16:30
Hello
I put 241 homes in the houses of the mysql table.
I did load the home. Until then everything works perfectly. More time to save, not save every home, only 106 of 241.
and the gamemode, half of a locked. I can not explain well, just that there's something wrong. If someone can help me, I will be very grateful and happy.
Thank you!
Below is the code of my attempt.
Many thanks to those who help, and those who try to help too!
I put 241 homes in the houses of the mysql table.
I did load the home. Until then everything works perfectly. More time to save, not save every home, only 106 of 241.
and the gamemode, half of a locked. I can not explain well, just that there's something wrong. If someone can help me, I will be very grateful and happy.
Thank you!
Below is the code of my attempt.
pawn Код:
mysql_function_query(Connect, "SELECT * FROM `casas`", true, "SaveHouses", "");
pawn Код:
forward SaveHouses();
public SaveHouses()
{
new rows, fields,TotalCasas;
cache_get_data(rows, fields);
while(TotalCasas < rows)
{
new Str[315];
format(Str,163,"UPDATE `casas` SET `HealthX`='%f',`HealthY`='%f',`HealthZ`='%f',`ArmorrX`='%f',`ArmorrY`='%f',`ArmorrZ`='%f',",HouseInfo[TotalCasas][hHealthx],
HouseInfo[TotalCasas][hHealthy],HouseInfo[TotalCasas][hHealthz],HouseInfo[TotalCasas][hArmorrx],HouseInfo[TotalCasas][hArmorry],HouseInfo[TotalCasas][hArmorrz]);
format(Str,380,"%s`Dono`='%s',`Descricao`='%s',`Valor`='%i',`Saude`='%i',`Colete`='%i',`Interior`='%i',`Trancado`='%i',`Vendido`='%i',",Str,HouseInfo[TotalCasas][hOwner],
HouseInfo[TotalCasas][hDiscription],HouseInfo[TotalCasas][hValue],HouseInfo[TotalCasas][hHel],HouseInfo[TotalCasas][hArm],HouseInfo[TotalCasas][hInt],HouseInfo[TotalCasas][hLock],HouseInfo[TotalCasas][hOwned]);
format(Str,557,"%s`Rooms`='%i',`Rent`='%i',`Rentabil`='%i',`Takings`='%i',`Vec`='%i',`Vcol1`='%i',`Vcol2`='%i',`Data`='%i',",Str,HouseInfo[TotalCasas][hRooms],HouseInfo[TotalCasas][hRent],
HouseInfo[TotalCasas][hRentabil],HouseInfo[TotalCasas][hTakings],HouseInfo[TotalCasas][hVec],HouseInfo[TotalCasas][hVcol1],HouseInfo[TotalCasas][hVcol2],HouseInfo[TotalCasas][hDate]);
format(Str,603,"%s`Level`='%i' WHERE `ID`='%i'",Str,HouseInfo[TotalCasas][hLevel],TotalCasas);
mysql_function_query(Connect, Str, false, "","");
//print("");
//print(Str);
TotalCasas++;
}
printf("[BVS]: %d Houses Loaded",TotalCasas);
return 1;
}