#PS-Housing [RENEWED-PHONE] APP
162 messages Β· Page 1 of 1 (latest)
PS-Housing
client/client.lua
function HouseTrack(propertyId)
local coords
if PropertiesTable[propertyId].propertyData.apartment ~= nil then
local getConfigName = PropertiesTable[propertyId].propertyData.apartment
coords = Config.Apartments[getConfigName].door
else
coords = PropertiesTable[propertyId].propertyData.door_data
end
SetNewWaypoint(coords.x, coords.y)
end
exports("HouseTrack", HouseTrack)
server/server.lua
May contain some junk code from previous "version"
Your a legend! thank you so mutch for sharing this β€οΈ
Tried on qb-phone the one I am working on, hoping it would work as they are very similar, but the js seems messed up.
I'm getting the same, he probably forgot to post some code π Lets wait for a fix
I know, i'm using it for renewed
ox_lib? you should get error cuz im using ox_lib for callbacks
default renewed-phone doesnt have ox_lib support
shared_scripts {
'@ox_lib/init.lua',
}
aah, ox_lib callback
thansk π
that should fix it
ui looks wierd, and still getting some errors π¦
Seems to be resolution.. thing
I just uncomment all the old stuff and put new code under it for testing
local QBCore = exports['qb-core']:GetCoreObject()
-- -- NUI Callback
-- RegisterNUICallback('GetPlayerHouses', function(_, cb)
-- QBCore.Functions.TriggerCallback('qb-phone:server:GetPlayerHouses', function(Houses)
-- cb(Houses)
-- end)
-- end)
-- RegisterNUICallback('GetPlayerKeys', function(_, cb)
-- QBCore.Functions.TriggerCallback('qb-phone:server:GetHouseKeys', function(Keys)
-- cb(Keys)
-- end)
-- end)
-- RegisterNUICallback('SetHouseLocation', function(data, cb)
-- SetNewWaypoint(data.HouseData.HouseData.coords.enter.x, data.HouseData.HouseData.coords.enter.y)
-- QBCore.Functions.Notify("GPS satt til " .. data.HouseData.HouseData.adress .. "!", "success")
-- cb("ok")
-- end)
-- RegisterNUICallback('RemoveKeyholder', function(data, cb)
-- TriggerServerEvent('qb-houses:server:removeHouseKey', data.HouseData.name, {
-- citizenid = data.HolderData.citizenid,
-- firstname = data.HolderData.charinfo.firstname,
-- lastname = data.HolderData.charinfo.lastname,
-- })
-- cb("ok")
-- end)
-- RegisterNUICallback('TransferCid', function(data, cb)
-- local TransferedCid = data.newBsn
-- QBCore.Functions.TriggerCallback('qb-phone:server:TransferCid', function(CanTransfer)
-- cb(CanTransfer)
-- end, TransferedCid, data.HouseData)
-- end)
-- RegisterNUICallback('FetchPlayerHouses', function(data, cb)
-- QBCore.Functions.TriggerCallback('qb-phone:server:MeosGetPlayerHouses', function(result)
-- cb(result)
-- end, data.input)
-- end)
-- RegisterNUICallback('SetGPSLocation', function(data, cb)
-- SetNewWaypoint(data.coords.x, data.coords.y)
-- QBCore.Functions.Notify('GPS satt!', "success")
-- cb("ok")
-- end)
-- RegisterNUICallback('SetApartmentLocation', function(data, cb)
-- local ApartmentData = data.data.appartmentdata
-- local TypeData = Apartments.Locations[ApartmentData.type]
-- SetNewWaypoint(TypeData.coords.enter.x, TypeData.coords.enter.y)
-- QBCore.Functions.Notify('GPS satt!', "success")
-- cb("ok")
-- end)
-- NUI Callback
RegisterNUICallback('SetupHouses', function(_, cb)
lib.callback('ps-housing:server:GetPlayerProperties', false, function(Houses)
cb(Houses)
end)
end)
RegisterNUICallback('gpsProperty', function(data, cb)
print(data.house)
local house = data.house
local property = house.propertyId
exports['ps-housing']:HouseTrack(property)
--TriggerServerEvent('setPlayerWaypoint', property)
TriggerEvent('qb-phone:client:CustomNotification', "PROPERTIES", "GPS Marker Set!", "fas fa-car", "#e84118", 5000)
cb("ok")
end)
RegisterNUICallback('GiveKeys', function(data, cb)
TriggerServerEvent('qb-phone:server:giveKeys', data)
cb("ok")
end)
RegisterNUICallback('KickPlayer', function(data, cb)
TriggerServerEvent("ps-housing:server:removeAccess", data.propertyId, data.playerId)
cb("ok")
end)
RegisterNetEvent('qb-phone:client:giveKeys', function(property, toplayer)
TriggerServerEvent("ps-housing:server:addAccess", property, toplayer)
end)
RegisterNUICallback('GetPlayersWithAccess', function(data, cb)
local propertyId = data.propertyId
local playersWithAccess = lib.callback.await("ps-housing:cb:getPlayersWithAccess", source, propertyId)
cb(playersWithAccess)
end)```
Can u try for FHD this ?
ALL RES
Should work properly for all resoulutions now
(If you can show me player list how it looks.. dont want to start another fivem client rn)
Also about ur error did you implement everything (Ps housing etc?)
Yes I put in everything you posted
looks bether now π font is a bit to big maby?
I am getting a these errors
I followed the steps but maybe I did something wrong?
its for RENEWED
Can you try it before i dive into what did i miss? π
do u got a sql for me?
Nothing needed
oh ok gimme sec
thanks
What is that error? never heard about
doesnt let im import the sql
yep
Also it is possible that i forgot about something in ps-housing you may try ps-housing from my github... i just updated it should work π
Okay let me go get it really fast and add it and see if it works
Click on my profile and there is a link
?
} else if (PressedApplication == "houses") {
$.post('https://qb-phone/SetupHouses', JSON.stringify({}), function(Houses){
SetupPlayerHouses(Houses);
});
app.js π
I like the black and white Ui looks better
working now
Did it really quick to fit my theme... hopefully i did change everything necessary
Works now lol
Yes very
i would do a new post and close this one, to make a complete new step by step
Yeah would be good
u can do it if u want πs
wish it could work with the normal qb-phone then I can add to my qb-phone rework. https://discord.com/channels/897744257237000222/1136047909834604646
Should work since its just "transfering" data just adjust css
I tried it already, many errors, its been fixed since then? I will give it another go later and let you know.
fix π
this goes in the houses.js file you posted before yea?
app.js
@prisma sorrel Now its working π β€οΈ
Was just the code in app.js that was missing
No errors, been playing around with the CSS to fit my phone, but I cant press any of the buttons, something I miss?!
There is only 1clickable button and it says when u aim on it
where about on here then? π
got a feeling the button is out of shot as I have a moved/heavily configured phone. Which part in CSS I need to find for the button please?
Okay, just bought another house it isn't updating for me, still the same property, so I have done something wrong. Where did you guys add the parts for ps-housing exactly please?
That doesnt matter it does fetch data on app open
Works perfect thank you OrloN
LOL im an idiot! π€£ I didnt put the houses client/server in the fxmanifest
embarrassing π¬
still wont work though...
thanks, getting somewhere now
FIXED! Working, finally π
The things in the first post were updated, I updated my script and its all good now π
Just wondering, is it alright to remove/disable the console logs?
console.log("Showing owned no-properties-message");
$("#owned .no-properties-message").show();
} else {
console.log("Hiding owned no-properties-message");
$("#owned .no-properties-message").hide();
}
if ($("#shared .property-card").length === 0) {
console.log("Showing shared no-properties-message");
$("#shared .no-properties-message").show();
} else {
console.log("Hiding shared no-properties-message");
$("#shared .no-properties-message").hide();
}```
Reason im asking is cause I get this sometimes
yes
I found something that needs a fix, when you hit the + sign to add players. If you have something on the hotbar you will use the item when hitting numbers
For some reason on restart this happens
got it workin
for some reason, the script needs to be restart / ensured but
not it works
Im lost so whats the problem? π is there any?
Probably just missed app.js idk how ppl can miss it its perfectly visible
Works like a treat π
make sure you rename js callbacks from qb-phone to whatever you have.
yea its all working good now π
i want this but everytime i tried it i break the phone lol
cant help u more :/ Those "thread contain everything you will need to troubleshot"
its okay ill figure it out eventually
can u send screeshot how does it look like?
Maybe i will know where u did something wrong
on the --js part do we replace the whole file ?
is there a specific spot or it doesnt matter
whole file
so replace the whole file
yep
im just getting these errors now
so when u scroll up, your going to find that 2 errors
.
Are you supose to see the name of the players you share houses with?
https://gyazo.com/806e67203ece25e3e822663743bd3ba2
Yep i didnt check it when i update colors to use black scheme π
just change it in css
The text is there? just same color as background?
yep
Ahh, thanks π
@prisma sorrel did you test this on your end?
Its QB only and yes i did test it with white theme didnt with black
Just nui focus
replace all the current code ?
This thread is not for support.
