Jump to content

Problem Whit House


daKillar2000

Recommended Posts

heey i want save me house

here i want save when buy house

local subnode = xmlCreateChild ( file, "house" )

  
                
  
function onHouseBuy ( cost, ID ) 
    cost = tonumber ( cost ) 
    if ( getPlayerMoney ( source ) >= cost ) then 
        local total = totalHouse ( source ) 
        if ( total < 2 ) then 
            local subnode = findHouse ( ID ) 
            if ( subnode ) then 
                local theAccount = getPlayerAccount ( source ) 
                if not ( isGuestAccount ( theAccount ) ) then 
                    xmlNodeSetAttribute ( subnode, "owner", getAccountName ( theAccount ) ) 
                    triggerClientEvent ( source, "closeGUI", source, "E" ) 
                    takePlayerMoney ( source, cost ) 
                 [size=6]  xmlSaveFile ( file )[/size] 
                                        t[createPickup ( x, y, z, 3, 1273, 5000 )] = ID - 1 
                end 
                if ( isGuestAccount ( theAccount ) ) then 
                    outputChatBox ( "You must be logged in.", source ) 
                end 
                cost = nil 
            end 
        end 
        if not ( total > 2 ) and ( cost ) then 
            outputChatBox ( "You can't own more than two properties.", source ) 
        end 
    end 
    if ( cost ) and ( getPlayerMoney ( source ) < cost ) then 
        outputChatBox ( "You can't afford it.", source ) 
    end 
end 
addEvent ( "onHouseBuy", true ) 
addEventHandler ( "onHouseBuy", getRootElement ( ), onHouseBuy ) 
  

Whats wrong??

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...