Jump to content

اكواد البوابه


aL.Kfo

Recommended Posts

مرحبا شباب

كانت استخددم كود اوسامة لتحريك الاوبجكت بس بعد فتره تعطل مدري السبب اني ضفت شي ب الغلط او وش الشكله ب الضبط

الاوجبكت بكبره ما يطلع

الكود

لو فيه حل للكود حلو لو مافيه اطرحولنا كوداتكم لا هنتم

local Object = createObject ( ID, x, y, z, rx, ry, rz ) 
local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 )) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        local accName = getAccountName ( getPlayerAccount ( player ) ) 
        if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Group Name" ) ) then 
            if not Open then 
                moveObject ( Object, 1500, moveX, moveY, moveZ ) 
            else 
                moveObject ( Object, 1500, x, y, z ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You must be 'Group Name' !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject ) 
    end 
) 
  
  
  

Link to comment

ركب الكود و كل شي تمام بس اخر شي لا جيت افتح البوابه يطلع لي اسم القروب بالشات مع العلم اني حاط اسم التيم فى الكود فوق و تحت

و خاش التيم فى السيرفر لو فيه كود ثاني افضل و يكون لتيم مخصص

Link to comment
ركب الكود و كل شي تمام بس اخر شي لا جيت افتح البوابه يطلع لي اسم القروب بالشات مع العلم اني حاط اسم التيم فى الكود فوق و تحت

و خاش التيم فى السيرفر لو فيه كود ثاني افضل و يكون لتيم مخصص

:?انت تبغى البوابة تفتح لفريق معين..؟

Edit:

المهم اذا كنت تقصد لفريق معين تفضل

Team = "اسم الفريق" 
local Object = createObject ( ID, x, y, z, rx, ry, rz ) 
local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 ) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open then 
                moveObject ( Object, 1500, moveX, moveY, moveZ ) 
            else 
                moveObject ( Object, 1500, x, y, z ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject ) 
    end 
) 

update

:?واذا كنت تقصد غير كذا الله اعلم

Link to comment
ركب الكود و كل شي تمام بس اخر شي لا جيت افتح البوابه يطلع لي اسم القروب بالشات مع العلم اني حاط اسم التيم فى الكود فوق و تحت

و خاش التيم فى السيرفر لو فيه كود ثاني افضل و يكون لتيم مخصص

:?انت تبغى البوابة تفتح لفريق معين..؟

Edit:

المهم اذا كنت تقصد لفريق معين تفضل

Team = "اسم الفريق" 
local Object = createObject ( ID, x, y, z, rx, ry, rz ) 
local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 ) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open then 
                moveObject ( Object, 1500, moveX, moveY, moveZ ) 
            else 
                moveObject ( Object, 1500, x, y, z ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject ) 
    end 
) 

update

:?واذا كنت تقصد غير كذا الله اعلم

لا ذا الاي اقصد و ب الضبطط

زبط معي لا هنت يا بطل

Link to comment

ماله داعي انزل موضوع ثاني سوال بسيط

سويت مثلا ماب فيه 20 بوابه

لكل باب احادث خاص و الخ المهم سويت البوابات و كل كود في مجلد ولا جملعتهم مع بعض مع يفتحون و كثيره المجلدات

هل فيه طريقه اجمع كل الكواد في مستند واحد او مجلد واحد

Link to comment
ياليت توظح اكثر

قصدك احطهم في مستند و احط المستند في ملف zip

تحطهم في نفس المستند ,, + تغير اسم الماركر والبوابه

Edit #

تأكد انك تغير اسم ال

Object = createObject  

Object يعني تحط بدال ال

تسوي كذا

Object2 = createObject  

Object2 لاحظ حطيت

كل ما تضيف بوابه تزود رقم وكذا عشان الاوبجكت ما يتخربط موب شرط تحط ارقام ورا بعض

حط اي رقم عشان لا يتلخبط ,, لأن ممكن اذا ددخلت في الماركر ,, تتحرك كل البوابات

+

Object2 اذا حطيت

تروح تغيره في ال

moveObject 

وكذا

كل ما تضيف تسوي كذا وبيضبط معك ,,

+

تغير اسم

Marker = createMarker 

Marker2 تضيف

تخليها كذا

Marker2 = createMarker 

+

تغير اسم الماركر هنا

if isElementWithinMarker ( player, Marker ) then 

Marker يعني بدال

تحط اسم الماركر الي حطيته في

createMarker 

الي هو

Marker

الي حطيناه هنا

Marker = createMarker 

!! اتمنى فهمت

Link to comment
ياليت توظح اكثر

قصدك احطهم في مستند و احط المستند في ملف zip

تحطهم في نفس المستند ,, + تغير اسم الماركر والبوابه

Edit #

تأكد انك تغير اسم ال

Object = createObject  

Object يعني تحط بدال ال

تسوي كذا

Object2 = createObject  

Object2 لاحظ حطيت

كل ما تضيف بوابه تزود رقم وكذا عشان الاوبجكت ما يتخربط موب شرط تحط ارقام ورا بعض

حط اي رقم عشان لا يتلخبط ,, لأن ممكن اذا ددخلت في الماركر ,, تتحرك كل البوابات

+

Object2 اذا حطيت

تروح تغيره في ال

moveObject 

وكذا

كل ما تضيف تسوي كذا وبيضبط معك ,,

+

تغير اسم

Marker = createMarker 

Marker2 تضيف

تخليها كذا

Marker2 = createMarker 

+

تغير اسم الماركر هنا

if isElementWithinMarker ( player, Marker ) then 

Marker يعني بدال

تحط اسم الماركر الي حطيته في

createMarker 

الي هو

Marker

الي حطيناه هنا

Marker = createMarker 

!! اتمنى فهمت

اشكرك ع مجهودكك

شوف الاي عملته هو صح ولا لين البوابات لا حطيت كل ملف مع كلنت في مجلد لحاله يفتح

اما لا جمعتهم كذا ما يفتح بس يطلع الاوبجكت ولا تتحرك

Team = "Team" 
local Object1 = createObject ( 2930, 1565.099609375, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker1 = createMarker ( 1565.1639404297, -1637.4421386719, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open then 
                moveObject ( Object, 1500, 1563.4000244141, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object, 1500, 1565.099609375, -1637.7998046875, -78.400001525879 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject ) 
    end 
) 
  
  
  
  
Team = "Team" 
local Object2 = createObject ( 2930, 1561.69921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker2 = createMarker ( 1561.861328125, -1637.4370117188, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open then 
                moveObject ( Object, 1500, 1560, -1637.7998046875, -78.400001525879 ) 
            else 
                moveObject ( Object, 1500, 1561.69921875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject ) 
    end 
) 
  
  
  
  
Team = "Team" 
local Object3 = createObject ( 2930, 1558.2998046875, -1637.69921875, -78.400001525879, 0, 0, 90 ) 
local Marker3 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open then 
                moveObject ( Object, 1500, 1556.5999755859, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object, 1500, 1558.2998046875, -1637.69921875, -78.400001525879 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject ) 
    end 
) 
  

الان في الكود ذا 3 بوابات و لاحظ جنب كلمه ماركر 1 و الكود الثاني جنب كلمه ماركر 2 صحيح ولا

Link to comment

اكثر من مره :? لانها قيمة ثابته "Team" مو ضروري تكرر القيمة

Team = "Team" 
local Object1 = createObject ( 2930, 1565.099609375, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker1 = createMarker ( 1565.1639404297, -1637.4421386719, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject1 ( player ) 
    if isElementWithinMarker ( player, Marker1 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open1 then 
                moveObject ( Object1, 1500, 1563.4000244141, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object1, 1500, 1565.099609375, -1637.7998046875, -78.400001525879 ) 
            end 
            Open1 = not Open1 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject1 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject1 ) 
    end 
) 
  
  
  
  
local Object2 = createObject ( 2930, 1561.69921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker2 = createMarker ( 1561.861328125, -1637.4370117188, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject2 ( player ) 
    if isElementWithinMarker ( player, Marker2 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open2 then 
                moveObject ( Object2, 1500, 1560, -1637.7998046875, -78.400001525879 ) 
            else 
                moveObject ( Object2, 1500, 1561.69921875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open2 = not Open2 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject2 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject2 ) 
    end 
) 
  
  
  
  
local Object3 = createObject ( 2930, 1558.2998046875, -1637.69921875, -78.400001525879, 0, 0, 90 ) 
local Marker3 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject3 ( player ) 
    if isElementWithinMarker ( player, Marker3 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open3 then 
                moveObject ( Object3, 1500, 1556.5999755859, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object3, 1500, 1558.2998046875, -1637.69921875, -78.400001525879 ) 
            end 
            Open3 = not Open3 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject3 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject3 ) 
    end 
) 

update #1

Link to comment

ياليل سويت كم بوابه وحطيت الاكواد فوق الاي عدلتها خربت صار معد يغتح

شوف الاكواد بعد الاضافه ووش الخطاء

Team = "Team" 
local Object1 = createObject ( 2930, 1565.099609375, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker1 = createMarker ( 1565.1639404297, -1637.4421386719, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject1 ( player ) 
    if isElementWithinMarker ( player, Marker1 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open1 then 
                moveObject ( Object1, 1500, 1563.4000244141, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object1, 1500, 1565.099609375, -1637.7998046875, -78.400001525879 ) 
            end 
            Open1 = not Open1 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject1 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject1 ) 
    end 
) 
  
  
  
  
local Object2 = createObject ( 2930, 1561.69921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker2 = createMarker ( 1561.861328125, -1637.4370117188, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject2 ( player ) 
    if isElementWithinMarker ( player, Marker2 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open2 then 
                moveObject ( Object2, 1500, 1560, -1637.7998046875, -78.400001525879 ) 
            else 
                moveObject ( Object2, 1500, 1561.69921875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open2 = not Open2 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject2 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject2 ) 
    end 
) 
  
  
  
  
local Object3 = createObject ( 2930, 1558.2998046875, -1637.69921875, -78.400001525879, 0, 0, 90 ) 
local Marker3 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject3 ( player ) 
    if isElementWithinMarker ( player, Marker3 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open3 then 
                moveObject ( Object3, 1500, 1556.5999755859, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object3, 1500, 1558.2998046875, -1637.69921875, -78.400001525879 ) 
            end 
            Open3 = not Open3 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject3 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject3 ) 
    end 
) 
  
  
  
Team = "Team" 
local Object4 = createObject ( 2930, 1554.7998046875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker4 = createMarker ( 1554.8572998047, -1637.2880859375, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject1 ( player ) 
    if isElementWithinMarker ( player, Marker1 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open1 then 
                moveObject ( Object4, 1500, 1553.3000488281, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object4, 1500, 1554.7998046875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open1 = not Open1 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject1 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject1 ) 
    end 
) 
  
  
  
  
local Object5 = createObject ( 2930, 1551.5, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker5 = createMarker ( 1551.578125, -1637.4434814453, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject2 ( player ) 
    if isElementWithinMarker ( player, Marker2 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open2 then 
                moveObject ( Object5, 1500, 1549.8000488281, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object5, 1500, 1551.5, -1637.7998046875, -78.400001525879 ) 
            end 
            Open2 = not Open2 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject2 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject2 ) 
    end 
) 
  
  
  
  
local Object6 = createObject ( 2930, 1548.19921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker6 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject3 ( player ) 
    if isElementWithinMarker ( player, Marker3 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open3 then 
                moveObject ( Object6, 1500, 1546.5999755859, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object6, 1500, 1548.19921875, -1637.3411865234, -78.400001525879 ) 
            end 
            Open3 = not Open3 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject3 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject3 ) 
    end 
) 

Link to comment

-:الخطأ كان

  • function OpenObject1
  • function OpenObject2
  • function OpenObject3

ثاني عشان كذا تلخبط الكود function مثل اسم functionالخطأ انك كنت حاط اسم الـ

-:الخطأ الثاني انك ما غيرت في

  • if not Open1 then & Open1 = not Open1
  • if not Open2 then & Open2 = not Open2
  • if not Open3 then & Open3 = not Open3

خلاصة الموضوع الأخطاء كانت في المتغيرات كانت متشابها مع المتغيرات الثانيه

-:عشان كذا تلخبط المود.. التعديل تحت

Team = "Team" 
local Object1 = createObject ( 2930, 1565.099609375, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker1 = createMarker ( 1565.1639404297, -1637.4421386719, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject1 ( player ) 
    if isElementWithinMarker ( player, Marker1 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open1 then 
                moveObject ( Object1, 1500, 1563.4000244141, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object1, 1500, 1565.099609375, -1637.7998046875, -78.400001525879 ) 
            end 
            Open1 = not Open1 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject1 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject1 ) 
    end 
) 
  
  
  
  
local Object2 = createObject ( 2930, 1561.69921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker2 = createMarker ( 1561.861328125, -1637.4370117188, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject2 ( player ) 
    if isElementWithinMarker ( player, Marker2 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open2 then 
                moveObject ( Object2, 1500, 1560, -1637.7998046875, -78.400001525879 ) 
            else 
                moveObject ( Object2, 1500, 1561.69921875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open2 = not Open2 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject2 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject2 ) 
    end 
) 
  
  
  
  
local Object3 = createObject ( 2930, 1558.2998046875, -1637.69921875, -78.400001525879, 0, 0, 90 ) 
local Marker3 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject3 ( player ) 
    if isElementWithinMarker ( player, Marker3 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open3 then 
                moveObject ( Object3, 1500, 1556.5999755859, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object3, 1500, 1558.2998046875, -1637.69921875, -78.400001525879 ) 
            end 
            Open3 = not Open3 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject3 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject3 ) 
    end 
) 
  
  
  
local Object4 = createObject ( 2930, 1554.7998046875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker4 = createMarker ( 1554.8572998047, -1637.2880859375, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject4 ( player ) 
    if isElementWithinMarker ( player, Marker4 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open4 then 
                moveObject ( Object4, 1500, 1553.3000488281, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object4, 1500, 1554.7998046875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open4 = not Open4 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject4 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject4 ) 
    end 
) 
  
  
  
  
local Object5 = createObject ( 2930, 1551.5, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker5 = createMarker ( 1551.578125, -1637.4434814453, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject5 ( player ) 
    if isElementWithinMarker ( player, Marker5 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open5 then 
                moveObject ( Object5, 1500, 1549.8000488281, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object5, 1500, 1551.5, -1637.7998046875, -78.400001525879 ) 
            end 
            Open5 = not Open5 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject5 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject5 ) 
    end 
) 
  
  
  
  
local Object6 = createObject ( 2930, 1548.19921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker6 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject6 ( player ) 
    if isElementWithinMarker ( player, Marker6 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open6 then 
                moveObject ( Object6, 1500, 1546.5999755859, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object6, 1500, 1548.19921875, -1637.3411865234, -78.400001525879 ) 
            end 
            Open6 = not Open6 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject6 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject6 ) 
    end 
) 
Link to comment
-:الخطأ كان
  • function OpenObject1
  • function OpenObject2
  • function OpenObject3

ثاني عشان كذا تلخبط الكود function مثل اسم functionالخطأ انك كنت حاط اسم الـ

-:الخطأ الثاني انك ما غيرت في

  • if not Open1 then & Open1 = not Open1
  • if not Open2 then & Open2 = not Open2
  • if not Open3 then & Open3 = not Open3

خلاصة الموضوع الأخطاء كانت في المتغيرات كانت متشابها مع المتغيرات الثانيه

-:عشان كذا تلخبط المود.. التعديل تحت

Team = "Team" 
local Object1 = createObject ( 2930, 1565.099609375, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker1 = createMarker ( 1565.1639404297, -1637.4421386719, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject1 ( player ) 
    if isElementWithinMarker ( player, Marker1 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open1 then 
                moveObject ( Object1, 1500, 1563.4000244141, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object1, 1500, 1565.099609375, -1637.7998046875, -78.400001525879 ) 
            end 
            Open1 = not Open1 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject1 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject1 ) 
    end 
) 
  
  
  
  
local Object2 = createObject ( 2930, 1561.69921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker2 = createMarker ( 1561.861328125, -1637.4370117188, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject2 ( player ) 
    if isElementWithinMarker ( player, Marker2 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open2 then 
                moveObject ( Object2, 1500, 1560, -1637.7998046875, -78.400001525879 ) 
            else 
                moveObject ( Object2, 1500, 1561.69921875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open2 = not Open2 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject2 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject2 ) 
    end 
) 
  
  
  
  
local Object3 = createObject ( 2930, 1558.2998046875, -1637.69921875, -78.400001525879, 0, 0, 90 ) 
local Marker3 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject3 ( player ) 
    if isElementWithinMarker ( player, Marker3 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open3 then 
                moveObject ( Object3, 1500, 1556.5999755859, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object3, 1500, 1558.2998046875, -1637.69921875, -78.400001525879 ) 
            end 
            Open3 = not Open3 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject3 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject3 ) 
    end 
) 
  
  
  
local Object4 = createObject ( 2930, 1554.7998046875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker4 = createMarker ( 1554.8572998047, -1637.2880859375, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject4 ( player ) 
    if isElementWithinMarker ( player, Marker4 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open4 then 
                moveObject ( Object4, 1500, 1553.3000488281, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object4, 1500, 1554.7998046875, -1637.7998046875, -78.400001525879 ) 
            end 
            Open4 = not Open4 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject4 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject4 ) 
    end 
) 
  
  
  
  
local Object5 = createObject ( 2930, 1551.5, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker5 = createMarker ( 1551.578125, -1637.4434814453, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject5 ( player ) 
    if isElementWithinMarker ( player, Marker5 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open5 then 
                moveObject ( Object5, 1500, 1549.8000488281, -1637.8000488281, -78.400001525879 ) 
            else 
                moveObject ( Object5, 1500, 1551.5, -1637.7998046875, -78.400001525879 ) 
            end 
            Open5 = not Open5 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject5 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject5 ) 
    end 
) 
  
  
  
  
local Object6 = createObject ( 2930, 1548.19921875, -1637.7998046875, -78.400001525879, 0, 0, 90 ) 
local Marker6 = createMarker ( 1558.4349365234, -1637.3411865234, -80.043746948242-1, "cylinder", 2, 0, 0, 0, 0 ) 
  
function OpenObject6 ( player ) 
    if isElementWithinMarker ( player, Marker6 ) then 
        if ( getTeamName( getPlayerTeam( player ) ) == Team ) then 
            if not Open6 then 
                moveObject ( Object6, 1500, 1546.5999755859, -1637.9000244141, -78.400001525879 ) 
            else 
                moveObject ( Object6, 1500, 1548.19921875, -1637.3411865234, -78.400001525879 ) 
            end 
            Open6 = not Open6 
        else 
            outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true ) 
        end 
    end 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, v in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( v, "tab", "down", OpenObject6 ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "tab", "down", OpenObject6 ) 
    end 
) 

اها صحيح عدلت الارقام و الارقام الثانيه مع عدلتها

م قصرت ي بعدهم و الحين راح اضبط الباقي بنفسي لا هنت ي معلمممم

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...