mr.ekoo Posted January 28, 2013 Share Posted January 28, 2013 (edited) عندي هالكود checkGateMarker = createMarker ( x, y, z, "corona", 6.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 980, x, y, z, 0, 0, 90) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 2000, x, y, z ) end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function movingBackPolice ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 2000, x, y, z ) end addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice ) هذي بوابة ويوم تجي جنبها تتحرك الى ابغاه تعدلون الكود ووتخلونه يوم اضغط زر تاب واكون من فريق معين يفتح لي ياريت تعدلونه Edited January 28, 2013 by Guest Link to comment
iPrestege Posted January 28, 2013 Share Posted January 28, 2013 استخدم : getPlayerTeam getTeamName bindKey وعدل الايفنت ذذ Link to comment
mr.ekoo Posted January 28, 2013 Author Share Posted January 28, 2013 طيب راح احاول اعدله بالاكواد الى عطيتني اياها بس يوم بخلي تاب مثلا لو كنت بخلي N بسوي كذا bindKey ( player, "n", "down", funcInput ) بس لو بحط تاب وش اخلي ؟ Link to comment
iPrestege Posted January 28, 2013 Share Posted January 28, 2013 طيب راح احاول اعدله بالاكواد الى عطيتني اياهابس يوم بخلي تاب مثلا لو كنت بخلي N بسوي كذا bindKey ( player, "n", "down", funcInput ) بس لو بحط تاب وش اخلي ؟ Tab Link to comment
mr.ekoo Posted January 28, 2013 Author Share Posted January 28, 2013 سويت كذا وماصار checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function bindTheKeys ( player, commandName ) bindKey ( player, "Tab", "down", gateCheckingTeam ) -- bind the player's F1 down key end addCommandHandler ( "bindme", bindTheKeys ) Link to comment
iMr.Dawix~# Posted January 28, 2013 Share Posted January 28, 2013 يمكن كذا Local checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function bindTheKeys ( player, commandName ) bindKey ( player, "Tab", "down", gateCheckingTeam ) -- bind the player's F1 down key end addCommandHandler ( "bindme", bindTheKeys ) Link to comment
mr.ekoo Posted January 28, 2013 Author Share Posted January 28, 2013 اخوي البوابة تفتح لحالها نفس الشيئ بالكود حقك ماقدر اتاكد صح ولا غلط Link to comment
iPrestege Posted January 28, 2013 Share Posted January 28, 2013 سويت كذا وماصار checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function bindTheKeys ( player, commandName ) bindKey ( player, "Tab", "down", gateCheckingTeam ) -- bind the player's F1 down key end addCommandHandler ( "bindme", bindTheKeys ) يمكن كذا Local checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function bindTheKeys ( player, commandName ) bindKey ( player, "Tab", "down", gateCheckingTeam ) -- bind the player's F1 down key end addCommandHandler ( "bindme", bindTheKeys ) ذذ انت ماستخدمت @ getPlayerTeam getTeamName كيف تبية يفتح بـ تيم ؟ وانت اصلا ماسويتة ؟! ذذ Link to comment
mr.ekoo Posted January 28, 2013 Author Share Posted January 28, 2013 اخوي انا قلت بجرب اسوي بزر اول وبعدين لما اخلص الزر اسوي التيم Link to comment
TAPL Posted January 28, 2013 Share Posted January 28, 2013 addEventHandler("onResourceStart", resourceRoot, function() gatePolice1 = createObject(980, 1544.9, -1627.9, 15.1, 0, 0, 90) checkGateMarker = createMarker(1544.9, -1627.9, 15.1, "corona", 6.0, 0, 0, 255, 0) for i, player in ipairs (getElementsByType("player")) do bindTheKeys(player) end end) addEventHandler("onPlayerJoin", root, function() bindTheKeys(source) end) function bindTheKeys(player) bindKey(player, "Tab", "down", gateCheckingTeam) end function gateCheckingTeam(player) local Team = getPlayerTeam(player) local TeamName = Team and getTeamName(Team) or "" if isElementWithinMarker(player, checkGateMarker) and (TeamName == "أسم التيم هنا") then moveObject(gatePolice1, 2000, 1544.9, -1627.9, 9.2) end end Link to comment
mr.ekoo Posted January 28, 2013 Author Share Posted January 28, 2013 مانفع الكود اخوي ؟ اضرب تاب مايتحرك + انت حذفت بعض السطور مثل لما يطلع من الماركر ترجع البوابة لمكانها شوف انا عدلته شوف صح او لا addEventHandler("onResourceStart", resourceRoot, function() gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) for i, player in ipairs (getElementsByType("player")) do bindTheKeys(player) end end) addEventHandler("onPlayerJoin", root, function() bindTheKeys(source) end) function bindTheKeys(player) bindKey(player, "Tab", "down", gateCheckingTeam) end function gateCheckingTeam(player) local Team = getPlayerTeam(player) local TeamName = Team and getTeamName(Team) or "" if isElementWithinMarker(player, checkGateMarker) and (TeamName == "Police") then moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) end end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function movingBackPolice ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 15.199999809265 ) end addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice ) Link to comment
TAPL Posted January 28, 2013 Share Posted January 28, 2013 Police تأكد أنك حاطه سيرفر + تأكد أنك في تيم addEventHandler("onResourceStart", resourceRoot, function() gatePolice1 = createObject(980, 1544.9, -1627.9, 15.1, 0, 0, 90) checkGateMarker = createMarker(1544.9, -1627.9, 15.1, "corona", 6.0, 0, 0, 255, 0) for i, player in ipairs (getElementsByType("player")) do bindTheKeys(player) end end) addEventHandler("onPlayerJoin", root, function() bindTheKeys(source) end) function bindTheKeys(player) bindKey(player, "Tab", "down", gateCheckingTeam) end function gateCheckingTeam(player) local Team = getPlayerTeam(player) local TeamName = Team and getTeamName(Team) or "" if isElementWithinMarker(player, checkGateMarker) and (TeamName == "Police") then moveObject(gatePolice1, 2000, 1544.9, -1627.9, 9.2) end end addEventHandler("onMarkerLeave", checkGateMarker, function(player) if getElementType(player) ~= "player" then return end local Team = getPlayerTeam(player) local TeamName = Team and getTeamName(Team) or "" if (TeamName == "Police") then moveObject(gatePolice1, 2000, 1544.9, -1627.9, 15.1) end end) Link to comment
mr.ekoo Posted January 28, 2013 Author Share Posted January 28, 2013 اوك شغال الحين اخوي مشكور بس الحين مايسكر بس اضغط تاب يظل مفتوح ابغاه يسكر Link to comment
3NAD Posted January 28, 2013 Share Posted January 28, 2013 addEventHandler ( "onResourceStart", resourceRoot, function ( ) gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) for _, player in ipairs ( getElementsByType ( "player" ) ) do bindTheKeys ( player ) end end ) addEventHandler ( "onPlayerJoin", root, function ( ) bindTheKeys ( source ) end ) function bindTheKeys ( player ) bindKey ( player, "Tab", "down", gateCheckingTeam ) end open = false function gateCheckingTeam ( player ) local PlayerTeam = getPlayerTeam ( player ) local PoliceTeam = getTeamFromName ( "Police" ) if isElementWithinMarker ( player, checkGateMarker ) then if PlayerTeam == PoliceTeam then if open == false then moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) open = true else moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 15.199999809265 ) open = false end end end end Link to comment
mr.ekoo Posted January 30, 2013 Author Share Posted January 30, 2013 شكرا اخوي الحين تمام 100% 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