#Soking Posted December 24, 2015 Share Posted December 24, 2015 سلام عليكم ورحمه الله ويركاته بدي فنكشات كالاتي لو كان في البحر ومعاه سياره وفي تيم معين و Data معينه يعطيه فلوس وبدي التحقق يكون كل ٣٠ ثانيه باستمرار بدي الفنشكات وانا بحاول اسويه Link to comment
#CroSs Posted December 24, 2015 Share Posted December 24, 2015 setTimer isElementInWater isPedInVehicle getPlayerTeam getTeamName getElementData givePlayerMoney Link to comment
iPrestege Posted December 24, 2015 Share Posted December 24, 2015 isElementInWater -- هذا راح يتحقق اذا كان في الماء مهو شرط البحر اي ماء .. Link to comment
#Soking Posted December 24, 2015 Author Share Posted December 24, 2015 مشكور بس خل عينك علموضوع علشان لو خربط Link to comment
#Soking Posted December 24, 2015 Author Share Posted December 24, 2015 يظهر بل ديبوق Error:FishJob\server.lua:42 attempet to call global " isElementainWater" (a nil value) Link to comment
#CroSs Posted December 24, 2015 Share Posted December 24, 2015 يظهر بل ديبوقError:FishJob\server.lua:42 attempet to call global " isElementainWater" (a nil value) isElementainWater X isElementInWater Link to comment
#Soking Posted December 24, 2015 Author Share Posted December 24, 2015 اها شكرا بس مايعطي فلوسس الكود لو تبونه setTimer ( function() if isElementInWater() then for i, player in ipairs(getElementsByType("player")) do if ( isElement(player) ) then if isPedInVehicle(source) then if getPlayerTeam(source) ~= getTeamFromName("Fish") then end local Fix = math.random(5000,10000) setElementData(source, "Money", getElementData(source, "Money")+Fix) exports["guimessages"]:outputServer( source,""..Fix.."", 0, 225, 0 ) end end end end end, 4000,0) Link to comment
#CroSs Posted December 24, 2015 Share Posted December 24, 2015 (edited) setTimer( function() for _, Player in ipairs( getElementsByType( "player" ) ) do if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == ( getTeamFromName( "Fish" ) or nil ) ) then local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" ) setElementData( Player, "Money", getElementData( Player, "Money" ) + Money ) if ( Resource and getResourceState( Resource ) == "running" ) then call( Resource, "outputServer", Player, Money, 0, 225, 0 ) end end end end, 4000, 0 ) Edited December 25, 2015 by Guest Link to comment
Rockyz Posted December 24, 2015 Share Posted December 24, 2015 ^ setTimer( function() for _, Player in ipairs( getElementsByType( "player" ) ) do if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == getTeamFromName( "Fish" ) ) then local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" ) setElementData( Player, "Money", getElementData( Player, "Money" ) + Money ) if ( Resource and getResourceState( Resource ) == "running" ) then call( Resource, "outputServer", Player, Money, 0, 225, 0 ) end end end end, 4000, 0 ) Link to comment
#Soking Posted December 24, 2015 Author Share Posted December 24, 2015 شكركا بش فهمني علشان اتعلم Link to comment
#CroSs Posted December 24, 2015 Share Posted December 24, 2015 (edited) ^ setTimer( function() for _, Player in ipairs( getElementsByType( "player" ) ) do if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == ( getTeamFromName( "Fish" ) or nil ) ) then local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" ) setElementData( Player, "Money", getElementData( Player, "Money" ) + Money ) if ( Resource and getResourceState( Resource ) == "running" ) then call( Resource, "outputServer", Player, Money, 0, 225, 0 ) end end end end, 4000, 0 ) . توني منتبه لها جاي بصححها إلا أنت رديت ض1 على العموم مشكور على التصحيح Edited December 25, 2015 by Guest Link to comment
#Soking Posted December 24, 2015 Author Share Posted December 24, 2015 طيب انا مافهمت وش سويت انت Link to comment
#Soking Posted December 24, 2015 Author Share Posted December 24, 2015 https://wiki.multitheftauto.com/wiki/get ... iedVehicle وش وظيفة الكود دا وبعدين فهمني شو سويت ووين كان الغلط Link to comment
Rockyz Posted December 25, 2015 Share Posted December 25, 2015 numb = 30 -- عدد الثواني setTimer( function() for _, Player in ipairs( getElementsByType( "player" ) ) do -- لوب على جميع الاعبين عشان تجيبهم كامل if ( isPedInVehicle( Player ) and isElementInWater( getPedOccupiedVehicle( Player ) ) and getPlayerTeam( Player ) == getTeamFromName( "Fish" ) ) then -- هنا تتحقق اذا الاعب في الماء و في سيارة و في تيم اسمه Fish يكمل الحدث local Money, Resource = math.random( 5000, 10000 ), getResourceFromName( "guimessages" ) -- تعريف الفلوس و اسم المود setElementData( Player, "Money", getElementData( Player, "Money" ) + Money ) -- يزيد فلوسه على حسب الي عنده if ( Resource and getResourceState( Resource ) == "running" ) then call ( Resource, "outputServer", Player, Money, 0, 225, 0 ) else outputChatBox ( Money, Player, 0, 255, 0, true ) -- هنا يتحقق اذا الريسورس (guimesssages) شغال ولا لا اذا كان مشغل يضع رسالة منه اذا كنت مو مشغل يطلع كلام شات end end end end, numb * 1000, 0 ) -- الصفر يكرر التايمر Link to comment
LoOs Posted December 25, 2015 Share Posted December 25, 2015 https://wiki.multitheftauto.com/wiki/getPedOccupiedVehicleوش وظيفة الكود دا وبعدين فهمني شو سويت ووين كان الغلط هذي الوظيفة تجلب سيارة الاعب الي راكب فيها ، وهو حطها بالتحقق عشان يتحقق انه بسيارة اصلا ، Link to comment
#Soking Posted December 25, 2015 Author Share Posted December 25, 2015 هو حاطط اكواد كتيره اقرد اختصرها بسطر بس يعطيه العافيه شكرا لو علي التوضيح 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