Jump to content

طلب كود


Recommended Posts

السلام عليكم ورحمة الله وبركاته

ابي لو سمحتم كود لاهنتم

والكود هو

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

لقروب وليس تيم

(يعني مثل قروباآت حرب العصابات(والله لااقصد النشر

وشكرا

Link to comment
local Object = createObject ( 980, 1270.5, -1650, 16, 0, 0 ,90 ) 
local Marker = createMarker ( 1272.3994140625, -1650.7998046875, 10.800000190735, 'cylinder', 18, 0, 0, 0, 0 ) 
open = false 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if getElementData(player,"Group") == "KOL" then 
            if not Open then 
                    moveObject ( Object, 1500, 1270.5, -1650, 8.1 ) 
            else 
                moveObject ( Object, 1500, 1270.5, -1650, 16 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( '* You must be 'KOL' !', 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 ) 
  

Link to comment
local Object = createObject ( 980, 1270.5, -1650, 16, 0, 0 ,90 ) 
local Marker = createMarker ( 1272.3994140625, -1650.7998046875, 10.800000190735, 'cylinder', 18, 0, 0, 0, 0 ) 
open = false 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if getElementData(player,"Group") == "KOL" then 
            if not Open then 
                    moveObject ( Object, 1500, 1270.5, -1650, 8.1 ) 
            else 
                moveObject ( Object, 1500, 1270.5, -1650, 16 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( '* You must be 'KOL' !', 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 ) 
  

هذي تفتح بزر ... يمكن هو يبغى لما يتقرب اللاعب .. ؟ :|

Link to comment
local Object = createObject ( 980, 1270.5, -1650, 16, 0, 0 ,90 ) 
local Marker = createMarker ( 1272.3994140625, -1650.7998046875, 10.800000190735, 'cylinder', 18, 0, 0, 0, 0 ) 
open = false 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if getElementData(player,"Group") == "KOL" then 
            if not Open then 
                    moveObject ( Object, 1500, 1270.5, -1650, 8.1 ) 
            else 
                moveObject ( Object, 1500, 1270.5, -1650, 16 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( '* You must be 'KOL' !', 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 ) 
  

هذي تفتح بزر ... يمكن هو يبغى لما يتقرب اللاعب .. ؟ :|

يعدلها بنفسه

Link to comment

لم تتم التجربة

addEventHandler ( 'onResourceStart', resourceRoot, 
function ( thePlayer ) 
           local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
         local x, y, z = getElementPosition ( thePlayer ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "GroupName" ) ) then 
                     if not Open then 
               moveObject ( objectName, 1500, x, y, z ) 
                
                        end  
                 end 
        end  
    ) 

مع اني ما افهم كثير في ذي السوالف حقت تحريك الاوجبكت و الاسل .. آلخ

Link to comment
لم تتم التجربة
addEventHandler ( 'onResourceStart', resourceRoot, 
function ( thePlayer ) 
           local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
         local x, y, z = getElementPosition ( thePlayer ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "GroupName" ) ) then 
                     if not Open then 
               moveObject ( objectName, 1500, x, y, z ) 
                
                        end  
                 end 
        end  
    ) 

مع اني ما افهم كثير في ذي السوالف حقت تحريك الاوجبكت و الاسل .. آلخ

خربطة تآيمم .. :mrgreen:

Link to comment
لم تتم التجربة
addEventHandler ( 'onResourceStart', resourceRoot, 
function ( thePlayer ) 
           local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
         local x, y, z = getElementPosition ( thePlayer ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "GroupName" ) ) then 
                     if not Open then 
               moveObject ( objectName, 1500, x, y, z ) 
                
                        end  
                 end 
        end  
    ) 

مع اني ما افهم كثير في ذي السوالف حقت تحريك الاوجبكت و الاسل .. آلخ

مع الخيل يا شقرا

getAccountName 
getPlayerAccount 
isObjectInACLGroup 
moveObject 

مايقصد قروب ACL -_-

(يعني مثل قروباآت حرب العصابات)

Link to comment
  
createMarker 
createObject 
getTeamName 
getPlayerTeam 
moveObject 
bindKey 
  

قلنا ذكي قالوا عرفنا

لم تتم التجربة
addEventHandler ( 'onResourceStart', resourceRoot, 
function ( thePlayer ) 
           local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
         local x, y, z = getElementPosition ( thePlayer ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "GroupName" ) ) then 
                     if not Open then 
               moveObject ( objectName, 1500, x, y, z ) 
                
                        end  
                 end 
        end  
    ) 

مع اني ما افهم كثير في ذي السوالف حقت تحريك الاوجبكت و الاسل .. آلخ

مع الخيل يا شقرا

getAccountName 
getPlayerAccount 
isObjectInACLGroup 
moveObject 

مايقصد قروب ACL -_-

(يعني مثل قروباآت حرب العصابات)

Link to comment
local Object = createObject ( 980, 1270.5, -1650, 16, 0, 0 ,90 ) 
local Marker = createMarker ( 1272.3994140625, -1650.7998046875, 10.800000190735, 'cylinder', 18, 0, 0, 0, 0 ) 
open = false 
  
function OpenObject ( player ) 
    if isElementWithinMarker ( player, Marker ) then 
        if getElementData(player,"Group") == "KOL" then 
            if not Open then 
                    moveObject ( Object, 1500, 1270.5, -1650, 8.1 ) 
            else 
                moveObject ( Object, 1500, 1270.5, -1650, 16 ) 
            end 
            Open = not Open 
        else 
            outputChatBox ( '* You must be 'KOL' !', 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 ) 
  

Link to comment

كودي أحس فيه أخطاء ذذ

جرب ذا :

local Object = createObject( 980, 1270.5, -1650, 16, 0, 0 ,90 ); 
local Marker = createMarker( 1272.3994140625, -1650.7998046875, 10.800000190735, 'cylinder', 18, 0, 0, 0, 0 ); 
open = false; 
  
function OpenObject ( player ) 
    if isElementWithinMarker( player, Marker ) then 
        if getElementData( player, 'Group') == 'KOL' then 
            if not Open then 
                moveObject( Object, 1500, 1270.5, -1650, 8.1 ); 
            else 
                moveObject( Object, 1500, 1270.5, -1650, 16 ); 
            end 
            Open = not Open; 
        else 
            outputChatBox ( '* You must be \'KOL\' !', player, 200, 0, 0, true ); 
        end 
    end 
end 
  
addEventHandler ( 'onResourceStart', resourceRoot, function ( ) 
    for _, v in ipairs ( getElementsByType ( 'player' ) ) do 
        bindKey ( v, 'tab', 'down', OpenObject, v ); 
    end 
end ); 
  
addEventHandler ( 'onPlayerJoin', root, function ( ) 
    bindKey ( source, 'tab', 'down', OpenObject, source ); 
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...