From 4a18d7585a2fa45eaed18d4b4796744a235a23c5 Mon Sep 17 00:00:00 2001 From: Shady <68560906+shadylua@users.noreply.github.com> Date: Fri, 22 Nov 2024 03:36:47 +0300 Subject: [PATCH 1/6] added walk styles (Freeroam) --- [gameplay]/freeroam/fr_client.lua | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/[gameplay]/freeroam/fr_client.lua b/[gameplay]/freeroam/fr_client.lua index 1ad1f5003..9729f37a3 100644 --- a/[gameplay]/freeroam/fr_client.lua +++ b/[gameplay]/freeroam/fr_client.lua @@ -875,6 +875,45 @@ wndStats = { }, oncreate = initStats } +--------------------------- +-- Walk Style +--------------------------- +function applyWalkStyle( leaf ) + if type( leaf ) ~= 'table' then + leaf = getSelectedGridListLeaf( wndWalking, 'walkStyle' ) + if not leaf then + return + end + end + server.setPedWalkingStyle(localPlayer, leaf.id) +end + +function stopWalkStyle() + server.setPedWalkingStyle(localPlayer, 0) +end + +wndWalking = { + 'wnd', + text = 'Walk Styles', + width = 250, + controls = { + { + 'lst', + id = 'walkStyle', + width = 230, + height = 290, + columns = { + { text = 'Styles', attr = 'name' } + }, + rows = { xml = 'data/walk.xml', attrs = { 'id', 'name' } }, + onitemdoubleclick = applyWalkStyle + }, + { 'btn', id = 'Apply', onclick = applyWalkStyle, width = 70 }, + { 'btn', id = 'Remove', onclick = stopWalkStyle, width = 70 }, + { 'btn', id = 'Close', closeswindow = true, width = 70 } + } +} + --------------------------- -- Bookmarks window @@ -2175,6 +2214,7 @@ wndMain = { {'btn', id='playergrav', text='grav', window=wndGravity}, {'btn', id='warp', window=wndWarp}, {'btn', id='stats', window=wndStats}, + {'btn', id='walks', window=wndWalking}, {'btn', id='bookmarks', window=wndBookmarks}, {'br'}, From 13fce859e7c765a06f9c920867d97ac832e96b00 Mon Sep 17 00:00:00 2001 From: Shady <68560906+shadylua@users.noreply.github.com> Date: Fri, 22 Nov 2024 03:39:48 +0300 Subject: [PATCH 2/6] Update fr_client.lua trailing whitespace in a comment --- [gameplay]/freeroam/fr_client.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[gameplay]/freeroam/fr_client.lua b/[gameplay]/freeroam/fr_client.lua index 9729f37a3..38cd74318 100644 --- a/[gameplay]/freeroam/fr_client.lua +++ b/[gameplay]/freeroam/fr_client.lua @@ -877,7 +877,7 @@ wndStats = { } --------------------------- -- Walk Style ---------------------------- +--------------------------- function applyWalkStyle( leaf ) if type( leaf ) ~= 'table' then leaf = getSelectedGridListLeaf( wndWalking, 'walkStyle' ) From ad7229a12a8be0392a4147e26ec92e5c2259072f Mon Sep 17 00:00:00 2001 From: Shady1 Date: Fri, 22 Nov 2024 03:41:50 +0300 Subject: [PATCH 3/6] update freeroam --- [gameplay]/freeroam/fr_server.lua | 3 +++ [gameplay]/freeroam/meta.xml | 2 ++ .../freeroam/remote_player_call_validation_server.lua | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/[gameplay]/freeroam/fr_server.lua b/[gameplay]/freeroam/fr_server.lua index 8865ca4c9..ed1ca06af 100644 --- a/[gameplay]/freeroam/fr_server.lua +++ b/[gameplay]/freeroam/fr_server.lua @@ -42,6 +42,7 @@ g_RPCFunctions = { setPedAnimation = { option = 'anim', descr = 'Setting an animation' }, setPedFightingStyle = { option = 'setstyle', descr = 'Setting fighting style' }, setPedGravity = { option = 'gravity.enabled', descr = 'Setting gravity' }, + setPedWalkingStyle = { option = 'walkstyle', descr = 'Setting walking style' }, setPedStat = { option = 'stats', descr = 'Changing stats' }, setPedWearingJetpack = { option = 'jetpack', descr = 'Adding/removing a jetpack' }, setVehicleColor = true, @@ -74,6 +75,7 @@ g_OptionDefaults = { setstyle = true, spawnmaponstart = true, spawnmapondeath = true, + walkstyle= true, stats = true, upgrades = true, warp = true, @@ -471,6 +473,7 @@ addEventHandler('onPlayerChat', root, end ) + addEventHandler('onVehicleEnter', root, function(player, seat) if not g_VehicleData[source] then diff --git a/[gameplay]/freeroam/meta.xml b/[gameplay]/freeroam/meta.xml index bc3c5b0a3..8ceca17f3 100644 --- a/[gameplay]/freeroam/meta.xml +++ b/[gameplay]/freeroam/meta.xml @@ -29,6 +29,7 @@ + @@ -79,6 +80,7 @@ + diff --git a/[gameplay]/freeroam/remote_player_call_validation_server.lua b/[gameplay]/freeroam/remote_player_call_validation_server.lua index 88d529878..4305752a5 100644 --- a/[gameplay]/freeroam/remote_player_call_validation_server.lua +++ b/[gameplay]/freeroam/remote_player_call_validation_server.lua @@ -104,6 +104,13 @@ g_RPCFunctionsValidation = { if (#{ ... } > 0) then return false end return true end, + setPedWalkingStyle = function(thePlayer, styleId, ...) + if client ~= thePlayer then return false end + if type(styleId) ~= "number" then return false end + if (#{ ... } > 0) then return false end + return true + end, + setPedWearingJetpack = function(thePlayer, toggle, ...) if client ~= thePlayer then return false end if type(toggle) ~= "boolean" then return false end From 0b6f3b39eab5d912f62bf9723ba6a1ea6477275f Mon Sep 17 00:00:00 2001 From: Shady1 Date: Fri, 22 Nov 2024 03:42:53 +0300 Subject: [PATCH 4/6] added walk.xml --- [gameplay]/freeroam/data/walk.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 [gameplay]/freeroam/data/walk.xml diff --git a/[gameplay]/freeroam/data/walk.xml b/[gameplay]/freeroam/data/walk.xml new file mode 100644 index 000000000..068e416c9 --- /dev/null +++ b/[gameplay]/freeroam/data/walk.xml @@ -0,0 +1,24 @@ + +