Jump to content

X[طلب]X


Recommended Posts

السلام عليكم عندي مشكلة ف مود فتح ابواب السيارة 

لماتاتي الي لوحة فتح ابواب ماينفتح لي ابواب سيارة ملاحطه قبل ماتقولي شئ رجاء جرب مود عندك

---client

GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Label = {}
GUIEditor_Scrollbar = {}

local x,y = guiGetScreenSize()
Car = guiCreateWindow(x/2-136, y/2-144,272,288,"!! ~ [ مود فتح الابواب ] - #",false)
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,Car)
GUIEditor_Label[1] = guiCreateLabel(95,30,135,15,"=[ الكبوت ]=",false,Car)
guiSetFont(GUIEditor_Label[1],"default-bold-small")
GUIEditor_Label[2] = guiCreateLabel(96,72,135,15,"=[ الباب 1 ]=",false,Car)
guiSetFont(GUIEditor_Label[2],"default-bold-small")
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,Car)
GUIEditor_Label[3] = guiCreateLabel(96,112,135,15,"=[ الباب 2 ]=",false,Car)
guiSetFont(GUIEditor_Label[3],"default-bold-small")
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,Car)
GUIEditor_Label[4] = guiCreateLabel(96,151,135,15,"=[ الباب 3 ]=",false,Car)
guiSetFont(GUIEditor_Label[4],"default-bold-small")
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,Car)
GUIEditor_Label[5] = guiCreateLabel(96,189,135,15,"=[ الباب 4 ]=",false,Car)
guiSetFont(GUIEditor_Label[5],"default-bold-small")
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,Car)
GUIEditor_Label[6] = guiCreateLabel(95,226,135,15,"=[ الشنطه ]=",false,Car)
guiSetFont(GUIEditor_Label[6],"default-bold-small")
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,Car)
GUIEditor_Button[1] = guiCreateButton(23,265,230,15,"[ اغلاق ]",false,Car)
guiSetFont(GUIEditor_Button[1],"default-small")
guiWindowSetSizable ( Car, false )
setElementData(GUIEditor_Scrollbar[1], "Type", 0)
setElementData(GUIEditor_Scrollbar[2], "Type", 2)
setElementData(GUIEditor_Scrollbar[3], "Type", 3)
setElementData(GUIEditor_Scrollbar[4], "Type", 4)
setElementData(GUIEditor_Scrollbar[5], "Type", 5)
setElementData(GUIEditor_Scrollbar[6], "Type", 1)
guiSetVisible(Car, false)
showCursor(false)



function enableVehicleControl()
	if guiGetVisible(Car) == false then
		guiSetVisible(Car, true)
		showCursor(true)
	else
		guiSetVisible(Car, false)
		showCursor(false)
	end
end
bindKey("","down",enableVehicleControl)

function closeButton()
		guiSetVisible(Car, false)
		showCursor(false)
end
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false )

function updateRatio(Scrolled)
	local position = guiScrollBarGetScrollPosition(Scrolled)
	local door = getElementData(Scrolled, "Type")
	triggerServerEvent("moveThis:~", getLocalPlayer(), door, position)
end
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio)
	

---server
Closed = true
Rotation = 0

addEvent("OpenDoor",true)
addEventHandler("OpenDoor",root,function(Id)
 local Vehicle = getPedOccupiedVehicle(source)
 if ( Vehicle ) then
  if ( Closed == true ) then
   if ( isTimer(TimerOpen) ) then 
    killTimer(TimerOpen)
   end
   if ( isTimer(TimerClosed) ) then 
    killTimer(TimerClosed)
   end
   TimerOpen = setTimer(function()
    Rotation = tonumber(Rotation) + tonumber(1)
    setVehicleDoorOpenRatio(Vehicle,tonumber(Id),tonumber(Rotation))
    if ( Rotation >= tonumber(100) ) then
     killTimer(TimerOpen)
    end
   end,1000,0)
   Closed = false
  else
   if ( isTimer(TimerOpen) ) then 
    killTimer(TimerOpen)
   end
   if ( isTimer(TimerClosed) ) then 
    killTimer(TimerClosed)
   end
   TimerClosed = setTimer(function()
    Rotation = tonumber(Rotation) - tonumber(1)
    setVehicleDoorOpenRatio(Vehicle,tonumber(Id),tonumber(Rotation))
    if ( Rotation <= tonumber(0) ) then
     killTimer(TimerClosed)
    end
   end,1000,0)
   Closed = true
  end
 else
  outputChatBox("Need To Enter To Vehicle",source,255,0,0,true)
 end
end)

ارجو مساعدة

Link to comment
---client

GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Label = {}
GUIEditor_Scrollbar = {}

local x,y = guiGetScreenSize()
Car = guiCreateWindow(x/2-136, y/2-144,272,288,"!! ~ [ مود فتح الابواب ] - #",false)
GUIEditor_Scrollbar[1] = guiCreateScrollBar(24,49,225,17,true,false,Car)
GUIEditor_Label[1] = guiCreateLabel(95,30,135,15,"=[ الكبوت ]=",false,Car)
guiSetFont(GUIEditor_Label[1],"default-bold-small")
GUIEditor_Label[2] = guiCreateLabel(96,72,135,15,"=[ الباب 1 ]=",false,Car)
guiSetFont(GUIEditor_Label[2],"default-bold-small")
GUIEditor_Scrollbar[2] = guiCreateScrollBar(24,91,225,17,true,false,Car)
GUIEditor_Label[3] = guiCreateLabel(96,112,135,15,"=[ الباب 2 ]=",false,Car)
guiSetFont(GUIEditor_Label[3],"default-bold-small")
GUIEditor_Scrollbar[3] = guiCreateScrollBar(24,130,225,17,true,false,Car)
GUIEditor_Label[4] = guiCreateLabel(96,151,135,15,"=[ الباب 3 ]=",false,Car)
guiSetFont(GUIEditor_Label[4],"default-bold-small")
GUIEditor_Scrollbar[4] = guiCreateScrollBar(24,168,225,17,true,false,Car)
GUIEditor_Label[5] = guiCreateLabel(96,189,135,15,"=[ الباب 4 ]=",false,Car)
guiSetFont(GUIEditor_Label[5],"default-bold-small")
GUIEditor_Scrollbar[5] = guiCreateScrollBar(24,206,225,17,true,false,Car)
GUIEditor_Label[6] = guiCreateLabel(95,226,135,15,"=[ الشنطه ]=",false,Car)
guiSetFont(GUIEditor_Label[6],"default-bold-small")
GUIEditor_Scrollbar[6] = guiCreateScrollBar(24,243,225,17,true,false,Car)
GUIEditor_Button[1] = guiCreateButton(23,265,230,15,"[ اغلاق ]",false,Car)
guiSetFont(GUIEditor_Button[1],"default-small")
guiWindowSetSizable ( Car, false )
setElementData(GUIEditor_Scrollbar[1], "Type", 0)
setElementData(GUIEditor_Scrollbar[2], "Type", 2)
setElementData(GUIEditor_Scrollbar[3], "Type", 3)
setElementData(GUIEditor_Scrollbar[4], "Type", 4)
setElementData(GUIEditor_Scrollbar[5], "Type", 5)
setElementData(GUIEditor_Scrollbar[6], "Type", 1)
guiSetVisible(Car, false)
showCursor(false)

function enableVehicleControl()
    if guiGetVisible(Car) == false then
        guiSetVisible(Car, true)
        showCursor(true)
    else
        guiSetVisible(Car, false)
        showCursor(false)
    end
end
bindKey("F1","down",enableVehicleControl)

function closeButton()
        guiSetVisible(Car, false)
        showCursor(false)
end
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], closeButton, false )

function updateRatio(Scrolled)
    local position = guiScrollBarGetScrollPosition(Scrolled)
    local door = getElementData(Scrolled, "Type")
    triggerServerEvent("moveThis:~", getLocalPlayer(), door, position)
end
addEventHandler("onClientGUIScroll", getRootElement(), updateRatio)
    
---------server

Closed = true
Rotation = 0

addEvent("moveThis:~",true)
addEventHandler("moveThis:~",root,function(Id)
 local Vehicle = getPedOccupiedVehicle(source)
 if ( Vehicle ) then
  if ( Closed == true ) then
   if ( isTimer(TimerOpen) ) then 
    killTimer(TimerOpen)
   end
   if ( isTimer(TimerClosed) ) then 
    killTimer(TimerClosed)
   end
   TimerOpen = setTimer(function()
    Rotation = tonumber(Rotation) + tonumber(1)
    setVehicleDoorOpenRatio(Vehicle,tonumber(Id),tonumber(Rotation))
    if ( Rotation >= tonumber(100) ) then
     killTimer(TimerOpen)
    end
   end,1000,0)
   Closed = false
  else
   if ( isTimer(TimerOpen) ) then 
    killTimer(TimerOpen)
   end
   if ( isTimer(TimerClosed) ) then 
    killTimer(TimerClosed)
   end
   TimerClosed = setTimer(function()
    Rotation = tonumber(Rotation) - tonumber(1)
    setVehicleDoorOpenRatio(Vehicle,tonumber(Id),tonumber(Rotation))
    if ( Rotation <= tonumber(0) ) then
     killTimer(TimerClosed)
    end
   end,1000,0)
   Closed = true
  end
 else
  outputChatBox("Need To Enter To Vehicle",source,255,0,0,true)
 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...