Skip to content

Commit

Permalink
added walk styles (Freeroam) (#580)
Browse files Browse the repository at this point in the history
* added walk styles (Freeroam)

* Update fr_client.lua

trailing whitespace in a comment

* update  freeroam

* added walk.xml

* update walk.xml

I added some styles that I forgot to add

* Update meta.xml

fixed thanks

---------

Co-authored-by: Shady1 <[email protected]>
  • Loading branch information
shadylua and Shady1 authored Nov 25, 2024
1 parent e1c06c3 commit 557aae1
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
40 changes: 40 additions & 0 deletions [gameplay]/freeroam/data/walk.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<catalog type="style">
<style id="54" name="Carl Johnson" />
<style id="55" name="Carl Johnson (Fat)" />
<style id="56" name="Carl Johnson (Muscular)" />
<style id="57" name="Rocket" />
<style id="58" name="Rocket (Fat)" />
<style id="59" name="Rocket (Muscular)" />
<style id="60" name="Armed" />
<style id="61" name="Armed (Fat)" />
<style id="62" name="Armed (Muscular)" />
<style id="63" name="Baseball Bat" />
<style id="64" name="Baseball Bat (Fat)" />
<style id="65" name="Baseball Bat (Muscular)" />
<style id="66" name="Chainsaw" />
<style id="67" name="Chainsaw (Fat)" />
<style id="68" name="Chainsaw (Muscular)" />
<style id="69" name="Sneaking" />
<style id="70" name="Jetpack" />
<style id="118" name="Man" />
<style id="119" name="Shuffle" />
<style id="120" name="Old Man" />
<style id="121" name="Gang 1" />
<style id="122" name="Gang 2" />
<style id="123" name="Old Fat Man" />
<style id="124" name="Fat Man" />
<style id="125" name="Jogger" />
<style id="126" name="Drunk Man" />
<style id="127" name="Blind Man" />
<style id="128" name="Swat" />
<style id="129" name="Woman" />
<style id="130" name="Shopping" />
<style id="131" name="Busy Woman" />
<style id="132" name="Sexy Woman" />
<style id="133" name="Pro" />
<style id="134" name="Old Woman" />
<style id="135" name="Fat Woman" />
<style id="136" name="Jog Woman" />
<style id="137" name="Old Fat Woman" />
<style id="138" name="Skate" />
</catalog>
40 changes: 40 additions & 0 deletions [gameplay]/freeroam/fr_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'},

Expand Down
3 changes: 3 additions & 0 deletions [gameplay]/freeroam/fr_server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -74,6 +75,7 @@ g_OptionDefaults = {
setstyle = true,
spawnmaponstart = true,
spawnmapondeath = true,
walkstyle= true,
stats = true,
upgrades = true,
warp = true,
Expand Down Expand Up @@ -471,6 +473,7 @@ addEventHandler('onPlayerChat', root,
end
)


addEventHandler('onVehicleEnter', root,
function(player, seat)
if not g_VehicleData[source] then
Expand Down
2 changes: 2 additions & 0 deletions [gameplay]/freeroam/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<config src="data/animations.xml" type="client" />
<config src="data/interiors.xml" type="client" />
<config src="data/skins.xml" type="client" />
<config src="data/walk.xml" type="client" />
<config src="data/stats.xml" type="client" />
<config src="data/vehicles.xml" type="client" />
<config src="data/weapons.xml" type="client" />
Expand Down Expand Up @@ -79,6 +80,7 @@
<setting name="*setskin" value="true" />
<setting name="*setstyle" value="true" />
<setting name="*stats" value="true" />
<setting name="*walks" value="true" />
<setting name="*upgrades" value="true" />
<setting name="*warp" value="true" />
<setting name="*weapons/enabled" value="true" /> <!-- Can players give themselves weapons? -->
Expand Down
7 changes: 7 additions & 0 deletions [gameplay]/freeroam/remote_player_call_validation_server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 557aae1

Please sign in to comment.