Hi! This pull request adds support for multiple realtor jobs. It's done in the same way as the PoliceJobNames. For the payout using qb-banking, I've changed it to get the current job of of the realtor instead of the configured realtor job, for all other things it indexes RealtorJobs with the player's job name. I have also made a similar pull request for ps-realtor which I will link below once I've made it.
The housing menu itself is not split up as this would require keeping track of the realtor who made the property. Although this is really simple to implement, it also means that other realtors would not be able to sell already owned properties made by other realtors. This can also be circumvented by clearing the realtor field after and not filtering those out, but including this hassle for so little gain seemed pointless to me at this time. And this would also add a column to the database table. If this is something you guys would like I can look into it in a future pull request.
I'd say the best way to implement this then is to store the realtor job on the property once they change it to "For Sale" or create the property in the first place, then clear it once it gets sold. You'd then only manage properties your job put up for sale, but will still be able to see the other properties and put sold properties back on sale.
Details
I think it's useful to be able to have multiple realtors. It allows for competition in the market for instance.
UI Changes / Functionality
Config.RealtorJobName was changed to Config.RealtorJobNames and is now an array of job names. It uses the same mechanism as Config.PoliceJobNames to check for the jobs. It's nothing visible in the UI, just that you're able to sell houses with different jobs.
Testing Steps
Add another job to Config.RealtorJobNames or just leave "realestate".
Go in game and see that you can sell houses and interact with them etc. as the other job.
Check the /housing menu from ps-realtor with the pull request linked below.
[x] Did you test the changes you made?
[x] Did you test core functionality of the script to ensure your changes do not regress other areas?
[x] Did you test your changes in multiplayer to ensure it works correctly on all clients?
Overview
Hi! This pull request adds support for multiple realtor jobs. It's done in the same way as the PoliceJobNames. For the payout using qb-banking, I've changed it to get the current job of of the realtor instead of the configured realtor job, for all other things it indexes RealtorJobs with the player's job name. I have also made a similar pull request for ps-realtor which I will link below once I've made it.
The housing menu itself is not split up as this would require keeping track of the realtor who made the property. Although this is really simple to implement, it also means that other realtors would not be able to sell already owned properties made by other realtors. This can also be circumvented by clearing the realtor field after and not filtering those out, but including this hassle for so little gain seemed pointless to me at this time. And this would also add a column to the database table. If this is something you guys would like I can look into it in a future pull request.
I'd say the best way to implement this then is to store the realtor job on the property once they change it to "For Sale" or create the property in the first place, then clear it once it gets sold. You'd then only manage properties your job put up for sale, but will still be able to see the other properties and put sold properties back on sale.
Details
I think it's useful to be able to have multiple realtors. It allows for competition in the market for instance.
UI Changes / Functionality
Config.RealtorJobName
was changed toConfig.RealtorJobNames
and is now an array of job names. It uses the same mechanism asConfig.PoliceJobNames
to check for the jobs. It's nothing visible in the UI, just that you're able to sell houses with different jobs.Testing Steps
Config.RealtorJobNames
or just leave "realestate"./housing
menu from ps-realtor with the pull request linked below.