Axel Posted February 3, 2012 Share Posted February 3, 2012 Did someone managed to fix the sell housing in Mabako MTA Paradise? What i mean is this addCommandHandler( { "sellinterior", "sellproperty" }, function( player, ... ) local interiorID = getElementDimension( player ) local interior = interiors[ interiorID ] if interior then -- we can only sell owned houses if interior.type > 0 and interior.characterID == exports.players:getCharacterID( player ) then -- update the sql before anything else if exports.sql:query_free( "UPDATE interiors SET characterID = 0 WHERE interiorID = " .. interiorID ) then interiors.characterID = 0 exports.players:giveMoney( player, math.floor( interior.price ) ) -- restore the element data which shows it as not sold setElementData( interior.outside, "type", interior.type ) setElementData( interior.outside, "price", interior.price ) -- TODO: destroy all house keys -- HERE , RIGHT HERE!!! -- for now: destroy the person's key exports.items:take( player, 2, interior.id ) -- destroy a blip if there was one if isElement( interior.blip ) then destroyElement( interior.blip ) interior.blip = nil end Link to comment
myonlake Posted February 3, 2012 Share Posted February 3, 2012 Whole script works just fine. Link to comment
Axel Posted February 3, 2012 Author Share Posted February 3, 2012 Well in my server when i buy a house, i sell it then i buy it again, it doesn't buy it just enters.. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now