Jump to content

طلب كود


Recommended Posts

-- Server Side # 
local x, y, z = 0, 0, 0 -- إحداثيات البوابة 
local teamName = "اسم التيم" -- x اسم التيم المسموح له بفتح البوابة 
local Object = createObject ( 980, x, y, z ) 
local Marker = createMarker ( x, y, z, "cylinder", 5, 0, 0, 0, 0 ) 
  
function countPlayersInMarker ( marker ) 
    local players = 0 
    if marker and getElementType(marker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,marker) then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            local team = getPlayerTeam ( theElm ) 
            if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 1500, x, y, z + 5 ) 
            end 
        else 
            if ( countPlayersInMarker ( Marker ) == 0 ) then 
                moveObject ( Object, 1500, x, y, z ) 
            end 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, MoveObject ) 
addEventHandler ( "onMarkerLeave", Marker, MoveObject ) 
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then 
            moveObject ( Object, 1500, x, y, z ) 
        end 
    end 
) 

. عوض مكان المتغيرات في السطر الثاني والثالث فقط والباقي يتعدل تلقائياً بالكود **

Link to comment

اخي شوف المشكلة

بطلع بس ما بترجعلما اطلع من الماركر

local x, y, z = 1544.69921875,-1630.7998046875,13.300000190735 
local teamName = "Police"  
local Object = createObject ( 968, 1544.69921875,-1630.7998046875,13.300000190735,0,90,90) 
local Marker = createMarker ( x, y, z, "cylinder", 5,255,255,50) 
  
function countPlayersInMarker ( marker ) 
    local players = 0,9 
    if marker and getElementType(marker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,marker) then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            local team = getPlayerTeam ( theElm ) 
            if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 2000, 544.69921875,-1630.7998046875,13.300000190735,0,0,90) 
            end 
        else 
            if ( countPlayersInMarker ( Marker ) == 0 ) then 
                moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90) 
            end 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, MoveObject ) 
addEventHandler ( "onMarkerLeave", Marker, MoveObject ) 
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then 
            moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90 ) 
        end 
    end 
) 

Link to comment
اخي شوف المشكلة

بطلع بس ما بترجعلما اطلع من الماركر

local x, y, z = 1544.69921875,-1630.7998046875,13.300000190735 
local teamName = "Police"  
local Object = createObject ( 968, 1544.69921875,-1630.7998046875,13.300000190735,0,90,90) 
local Marker = createMarker ( x, y, z, "cylinder", 5,255,255,50) 
  
function countPlayersInMarker ( marker ) 
    local players = 0,9 
    if marker and getElementType(marker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,marker) then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            local team = getPlayerTeam ( theElm ) 
            if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 2000, 544.69921875,-1630.7998046875,13.300000190735,0,0,90) 
            end 
        else 
            if ( countPlayersInMarker ( Marker ) == 0 ) then 
                moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90) 
            end 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, MoveObject ) 
addEventHandler ( "onMarkerLeave", Marker, MoveObject ) 
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then 
            moveObject ( Object, 2000,544.69921875,-1630.7998046875,13.300000190735,0,90,90 ) 
        end 
    end 
) 

قلت لك لاتعوض مكان شي ثاني غير المتغيرات .. على كل حال خلاص عوضتها لك انا .. انسخه ولاتعدل فيه شي ابد ع طول ركبه

-- Server Side # 
local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 
local teamName = "Police" 
local Object = createObject ( 968, x, y, z, 13.300000190735, 0, 90 ) 
local Marker = createMarker ( x, y, z, "cylinder", 5, 0, 0, 0, 0 ) 
  
function countPlayersInMarker ( marker ) 
    local players = 0 
    if marker and getElementType(marker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,marker) then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            local team = getPlayerTeam ( theElm ) 
            if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 1500, 544.69921875, y, z ) 
            end 
        else 
            if ( countPlayersInMarker ( Marker ) == 0 ) then 
                moveObject ( Object, 1500, x, y, z ) 
            end 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, MoveObject ) 
addEventHandler ( "onMarkerLeave", Marker, MoveObject ) 
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then 
            moveObject ( Object, 1500, x, y, z ) 
        end 
    end 
) 

Link to comment
اخي ما زبط ادخل و شوف هاي العصاي يلي بتكون عند الشرطة عند المركزجرب شغل مود و شوف كيف يجي

!!! ياخي انت مفروض تضبط الاحداثيات حق العصا حقتكـ مدري وش هي ! ضل العب بالاحداثيات بعد التحريكـ لين تضبط معكـ .. ولا تبي اسويلكـ الإحداثيات كمان

: ع العموم يمديكـ تعدل احداثيات العصا بعد التحريكـ من سطر رقم 24 الي هو

moveObject ( Object, 1500, 544.69921875, y, z ) 
-- 544.69921875, y, z 
-- هاذي هي الإحداثيات بعد التحريك ^ 

Link to comment
local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 
local teamName = "Police" 
local Object = createObject ( 968, x, y, z, 0, 90, 90 ) 
local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 5, 0, 0, 0, 0 ) 
  
function countPlayersInMarker ( marker ) 
    local players = 0 
    if marker and getElementType(marker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,marker) then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            local team = getPlayerTeam ( theElm ) 
            if ( team ) and ( getTeamName ( team ) == teamName  ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 1500,x, y, z,0,0,90 ) 
            end 
        else 
            if ( countPlayersInMarker ( Marker ) == 0 ) then 
                moveObject ( Object, 1500, x, y, z,0,0,90 ) 
            end 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, MoveObject ) 
addEventHandler ( "onMarkerLeave", Marker, MoveObject ) 
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then 
            moveObject ( Object, 1500, x, y, z,0,0,90 ) 
        end 
    end 
) 

Link to comment

جرب هذا

local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 
local teamName = "Police" 
local Object = createObject ( 968, x, y, z, 0, 90, 90 ) 
local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 5, 0, 0, 0, 0 ) 
  
function countPlayersInMarker ( marker ) 
    local players = 0 
    if marker and getElementType(marker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,marker) then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            local team = getPlayerTeam ( theElm ) 
            if ( team ) and ( getTeamName ( team ) == teamName  ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 1000,x, y, z,0,-90,0 ) 
            end 
        else 
            if ( countPlayersInMarker ( Marker ) == 0 ) then 
                moveObject ( Object, 1000, x, y, z,0,90,0 ) 
            end 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, MoveObject ) 
addEventHandler ( "onMarkerLeave", Marker, MoveObject ) 
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then 
            moveObject ( Object, 1000, x, y, z,0,90,0 ) 
        end 
    end 
) 
  
  

Link to comment

# ججرب ذا ..

local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 
local teamName = "Police" 
local Object = createObject ( 968, x, y, z, 0, 90, 90 ) 
local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 5, 0, 0, 0, 0 ) 
  
function countPlayersInMarker ( marker ) 
    local players = 0 
    if marker and getElementType(marker) == "marker" then 
        for i,player in ipairs(getElementsByType("player")) do 
            if isElementWithinMarker(player,marker) then 
                players = players + 1 
            end 
        end 
    end 
    return players 
end 
  
function MoveObject ( theElm ) 
    if ( getElementType ( theElm ) == "player" ) then 
        if ( eventName == "onMarkerHit" ) then 
            local team = getPlayerTeam ( theElm ) 
            if ( team ) and ( getTeamName ( team ) == teamName ) and ( countPlayersInMarker ( Marker ) <= 1 ) then 
                moveObject ( Object, 1500,x, y, z,0,0,90 ) 
            end 
        else 
            if ( countPlayersInMarker ( Marker ) == 0 ) then 
                moveObject ( Object, 1500, x, y, z,0,0,90 ) 
            end 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", Marker, MoveObject ) 
addEventHandler ( "onMarkerLeave", Marker, MoveObject ) 
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if ( isElementWithinMarker ( source, Marker ) ) and ( countPlayersInMarker ( Marker ) == 0 ) then 
            moveObject ( Object, 1500, x, y, z,0,0,90 ) 
        end 
    end 
) 
Edited by Guest
Link to comment
اخي الكود هلك كلة خربات لانو

1- لما يسوي اوبجكت ما بعدو

2- بفتح يا الكل مو بس يا الشرطة

اذا بلاقي عندك كود تانج

لاني محتاجة كتير و ضروري

وبكون ممنونلك

# 1 - الاحداثيات هي مو مشكلة , انت لأزم تسويها شي شي خطوة خطوة

2- كيف للكل ,؟ , الكود صحيح اشوفه وما فيه شي , تأكد انك بـ اسم التيم اللي فوق ..

Link to comment

جرب ذا

-- Client

local x, y, z = 1544.69921875, -1630.7998046875, 13.300000190735 
local Marker = createMarker ( 1544.32288, -1627.25330, 11.38281, "cylinder", 6, 0, 0, 0, 0 ) 
local Object = createObject ( 968, x, y, z, 0, 90, 90 ) 
  
addEventHandler("onClientMarkerHit",Marker, 
function (player) 
      if    (getTeamName( getPlayerTeam( localPlayer )) == "Police" ) then 
             moveObject ( Object, 1000,x, y, z,0,-90,0 ) 
  end 
end 
)  
    addEventHandler("onClientMarkerLeave",Marker, 
function(player) 
    if  (getTeamName( getPlayerTeam( localPlayer )) == "Police" ) then  
         moveObject ( Object, 1000,x, y, z,0,90,0 )  
  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...