Simba Posted January 21, 2014 Share Posted January 21, 2014 السلام عليكم .. ممكن فنكشات انه لو جيت ولمست الماكر يعطيني فلوس ولو خرجت من الماركر يسحب الفلوس! givePlayerMoney takePlayerMoney وايش كمان ؟؟ Link to comment
shwaeki Posted January 21, 2014 Share Posted January 21, 2014 createMarker------- تسوي ماركر onMarkerHit------ عند لمس الماركر givePlayerMoney --------اعطاء فلوس onMarkerLeave------- عند الخروج من الماركر takePlayerMoney------ سحب فلوس ما بعرف اذا في كمان بس اعتقد هاد كلشي Link to comment
Simba Posted January 21, 2014 Author Share Posted January 21, 2014 local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) addEventHandler ("onMarkerHit", myMarker, function () givePlayerMoney (player, 100000 ) end) local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) addEventHandler ("onMarkerLeave", myMarker function () takePlayerMoney (player, 100000 ) end) صح كذا ؟؟ اتوقع انه هريس لاني ما سويت تحقق ان الي لمس الماركر لاعب مع اني مااا اعرف اسويها Link to comment
#DRAGON!FIRE Posted January 21, 2014 Share Posted January 21, 2014 local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) addEventHandler ( "onMarkerHit", myMarker, function ( element ) if getElementType ( element ) == "player" then givePlayerMoney ( element, 100000 ) end end ) addEventHandler ( "onMarkerLeave", myMarker, function ( element ) if getElementType ( element ) == "player" then takePlayerMoney ( element, 100000 ) end end ) Link to comment
Simba Posted January 21, 2014 Author Share Posted January 21, 2014 local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) addEventHandler ( "onMarkerHit", myMarker, function ( element ) if getElementType ( element ) == "player" then givePlayerMoney ( element, 100000 ) end end ) addEventHandler ( "onMarkerLeave", myMarker, function ( element ) if getElementType ( element ) == "player" then takePlayerMoney ( element, 100000 ) end end ) شكرا لك اشتغل وشكرا لانك علمتني كيف اسوي تحقق للالمنت هذا الي كنت احتاجه Link to comment
#DRAGON!FIRE Posted January 21, 2014 Share Posted January 21, 2014 local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) addEventHandler ( "onMarkerHit", myMarker, function ( element ) if getElementType ( element ) == "player" then givePlayerMoney ( element, 100000 ) end end ) addEventHandler ( "onMarkerLeave", myMarker, function ( element ) if getElementType ( element ) == "player" then takePlayerMoney ( element, 100000 ) end end ) شكرا لك اشتغل وشكرا لانك علمتني كيف اسوي تحقق للالمنت هذا الي كنت احتاجه حياك الله Link to comment
shwaeki Posted January 22, 2014 Share Posted January 22, 2014 طيب اخي زاحف كيف اخلي بعد ما يلمس الماركر يستنا 10 ثواني بعدين يغطية الفلوس Link to comment
shwaeki Posted January 22, 2014 Share Posted January 22, 2014 طيب اخي زاحف كيف اخلي بعد ما يلمس الماركر يستنا 10 ثواني بعدين يغطية الفلوس Link to comment
al-Kobra Posted January 22, 2014 Share Posted January 22, 2014 (edited) setTimer isTimer killTimer Edited January 22, 2014 by Guest Link to comment
AboShanab Posted January 22, 2014 Share Posted January 22, 2014 local myMarker = createMarker( x, y, z, "cylinder",2, 255, 255, 255, 170 ) addEventHandler ( "onMarkerHit", myMarker, function ( element ) if getElementType ( element ) == "player" then setTimer(givePlayerMoney,10000,1,element, 100000) end end ) addEventHandler ( "onMarkerLeave", myMarker, function ( element ) if getElementType ( element ) == "player" then takePlayerMoney ( element, 100000 ) end end ) Link to comment
shwaeki Posted January 22, 2014 Share Posted January 22, 2014 انا سويت هيك بس لما ادخل الماركر ما يصير شي و انا ما بعرف استحدم و ايش فايدتة isTimer addEventHandler ( "onMarkerHit", myMarker, setTimer( function ( element ) if getElementType ( element ) == "player" then givePlayerMoney ( element, 100000 ) end end ) ,1000,0) Link to comment
AboShanab Posted January 22, 2014 Share Posted January 22, 2014 بالنسبة لـ isTimer التاكد من التايمر شغال ولا لا ------------------------ addEventHandler ( "onMarkerHit", myMarker,function ( element ) if ( getElementType(element) == "player" and not isPedInVehicle(element) ) then setTimer(function ( element ) givePlayerMoney ( element, 100000 ) end,1000,0,element) end end) Link to comment
shwaeki Posted January 22, 2014 Share Posted January 22, 2014 اخي الكود شغال بس اطلع من الماركر بتم يعطيني فلوس Link to comment
jafar Posted January 22, 2014 Share Posted January 22, 2014 local myMarker = createMarker ( x, y, z, "cylinder", 2, 255, 255, 255, 255 ); local Timer = { }; local Money = 100000 addEventHandler ( "onMarkerHit", myMarker, function ( element ) if getElementType ( element ) == "player" and not isPedInVehicle ( element ) then if isTimer ( Timer [ element ] ) then killTimer ( Timer [ element ] ) end Timer [ element ] = setTimer ( function ( ) givePlayerMoney ( element, Money ); end, 1000, 0 ); end end ); addEventHandler ( "onMarkerLeave", myMarker, function ( element ) if getElementType ( element ) == "player" then if isTimer ( Timer [ element ] ) then killTimer ( Timer [ element ] ); end Timer [ element ] = nil end end ); Link to comment
al-Kobra Posted January 22, 2014 Share Posted January 22, 2014 اخوي هاي وش فايتها nil تصفر القيمة Link to comment
#DRAGON!FIRE Posted January 22, 2014 Share Posted January 22, 2014 اخوي هاي وش فايتها nil هذي تشيل القيمة من الجدول table.remove تقدر تقول زيها زي 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