Jump to content

مشكلة في الكود ما يشتغل


Recommended Posts

انا الحين صممت مقر لكن الشمكلة ان الباب ما يتحرك ذا

الأقواد الي استعملتها

local Object = createObject ( ID,object (airportgate) (2) x,136.19999694824 y,1942.4000244141 z,21.10000038147 rx,0 ry,0 rz,0 ) 
local Marker = createMarker ( x,141.60000610352 y,1946.8000488281 z,18.10000038147 "cylinder", size,2 0, 0, 0, 0 ) 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        local accName = getAccountName ( getPlayerAccount ( player ) ) 
        if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
            if not Open then 
                moveObject ( Object, 1500, moveX,136.19999694824 moveY,1942.4000244141 moveZ,26.10000038147 ) 
            else 
                moveObject ( Object, 1500, x,136.19999694824 y,1942.4000244141 z,21.10000038147 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( "* You must be 'Admin' !", 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 
) 

و ملف متا

    type="map" version="1.0.0">
    "army2.map" dimension="0">
    

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

مشكور اخوي جربتو ونفع 100%

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