~>i'Mr.ZaId<~ Posted June 20, 2013 Share Posted June 20, 2013 الــسلام عليكمـ ورحمةة اللهه وبركـآتهه يا شباب ياليت تشوفو وش مشكلة الكؤد ذآ gate = createObject(980,2673.5,596.79998779297,16.89999961853,0,0,0) marker = createMarker(2674.3000488281,599,14,"cylinder",10,255,255,255,0) createTeam("Army",255,0,0) bindKey("tap","down", function (thePlayer) if (isElementWithInMarker(thePlayer,marker)) then if (getPlayerTeam (thePlayer) == getTeamFromName("Army") ) then moveObject(gate,1000,2673.5,596.79998779297,22,0,0,0) else outputChatBox("This Army Base...",thePlayer,255,255,0,true) end end end ) function move2 (thePlayer) if (getPlayerTeam (thePlayer) == getTeamFromName("Army") ) then moveObject(gate,1000,2673.5,596.79998779297,16.89999961853,0,0,0) end end addEventHandler("onMarkerLeave",marker,move2) Link to comment
PaiN^ Posted June 20, 2013 Share Posted June 20, 2013 gate = createObject( 980, 2673.5, 596.79998779297, 16.89999961853, 0, 0, 0 ) marker = createMarker( 2674.3000488281, 599, 14, "cylinder", 10, 255, 255, 255, 0 ) createTeam( "Army", 255, 0, 0 ) function openGate( thePlayer ) if isElementWithInMarker( thePlayer, marker ) then if getPlayerTeam( thePlayer ) == getTeamFromName( "Army" ) then moveObject( gate, 1000, 2673.5, 596.79998779297, 22, 0, 0, 0 ) else outputChatBox( "This Army Base...", thePlayer, 255, 255, 0, true ) end end end addEventHandler( "onResourceStart", resourceRoot, function( ) local armyPlayers = getPlayersInTeam( getTeamFromName( "Army" ) ) if #armyPlayers > 0 then for k,v in ipairs( armyPlayers ) do bindKey( v, "tab", "down", openGate, v ) end end end ) addEventHandler( "onPlayerLogin", root, function( ) if getPlayerTeam( source ) == getTeamFromName( "Army" ) then bindKey( source, "tab", "down", openGate, source ) end end ) function closeGate( thePlayer ) if getElementType( thePlayer ) == "player" then if getPlayerTeam( thePlayer ) == getTeamFromName( "Army" ) then moveObject( gate, 1000, 2673.5, 596.79998779297, 16.89999961853, 0, 0, 0 ) end end end addEventHandler( "onMarkerLeave", marker, closeGate ) Link to comment
3NAD Posted June 20, 2013 Share Posted June 20, 2013 ^ إفرض ان اللاعب ماعنده تيم ممكن يسبب أخطاء ؟ Link to comment
Tete omar Posted June 20, 2013 Share Posted June 20, 2013 ^ إفرض ان اللاعب ماعنده تيم ممكن يسبب أخطاء ؟ لا ما رح يسبب اخطاء .. الحين هو يقارن شيء بشيء .. واللاعب الي ما عنده تيم الفنكشن بترجع فالس يعني المقارنة رح تكون مثل كذا if false == getTeamFromName( "Army" ) then . . . Link to comment
3NAD Posted June 20, 2013 Share Posted June 20, 2013 لـ الأسف جربتها وانا ماعندي تيم .. مشت الوظيفة ( بق )ء Link to comment
Tete omar Posted June 20, 2013 Share Posted June 20, 2013 دوبي مجربها بالرن كود عندي يقولي كذا Executing client-side command: getPlayerTeam(localPlayer)Command results: false [boolean] وما طلع خطأ بالديبق ... Link to comment
3NAD Posted June 20, 2013 Share Posted June 20, 2013 انت جرب الوظيفة كاملة .. انا ماكان عندي تيم + البوابة تحركت Link to comment
Tete omar Posted June 20, 2013 Share Posted June 20, 2013 انت جرب الوظيفة كاملة ..انا ماكان عندي تيم + البوابة تحركت البوابة تحركت لان احتمال التيم الي تقارن به يرجع فالس بعد يعني انت مثلاً تسوي كذا if getPlayerTeam(player) == getTeamFromName("3NAD") then وتيم عناد مهو موجود يعني التحقق رح يكون كذا if false == false then اكيد المقارنة بتكون صحيحة تاكد من التيم الي تتحقق منه اذا موجود edit : الموضوع انحرف عن مساره ذذ .. نكمل في الخاص Link to comment
MSHOOSH Posted June 20, 2013 Share Posted June 20, 2013 local ob = createObject ( 7910, 87, 1868.5, 22.700000762939,0,0, 180 ) local mr = createMarker ( 86.5, 1867.1999511719, 18.39999961853, "cylinder", 15, 255, 0, 0, 0 ) addEventHandler( "onMarkerHit", mr, function ( player ) local PlayerTeam = getPlayerTeam ( player ) local TheTeam = getTeamFromName ( "ARMY" ) if PlayerTeam == TheTeam then moveObject(ob, 2000, 87, 1868.5, 28.5 ) end end) addEventHandler("onMarkerLeave", mr, function ( player ) moveObject ( ob, 2000, 87, 1868.5, 22.700000762939 ) end) هذا انا مجربه و شغال تمام ملاحظه : اذا انت بسويه ل حرب العصابات اسم الفريق بالكابتل ARMY Link to comment
Tete omar Posted June 20, 2013 Share Posted June 20, 2013 ^ نفس الشيء مافرقت نكمل في الخاص ... 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