Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added walk styles (Freeroam) #580

Merged
merged 7 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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