16.11.2016, 11:37
PHP код:
public farmsLoad(){
new query[128];
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `farms_info`");
mysql_query(mysql, query);
for(new i = 0;i < cache_get_row_count(); i++){
printf("Sodyba %d buvo uzkrauta !", i);
FARM[i][ID] = cache_get_field_content_int(0, "number");
cache_get_field_content(0, "OwnerName", FARM[i][fOWNER], mysql, MAX_PLAYER_NAME);
FARM[i][hLEVEL] = cache_get_field_content_int(0, "Level");
FARM[i][hUpgrapadeTime] = cache_get_field_content_int(0, "UgrapadeTime");
FARM[i][fPRICE] = cache_get_field_content_int(0, "Price");
FARM[i][fPlantations] = cache_get_field_content_int(0, "Plantations");
FARM[i][fPlantation][0] = cache_get_field_content_int(0, "Plantation1");
FARM[i][fPlantation][1] = cache_get_field_content_int(0, "Plantation2");
FARM[i][fPlantation][2] = cache_get_field_content_int(0, "Plantation3");
FARM[i][fPlantation][3] = cache_get_field_content_int(0, "Plantation4");
FARM[i][fCow][0] = cache_get_field_content_int(0, "fCow");
FARM[i][POSX] = cache_get_field_content_float(0, "posX");
FARM[i][POSY] = cache_get_field_content_float(0, "posY");
FARM[i][POSZ] = cache_get_field_content_float(0, "posZ");
CreatePickup(19524, 1, FARM[i][POSX], FARM[i][POSY], FARM[i][POSZ], -1);
for (new p = 0; p < FARM[i][fPlantations]; ++p) // cia uzkrauname turimas plantacijas fPlanta
{
printf("%d\n", p);
if(FARM[i][fPlantation][p] == 1){
printf("%d\n", p+1);
CreateObject(19454, housesFarms[i][firstPlantationX], housesFarms[i][firstPlantationY], housesFarms[i][firstPlantationZ], 0.00000, housesFarms[i][firstPlantationAngle], 0.00000);
CreateObject(19454, housesFarms[i][secondPlantationX], housesFarms[i][secondPlantationY], housesFarms[i][secondPlantationZ], 0.00000, housesFarms[i][secondPlantationAngle], 0.00000);
CreateObject(19454, housesFarms[i][thirdPlantationX], housesFarms[i][thirdPlantationY], housesFarms[i][thirdPlantationZ], 0.00000, housesFarms[i][thirdPlantationAngle], 0.00000);
CreateObject(19454, housesFarms[i][fourthPlantationX], housesFarms[i][fourthPlantationY], housesFarms[i][fourthPlantationZ], 0.00000, housesFarms[i][fourthPlantationAngle], 0.00000);
}
}
printf("%d\n", FARM[i][hLEVEL]);
switch(FARM[i][hLEVEL]){
case 1: FARM[i][fHouseObject] = CreateObject(housesFarms[i][firstHouseId], housesFarms[i][firstHouseX], housesFarms[i][firstHouseY], housesFarms[i][firstHouseZ], housesFarms[i][firstHouserX], housesFarms[i][firstHouserY], housesFarms[i][firstHouserZ]), printf("veikiu 1");
case 2: FARM[i][fHouseObject] = CreateObject(housesFarms[i][secondHouseId], housesFarms[i][firstHouseX], housesFarms[i][firstHouseY], housesFarms[i][firstHouseZ], housesFarms[i][firstHouserX], housesFarms[i][firstHouserY], housesFarms[i][firstHouserZ]), printf("veikiu 2");
}
new Float:x, Float:y, Float:z;
GetObjectPos(FARM[i][fHouseObject], x, y, z);
printf("%f X %f Y %f Z", x, y, z);
}
}
PHP код:
enum farmHouses{
firstHouseId,
Float:firstHouseX,
Float:firstHouseY,
Float:firstHouseZ,
Float:firstHouserX,
Float:firstHouserY,
Float:firstHouserZ,
secondHouseId,
Float:secondHouseX,
Float:secondHouseY,
Float:secondHouseZ,
Float:secondHouserX,
Float:secondHouserY,
Float:secondHouserZ,
Float:firstPlantationX,
Float:firstPlantationY,
Float:firstPlantationZ,
Float:firstPlantationAngle,
Float:secondPlantationX,
Float:secondPlantationY,
Float:secondPlantationZ,
Float:secondPlantationAngle,
Float:thirdPlantationX,
Float:thirdPlantationY,
Float:thirdPlantationZ,
Float:thirdPlantationAngle,
Float:fourthPlantationX,
Float:fourthPlantationY,
Float:fourthPlantationZ,
Float:fourthPlantationAngle
}
new housesFarms[][farmHouses] =
{
{ 19505, 749.67218, -508.03879, 17.33210, 0.00000, 0.00000, 90.00000, 19505, 749.67218, -508.03879, 17.33210, 0.00000, 0.00000, 90.00000, 734.58252, -491.35150, 15.09620, 90.00000, 741.08252, -491.35150, 15.09620, 90.0000019454, 747.58252, -491.35150, 15.09620, 90.00000, 754.08252, -491.35150, 15.09620, 90.00000}
};

In server log:
Код:
[14:28:57] veikiu 1 [14:28:57] 0.000000 X 0.000000 Y 0.000000 Z