#PS-Housing [RENEWED-PHONE] APP

162 messages Β· Page 1 of 1 (latest)

prisma sorrel
#

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)

#

May contain some junk code from previous "version"

wary trellis
#

Your a legend! thank you so mutch for sharing this ❀️

undone pollen
#

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.

wary trellis
tulip relic
#

its for renewed guys

#

not for default qb

wary trellis
#

I know, i'm using it for renewed

prisma sorrel
#

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',
}
wary trellis
#

aah, ox_lib callback

#

thansk πŸ˜„

#

that should fix it

#

ui looks wierd, and still getting some errors 😦

prisma sorrel
wary trellis
#

πŸ˜…

prisma sorrel
#

Seems to be resolution.. thing

wary trellis
#

maby, i'm on 1920x1080

#

ui stuff I can fix myself πŸ™‚

prisma sorrel
#

show me ur phone client lua

#

gpsProperty is not on line 75

wary trellis
#

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)```
prisma sorrel
#

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?)

wary trellis
#

Yes I put in everything you posted

#

looks bether now πŸ™‚ font is a bit to big maby?

prisma sorrel
#

hmm interesting maybe cuz im using "Fivem option to force FHD" will fix it

random sandal
#

I am getting a these errors

#

I followed the steps but maybe I did something wrong?

tulip relic
#

its for RENEWED

random sandal
#

I use renewed

prisma sorrel
tulip relic
#

do u got a sql for me?

prisma sorrel
#

Nothing needed

tulip relic
#

with properties

#

i dont have properties

#

because of the trim error

prisma sorrel
#

oh ok gimme sec

tulip relic
#

thanks

prisma sorrel
#

What is that error? never heard about

tulip relic
#

when having 0 properties and pressing on the add poprerty button u get a trim error

prisma sorrel
#

hmm i should try delete everything πŸ˜„

tulip relic
#

doesnt let im import the sql

random sandal
#

remove that

tulip relic
#

yep

prisma sorrel
random sandal
#

Okay let me go get it really fast and add it and see if it works

prisma sorrel
#

Click on my profile and there is a link

tulip relic
#

link to it ?

random sandal
prisma sorrel
#

sorry

#

@random sandal @tulip relic @wary trellis

random sandal
#

?

prisma sorrel
#

} else if (PressedApplication == "houses") {
$.post('https://qb-phone/SetupHouses', JSON.stringify({}), function(Houses){
SetupPlayerHouses(Houses);
});

#

app.js πŸ˜„

random sandal
#

o lordy lol

#

Let me try this now

random sandal
tulip relic
#

working now

prisma sorrel
random sandal
#

Works now lol

tulip relic
#

looks very good

random sandal
#

Yes very

tulip relic
#

i would do a new post and close this one, to make a complete new step by step

random sandal
#

Yeah would be good

prisma sorrel
tulip relic
#

because rn its very overwhelming for most of the 5iq guys

#

naaahh XDD

undone pollen
prisma sorrel
#

Should work since its just "transfering" data just adjust css

undone pollen
undone pollen
prisma sorrel
#

app.js

undone pollen
#

OMG!!!!!! it works, no errors! 😊 ❀️

#

My Phone is now complete πŸ˜„

wary trellis
#

@prisma sorrel Now its working πŸ˜„ ❀️

#

Was just the code in app.js that was missing

undone pollen
#

No errors, been playing around with the CSS to fit my phone, but I cant press any of the buttons, something I miss?!

prisma sorrel
#

There is only 1clickable button and it says when u aim on it

undone pollen
#

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?

prisma sorrel
#

Icon = button

undone pollen
#

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?

prisma sorrel
#

That doesnt matter it does fetch data on app open

wary marten
#

Works perfect thank you OrloN

undone pollen
#

LOL im an idiot! 🀣 I didnt put the houses client/server in the fxmanifest

#

embarrassing 😬

#

still wont work though...

wary marten
#

Need to put shared_scripts {
'@ox_lib/init.lua', }

#

fxmanifest should look like this

undone pollen
#

FIXED! Working, finally πŸ˜„
The things in the first post were updated, I updated my script and its all good now πŸ‘

undone pollen
#

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
prisma sorrel
#

yes

wary trellis
#

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

cold needle
#

the dark theme looks incredible

#

great work

tidal zinc
#

nvm i

#

got it working

#

very tired Tiredge

tidal zinc
#

For some reason on restart this happens

#

got it workin

#

for some reason, the script needs to be restart / ensured but

#

not it works

prisma sorrel
tulip relic
#

not it works = no it works

#

so he got it working

prisma sorrel
#

Probably just missed app.js idk how ppl can miss it its perfectly visible

tidal zinc
#

Na just had to do the server side file

#

Was like 3 am was tired πŸ˜‚

tough helm
#

Works like a treat πŸ™‚

vocal kindle
undone pollen
dreamy cape
#

i want this but everytime i tried it i break the phone lol

prisma sorrel
#

cant help u more :/ Those "thread contain everything you will need to troubleshot"

dreamy cape
#

its okay ill figure it out eventually

prisma sorrel
#

Maybe i will know where u did something wrong

dreamy cape
prisma sorrel
dreamy cape
#

is there a specific spot or it doesnt matter

prisma sorrel
#

whole file

dreamy cape
#

so replace the whole file

prisma sorrel
#

yep

dreamy cape
#

i figured it out !! i forgot the small change in the app.js

#

it works now thank you

dreamy cape
tulip relic
#

so when u scroll up, your going to find that 2 errors

wary trellis
prisma sorrel
#

Yep i didnt check it when i update colors to use black scheme πŸ˜„

#

just change it in css

wary trellis
#

The text is there? just same color as background?

prisma sorrel
#

yep

wary trellis
#

Ahh, thanks πŸ˜„

wary trellis
prisma sorrel
#

Its QB only and yes i did test it with white theme didnt with black

wary trellis
prisma sorrel
#

Just nui focus

molten totem
obsidian bone
#

This thread is not for support.