ahmad_1994 Posted December 11, 2013 Share Posted December 11, 2013 السلام عليكم شباب ابي كود بوابة تفتح يا تيم مثل الشرطة بس ابيها لما اقرب منها تقتح يا حالهم ما ابي اعص زر Link to comment
K1NG Posted December 11, 2013 Share Posted December 11, 2013 -- Server Side # local x, y, z = 0, 0, 0 -- إحداثيات البوابة local teamName = "اسم التيم" -- x اسم التيم المسموح له بفتح البوابة local Object = createObject ( 980, x, y, z ) local Marker = createMarker ( x, y, z, "cylinder", 5, 0, 0, 0, 0 ) function countPlayersInMarker ( marker ) local players = 0 if marker and getElementType(marker) == "marker" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,marker) then players = players + 1 end end end return players end function MoveObject ( theElm ) if ( getElementType ( theElm ) == "player" ) then if ( eventName == "onMarkerHit" ) then local team = getPlayerTeam ( theElm ) if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then moveObject ( Object, 1500, x, y, z + 5 ) end else if ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z ) end end end end addEventHandler ( "onMarkerHit", Marker, MoveObject ) addEventHandler ( "onMarkerLeave", Marker, MoveObject ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z ) end end ) . عوض مكان المتغيرات في السطر الثاني والثالث فقط والباقي يتعدل تلقائياً بالكود ** Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 تسلم والله انك كفووووووووووووووو شكرااااااا Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 اخي شوف المشكلة بطلع بس ما بترجعلما اطلع من الماركر local x, y, z = 1544.69921875,-1630.7998046875,13.300000190735 local teamName = "Police" local Object = createObject ( 968, 1544.69921875,-1630.7998046875,13.300000190735,0,90,90) local Marker = createMarker ( x, y, z, "cylinder", 5,255,255,50) function countPlayersInMarker ( marker ) local players = 0,9 if marker and getElementType(marker) == "marker" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,marker) then players = players + 1 end end end return players end function MoveObject ( theElm ) if ( getElementType ( theElm ) == "player" ) then if ( eventName == "onMarkerHit" ) then local team = getPlayerTeam ( theElm ) if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then moveObject ( Object, 2000, 544.69921875,-1630.7998046875,13.300000190735,0,0,90) end else if ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90) end end end end addEventHandler ( "onMarkerHit", Marker, MoveObject ) addEventHandler ( "onMarkerLeave", Marker, MoveObject ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90 ) end end ) Link to comment
K1NG Posted December 11, 2013 Share Posted December 11, 2013 اخي شوف المشكلةبطلع بس ما بترجعلما اطلع من الماركر local x, y, z = 1544.69921875,-1630.7998046875,13.300000190735 local teamName = "Police" local Object = createObject ( 968, 1544.69921875,-1630.7998046875,13.300000190735,0,90,90) local Marker = createMarker ( x, y, z, "cylinder", 5,255,255,50) function countPlayersInMarker ( marker ) local players = 0,9 if marker and getElementType(marker) == "marker" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,marker) then players = players + 1 end end end return players end function MoveObject ( theElm ) if ( getElementType ( theElm ) == "player" ) then if ( eventName == "onMarkerHit" ) then local team = getPlayerTeam ( theElm ) if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then moveObject ( Object, 2000, 544.69921875,-1630.7998046875,13.300000190735,0,0,90) end else if ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90) end end end end addEventHandler ( "onMarkerHit", Marker, MoveObject ) addEventHandler ( "onMarkerLeave", Marker, MoveObject ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90 ) end end ) قلت لك لاتعوض مكان شي ثاني غير المتغيرات .. على كل حال خلاص عوضتها لك انا .. انسخه ولاتعدل فيه شي ابد ع طول ركبه -- Server Side # local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 local teamName = "Police" local Object = createObject ( 968, x, y, z, 13.300000190735, 0, 90 ) local Marker = createMarker ( x, y, z, "cylinder", 5, 0, 0, 0, 0 ) function countPlayersInMarker ( marker ) local players = 0 if marker and getElementType(marker) == "marker" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,marker) then players = players + 1 end end end return players end function MoveObject ( theElm ) if ( getElementType ( theElm ) == "player" ) then if ( eventName == "onMarkerHit" ) then local team = getPlayerTeam ( theElm ) if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then moveObject ( Object, 1500, 544.69921875, y, z ) end else if ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z ) end end end end addEventHandler ( "onMarkerHit", Marker, MoveObject ) addEventHandler ( "onMarkerLeave", Marker, MoveObject ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z ) end end ) Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 اخي ما زبط ادخل و شوف هاي العصاي يلي بتكون عند الشرطة عند المركزجرب شغل مود و شوف كيف يجي Link to comment
K1NG Posted December 11, 2013 Share Posted December 11, 2013 اخي ما زبط ادخل و شوف هاي العصاي يلي بتكون عند الشرطة عند المركزجرب شغل مود و شوف كيف يجي !!! ياخي انت مفروض تضبط الاحداثيات حق العصا حقتكـ مدري وش هي ! ضل العب بالاحداثيات بعد التحريكـ لين تضبط معكـ .. ولا تبي اسويلكـ الإحداثيات كمان : ع العموم يمديكـ تعدل احداثيات العصا بعد التحريكـ من سطر رقم 24 الي هو moveObject ( Object, 1500, 544.69921875, y, z ) -- 544.69921875, y, z -- هاذي هي الإحداثيات بعد التحريك ^ Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 اخي الكود ما يرجع بتيم يتحرك في هنك واحد تاني Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 ممكن الكود بكون ممنونلك لاني محتاجة ضروري Link to comment
Mr-M3AND Posted December 11, 2013 Share Posted December 11, 2013 local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 local teamName = "Police" local Object = createObject ( 968, x, y, z, 0, 90, 90 ) local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 5, 0, 0, 0, 0 ) function countPlayersInMarker ( marker ) local players = 0 if marker and getElementType(marker) == "marker" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,marker) then players = players + 1 end end end return players end function MoveObject ( theElm ) if ( getElementType ( theElm ) == "player" ) then if ( eventName == "onMarkerHit" ) then local team = getPlayerTeam ( theElm ) if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then moveObject ( Object, 1500,x, y, z,0,0,90 ) end else if ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z,0,0,90 ) end end end end addEventHandler ( "onMarkerHit", Marker, MoveObject ) addEventHandler ( "onMarkerLeave", Marker, MoveObject ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z,0,0,90 ) end end ) Link to comment
Mr-M3AND Posted December 11, 2013 Share Posted December 11, 2013 جرب هذا local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 local teamName = "Police" local Object = createObject ( 968, x, y, z, 0, 90, 90 ) local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 5, 0, 0, 0, 0 ) function countPlayersInMarker ( marker ) local players = 0 if marker and getElementType(marker) == "marker" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,marker) then players = players + 1 end end end return players end function MoveObject ( theElm ) if ( getElementType ( theElm ) == "player" ) then if ( eventName == "onMarkerHit" ) then local team = getPlayerTeam ( theElm ) if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then moveObject ( Object, 1000,x, y, z,0,-90,0 ) end else if ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1000, x, y, z,0,90,0 ) end end end end addEventHandler ( "onMarkerHit", Marker, MoveObject ) addEventHandler ( "onMarkerLeave", Marker, MoveObject ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1000, x, y, z,0,90,0 ) end end ) Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 اخي هاد نفس يلي فوق Link to comment
#DRAGON!FIRE Posted December 11, 2013 Share Posted December 11, 2013 (edited) # ججرب ذا .. local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 local teamName = "Police" local Object = createObject ( 968, x, y, z, 0, 90, 90 ) local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 5, 0, 0, 0, 0 ) function countPlayersInMarker ( marker ) local players = 0 if marker and getElementType(marker) == "marker" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinMarker(player,marker) then players = players + 1 end end end return players end function MoveObject ( theElm ) if ( getElementType ( theElm ) == "player" ) then if ( eventName == "onMarkerHit" ) then local team = getPlayerTeam ( theElm ) if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then moveObject ( Object, 1500,x, y, z,0,0,90 ) end else if ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z,0,0,90 ) end end end end addEventHandler ( "onMarkerHit", Marker, MoveObject ) addEventHandler ( "onMarkerLeave", Marker, MoveObject ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then moveObject ( Object, 1500, x, y, z,0,0,90 ) end end ) Edited December 11, 2013 by Guest Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 اخي الكود هلك كلة خربات لانو 1- لما يسوي اوبجكت ما بعدو 2- بفتح يا الكل مو بس يا الشرطة اذا بلاقي عندك كود تانج لاني محتاجة كتير و ضروري وبكون ممنونلك Link to comment
#DRAGON!FIRE Posted December 11, 2013 Share Posted December 11, 2013 اخي الكود هلك كلة خربات لانو 1- لما يسوي اوبجكت ما بعدو 2- بفتح يا الكل مو بس يا الشرطة اذا بلاقي عندك كود تانج لاني محتاجة كتير و ضروري وبكون ممنونلك # 1 - الاحداثيات هي مو مشكلة , انت لأزم تسويها شي شي خطوة خطوة 2- كيف للكل ,؟ , الكود صحيح اشوفه وما فيه شي , تأكد انك بـ اسم التيم اللي فوق .. Link to comment
ahmad_1994 Posted December 11, 2013 Author Share Posted December 11, 2013 اخي طيب و انا مو في التيم يفتح الباب Link to comment
Mr-M3AND Posted December 11, 2013 Share Posted December 11, 2013 جرب ذا -- Client local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 6, 0, 0, 0, 0 ) local Object = createObject ( 968, x, y, z, 0, 90, 90 ) addEventHandler("onClientMarkerHit",Marker, function (player) if (getTeamName( getPlayerTeam( localPlayer )) == "Police" ) then moveObject ( Object, 1000,x, y, z,0,-90,0 ) end end ) addEventHandler("onClientMarkerLeave",Marker, function(player) if (getTeamName( getPlayerTeam( localPlayer )) == "Police" ) then moveObject ( Object, 1000,x, y, z,0,90,0 ) end end ) Link to comment
فاّرس Posted December 12, 2013 Share Posted December 12, 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