SolideRock Posted May 16, 2016 Share Posted May 16, 2016 السلام عليكم ورحمه الله وبركاته شباب بدي كود احطه في مود ولما اشغل المود ذا يعمل على تشغيل المودات الي حاطط اسمها انا Link to comment
#J2mes Posted May 16, 2016 Share Posted May 16, 2016 getResourceState startResource restartResource getResourceFromName Link to comment
Ja[B]er[X]Pro Posted May 16, 2016 Share Posted May 16, 2016 دا مثال اسف ان يوجد خطأ غير مجرب resourcename = {"test","test2","test3"} addEventHandler("onResourceStart",resourceRoot,function() for k,v in ipairs (#resourcename) do local name = getResourceFromName(k) startResource(name) end end) Link to comment
3NAD Posted May 16, 2016 Share Posted May 16, 2016 resourcename = {"test1","test2","test3"} addEventHandler ( "onResourceStart", resourceRoot, function ( ) for key, value in ipairs ( resourcename ) do local resource = getResourceFromName ( value ) if resource then local state = getResourceState ( resource ) if state == "loaded" or state == "stopping" then if not startResource ( resource ) then outputDebugString ( "#Auto-Start: Error, couldn't start '"..value.."'." ) end end else outputDebugString ( "#Auto-Start: '"..value.."' not found." ) end end end ) 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