..: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.
..: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?
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
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.
..:D&G:.. Posted November 23, 2014 Author Posted November 23, 2014 Yes, they are even in the same server side file.
ChaosMTA Posted November 23, 2014 Posted November 23, 2014 [quote name=..&G:..]Yes, they are even in the same server side file. Any errors?
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?
..: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.
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
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)
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