MrBiG Posted October 13, 2017 Share Posted October 13, 2017 (edited) السلام عليكم انا مسوي باب ما يقدرو يفتحو غير الشرطة بس مو راضي يشتغل وش المشكلة متت يا اخوان -------------------------------- Marcker Open Door -----------------------------| local Door = createMarker(590.20, 585.09, 15.699,"cylinder",1,0,0,255,250) setElementDimension(Door,1) setElementInterior(Door,3) --------------------------- Objects Door ----------------------------------------| local DP = createObject( 1537, 589.599, 585.70, 15.699,0,0,90 ) setElementDimension(DP,1) setElementInterior(DP,3) -- local DC = createObject( 1537, 589.599, 584.10, 15.699,0,0,90 ) setElementDimension(DC,1) setElementInterior(DC,3) ----------------------------------------------------------------------------------| addEventHandler("onMarkerHit",root, function(player) if (source == Door) then local Team = getPlayerTeam(player) if Team and getTeamName(Team) == "Police" then bindKey(player,"tab","down",OpenDoor,1) end end end) function OpenDoor (player,_,_,Number) setPedAnimation(player,"ped","bomber") setTimer(setPedAnimation,500,1,player,nil,nil) if Number == 1 then if Opened == true then moveObject(DP,1000,589.599, 585.70-1, 15.699) moveObject(DC,1000,589.599, 584.10-1, 15.699) Opened = false exports ["guimessages"] : outputServer( player,"You Are Open Door", 0, 255, 0) else moveObject(DP,1000,589.599, 585.70, 15.699) moveObject(DC,1000,589.599, 584.10, 15.699) Opened = true exports ["guimessages"] : outputServer( player,"You Closed Door", 0, 255, 0) end end end Edited October 13, 2017 by Debo15 Link to comment
#BrosS Posted October 13, 2017 Share Posted October 13, 2017 addEventHandler("onMarkerHit",root, function(player) if (source == Door) then local super = getPlayerTeam (player) local saiyan = getTeamFromName ( "Police" ) if ( super ) == saiyan then bindKey(player,"tab","down",OpenDoor,1) end end end); Link to comment
#Soking Posted October 13, 2017 Share Posted October 13, 2017 22 minutes ago, #BrosS said: addEventHandler("onMarkerHit",root, function(player) if (source == Door) then local super = getPlayerTeam (player) local saiyan = getTeamFromName ( "Police" ) if ( super ) == saiyan then bindKey(player,"tab","down",OpenDoor,1) end end end); ناقصك تحققات و كدا ممكن يصير مليون بند كي Link to comment
Rockyz Posted October 13, 2017 Share Posted October 13, 2017 (edited) function saiyansDoor ( saiyan ) if ( saiyan and getElementType ( saiyan ) == 'player' and source == Door ) then local super = getPlayerTeam ( saiyan ) local saiyanType = getTeamFromName ( 'Police' ) if ( super == saiyanType ) then local isSaiyan = isKeyBound ( saiyan, 'tab', 'down', OpenDoor ) if ( eventName == 'onMarkerHit' ) then if not ( isSaiyan ) then bindKey ( saiyan, 'tab', 'down', OpenDoor, 1 ) end elseif ( eventName == 'onMarkerLeave' ) then if ( isSaiyan ) then unbindKey ( saiyan, 'tab', 'down', OpenDoor ) end end end end end addEventHandler ( 'onMarkerHit', root, saiyansDoor ) addEventHandler ( 'onMarkerLeave', root, saiyansDoor ) Edited October 13, 2017 by #,+( _xiRoc[K]; > Link to comment
Abdul KariM Posted October 13, 2017 Share Posted October 13, 2017 لازم يكون فيه تحقق من نوع الالمنت الي دخل الماركر نفترض انه دخل الماركر سيارة راح تظهر بقات ولا راح يستفيد شي من الكود 1 Link to comment
MrBiG Posted October 14, 2017 Author Share Posted October 14, 2017 ليش معقدين الأمر كذا يعني ؟؟ خلاص كتبتو بطريقة ثانية اشكركم onMarkerLeave انا مسوي كود يخص ذا للعلم اقصد وظيفة 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