Jump to content

استفسار بسيط


Recommended Posts

  
  
client ~   
  
  
Opc = true 
  
  
addEventHandler ("onClientGUIClick", root, 
function () 
if source == m then 
   if ( Opc == true ) then 
 triggerServerEvent ( "OpenB", localPlayer ) 
    guiSetText (m,"Close") 
    guiSetProperty(m, "NormalTextColour", "FFFF0000") 
   Opc = false 
else 
 triggerServerEvent ( "CloseB", localPlayer ) 
    guiSetText (m,"Open") 
    guiSetProperty(m, "NormalTextColour", "FF00FF00") 
   Opc = true 
        end 
    end 
end 
) 

  
  
server  ~  
  
TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
addEvent( "OpenB", true ) 
addEventHandler("OpenB", root, 
function () 
moveObject (TheDoor,1000,-536.90002441406,3821.8000488281,5.4000000953674) 
end 
) 
  
addEvent( "CloseB", true ) 
addEventHandler("CloseB", root, 
function () 
moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
end 
) 

Link to comment

اتمني ماتعدل ع كودي هاذا وتجربه بنفسك اذا اشتغل عدل عليه

واذا خرب حاول تكتشف خطأك بنفسك

#Client..

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        m = guiCreateButton(0.42, 0.40, 0.15, 0.08, "Move object", true) 
        guiSetProperty(m, "NormalTextColour", "FFAAAAAA")     
    end 
) 
  
Opc = true 
     
  
addEventHandler ("onClientGUIClick", root, 
    function () 
        if source == m then 
            if ( Opc == true ) then 
                triggerServerEvent ( "OpenB", localPlayer ) 
                guiSetText (m,"Close") 
                guiSetProperty(m, "NormalTextColour", "FFFF0000") 
                Opc = false 
            else 
                triggerServerEvent ( "CloseB", localPlayer ) 
                guiSetText (m,"Open") 
                guiSetProperty(m, "NormalTextColour", "FF00FF00") 
                Opc = true 
            end 
        end 
    end 
    ) 

#Server..

TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
addEvent( "OpenB", true ) 
addEventHandler("OpenB", root, 
function () 
    moveObject (TheDoor,1000,96.699996948242,1924.9999511719,18.89999961853) 
end 
) 
      
addEvent( "CloseB", true ) 
addEventHandler("CloseB", root, 
function () 
    moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
end 
) 
Link to comment

اتمني ماتعدل ع كودي هاذا وتجربه بنفسك اذا اشتغل عدل عليه

واذا خرب حاول تكتشف خطأك بنفسك

#Client..

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        m = guiCreateButton(0.42, 0.40, 0.15, 0.08, "Move object", true) 
        guiSetProperty(m, "NormalTextColour", "FFAAAAAA")     
    end 
) 
  
Opc = true 
     
  
addEventHandler ("onClientGUIClick", root, 
    function () 
        if source == m then 
            if ( Opc == true ) then 
                triggerServerEvent ( "OpenB", localPlayer ) 
                guiSetText (m,"Close") 
                guiSetProperty(m, "NormalTextColour", "FFFF0000") 
                Opc = false 
            else 
                triggerServerEvent ( "CloseB", localPlayer ) 
                guiSetText (m,"Open") 
                guiSetProperty(m, "NormalTextColour", "FF00FF00") 
                Opc = true 
            end 
        end 
    end 
    ) 

#Server..

TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
addEvent( "OpenB", true ) 
addEventHandler("OpenB", root, 
function () 
    moveObject (TheDoor,1000,96.699996948242,1924.9999511719,18.89999961853) 
end 
) 
      
addEvent( "CloseB", true ) 
addEventHandler("CloseB", root, 
function () 
    moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
end 
) 

نصور يمكن هو قصده مو زر gui

يمكن زر من الكيبورد

وكودي مجربنه 100% شغال

Link to comment

اتمني ماتعدل ع كودي هاذا وتجربه بنفسك اذا اشتغل عدل عليه

واذا خرب حاول تكتشف خطأك بنفسك

#Client..

addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        m = guiCreateButton(0.42, 0.40, 0.15, 0.08, "Move object", true) 
        guiSetProperty(m, "NormalTextColour", "FFAAAAAA")     
    end 
) 
  
Opc = true 
     
  
addEventHandler ("onClientGUIClick", root, 
    function () 
        if source == m then 
            if ( Opc == true ) then 
                triggerServerEvent ( "OpenB", localPlayer ) 
                guiSetText (m,"Close") 
                guiSetProperty(m, "NormalTextColour", "FFFF0000") 
                Opc = false 
            else 
                triggerServerEvent ( "CloseB", localPlayer ) 
                guiSetText (m,"Open") 
                guiSetProperty(m, "NormalTextColour", "FF00FF00") 
                Opc = true 
            end 
        end 
    end 
    ) 

#Server..

TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
addEvent( "OpenB", true ) 
addEventHandler("OpenB", root, 
function () 
    moveObject (TheDoor,1000,96.699996948242,1924.9999511719,18.89999961853) 
end 
) 
      
addEvent( "CloseB", true ) 
addEventHandler("CloseB", root, 
function () 
    moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
end 
) 

نصور يمكن هو قصده مو زر gui

يمكن زر من الكيبورد

وكودي مجربنه 100% شغال

يخي سويت مثل كودك وكل شي وركبت البوابة وظهرت وكل شي يخي بس باقي حرف الـ

m

اطغطه م يجي شي وش الحل !! ؟

يمديك تسويه لي ع شكل مود وترسله ؟ !!

Link to comment

-- # Client Side : 
  
TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
 Door = false 
  
bindKey ( "m", "down", function () 
    if ( Door == false ) then 
    moveObject (TheDoor,1000,96.699996948242,1924.9999511719,18.89999961853) 
    Door = true 
      else 
     moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
     Door = false 
         end 
    end 
 ) 
Edited by Guest
Link to comment
-- # Server Side : 
  
TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
 Door = false 
  
bindKey ( "m", "down", function () 
    if ( Door == false ) then 
    moveObject (TheDoor,1000,96.699996948242,1924.9999511719,18.89999961853) 
    Door = true 
      else 
     moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
     Door = false 
         end 
    end 
 ) 

tK9KcQY.png

http://i.imgur.com/tK9KcQY.png

Link to comment

صحيح عند الي ضغط الزر لآكن هو ما قآل يبيها لـ من تتحرك الي ضغط أو الكل؟

اذا يبيها للكل = ))

-- # Server Side : 
  
TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
 Door = false 
  
 function move () 
    if ( Door == false ) then 
    moveObject (TheDoor,1000,96.699996948242,1924.9999511719,18.89999961853) 
    Door = true 
      else 
     moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
     Door = false 
       end 
 end 
  
 addEventHandler ( "onResourceStart", resourceRoot, function ( ) 
      for _, player in ipairs ( getElementsByType ( "player" ) ) do 
      bindKey (player, "m", "down", move ) 
            end 
        end 
    ) 
      
addEventHandler ( "onPlayerJoin", root, function ( ) 
     bindKey ( source, "m", "down", move ) 
     end 
  ) 
Link to comment
مشششكور خوي بس

استفسار بسيط الحين هو يفتح ع اليمين كيف اخليه لفوق + يعطيك العافيةة ي سفاح <3

الله يعآفيككـ ذذذذ

آذآ تبيها فوق غير الآحدآثيات

EDIT :

هذآ هو سويته لككـ فوق ذذذذ

-- # Server Side : 
  
TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0) 
  
 Door = false 
  
 function move () 
    if ( Door == false ) then 
    moveObject (TheDoor,1000,96.699996948242,1920.9999111719,22.89999961853) 
    Door = true 
      else 
     moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853) 
     Door = false 
       end 
 end 
  
 addEventHandler ( "onResourceStart", resourceRoot, function ( ) 
      for _, player in ipairs ( getElementsByType ( "player" ) ) do 
      bindKey (player, "m", "down", move ) 
            end 
        end 
    ) 
      
addEventHandler ( "onPlayerJoin", root, function ( ) 
     bindKey ( source, "m", "down", move ) 
     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...