[SOLVED] ESX_Property One Owner Per House

Hey! How can i make esx_property works like, only one owner per house.
I have tried to search from google and many forums, but i havent seen anything helping information for that.

Get your realestate boss to make a Google doc and keep it updated.
Simply: Dont rely on ESX for it.

But, i dont want realestate job. I want players can buy house from front of house but only one player can own that house.

I solved this problem with my own technique. Thanks to @Twittchter for answering.

Imagine you’ve already fixed it, but for people who wanna know how to do it regardless:

Add a column in your database’s properties table that is named ‘isOwned’.

In your server.lua create an event that checks if the house is owned or not.

In your client.lua run that event when a player opens the Visit/Buy house menu, in which you could see the buy house option only if the server event that checks for the house’s isOwned status in your database returns false.

This is only in theory but should work.

Good luck! :slight_smile:

3 Likes

Yes, you are right. I did it mostly like that.
Thanks for sharing that method. Forgot to share it here :slight_smile:

@Th3Cha0s do you have a code for this

No, that’s something you’ll have to figure out yourself :stuck_out_tongue:

what does such an event look like that checks whether the house is owned or not @Th3Cha0s

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.