SilentRipper Posted May 15, 2013 Share Posted May 15, 2013 Hello i have a problem i want add bots to my server and give them simple anim i use this code function pedLoad () ped1 = createPed(247, 2242.598, 2151.254, 10.67) setPedRotation(ped1, 115) giveWeapon(ped1, 34, 1, true) setPedAnimation ( ped1, "BAR", "Barcustom_loop", 1, true, true, true) end addEventHandler ( "onResourceStart", getRootElement(), pedLoad ) meta <meta> <info type="script" author="test" version="1.0" /> <script type="server" src="client.lua" /> </meta> But this code not working aswell i mean bot spawn and rotation works good but anims and give weapon not working.Bot just stand and dont do nothing.Can somebody told me whats wrong ? Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 First welcome to the mta forum . Second you're posting on the wrong section ! Scripting Section Here And you're problem is you are set the meta.xml file to client and the script should be server and change get root element to get resource root element get this resource > resourceRoot . Link to comment
SilentRipper Posted May 15, 2013 Author Share Posted May 15, 2013 First welcome to the mta forum . Thanks nice to meet you. Second you're posting on the wrong section ! Sorry when i saw this HELP! HELP! Need help? Post here. On subfroum i thought that was good section.Anyway i dont want make other topic so can moderator move it to right section? And you're problem is you are set the meta.xml file to client and the script should be server and change get root element to get resource root element get this resource > resourceRoot . The file type is set to server but file name is a client.lua.Ok so i change getRootElement to resourceRoot but now script say this: attempt to call global 'resourceRoot' Im new in lua scripting only what i want to do is only put ped with aim Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 Yes, I've reported the topic and I think the mta moderators will soon move the topic to the right section . -- # Server Side function pedLoad () ped1 = createPed( 247, 2242.598, 2151.254, 10.67,115 ) setTimer( function ( ) setPedAnimation ( ped1, "BAR", "Barcustom_loop", 1, true, true, true ) giveWeapon ( ped1,34,1,true ) end,50,1 ) end addEventHandler ( "onResourceStart",resourceRoot, pedLoad ) Link to comment
SilentRipper Posted May 15, 2013 Author Share Posted May 15, 2013 Thanks it's working But there is bug if i start script and im far away from ped when i get closer to him he dont do animation .But when i start script near ped then its work fine.Is there any solution for that or it is a game bug or something like that ? Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 I Don't think that but try this : setPedAnimation ( ped1, "BAR", "Barcustom_loop",false,true,true,true ) Link to comment
SilentRipper Posted May 15, 2013 Author Share Posted May 15, 2013 Your little patch does not help.But i realy appreciate that you try help me. But maybe there is a way to solve this .I dont know lua language but i know is powerfull thing.Is that possible to script get auto load if player is in some area near ped ? Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 What you mean by auto load like a spawn or something like that ? Link to comment
SilentRipper Posted May 15, 2013 Author Share Posted May 15, 2013 If player join in some area then will be send a message to server and as call back ped will be spawn or something like that.Because like i said before when somebody join to server or is far away from ped when he come close to him he dont see animations and holding weapon only standing ped.I think about making a big marker (cylinder for example) and the ped will spawn if player be in marker. Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 Great idea make it what's the problem? Link to comment
SilentRipper Posted May 15, 2013 Author Share Posted May 15, 2013 I dont know is that possible. Link to comment
iPrestege Posted May 15, 2013 Share Posted May 15, 2013 I Don't know because i don't understand you 100 % But i think yes go ahead and try to make it. 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