Jump to content

طلب تعديل كود


mr.ekoo

Recommended Posts

عندي هالكود

checkGateMarker = createMarker ( x, y, z, "corona", 6.0, 0, 0, 255, 0 ) 
  
function createGate () 
    gatePolice1 = createObject ( 980, x, y, z, 0, 0, 90) 
     
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice1, 2000, x, y, z ) 
     
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
  
  
function movingBackPolice ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice1, 2000, x, y, z ) 
     
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice ) 
  

هذي بوابة ويوم تجي جنبها تتحرك

الى ابغاه

تعدلون الكود ووتخلونه

يوم اضغط زر تاب

واكون من فريق معين يفتح لي

ياريت تعدلونه

Edited by Guest
Link to comment

سويت كذا وماصار

checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) 
  
function createGate () 
    gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function bindTheKeys ( player, commandName ) 
  bindKey ( player, "Tab", "down", gateCheckingTeam )   -- bind the player's F1 down key 
end 
  
addCommandHandler ( "bindme", bindTheKeys ) 
  

Link to comment

يمكن كذا :roll:

  
Local checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) 
  
function createGate () 
    gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function bindTheKeys ( player, commandName ) 
  bindKey ( player, "Tab", "down", gateCheckingTeam )   -- bind the player's F1 down key 
end 
  
addCommandHandler ( "bindme", bindTheKeys ) 

Link to comment
سويت كذا وماصار
checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) 
  
function createGate () 
    gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function bindTheKeys ( player, commandName ) 
  bindKey ( player, "Tab", "down", gateCheckingTeam )   -- bind the player's F1 down key 
end 
  
addCommandHandler ( "bindme", bindTheKeys ) 
  

يمكن كذا :roll:
  
Local checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) 
  
function createGate () 
    gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) 
  
function gateCheckingTeam ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) 
end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function bindTheKeys ( player, commandName ) 
  bindKey ( player, "Tab", "down", gateCheckingTeam )   -- bind the player's F1 down key 
end 
  
addCommandHandler ( "bindme", bindTheKeys ) 

ذذ انت ماستخدمت @

getPlayerTeam 
getTeamName 

كيف تبية يفتح بـ تيم ؟ وانت اصلا ماسويتة ؟! ذذ

Link to comment
addEventHandler("onResourceStart", resourceRoot, 
function() 
    gatePolice1 = createObject(980, 1544.9, -1627.9, 15.1, 0, 0, 90) 
    checkGateMarker = createMarker(1544.9, -1627.9, 15.1, "corona", 6.0, 0, 0, 255, 0) 
    for i, player in ipairs (getElementsByType("player")) do 
        bindTheKeys(player) 
    end 
end) 
  
addEventHandler("onPlayerJoin", root, 
function() 
    bindTheKeys(source) 
end) 
  
function bindTheKeys(player) 
    bindKey(player, "Tab", "down", gateCheckingTeam) 
end 
  
function gateCheckingTeam(player) 
    local Team = getPlayerTeam(player) 
    local TeamName = Team and getTeamName(Team) or "" 
    if isElementWithinMarker(player, checkGateMarker) and (TeamName == "أسم التيم هنا") then 
        moveObject(gatePolice1, 2000, 1544.9, -1627.9, 9.2) 
    end 
end 

Link to comment

مانفع الكود اخوي ؟

اضرب تاب مايتحرك

+

انت حذفت بعض السطور

مثل

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

شوف انا عدلته شوف صح او لا

     addEventHandler("onResourceStart", resourceRoot, 
    function() 
        gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) 
        checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) 
        for i, player in ipairs (getElementsByType("player")) do 
            bindTheKeys(player) 
        end 
    end) 
      
    addEventHandler("onPlayerJoin", root, 
    function() 
        bindTheKeys(source) 
    end) 
      
    function bindTheKeys(player) 
        bindKey(player, "Tab", "down", gateCheckingTeam) 
    end 
      
    function gateCheckingTeam(player) 
        local Team = getPlayerTeam(player) 
        local TeamName = Team and getTeamName(Team) or "" 
        if isElementWithinMarker(player, checkGateMarker) and (TeamName == "Police") then 
            moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) 
        end 
    end 
addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) 
  
function movingBackPolice ( thePlayer, matchingDimension ) 
    moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 15.199999809265 ) 
     
end 
addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice ) 

Link to comment

Police تأكد أنك حاطه سيرفر + تأكد أنك في تيم

addEventHandler("onResourceStart", resourceRoot, 
function() 
    gatePolice1 = createObject(980, 1544.9, -1627.9, 15.1, 0, 0, 90) 
    checkGateMarker = createMarker(1544.9, -1627.9, 15.1, "corona", 6.0, 0, 0, 255, 0) 
    for i, player in ipairs (getElementsByType("player")) do 
        bindTheKeys(player) 
    end 
end) 
  
addEventHandler("onPlayerJoin", root, 
function() 
    bindTheKeys(source) 
end) 
  
function bindTheKeys(player) 
    bindKey(player, "Tab", "down", gateCheckingTeam) 
end 
  
function gateCheckingTeam(player) 
    local Team = getPlayerTeam(player) 
    local TeamName = Team and getTeamName(Team) or "" 
    if isElementWithinMarker(player, checkGateMarker) and (TeamName == "Police") then 
        moveObject(gatePolice1, 2000, 1544.9, -1627.9, 9.2) 
    end 
end 
  
addEventHandler("onMarkerLeave", checkGateMarker, 
function(player) 
    if getElementType(player) ~= "player" then return end 
    local Team = getPlayerTeam(player) 
    local TeamName = Team and getTeamName(Team) or "" 
    if (TeamName == "Police") then 
        moveObject(gatePolice1, 2000, 1544.9, -1627.9, 15.1) 
    end 
end) 

Link to comment
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        gatePolice1 = createObject ( 980, 1544.9000244141, -1627.9000244141, 15.199999809265, 0, 0, 90) 
        checkGateMarker = createMarker ( 1544.9000244141, -1627.9000244141, 15.199999809265, "corona", 6.0, 0, 0, 255, 0 ) 
        for _, player in ipairs ( getElementsByType ( "player" ) ) do 
            bindTheKeys ( player ) 
        end 
    end 
) 
          
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindTheKeys ( source ) 
    end 
) 
          
function bindTheKeys ( player ) 
    bindKey ( player, "Tab", "down", gateCheckingTeam ) 
end 
          
open = false 
          
function gateCheckingTeam ( player ) 
    local PlayerTeam = getPlayerTeam ( player ) 
    local PoliceTeam = getTeamFromName ( "Police" ) 
    if isElementWithinMarker ( player, checkGateMarker ) then 
        if PlayerTeam == PoliceTeam then 
            if open == false then 
                moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 9.199999809265 ) 
                open = true 
            else 
                moveObject ( gatePolice1, 2000, 1544.9000244141, -1627.9000244141, 15.199999809265 )     
                open = false 
            end 
        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...