House doesn't appear in the place
#1

PHP код:
public farmsLoad(){
    new 
query[128];
    
mysql_format(mysqlquerysizeof(query), "SELECT * FROM `farms_info`");
    
mysql_query(mysqlquery);
    for(new 
0;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], mysqlMAX_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(195241FARM[i][POSX], FARM[i][POSY], FARM[i][POSZ], -1);
        for (new 
0FARM[i][fPlantations]; ++p// cia uzkrauname turimas plantacijas fPlanta
        
{
            
printf("%d\n"p);
            if(
FARM[i][fPlantation][p] == 1){
                
printf("%d\n"p+1);
                
CreateObject(19454housesFarms[i][firstPlantationX], housesFarms[i][firstPlantationY],    housesFarms[i][firstPlantationZ], 0.00000,    housesFarms[i][firstPlantationAngle], 0.00000);
                
CreateObject(19454housesFarms[i][secondPlantationX], housesFarms[i][secondPlantationY],    housesFarms[i][secondPlantationZ], 0.00000,    housesFarms[i][secondPlantationAngle], 0.00000);
                
CreateObject(19454housesFarms[i][thirdPlantationX], housesFarms[i][thirdPlantationY],    housesFarms[i][thirdPlantationZ], 0.00000,    housesFarms[i][thirdPlantationAngle], 0.00000);
                
CreateObject(19454housesFarms[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 
1FARM[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:xFloat:yFloat:z;
        
GetObjectPos(FARM[i][fHouseObject], xyz);
        
printf("%f X     %f Y     %f Z"xyz);
    }

So this is whole loading process. And this is the Array that I hold everything in -

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] = 
{
    { 
19505749.67218, -508.0387917.33210,   0.000000.0000090.00000,        19505749.67218, -508.0387917.33210,   0.000000.0000090.00000734.58252, -491.3515015.0962090.00000741.08252, -491.3515015.0962090.0000019454747.58252, -491.3515015.0962090.00000754.08252, -491.3515015.0962090.00000}
}; 
Plantations appear on the ground, but the house is like a ghost or something He doesn't want to be created.
In server log:
Код:
[14:28:57] veikiu 1
[14:28:57] 	0.000000 X 	0.000000 Y 	0.000000 Z
Reply
#2

the row id bro, cache_get_field_content_float(row, const field_name[])

change 0 to i , example FARM[i][POSZ] = cache_get_field_content_float(i, "posZ"); , its my idea i no use mysql, But nothing is lost trying
Reply
#3

Quote:
Originally Posted by Cerealguy
Посмотреть сообщение
the row id bro, cache_get_field_content_float(row, const field_name[])

change 0 to i , example FARM[i][POSZ] = cache_get_field_content_float(i, "posZ"); , its my idea i no use mysql, But nothing is lost trying
Everything is okay with that, those coordinates I use for pickup, it works, it's in the place. But Im talking about the house House coordinates and ID is in the array.
Reply
#4

check you no load firstPlantationX , firstPlantationY, firstPlantationZ, You are calling variables you have not loaded
Reply
#5

Quote:
Originally Posted by Cerealguy
Посмотреть сообщение
check you no load firstPlantationX , firstPlantationY, firstPlantationZ, You are calling variables you have not loaded
They are in the enum or how to pronaunce it. "farmHouses"
Reply
#6

The firstplantation, second and a third is apearing. But house still goes to 0.0000 0.0000 0.0000 cords.
Reply
#7

Okay so when you create house are you sure it is saved as it should be in DB?
Reply
#8

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Okay so when you create house are you sure it is saved as it should be in DB?
It should be in here and it is here.
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] =  

    { 
19505749.67218, -508.0387917.33210,   0.000000.0000090.00000,        19505749.67218, -508.0387917.33210,   0.000000.0000090.00000734.58252, -491.3515015.0962090.00000741.08252, -491.3515015.0962090.0000019454747.58252, -491.3515015.0962090.00000754.08252, -491.3515015.0962090.00000
}; 
Reply
#9

Do you have /createhouse command or smth like that?
Reply
#10

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Do you have /createhouse command or smth like that?
Its comes out from the DB.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)