Jump to content

Problem Whit House


daKillar2000

Recommended Posts

Posted

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??

Posted
Explain what you did before we close the topic. It will help others as well.

He didn't anything, i sent him the old code.. i guess he edited something wrong (like ever)

Posted

Ok, closing before this gets too far. I'll open it if the author of the topic will ask for it.

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

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