..:D&G:.. Posted November 22, 2014 Posted November 22, 2014 Hello guys, I need an alternative function for getPedWalkingStyle as it has been disabled. Anyone know another function or how to do something which does the same thing? Thank you. MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Moderators IIYAMA Posted November 22, 2014 Moderators Posted November 22, 2014 setPedAnimation Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
..:D&G:.. Posted November 22, 2014 Author Posted November 22, 2014 And how is that going to get the id of the walking style that a player has? MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
TAPL Posted November 22, 2014 Posted November 22, 2014 https://forum.multitheftauto.com/viewtopic.php?f=91&t=68057
..:D&G:.. Posted November 22, 2014 Author Posted November 22, 2014 I added those functions into my code, but it still doesn't change my walking style: elseif (source) then outputChatBox("on." source) setPedWalkingStyle(source, 138) if getPedWalkingStyle(source) then outputChatBox("off." source) setPedWalkingStyle(source, 0) end MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
ChaosMTA Posted November 23, 2014 Posted November 23, 2014 Do you have those functions stored in the same server side block? (resource) If not you need to use exports. OwlGaming Community Owner
..:D&G:.. Posted November 23, 2014 Author Posted November 23, 2014 Yes, they are even in the same server side file. MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
ChaosMTA Posted November 23, 2014 Posted November 23, 2014 [quote name=..&G:..]Yes, they are even in the same server side file. Any errors? OwlGaming Community Owner
Sasu Posted November 23, 2014 Posted November 23, 2014 getPedWalkingStyle function will always return a value so I will set you walking style 0. Exactly, what are you trying to do? State: Inactive
..:D&G:.. Posted November 23, 2014 Author Posted November 23, 2014 If the player has the walking style with ID 138 I want the script to set the player's walking style to 0, and vice versa. MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Sasu Posted November 23, 2014 Posted November 23, 2014 elseif (source) then if getPedWalkingStyle(source) ~= 138 then outputChatBox("on.", source) setPedWalkingStyle(source, 138) else outputChatBox("off." ,source) setPedWalkingStyle(source, 0) end State: Inactive
Tomas Posted November 24, 2014 Posted November 24, 2014 You can store the info of the walking style on a data, e.g setAccountData. function putWalkingStyle(player,_,number) if tonumber(number) == nil then return end setPedWalkingStyle(player,138) setAccountData(getPlayerAccount(player),"WalkingStyle",tonumber(number)) else outputChatBox("Syntax: /walkstyle ",player,255,0,0) end end addCommandHandler("walkstyle",putWalkingStyle) function WhatsMyWalkingStyle(player) if getAccountData(getPlayerAccount(player),"WalkingStyle") ~= false then outputChatBox("Your walking style is: "..getAccountData(getPlayerAccount(player),"WalkingStyle",player) else outputChatBox("You don't have a walking style, use /walkstyle ",player,255,0,0) end end addCommandHandler("whatsmywalkstyle",WhatsMyWalkingStyle) Currently developing for International Gaming Community - Join us!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now