Jump to content

ارجو دخول المبرمجين


charaf12

Recommended Posts

شباب ابي مساعدة وهي طريقة برمجة باب يفتح تلقائيا

انا جربت العديد من الاكواد ما ضبطت معي

ارجو كود شغال

ارجو منكم اعطائي كود برمجة الباب العادي ليفتح تلقائين

و كود برمجة باب مقر اي عصابة معينية يفتح لاعضاء العصابة تلقائيا عند الاقتراب و شكرااا

Link to comment

* Server Side:

local x, y, z = 0, 0, 0 -- إحداثيات البوابة 
local groupName = "اسم القروب" 
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) and getElementData ( player, "Group" ) == groupName then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            if ( getElementData ( theElm, "Group" ) == groupName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 1500, x, y, z + 4 ) 
            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

اول شيئ شكرا كنق على الكود

بس في مشكلة في كودك

انا لما عوضت في السطريين الاو و الثاني مثل ما قتلي المهم يصير في بوابتين بوابة تفتح و بوابة تبقى مكانها ارجو حل للمشكلة

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...