Hawkster Posted June 11, 2013 Share Posted June 11, 2013 Sup People, I've made a script, which SHOULD create a ped and let em do their animation, but they are only standing, so they not doing what they should do. Here is the code: addEventHandler("onResourceStart", resourceRoot, function() local ped = createPed(106, 2479.3000488281, -1653.1999511719, 13.5, 90, 0, 0) setElementFrozen(ped, true) setPedAnimation(ped, "GANGS", "smkcig_prtl", -1, true, true, false) end) There are no errors. Link to comment
iPrestege Posted June 11, 2013 Share Posted June 11, 2013 addEventHandler("onResourceStart", resourceRoot, function() local ped = createPed(106, 2479.3000488281, -1653.1999511719, 13.5, 90, 0, 0) setTimer ( function ( ) if isElement ( ped ) then setElementFrozen(ped, true) setPedAnimation(ped, "GANGS", "smkcig_prtl", -1, true, true, false) end end,100,1 ) end ) Use a timer because the ped maybe not created yet try this and tell me the results . Link to comment
iPrestege Posted June 11, 2013 Share Posted June 11, 2013 (edited) Every thing fine ? Edited June 11, 2013 by Guest Link to comment
Hawkster Posted June 11, 2013 Author Share Posted June 11, 2013 Do you know, how can I make the Ped immortal ? Link to comment
Hawkster Posted June 11, 2013 Author Share Posted June 11, 2013 I mean, that nobody can kill the peds. They should have unlimited health Link to comment
iPrestege Posted June 11, 2013 Share Posted June 11, 2013 -- # Client Side : addEventHandler('onClientPedDamage',root, function ( ) for _,ped in ipairs ( getElementsByType ( 'ped',resourceRoot ) ) do if source == ped then cancelEvent ( ) end end end ) Remember it's a client side . Link to comment
Hawkster Posted June 11, 2013 Author Share Posted June 11, 2013 Thank you very much brother Link to comment
Hawkster Posted June 11, 2013 Author Share Posted June 11, 2013 I need you help again How can I freeze,lock and make it undestroyable ? Code: createVehicle ( 567, 2479.8999023438, -1655.4000244141, 13.300000190735, 0, 0, 90.25, 6, 0, 0, 0, 0 ) -- Savanna Link to comment
iPrestege Posted June 11, 2013 Share Posted June 11, 2013 setVehicleLocked setElementFrozen Please use the wiki next time : https://wiki.multitheftauto.com/wiki/Main_Page You can find the client and server functions on the left good luck with it. Link to comment
Hawkster Posted June 12, 2013 Author Share Posted June 12, 2013 I've read this articles, but they only show me, how to freeze the car, while the player is sitting in it. It don't work when nobody is in it. Link to comment
iPrestege Posted June 12, 2013 Share Posted June 12, 2013 Please learn lua the wiki just explain how to use it arguments ..etc only . Link to comment
Hawkster Posted June 14, 2013 Author Share Posted June 14, 2013 Do you got some tips how I can learn lua fast ? Link to comment
iPrestege Posted June 14, 2013 Share Posted June 14, 2013 Do you got some tips how I can learn lua fast ? Never think about that. Link to comment
DiSaMe Posted June 15, 2013 Share Posted June 15, 2013 It's fine to think about that. Learning a programming language may take hours (or even minutes, if you're only after the basics). If you have some programming experience, learning new languages is easy. To learn Lua you can read this manual: http://www.lua.org/manual/5.1/ . The "Language" section describes the syntax and the features and the "Standard Libraries" section documents functions which come with Lua. If you are experienced enough in programming, you will be able to learn it fast. 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