monday Posted October 29, 2014 Share Posted October 29, 2014 Hi, I encountered a problem with setPedAnalogControlState while trying to make the ped walking forward. That's the code I used: function pedrespawn(pedID) if (isPedDead(pedID)) then destroyElement(pedID) ped1 = createPed (120, 2495.55, -1665.46, 14) setPedRotation(ped1, 270) setPedAnalogControlState(ped1, 'walk', 1) ----[b][u]This line displays the error message[/u][/b] end end function timerrespawn() --int totalAmmo, element killer, int killerWeapon, int bodypart, bool stealth setTimer(pedrespawn, 2000, 1, source) end addEventHandler ("onPedWasted", getRootElement(), timerrespawn) The ped is standing still and the error message is displayed The message is - ERROR: server.lua:35: attemt to call global 'setPedAnalogControlState' (35th line is the one marked as 7th in the code I posted) I was looking for a fix at mta's wiki, google and this forum but can't find a reason for this error and solution. Thanks in advance for any advice. "I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody."Btw is this a regular rank for new forum users or am I special?... Link to comment
Woovie Posted October 29, 2014 Share Posted October 29, 2014 That's just a normal forum rank. It clearly states "I'm an average nobody" As it states on the wiki, setPedAnalogControlStat is client only. You're clearly trying to use it serverside as the global 'setPedAnalogControlState' is nil. Link to comment
monday Posted October 29, 2014 Author Share Posted October 29, 2014 Oh, thanks, I used setPedAnimation instead:) Link to comment
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