Jump to content

x[ تمت الافاده ]x


Sfa7

Recommended Posts

سلالام عليكم..

شباب بغيت اسوي باب يفتح بـ زر تاب وابيه يفتح لـ قروب كونسل وحاولت وماقدرت يخرب الكود

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

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

لا ابي فقط الكونسل اذا ضغط يفتحله

وبس و يليت بـ اسرع وقت

local object = createObject ( 2963, 298.60000610352, -1616.5, 4870.2001953125, 0, 0, 270.25 ) 
local marker = createMarker ( 298.60000610352, -1616.5, 4870.2001953125, 'cylinder', 4, 0, 0, 0, 0 ) 
local open = false 
  
  
  
function onStart() 
    for i,v in ipairs(getElementsByType("player")) do 
        bindKey (v,"tab","down",openANDcloseFun) 
    end 
end 
addEventHandler ( "onResourceStart",getResourceRootElement(),onStart) 
  
function onJoin( ) 
    bindKey (source,"tab","down",openANDcloseFun) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) 
  
function openANDcloseFun( player ) 
    if ( isElementWithinMarker(player,marker) ) then   
        if ( open ) then 
            moveObject ( object, 1500, 302.29998779297, -1616.4000244141, 4870.2001953125 ) 
        else 
            moveObject ( object, 1500, 298.60000610352, -1616.5, 4870.2001953125 ) 
        end 
        open = not open 
    end 
end 
  
  

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

local accName = getAccountName(getPlayerAccount(player)) 
if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then 

local object = createObject ( 2963, 298.60000610352, -1616.5, 4870.2001953125, 0, 0, 270.25 ) 
local marker = createMarker ( 298.60000610352, -1616.5, 4870.2001953125, 'cylinder', 4, 0, 0, 0, 0 ) 
local open = false 
  
  
  
function onStart() 
    for i,v in ipairs(getElementsByType("player")) do 
        bindKey (v,"tab","down",openANDcloseFun) 
    end 
end 
addEventHandler ( "onResourceStart",getResourceRootElement(),onStart) 
  
function onJoin( ) 
    bindKey (source,"tab","down",openANDcloseFun) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) 
  
function openANDcloseFun( player ) 
local accName = getAccountName(getPlayerAccount(player)) 
if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then 
    if ( isElementWithinMarker(player,marker) ) then   
        if ( open ) then 
            moveObject ( object, 1500, 302.29998779297, -1616.4000244141, 4870.2001953125 ) 
        else 
            moveObject ( object, 1500, 298.60000610352, -1616.5, 4870.2001953125 ) 
        end 
        open = not open 
         end 
    end 
end 
  
  

Link to comment

^ كذآ لو بيسوي شي يجي بالشات , رح يصير لما يضغط تاب وهو بخارج الماركر

يجيه انه لازم يكون كونسل

هو كودكـ صح , لكن يفضل انك تحطها إذا كان بالماركر عشآن لو مسوي زر ثاني بتاب

ما يصير فيه تخربط #

يصصير كذآ

-- Server Side !

local object = createObject ( 2963, 298.60000610352, -1616.5, 4870.2001953125, 0, 0, 270.25 ) 
local marker = createMarker ( 298.60000610352, -1616.5, 4870.2001953125, 'cylinder', 4, 0, 0, 0, 0 ) 
local open = false 
  
  
  
function onStart() 
    for i,v in ipairs(getElementsByType("player")) do 
        bindKey (v,"tab","down",openANDcloseFun) 
    end 
end 
addEventHandler ( "onResourceStart",getResourceRootElement(),onStart) 
  
function onJoin( ) 
    bindKey (source,"tab","down",openANDcloseFun) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) 
  
function openANDcloseFun( player ) 
    if isElementWithinMarker(player,marker) then 
        local accName = getAccountName(getPlayerAccount(player)) 
        if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then 
            if open then 
                moveObject ( object, 1500, 302.29998779297, -1616.4000244141, 4870.2001953125 ) 
            else 
                moveObject ( object, 1500, 298.60000610352, -1616.5, 4870.2001953125 ) 
            end 
            open = not open 
        else 
            outputChatBox ( "* You must be 'Console' !", player, 210, 0, 0, true ) 
        end 
    end 
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...