Giter Club home page Giter Club logo

Comments (4)

bert1475 avatar bert1475 commented on July 30, 2024

Hi BigFudge87
i have solved your problem

if you go in to ps-housing/server/ sv_property.lua
and locate:

function Property:UpdateOwner(data)
    local targetSrc = data.targetSrc
    local realtorSrc = data.realtorSrc

    if not realtorSrc then Debug("No Realtor Src found") return end
    if not targetSrc then Debug("No Target Src found") return end

    local previousOwner = self.propertyData.owner

    local targetPlayer  = QBCore.Functions.GetPlayer(tonumber(targetSrc))

    local PlayerData = targetPlayer.PlayerData
    local bank = PlayerData.money.bank
    local citizenid = PlayerData.citizenid

    if self.propertyData.owner == citizenid then
        Framework[Config.Notify].Notify(targetSrc, "You already own this property", "error")
        Framework[Config.Notify].Notify(realtorSrc, "Client already owns this property", "error")
        return
    end

this code will need to be replaced by this code

function Property:UpdateOwner(data)
    local targetSrc = data.targetSrc
    local realtorSrc = data.realtorSrc

    if not realtorSrc then 
        Debug("No Realtor Src found") 
        return 
    end

    if not targetSrc then 
        Debug("No Target Src found") 
        return 
    end

    local targetPlayer  = QBCore.Functions.GetPlayer(tonumber(targetSrc))

    if not targetPlayer then
        Debug("Failed to retrieve target player data")
        return
    end

    local PlayerData = targetPlayer.PlayerData
    local bank = PlayerData.money.bank
    local citizenid = PlayerData.citizenid

    if self.propertyData.owner == citizenid then
        Framework[Config.Notify].Notify(targetSrc, "You already own this property", "error")
        Framework[Config.Notify].Notify(realtorSrc, "Client already owns this property", "error")
        return
    end

then it should work, just to be shure,
You should not use the citizen id, but the server id like 1 or 55 and not something like this QKH11580

hope it works :)

from ps-housing.

Bigfudge87 avatar Bigfudge87 commented on July 30, 2024

Thank you so much. seems to work like it should now. only thing missing is pictures of the shells. but everything else works :D

from ps-housing.

bert1475 avatar bert1475 commented on July 30, 2024

The shells is beacause the discord alle the images were located on is deleted, if you want to have stock images, you have to make them yourself and put them in the config.lua

from ps-housing.

MonkeyWhisper avatar MonkeyWhisper commented on July 30, 2024

Hi BigFudge87 i have solved your problem

if you go in to ps-housing/server/ sv_property.lua and locate:

function Property:UpdateOwner(data)
    local targetSrc = data.targetSrc
    local realtorSrc = data.realtorSrc

    if not realtorSrc then Debug("No Realtor Src found") return end
    if not targetSrc then Debug("No Target Src found") return end

    local previousOwner = self.propertyData.owner

    local targetPlayer  = QBCore.Functions.GetPlayer(tonumber(targetSrc))

    local PlayerData = targetPlayer.PlayerData
    local bank = PlayerData.money.bank
    local citizenid = PlayerData.citizenid

    if self.propertyData.owner == citizenid then
        Framework[Config.Notify].Notify(targetSrc, "You already own this property", "error")
        Framework[Config.Notify].Notify(realtorSrc, "Client already owns this property", "error")
        return
    end

this code will need to be replaced by this code

function Property:UpdateOwner(data)
    local targetSrc = data.targetSrc
    local realtorSrc = data.realtorSrc

    if not realtorSrc then 
        Debug("No Realtor Src found") 
        return 
    end

    if not targetSrc then 
        Debug("No Target Src found") 
        return 
    end

    local targetPlayer  = QBCore.Functions.GetPlayer(tonumber(targetSrc))

    if not targetPlayer then
        Debug("Failed to retrieve target player data")
        return
    end

    local PlayerData = targetPlayer.PlayerData
    local bank = PlayerData.money.bank
    local citizenid = PlayerData.citizenid

    if self.propertyData.owner == citizenid then
        Framework[Config.Notify].Notify(targetSrc, "You already own this property", "error")
        Framework[Config.Notify].Notify(realtorSrc, "Client already owns this property", "error")
        return
    end

then it should work, just to be shure, You should not use the citizen id, but the server id like 1 or 55 and not something like this QKH11580

hope it works :)

Hello,

Please submit a PR for this so we can credit you

from ps-housing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.