Jump to content

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


charaf12

Recommended Posts

السلام عليكم

ابي كود البوابة تفتح بزر تاب لتيم الشرطة

+القديم الي اعطانتني يا كنق خربان لما اعمل بوابه ثاني تخرب الاولى

: الكود الي عطيتكـ ياهـ مبرمَج على أوبجكت واحد إذا تبيه على أكثر من أوبجكت سويه على نظام الجداول، ولحسن حظكـ أنه فيه موضوع مكرر ونفس طلبكـ

https://forum.multitheftauto.com/viewtopic.php?f=160&t=56587#p546370

ذذ فية حرف زايد عندي يصير كذا :

  
local  Data = { 
{1560, -1664.9000244141, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1560, -1664.9000244141, 549.79998779297,2500,1500}, 
{1564.5999755859, -1661.8000488281, 549.40002441406, 'cylinder', 3.5, 0, 0, 0, 0,971, 1564.5999755859, -1661.8000488281, 549.40002441406,2500,1500}, 
{1575.3000488281, -1658, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1575.3000488281, -1658, 549.79998779297,2500,1500}, 
{1575.3000488281, -1653.3000488281, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1575.3000488281, -1653.3000488281, 549.79998779297,2500,1500}, 
{1575.3000488281, -1648.5, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1575.3000488281, -1648.5, 549.79998779297,2500,1500}, 
{1575.3000488281, -1643.8000488281, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0, 2930, 1575.3000488281, -1643.8000488281, 549,79998779297,2500,1500}, 
{1575.3000488281, -1639, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1575.3000488281, -1639, 549, 79998779297,2500,1500}, 
{1575.3000488281, -1633.8000488281, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1575.3000488281, -1633.8000488281, 549.79998779297,2500,1500}, 
{1569.099609375, -1632.5, 550.20001220703, 'cylinder', 3.5, 0, 0, 0, 0,971, 1569.099609375, -1632.5, 550.20001220703,2500,1500}, 
{1559.099609375, -1633.69921875, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559.099609375, -1633.69921875, 549.79998779297,2500,1500}, 
{1559, -1638.9000244141, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559, -1638.9000244141, 549,79998779297,2500,1500}, 
{1559, -1643.6999511719, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559, -1643.6999511719, 549.79998779297,2500,1500}, 
{1559.0999755859, -1648.4000244141, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559.0999755859, -1648.4000244141, 549.79998779297,2500,1500}, 
{1559, -1653.1999511719, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559, -1653.1999511719, 549.79998779297,2500,1500}, 
{1575.3000488281, -1648.5, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1575.3000488281, -1648.5, 549.79998779297,2500,1500}, 
{1559.0999755859, -1633.6999511719, 556.09997558594, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559.0999755859, -1633.6999511719, 556.09997558594,2500,1500}, 
{1575.3000488281, -1648.5, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559.0999755859, -1638.9000244141, 556.09997558594,2500,1500}, 
{1575.3000488281, -1648.5, 549.79998779297, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1559.0999755859, -1638.9000244141, 556.09997558594,2500,1500}, 
{1559.0999755859, -1638.9000244141, 556.09997558594, 'cylinder', 3.5, 0, 0, 0, 0,2930, 1575.3000488281, -1648.5, 549.79998779297,2500,1500} 
} 
  
marker = {} 
object = {} 
  
addEventHandler("onResourceStart",resourceRoot, 
    function ( ) 
        for k,v in ipairs( Data ) do 
            marker[k] = createMarker(v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9]); 
            setElementData(marker[k],"num",k) 
            object[k] = createObject(v[10],v[11],v[12],v[13]); 
        end 
        for _, player in ipairs ( getElementsByType ( 'player' ) ) do 
            bindKey ( player, 'tab', 'down', AlBab ) 
        end     
    end  
) 
  
local move = {} 
function AlBab ( plr ) 
    if (getPlayerTeam(plr) and getTeamName(getPlayerTeam(plr)) == "Police") then 
        local getMarker, num = getMarker( plr ) 
        if getMarker then 
            if not move[getMarker] then 
                moveObject (object[num],Data[num][14],Data[num][11] +3,Data[num][12],Data[num][13]); 
                move[getMarker] = true 
            else 
                moveObject (object[num],Data[num][15],Data[num][11],Data[num][12],Data[num][13]); 
                move[getMarker] = nil 
            end; 
        end; 
    end; 
end 
    
      
addEventHandler( 'onPlayerJoin', root, 
    function ( ) 
        bindKey ( source, 'tab', 'down', AlBab ) 
    end 
) 
  
function getMarker( plr ) 
  for i, v in ipairs( marker ) do 
    if isElementWithinMarker(plr, v) then 
      return v, tonumber( getElementData(v,"num") ) 
    end 
  end 
    return false,outputChatBox( "* يجب ان تكون في ماركر", plr, 255, 255, 0 ) 
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...