Load Mysql House
#1

Hello evryone , i have a bug in my house loading
PHP код:
House_Refresh(idz)
{
    if (
idz != -1)
    {
        static
            
string[128];
        if (
HouseInfo[HouseInfo[idz][hID]][hOwned] == 0) {
              
format(string,sizeof(string),""COL_BROWN"Owner: "COL_WHITE"None\n"COL_BROWN"Price: "COL_WHITE"$%d\n"COL_BROWN"Street Number: "COL_WHITE"%d"HouseInfo[idz][hPrice], HouseInfo[idz][hID]);
            
HouseInfo[HouseInfo[idz][hID]][hDLabel] = Create3DTextLabel(string0xFFFFFFHouseInfo[idz][hEntranceX],HouseInfo[idz][hEntranceY],HouseInfo[idz][hEntranceZ], 10.000);
            
HouseInfo[HouseInfo[idz][hID]][hOutsideIcon] = CreateDynamicPickup(12731HouseInfo[idz][hEntranceX], HouseInfo[idz][hEntranceY], HouseInfo[idz][hEntranceZ], HouseInfo[idz][hWorld]);
        }
        else {
              
format(string,sizeof(string),""COL_BROWN"Owner: "COL_WHITE"%s\n"COL_BROWN"Street Number: "COL_WHITE"%d"HouseInfo[idz][hOwner], HouseInfo[idz][hID]);
            
HouseInfo[HouseInfo[idz][hID]][hDLabel] = Create3DTextLabel(string0xFFFFFF,  HouseInfo[HouseInfo[idz][hID]][hEntranceX],HouseInfo[HouseInfo[idz][hID]][hEntranceY], HouseInfo[HouseInfo[idz][hID]][hEntranceZ], 10.000);
            
HouseInfo[HouseInfo[idz][hID]][hOutsideIcon] = CreateDynamicPickup(12721HouseInfo[HouseInfo[idz][hID]][hEntranceX], HouseInfo[HouseInfo[idz][hID]][hEntranceY], HouseInfo[HouseInfo[idz][hID]][hEntranceZ], HouseInfo[HouseInfo[idz][hID]][hWorld]);
            
        }
        
printf("House pickup created %d"idz);
    }
    return 
1;

This is the code

In my database i have 2 house in my table and when i launch the server , i can see in the serverlog 2 house pickup created but in game i can see only one ...

Can help me please ?
Reply
#2

up ?
Reply
#3

shouldn't this be:

pawn Код:
HouseInfo[HouseInfo[idz][hID]][hOutsideIcon] = CreateDynamicPickup(1272, 1, HouseInfo[HouseInfo[idz][hID]][hEntranceX], HouseInfo[HouseInfo[idz][hID]][hEntranceY], HouseInfo[HouseInfo[idz][hID]][hEntranceZ], HouseInfo[HouseInfo[idz][hID]][hWorld]);
this?
pawn Код:
HouseInfo[HouseInfo[idz][hID]][hOutsideIcon] = CreateDynamicPickup(1272, 1, HouseInfo[idz][hEntranceX], HouseInfo[idz][hEntranceY], HouseInfo[idz][hEntranceZ], HouseInfo[idz][hWorld]);
like the top one or vice versa? why did you do HouseInfo[idz][hEntranceY] in case of houseowned == 0 , while you did HouseInfo[HouseInfo[idz][hID]][hEntranceY] in case of "else"?
Reply
#4

PHP код:
House_Refresh(idz)
{
    if (
idz != -1)
    {

      static
           
string[128];
      for(new 
0<= idzi++) {
        if (
HouseInfo[HouseInfo[i][hID]][hOwned] == 0) {
              
format(string,sizeof(string),""COL_BROWN"Owner: "COL_WHITE"None\n"COL_BROWN"Price: "COL_WHITE"$%d\n"COL_BROWN"Street Number: "COL_WHITE"%d"HouseInfo[i][hPrice], HouseInfo[i][hID]);
            
HouseInfo[HouseInfo[i][hID]][hDLabel] = Create3DTextLabel(string0xFFFFFFHouseInfo[i][hEntranceX],HouseInfo[i][hEntranceY],HouseInfo[i][hEntranceZ], 10.000);
            
HouseInfo[HouseInfo[i][hID]][hOutsideIcon] = CreateDynamicPickup(12731HouseInfo[i][hEntranceX], HouseInfo[i][hEntranceY], HouseInfo[i][hEntranceZ], HouseInfo[i][hWorld]);

        }
        else {
              
format(string,sizeof(string),""COL_BROWN"Owner: "COL_WHITE"%s\n"COL_BROWN"Street Number: "COL_WHITE"%d"HouseInfo[i][hOwner], HouseInfo[i][hID]);
            
HouseInfo[HouseInfo[i][hID]][hDLabel] = Create3DTextLabel(string0xFFFFFF,  HouseInfo[HouseInfo[i][hID]][hEntranceX],HouseInfo[HouseInfo[i][hID]][hEntranceY], HouseInfo[HouseInfo[i][hID]][hEntranceZ], 10.000);
            
HouseInfo[HouseInfo[i][hID]][hOutsideIcon] = CreateDynamicPickup(12721HouseInfo[HouseInfo[i][hID]][hEntranceX], HouseInfo[HouseInfo[i][hID]][hEntranceY], HouseInfo[HouseInfo[i][hID]][hEntranceZ], HouseInfo[HouseInfo[i][hID]][hWorld]);

        }
      }
     
printf("House pickup created %d"idz);
    }
    return 
1;

Reply
#5

Thanks for your help but any of these answer are working ,same problem
Reply
#6

First remove both HouseInfo[HouseInfo[i][hID]][hDLabel] and HouseInfo[HouseInfo[i][hID]][hOutsideIcon]. Then refresh.
(I mean objects that those variables are pointing at).
Reply
#7

Quote:
Originally Posted by LetsOWN[PL]
Посмотреть сообщение
First remove both HouseInfo[HouseInfo[i][hID]][hDLabel] and HouseInfo[HouseInfo[i][hID]][hOutsideIcon]. Then refresh.
(I mean objects that those variables are pointing at).
I Have already DestroyDynamicPickup but don't work
Only the pickup of the small id of house is showing
Reply
#8

i have Good mysql site want ?
Reply
#9

Resolved ! I was doign a small error in my load sql house ! Thks !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)