From 41c26f953fdd4416d3aac2af5d30508f30c772b4 Mon Sep 17 00:00:00 2001 From: EDWernars Date: Wed, 12 Jun 2019 22:21:47 +0200 Subject: [PATCH 1/2] Update client.lua Add feature - all markers would now been shown with the - or + on your numpad. Changing keys - using scroll wheel for making it smaller or bigger. - using numpad - or + for making a different marker. Bugfix - Keys are now only available when marker is active. --- client.lua | 176 +++++++++++++++++++++++++++++------------------------ 1 file changed, 95 insertions(+), 81 deletions(-) diff --git a/client.lua b/client.lua index 3323c12..4b2e818 100644 --- a/client.lua +++ b/client.lua @@ -7,6 +7,7 @@ POSITIONS.marker.y = 0.0 POSITIONS.marker.z = 0.0 POSITIONS.marker.h = 0.0 POSITIONS.marker.r = 1.0 +POSITIONS.marker.o = 1 POSITIONS.start = function () if POSITIONS.marker.active then return end @@ -37,84 +38,97 @@ end Citizen.CreateThread(function () while true do Citizen.Wait(0) - if (IsControlJustReleased(1, 29)) then - POSITIONS.start() - end - - if (IsControlPressed(1, 172)) then -- ARROW UP - POSITIONS.marker.x = POSITIONS.marker.x + 0.01 - end - - if (IsControlPressed(1, 173)) then -- ARROW DOWN - POSITIONS.marker.x = POSITIONS.marker.x - 0.01 - end - - if (IsControlPressed(1, 174)) then -- ARROW LEFT - POSITIONS.marker.y = POSITIONS.marker.y + 0.01 - end - - if (IsControlPressed(1, 175)) then -- ARROW RIGHT - POSITIONS.marker.y = POSITIONS.marker.y - 0.01 - end - - if (IsControlPressed(1, 10)) then -- PAGE UP - POSITIONS.marker.z = POSITIONS.marker.z + 0.01 - end - - if (IsControlPressed(1, 11)) then --PAGE DOWN - POSITIONS.marker.z = POSITIONS.marker.z - 0.01 - end - - if (IsControlPressed(1, 108)) then -- NUMPAD 4 - POSITIONS.marker.h = POSITIONS.marker.h + 0.5 - if POSITIONS.marker.h > 360 then - POSITIONS.marker.h = 0.0 - elseif POSITIONS.marker.h < 0 then - POSITIONS.marker.h = 360.0 - end - end - - if (IsControlPressed(1, 109)) then -- NUMPAD 6 - POSITIONS.marker.h = POSITIONS.marker.h - 0.5 - if POSITIONS.marker.h > 360 then - POSITIONS.marker.h = 0.0 - elseif POSITIONS.marker.h < 0 then - POSITIONS.marker.h = 360.0 - end - end - - if (IsControlPressed(1, 96)) then -- NUMPAD + - POSITIONS.marker.r = POSITIONS.marker.r + 0.05 - Citizen.Wait(10) - end - - if (IsControlPressed(1, 97)) then --NUMPAD - - POSITIONS.marker.r = POSITIONS.marker.r - 0.05 - Citizen.Wait(10) - end - - if (IsControlJustReleased(1, 176)) then -- ENTER - local text = "{x = "..POSITIONS.marker.x..", y = "..POSITIONS.marker.y..", z = "..POSITIONS.marker.z..", h = "..POSITIONS.marker.h..", r = "..POSITIONS.marker.r.."}," - subTitle(text) - - TriggerServerEvent("position:s:insert", text) - - POSITIONS.marker.x = 0.0 - POSITIONS.marker.y = 0.0 - POSITIONS.marker.z = 0.0 - POSITIONS.marker.h = 0.0 - POSITIONS.marker.active = false - - subTitle("Position saved !") - end - - if (IsControlJustReleased(1, 177)) then - POSITIONS.marker.x = 0.0 - POSITIONS.marker.y = 0.0 - POSITIONS.marker.z = 0.0 - POSITIONS.marker.h = 0.0 - POSITIONS.marker.active = false - end + + if (IsControlJustReleased(1, 29)) then -- Press B + POSITIONS.start() + end + + if(POSITIONS.marker.active) then + if (IsControlPressed(1, 172)) then -- ARROW UP + POSITIONS.marker.x = POSITIONS.marker.x + 0.01 + end + + if (IsControlPressed(1, 173)) then -- ARROW DOWN + POSITIONS.marker.x = POSITIONS.marker.x - 0.01 + end + + if (IsControlPressed(1, 174)) then -- ARROW LEFT + POSITIONS.marker.y = POSITIONS.marker.y + 0.01 + end + + if (IsControlPressed(1, 175)) then -- ARROW RIGHT + POSITIONS.marker.y = POSITIONS.marker.y - 0.01 + end + + if (IsControlPressed(1, 10)) then -- PAGE UP + POSITIONS.marker.z = POSITIONS.marker.z + 0.01 + end + + if (IsControlPressed(1, 11)) then --PAGE DOWN + POSITIONS.marker.z = POSITIONS.marker.z - 0.01 + end + + if (IsControlPressed(1, 108)) then -- NUMPAD 4 + POSITIONS.marker.h = POSITIONS.marker.h + 0.5 + if POSITIONS.marker.h > 360 then + POSITIONS.marker.h = 0.0 + elseif POSITIONS.marker.h < 0 then + POSITIONS.marker.h = 360.0 + end + end + + if (IsControlPressed(1, 109)) then -- NUMPAD 6 + POSITIONS.marker.h = POSITIONS.marker.h - 0.5 + if POSITIONS.marker.h > 360 then + POSITIONS.marker.h = 0.0 + elseif POSITIONS.marker.h < 0 then + POSITIONS.marker.h = 360.0 + end + end + + if (IsControlPressed(1, 181)) then -- Scroll Wheel Up + + POSITIONS.marker.r = POSITIONS.marker.r + 0.05 + Citizen.Wait(10) + end + + if (IsControlPressed(1, 180)) then --Scroll Wheel Up + POSITIONS.marker.r = POSITIONS.marker.r - 0.05 + Citizen.Wait(10) + end + + if (IsControlPressed(1, 314) and POSITIONS.marker.o < 43) then -- NUMPAD + + POSITIONS.marker.o = POSITIONS.marker.o + 1 + Citizen.Wait(200) + end + + if (IsControlPressed(1, 315) and POSITIONS.marker.o > 1) then --NUMPAD - + POSITIONS.marker.o = POSITIONS.marker.o - 1 + Citizen.Wait(200) + end + + if (IsControlJustReleased(1, 176)) then -- ENTER + local text = "{o = "..POSITIONS.marker.o..", x = "..POSITIONS.marker.x..", y = "..POSITIONS.marker.y..", z = "..POSITIONS.marker.z..", h = "..POSITIONS.marker.h..", r = "..POSITIONS.marker.r.."}," + subTitle(text) + + TriggerServerEvent("position:s:insert", text) + + POSITIONS.marker.x = 0.0 + POSITIONS.marker.y = 0.0 + POSITIONS.marker.z = 0.0 + POSITIONS.marker.h = 0.0 + POSITIONS.marker.active = false + + subTitle("Position saved !") + end + + if (IsControlJustReleased(1, 177)) then + POSITIONS.marker.x = 0.0 + POSITIONS.marker.y = 0.0 + POSITIONS.marker.z = 0.0 + POSITIONS.marker.h = 0.0 + POSITIONS.marker.active = false + end + end end end) @@ -122,10 +136,10 @@ Citizen.CreateThread(function () while true do Citizen.Wait(0) if POSITIONS.marker.active then - DrawMarker(26, POSITIONS.marker.x, POSITIONS.marker.y, POSITIONS.marker.z, 0, 0, 0, 0, 0, POSITIONS.marker.h, POSITIONS.marker.r, POSITIONS.marker.r, 0.5, 0, 0, 255, 120, 0, 0, 2, 0, 0, 0, 0) + DrawMarker(POSITIONS.marker.o, POSITIONS.marker.x, POSITIONS.marker.y, POSITIONS.marker.z, 0, 0, 0, 0, 0, POSITIONS.marker.h, POSITIONS.marker.r, POSITIONS.marker.r, 0.5, 0, 0, 255, 120, 0, 0, 2, 0, 0, 0, 0) - local text = "{x = "..POSITIONS.marker.x..", y = "..POSITIONS.marker.y..", z = "..POSITIONS.marker.z..", h = "..POSITIONS.marker.h..", r = "..POSITIONS.marker.r.."}," + local text = "{o = "..POSITIONS.marker.o..", x = "..POSITIONS.marker.x..", y = "..POSITIONS.marker.y..", z = "..POSITIONS.marker.z..", h = "..POSITIONS.marker.h..", r = "..POSITIONS.marker.r.."}," subTitle(text) end end -end) \ No newline at end of file +end) From f435ff7df85e87a0a79dbfa0faf6edf4372aabc3 Mon Sep 17 00:00:00 2001 From: EDWernars Date: Fri, 14 Jun 2019 15:09:47 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 935604a..2d92691 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ About a week ago I made a simple script to get the coordinates of a certain posi - Press any arrow to move arround the marker. - Press "PAGE UP" and "PAGE DOWN" to change to height of the marker. - Press "'NUMPAD 4" and "NUMPAD 6" to rotate/change the heading of the marker. -- Press "NUMPAD +" and "NUMPAD -" to change the radius of the marker. +- Press "NUMPAD +" and "NUMPAD -" to change the marker style +- Press "Scroll Wheel Up" and "Scroll Wheel Down" to change the radius of the marker. - Press "'ENTER" to save the position in the _positions.txt_ file (this one is located in the server folder, and it will be always cleared when you restart the server). - You can also press "BACKSPACE" to cancel the process.