ExoticNx / properties

8 stars 17 forks source link

Cancling placing safe #5

Closed FBFezz closed 4 years ago

FBFezz commented 4 years ago

If you cancle trying to place the safe the item is still removed, What you could do is if item is placed then remove from inventory? I could be completely wrong

FBFezz commented 4 years ago

Also there is no option to go lower and you can not rotate 360 as it stops at a certain angle. Also if you restart the server when someone owns the house the options to sell and the other one are gone

ExoticNx commented 4 years ago

you can go up and down aswell as rotate. Citizen.CreateThread(function() while true do Citizen.Wait(0) if drawing then if IsControlJustPressed(0, 111) then if forward >= 0 and forward < 2.0 then forward = forward + 0.25 elseif forward == 2.0 then forward = 0 end elseif IsControlJustPressed(0, 126) then if forward > 0 then forward = forward - 0.25 elseif forward == 0 then forward = 2.0 end elseif IsControlJustPressed(0, 174) then if rotate < 360 then rotate = rotate + 2.5 end elseif IsControlJustPressed(0, 175) then if rotate > -360 then rotate = rotate - 2.5 end elseif IsControlJustPressed(0, 172) then if up < 1.25 then up = up + 0.125 elseif up == 1.25 then up = -1 end end end end end)

ExoticNx commented 4 years ago

can you be more specific in what you mean they are gone?

FBFezz commented 4 years ago

Will start up my server again as i think it may have been an error with my database but you have no key to go down as 173 is arrow down key

FBFezz commented 4 years ago

I think what is happening is its resetting who owns the house and then it breaks so the menu shows up for 1 second and then the script breaks but i amnt getting any erros

ExoticNx commented 4 years ago

messing with it right now, adding keys aswell.

FBFezz commented 4 years ago

Oh nice, im not sure if its just my localhost breaking or not but if it is sorry to bother you

ExoticNx commented 4 years ago

its no problem ill see if i can figure it out, think it is a problem with it not updating the owner.

FBFezz commented 4 years ago

Im gonna be messing around with the menu tomorrow to see if i can do it so if a person is a certain distance to show it

ExoticNx commented 4 years ago

odd nah i cant figure out why it would not work. for me has no problem

ExoticNx commented 4 years ago

if you restart the resource it breaks it but a server restart fixes that for me.

FBFezz commented 4 years ago

Yeah same, prob got to do with the SQL callbacks. Im gonna work on the keys and the draw function when i wake up as i haven't slept yet

ExoticNx commented 4 years ago

here is something that should do the distance for you.

` while true do if IsControlJustPressed(0, 46) then first = true menu = true elseif IsControlJustReleased(0, 46) then TriggerEvent('SM_Properties:UpdateOption') menu = false end

    --[[
    for i = 1, #properties, 1 do
        for j = 1, #properties[i].locations do

            local coords = GetEntityCoords(PlayerPedId())
            local distanceEnter = GetDistanceBetweenCoords(coords, properties[i].locations[j].enter.x, properties[i].locations[j].enter.y, properties[i].locations[j].enter.z, true)
            local distanceExit = GetDistanceBetweenCoords(coords, properties[i].locations[j].exit.x, properties[i].locations[j].exit.y, properties[i].locations[j].exit.z, true)
            if distanceEnter < 4 or distanceExit < 4 then
                first = true
                menu = true
            elseif distanceEnter > 4 or distanceExit > 4 then
                TriggerEvent('SM_Properties:UpdateOption')
                menu = false
            end
        end
    end]]

    if(menu) then`
ExoticNx commented 4 years ago

just comment out or remove the

if IsControlJustPressed(0, 46) then first = true menu = true elseif IsControlJustReleased(0, 46) then TriggerEvent('SM_Properties:UpdateOption') menu = false end

FBFezz commented 4 years ago

Thank you ill do that in the evening and let you know. Any news on the arrow down issue?

ExoticNx commented 4 years ago

hmm ill look later.

FBFezz commented 4 years ago

Ok thank you and sorry if i asked you already but I'm going on to nearly 24 hours of no sleep. Are you planning on adding a garage to the houses or not (Its not a thing I fully want but would be nice to have)

ExoticNx commented 4 years ago

as of now no, just released this and will fix bugs for a while but gonna be done doing stuff for fivem eventually.

FBFezz commented 4 years ago

Ah ok, if i figure out anything or find any bugs ill try fix them first and do a pull request

FBFezz commented 4 years ago

Because its an amazing script

FBFezz commented 4 years ago

Few questions for you just out of interest.

1) do the mlo's spawn below the house that you enter? or how does that work 2) Are there any dependencies for the script 3) Im guessing you start the mlo's before the script 4) Do you tp into the mlo or does the mlo get created as id like to use the same mlo for most houses

ExoticNx commented 4 years ago

please read the https://forum.cfx.re/t/release-esx-new-properties-script-furniture-script-one-owner-per-house-lock-door-unlock-door-non-instanced/1206114 FAQ

you need to go into code walker and place each mlo, esx, doesnt really matter in which order they start, you tp into the mlo that you placed in code walker.

FBFezz commented 4 years ago

Ok thank you