House doesn't save
#8

Update.
PHP код:
stock SaveHouse(houseid

    new 
query[2000]; 
    
format(querysizeof(query), "UPDATE `Houses` SET `hInteriorID` = %d, `hInteriorX` = '%f', `hInteriorY` = '%f', `hInteriorZ` = '%f', `hInteriorA` = '%f', `hExteriorID` = %d, `hExteriorX` = '%f', `hExteriorY` = '%f', `hExteriorZ` = '%f', `hExteriorA` = '%f', `hSpawnID` = %d, `hSpawnX` = '%f', `hSpawnY` = '%f', `hSpawnZ` = '%f', `hSpawnA` = '%f', "
        
Houses[houseid][hInteriorID], 
        
Houses[houseid][hInteriorX], 
        
Houses[houseid][hInteriorY], 
        
Houses[houseid][hInteriorZ], 
        
Houses[houseid][hInteriorA], 
        
Houses[houseid][hExteriorID], 
        
Houses[houseid][hExteriorX], 
        
Houses[houseid][hExteriorY], 
        
Houses[houseid][hExteriorZ], 
        
Houses[houseid][hExteriorA], 
        
Houses[houseid][hSpawnID], 
        
Houses[houseid][hSpawnX], 
        
Houses[houseid][hSpawnY], 
        
Houses[houseid][hSpawnZ], 
        
Houses[houseid][hSpawnA]); 
    
format(querysizeof(query), "%s`hOwner` = '%s', `hAddress` = '%s', `HousePrice` = %d, `hLockStatus` = %d, `hType` = '%s', `hLastLoginDate` = %d WHERE `HouseID` = %d"
        
query
        
Houses[houseid][hOwner], 
        
Houses[houseid][hAddress], 
        
Houses[houseid][HousePrice], 
        
Houses[houseid][hLockStatus], 
        
Houses[houseid][hType], 
        
Houses[houseid][hLastLoginDate], 
        
houseid); 
    
mysql_query(query); 
    return 
1

The create
PHP код:
forward SaveHouseCallback(houseidplayerid); 
public 
SaveHouseCallback(houseidplayerid

    new 
        
rows
    if(
rows == 1
    { 
        
//SendClientMessage(SavingVehiclePlayerID, RED, "This Vehicle already exists"); 
        
SendClientMessage(playeridRED"This House already exists!"); 
    } 
    else if(
rows == 0
    { 
        new 
query[2000]; 
         
format(querysizeof(query), "INSERT INTO `Houses` (`hInteriorID`, `hInteriorX`, `hInteriorY`, `hInteriorZ`, `hInteriorA`, `hExteriorID`, `hExteriorX`, `hExteriorY`, `hExteriorZ`, `hExteriorA`, `hSpawnID`, "); 
        
format(querysizeof(query), "%s`hSpawnX`, `hSpawnY`, `hSpawnZ`, `hSpawnA`, `hOwner`, `hAddress`, `HousePrice`, `hLockStatus`, `hType`) VALUES "query); 
        
format(querysizeof(query), "%s(%d, '%f', '%f', '%f', '%f', %d, '%f', '%f', '%f', '%f', %d, '%f', '%f', '%f', '%f', '%s', '%s', %d, %d, '%s')"
        
queryHouses[houseid][hInteriorID], 
         
Houses[houseid][hInteriorX], 
          
Houses[houseid][hInteriorY], 
           
Houses[houseid][hInteriorZ], 
        
Houses[houseid][hInteriorA], 
         
Houses[houseid][hExteriorID], 
         
Houses[houseid][hExteriorX], 
         
Houses[houseid][hExteriorY], 
         
Houses[houseid][hExteriorZ], 
         
Houses[houseid][hExteriorA], 
         
Houses[houseid][hSpawnID], 
         
Houses[houseid][hSpawnX], 
          
Houses[houseid][hSpawnY], 
           
Houses[houseid][hSpawnZ], 
           
Houses[houseid][hSpawnA], 
           
Houses[houseid][hOwner], 
           
Houses[houseid][hAddress], 
         -
1
          
1
          
Houses[houseid][hType]); 
        
mysql_queryM(query"DefaultCallback"); 
        new 
query2[400]; 
        
format(query2sizeof(query2), "SELECT * FROM `Houses` WHERE `HouseID` = %d"houseid); // Selects all the information from the table 
        
mysql_queryM(query2,"LoadHousesCallback""d"houseid); 
    } 
    else 
    { 
        
//SendClientMessage(SavingVehiclePlayerID, COLOR_WHITE, "There was a "#COL_EMB_RED"fatal error "#COL_EMB_WHITE"during registration! Please contact a developer."); 
        
SendClientMessage(playeridCOLOR_WHITE"There was a "#COL_EMB_RED"fatal error "#COL_EMB_WHITE"during registration! Please contact a developer."); 
    

    return 
1

As you see i got them both... But it's creating but not updating
Reply


Messages In This Thread
House doesn't save - by lulo356 - 15.03.2016, 19:39
Re: House doesn't save - by iKevin - 15.03.2016, 19:45
Re: House doesn't save - by thegamer355 - 15.03.2016, 20:15
Re: House doesn't save - by lulo356 - 15.03.2016, 20:35
Re: House doesn't save - by thegamer355 - 15.03.2016, 20:38
Re: House doesn't save - by lulo356 - 15.03.2016, 21:28
Re: House doesn't save - by thegamer355 - 16.03.2016, 06:00
Re: House doesn't save - by lulo356 - 16.03.2016, 13:35
Re: House doesn't save - by thegamer355 - 16.03.2016, 13:44

Forum Jump:


Users browsing this thread: 2 Guest(s)