Jump to content

تعديل كود بسيط جدا جدا


Recommended Posts

السلام عليكم معي اكواد فتح بوابة حين يتم تابة كلمة ب اف 8

ممكن تقلولي كيف اخليها لما يقرب من الباب و يكبس زر يفتح ؟

تفضلو الاكواد

gate = createObject(971,2481.1999511719,-1722.1999511719,16.10000038147,0,0,0) 
  
function opendoor() 
       moveObject (gate, 5000, 2481.1999511719, -1722.1999511719, 16.10000038147  ) 
end 
addCommandHandler("close1", opendoor)  -- زر اغلاق الباب الاول 
function closedoor() 
       moveObject (gate, 5000, 2481.1999511719, -1722.1999511719, 22.700000762939 ) 
end 
addCommandHandler("open1", closedoor) -- زر فتح الباب الاول 
---------------------------------------------------------------- 
gate2 = createObject(971,2420.8999023438,-1659.0999755859,16,0,0,90) 
  
function opendoor() 
       moveObject (gate2, 5000, 2420.8999023438, -1659.0999755859, 16  ) 
end 
addCommandHandler("close2", opendoor)  --زر اغلاق الباب الثاني 
function closedoor() 
       moveObject (gate2, 5000, 2420.8999023438, -1659.0999755859, 21.10000038147 ) 
end 
addCommandHandler("open2", closedoor)  -- زر فتح الباب الثاني 
  

Link to comment

هذا كود يفتح لقروب ادمن ويفتح ( بزر ) عاد انت عدل عليه مثل ماتبي ..

جرب ,

 

local Object = createObject ( 8172 ,136.19999694824 ,1942.4000244141 ,21.10000038147 ,0 ,0 ,0 ) 
local Marker = createMarker ( 141.60000610352 ,1946.8000488281 ,18.10000038147 ,"cylinder",5 , 170 ) 
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        local accName = getAccountName ( getPlayerAccount ( player ) ) 
        if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
                moveObject ( Object,140.19999694824 ,198.4000244141 ,15.10000038147 ) 
            else 
                moveObject ( Object,136.19999694824 ,1942.4000244141 ,21.10000038147 ) 
                end 
        else 
            outputChatBox ( "* You must be 'Admin' !", player, 200, 0, 0, true ) 
    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
local time = 3000 
local gate = createObject (971,2481.1999511719,-1722.1999511719,16.10000038147,0,0,0) 
local marker = createMarker ( 2480.1999511719,-1722.1999511719,11.10000038147,"cylinder", 6, 255, 255, 255, 0 ) 
  
---- فتح البوابه 
addEventHandler("onMarkerHit", marker, 
function (hitPlayer, matchingDimension) 
    moveObject(gate, time ,2481.1999511719,-1722.1999511719,21.10000038147,0,0,0, easing) 
end 
) 
  
---- اغلاق البوابه 
addEventHandler("onMarkerLeave", marker, 
function () 
    moveObject(gate, time ,2481.1999511719,-1722.1999511719,16.10000038147,0,0,0, easing) 
end 
) 

آي واحد يقرب من البوابه تفتح

وإذ بععد عنها تتقفل ..

#

Link to comment
local time = 3000 
local gate = createObject (971,2481.1999511719,-1722.1999511719,16.10000038147,0,0,0) 
local marker = createMarker ( 2480.1999511719,-1722.1999511719,11.10000038147,"cylinder", 6, 255, 255, 255, 0 ) 
  
---- فتح البوابه 
addEventHandler("onMarkerHit", marker, 
function (hitPlayer, matchingDimension) 
    moveObject(gate, time ,2481.1999511719,-1722.1999511719,21.10000038147,0,0,0, easing) 
end 
) 
  
---- اغلاق البوابه 
addEventHandler("onMarkerLeave", marker, 
function () 
    moveObject(gate, time ,2481.1999511719,-1722.1999511719,16.10000038147,0,0,0, easing) 
end 
) 

آي واحد يقرب من البوابه تفتح

وإذ بععد عنها تتقفل ..

#

السلام عليكم معي اكواد فتح بوابة حين يتم تابة كلمة ب اف 8

ممكن تقلولي كيف اخليها لما يقرب من الباب و يكبس زر يفتح ؟

هذا كود يفتح لقروب ادمن ويفتح ( بزر ) عاد انت عدل عليه مثل ماتبي ..

جرب ,
local Object = createObject ( 8172 ,136.19999694824 ,1942.4000244141 ,21.10000038147 ,0 ,0 ,0 ) 
local Marker = createMarker ( 141.60000610352 ,1946.8000488281 ,18.10000038147 ,"cylinder",5 , 170 ) 
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        local accName = getAccountName ( getPlayerAccount ( player ) ) 
        if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
                moveObject ( Object,140.19999694824 ,198.4000244141 ,15.10000038147 ) 
            else 
                moveObject ( Object,136.19999694824 ,1942.4000244141 ,21.10000038147 ) 
                end 
        else 
            outputChatBox ( "* You must be 'Admin' !", player, 200, 0, 0, true ) 
    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

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