MTASA TÜRK
Türkiye'nin En Güncel MTA Platformu


[YARDIM] Araç Kontrol Sorunu

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı swat1

  • Yeni Üye
  • *
    • İleti: 67
: 24 Ocak 2018, 12:38:13
Arkadaşlar araç kullanırken başka birisi ışınlanıp aracı kurcalayabiliyor jant,renk,aracı basma, kaldırma vb. aracı kullanan kişiden başka birisi aracı elleyemesin bunu nasıl halledebilirim.
« Son Düzenleme: 25 Ocak 2018, 19:04:33 Gönderen: Narkoz »
 


MTASA TÜRK

[YARDIM] Araç Kontrol Sorunu
« : 24 Ocak 2018, 12:38:13 »

Çevrimdışı Nameless

  • Serhat Üner
  • Yeni Üye
  • *
    • İleti: 76
  • Hunter Gaming | Kurucu & Yönetici
Yanıtla #1 : 24 Ocak 2018, 12:50:27
fr_client.lua
Kod: lua
---------------------------
-- Işınlanma Kapat
---------------------------
function warponoff(  )
if ( guiCheckBoxGetSelected( getControl( wndMain, 'Işınlanma Kapat' ) ) == true ) then
setElementData(g_Me,"Isinlanma",true)
else
setElementData(g_Me,"Isinlanma",false)
end
end

ana panel kısmına ;
Kod: lua
{"chk"; id = "Işınlanma Kapat", onclick = toggleGod, x = 15},

Işınlanma kapatınca haritadan da ışınlanma panelinden de ışınlanamazlar.
 


Çevrimdışı swat1

  • Yeni Üye
  • *
    • İleti: 67
Yanıtla #2 : 24 Ocak 2018, 13:09:46
benim demek istediğim ışınlanmayı kapatma değildir.
 


Çevrimdışı Nameless

  • Serhat Üner
  • Yeni Üye
  • *
    • İleti: 76
  • Hunter Gaming | Kurucu & Yönetici
Yanıtla #3 : 24 Ocak 2018, 14:40:16
Linki görebilmek için Kayıt olun yada Giriş yapın.
benim demek istediğim ışınlanmayı kapatma değildir.

Yani senin istediğin yardımla bağlantılı o yüzden attım.Adam yanına ışınlanamazsa jantlarla vb. oynayamaz :P
 


Çevrimdışı #Serius

  • Uzman Üye
  • *
    • İleti: 631
Yanıtla #4 : 24 Ocak 2018, 14:53:23
Araç kontrol panelini atarmısn ?

ayarlayıp atayım.
 


Çevrimdışı ByCash

  • Bilişim Teknolojileri
  • Admin
  • *
    • İleti: 989
  • ###
    • MTASATURK
Yanıtla #5 : 24 Ocak 2018, 15:32:29
Linki görebilmek için Kayıt olun yada Giriş yapın.
Yani senin istediğin yardımla bağlantılı o yüzden attım.Adam yanına ışınlanamazsa jantlarla vb. oynayamaz :P
Yanına oturarak oynuyabilir.
 


MTASA TÜRK

Ynt: [YARDIM] Araç Sorunu
« Yanıtla #5 : 24 Ocak 2018, 15:32:29 »

Çevrimdışı #Serius

  • Uzman Üye
  • *
    • İleti: 631
Yanıtla #6 : 24 Ocak 2018, 16:19:15
Sanırsam ertuğrulun araç kontrol panelini kullanıyorsun ordaki bind key fonksiyonunu bunla değiş;

Client.side
Kod: lua
function panel_ac_kapa()
if getPedOccupiedVehicleSeat (getLocalPlayer()) == 0 then return
outputChatBox("#cc0000Araç Kontrol Panelini Sadece araç sahibi  kullanabilir.", 255, 255, 255, true)
elseif (guiGetVisible(basma) == false) then
if getPedOccupiedVehicle (getLocalPlayer()) then
guiSetVisible(basma, true)
showCursor(true)
end
else
guiSetVisible(basma, false)
showCursor(false)
end
end
bindKey("F5", "down", panel_ac_kapa)

Mesaj Birleştirildi: 24 Ocak 2018, 22:59:56
Buyur; Hata çıkarsa mesaj atarsın.

Kod: lua
local customKills = {}
local config = {
["lines"] = 5,
["startY"] = 0.35,
["textHeight"] = 16,
["iconPosOffY"] = -10,
["iconHeight"] = 20,
["iconSpacing"] = 4,
["defaultWeapon"] = 255,
["fadeTime"] = 5000,
["startFade"] = 15000,
["align"] = "right",
["startX"] = -10
}

screenx,screeny = guiGetScreenSize()
width, height = 790, 350
x, y = (screenx/2-width/2), (screeny/2-height/2)

function shopInterface()
basma = guiCreateStaticImage(x, y, width, height, "resim/panel1.png", false)
guiSetVisible(basma, false)
--
panel_adi = guiCreateStaticImage(0, 0, width, 25, "resim/panel.png", false, basma)

panel_adii = guiCreateLabel(0, -8, width, 25, "Araç Kontrol Paneli", false, panel_adi)
guiLabelSetHorizontalAlign(panel_adii, "center")
guiLabelSetVerticalAlign(panel_adii, "bottom")
guiSetFont(panel_adii, "default-bold-small")
guiLabelSetColor(panel_adii, 255, 255, 255)
--
guiCreateStaticImage(25, 65, 210, 235, "resim/arrow.png", false, basma)
kaput = guiCreateStaticImage(107, 30, 45, 34, "resim/yukari.png", false, basma)
solon = guiCreateStaticImage(5, 135, 34, 45, "resim/sol.png", false, basma)
solarka = guiCreateStaticImage(5, 190, 34, 45, "resim/sol.png", false, basma)
bagaj = guiCreateStaticImage(107, 300, 45, 34, "resim/asagi.png", false, basma)
sagon = guiCreateStaticImage(220, 135, 34, 45, "resim/sag.png", false, basma)
sagarka = guiCreateStaticImage(220, 190, 34, 45, "resim/sag.png", false, basma)
--
guiCreateStaticImage(265, 135, 235, 82, "resim/car.png", false, basma)
bas = guiCreateStaticImage(325, 230, 45, 34, "resim/asagi.png", false, basma)
yukselt = guiCreateStaticImage(390, 230, 45, 34, "resim/yukari.png", false, basma)
--
guiCreateStaticImage(575, 60, 150, 250, "resim/car2.png", false, basma)
------------------------------------------------------------------------
peredlevoeP = guiCreateStaticImage(750, 210, 30, 40, "resim/sag.png", false, basma)
peredlevoeV = guiCreateStaticImage(710, 210, 30, 40, "resim/sol.png", false, basma)
------------------------------------------------------------------------
peredpravoV = guiCreateStaticImage(525, 210, 30, 40, "resim/sol.png", false, basma)
peredpravoP = guiCreateStaticImage(560, 210, 30, 40, "resim/sag.png", false, basma)
------------------------------------------------------------------------
zadlevoeP = guiCreateStaticImage(745, 100, 30, 40, "resim/sag.png", false, basma)
zadlevoeV = guiCreateStaticImage(705, 100, 30, 40, "resim/sol.png", false, basma)
------------------------------------------------------------------------
zadpravoeV = guiCreateStaticImage(525, 100, 30, 40, "resim/sol.png", false, basma)
zadpravoeP = guiCreateStaticImage(560, 100, 30, 40, "resim/sag.png", false, basma)
------------------------------------------------------------------------
end
addEventHandler("onClientResourceStart", resourceRoot, shopInterface)

addEventHandler("onClientGUIClick",root,
function ( x, y )
if source == kaput then
triggerServerEvent ("porta1", getLocalPlayer())
elseif source == solon then
triggerServerEvent ("porta2", getLocalPlayer())
elseif source == sagon then
triggerServerEvent ("porta3", getLocalPlayer())
elseif source == sagarka then
triggerServerEvent ("porta4", getLocalPlayer())
elseif source == solarka then
triggerServerEvent ("porta5", getLocalPlayer())
elseif source == bagaj then
triggerServerEvent ("porta6", getLocalPlayer())
elseif source == yukselt then
triggerServerEvent ("subir", getLocalPlayer())
playSound('sesler/bas.mp3')
elseif source == bas then
triggerServerEvent ("descer", getLocalPlayer())
playSound('sesler/bas.mp3')
end
end)

-- EKLENEN --
function panel_ac_kapa()
if getPedOccupiedVehicleSeat (getLocalPlayer()) == 0 then return
outputChatBox("#cc0000Araç Kontrol Panelini Sadece araç sahibikullanabilir.", 255, 255, 255, true)
elseif (guiGetVisible(basma) == false) then
if getPedOccupiedVehicle (getLocalPlayer()) then
guiSetVisible(basma, true)
showCursor(true)
end
else
guiSetVisible(basma, false)
showCursor(false)
end
end
bindKey("F5", "down", panel_ac_kapa)

function onGuiClick(button)
if button == "left" then
if source == bOpenHood then
local door = 0
local move_door = 1
triggerServerEvent("moveDoorVeh", getLocalPlayer(), door, move_door)
---------------------------------------------------------------------------------------------------
-------------------------------------- Arka Sağ ----------------------------------------------
---------------------------------------------------------------------------------------------------

elseif source == zadpravoeP then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rb_dummy")
setVehicleComponentPosition(theVeh, "wheel_rb_dummy", x-0.0005, y, z)
end
end


elseif source == zadpravoeV then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rb_dummy")
setVehicleComponentPosition(theVeh, "wheel_rb_dummy", x+0.0005, y, z)
end
end

---------------------------------------------------------------------------------------------------
-------------------------------------- Arka Sol ----------------------------------------------
---------------------------------------------------------------------------------------------------

elseif source == zadlevoeP then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lb_dummy")
setVehicleComponentPosition(theVeh, "wheel_lb_dummy", x-0.0005, y, z)
end
end

elseif source == zadlevoeV then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lb_dummy")
setVehicleComponentPosition(theVeh, "wheel_lb_dummy", x+0.0005, y, z)
end
end
---------------------------------------------------------------------------------------------------
-------------------------------------- ÖN Sağ ----------------------------------------------
---------------------------------------------------------------------------------------------------
elseif source == peredpravoP then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo2 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rf_dummy")
setVehicleComponentPosition(theVeh, "wheel_rf_dummy", x-0.0005, y, z)
end
end

elseif source == peredpravoV then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo2 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rf_dummy")
setVehicleComponentPosition(theVeh, "wheel_rf_dummy", x+0.0005, y, z)
end
end

---------------------------------------------------------------------------------------------------
-------------------------------------- ÖN Sol ----------------------------------------------
---------------------------------------------------------------------------------------------------
elseif source == peredlevoeP then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo1 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lf_dummy")
setVehicleComponentPosition(theVeh, "wheel_lf_dummy", x-0.0005, y, z)
end
end

elseif source == peredlevoeV then
local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
for steklo1 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lf_dummy")
setVehicleComponentPosition(theVeh, "wheel_lf_dummy", x+0.0005, y, z)
end
end

elseif source == bCloseMenu then
hideVehGUI()
end
end
end
addEventHandler("onClientGUIClick", getRootElement(), onGuiClick)




















local default = {
["lines"] = 5,
["startY"] = 0.25,
["textHeight"] = 16,
["iconPosOffY"] = -10,
["iconHeight"] = 20,
["iconSpacing"] = 4,
["defaultWeapon"] = 255,
["fadeTime"] = 5000,
["startFade"] = 15000,
["align"] = "right",
["startX"] = -10
}
local endTime
local screenX,screenY = guiGetScreenSize ()
local contentMessages = {}
local fadingLines = {}
---
local iconOrder = {}


function setupTextOnStart ( resource )
if resource ~= getThisResource() then return end
triggerServerEvent ( "onClientKillmessagesLoaded", getLocalPlayer() )
end
addEventHandler ( "onClientResourceStart", getRootElement(), setupTextOnStart )

addEvent ("doSetKillMessageStyle",true)
function setKillMessageStyle ( startX,startY,align,lines,fadeStart,fadeAnimTime )
if ( not startX ) then startX = default.startX end
if ( not startY ) then startY = default.startY end
if ( not align ) then align = default.align end
if ( not lines ) then lines = default.lines end
if ( not fadeStart ) then fadeStart = default.startFade end
if ( not fadeAnimTime ) then fadeAnimTime = default.fadeTime end
config.startX = startX
config.startY = startY
config.align = align
config.lines = lines
config.startFade = fadeStart
config.fadeTime = fadeAnimTime
if #contentMessages ~= 0 then
for i=1,config.lines do
if contentMessages[i] then
destroyLine ( i )
end
end
end
fadingLines = {}
killMessages = {}
if ( config.startY < 0 ) then
config.startY = screenY - math.abs(config.startY*screenY) - (config.iconHeight*config.lines)
config.startY = config.startY/screenY
end
createKillMessageGUI()
return true
end
addEventHandler ( "doSetKillMessageStyle",getRootElement(),setKillMessageStyle)

function createKillMessageGUI()
local gap = config.iconHeight - config.textHeight
gap = gap/2
for i=1,config.lines do
local y = config.startY*screenY + (config.iconHeight*(i-1))
y = y + gap
contentMessages[i] = { dxText:create("",0,y) }
end
endTime = config.fadeTime + config.startFade
end

function shiftUpGUI()
local i = 1
for i=config.lines,2,-1 do
local y = config.startY*screenY + (config.iconHeight*(i-1)) + (config.iconHeight - config.textHeight)/2
local targetY = config.startY*screenY + (config.iconHeight*(i-2)) + (config.iconHeight - config.textHeight)/2
if contentMessages[i] then
for k,part in ipairs(contentMessages[i]) do
local x,realY = getWidgetPosition(part)

local diffY = realY - y
setWidgetPosition(part,x,targetY + diffY)
end
end
end
for i=1,config.lines-1 do
---shift up the alpha too
local tick = fadingLines[i+1]
fadingLines[i] = tick
fadingLines[i+1] = nil
end
end

addEvent ( "doOutputMessage", true )
function outputMessage ( message, r, g, b, font )
if type(message) ~= "string" and type(message) ~= "table" then
outputDebugString ( "outputMessage - Bad 'message' argument", 0, 112, 112, 112 )
return false
end
if type(font) ~= "string" then
font = "default"
end
r = tonumber(r) or 255
g = tonumber(g) or 255
b = tonumber(b) or 255
---shift everything up
shiftUpGUI()
--Delete the first line
destroyLine (1)
table.remove ( contentMessages, 1 )
if type(message) == "string" then
message = {message}
end
local y = config.startY*screenY + (config.iconHeight*(config.lines-1)) + (config.iconHeight - config.textHeight)/2
local startX = config.startX
if startX < 1 and startX > -1 then --auto calculate whether its relative or absolute
startX = screenX/startX --make it relative
end
if startX < 0 then
startX = screenX + startX
end

for i,part in ipairs(message) do
if type(part) == "table" and part[1] == "image" then
if not part.resource and not part.resourceName then
part.resource = sourceResource
end
end
end

drawLine ( message, startX, y, config.align, config.lines, r, g, b, font, 1 )
fadeLine ( config.lines )
end
addEventHandler ( "doOutputMessage", getRootElement(), outputMessage )

function drawLine ( message, x,y, align, line, r, g, b, font, scale )
--First draw it and work out the width
local width = 0
contentMessages[line] = {}
for i,part in ipairs(message) do
if type(part) == "string" then
local text = dxText:create ( part, width, y, false )
text:font ( font )
text:scale ( scale )
text:type("shadow",1)
text:align"left"
text:color ( r,g,b )
table.insert ( contentMessages[line], text )
width = width + text:extent()
elseif part[1] == "icon" then
local iconWidth = part.width or iconWidths[part.id or -1] or iconWidths[255]
local iconHeight = part.height or config.iconHeight
local image = dxImage:create ( icons[part.id or 0] or icons[255], width, y + (part.posOffY or config.iconPosOffY), iconWidth, iconHeight, false )
image:color ( part.r or 255, part.g or 255, part.b or 255 )
image:rotation ( part.rot or 0, part.rotOffX or 0, part.rotOffY or 0 )
width = width + iconWidth
table.insert ( contentMessages[line], image )
elseif part[1] == "image" then
if part.width and part.path then
if part.resourceName then
part.resource = getResourceFromName(tostring(part.resourceName)) or part.resource
end
local image = dxImage:create ( ":"..getResourceName(part.resource).."/"..part.path, width, y + (part.posOffY or config.iconPosOffY), part.width, part.height or config.iconHeight, false )
image:color ( part.r or 255, part.g or 255, part.b or 255 )
image:rotation ( part.rot or 0, part.rotOffX or 0, part.rotOffY or 0 )
width = width + part.width
table.insert ( contentMessages[line], image )
end
elseif part[1] == "color" or part[1] == "colour" then
r = part.r or r
g = part.g or g
b = part.b or b
elseif part[1] == "padding" then
width = width + part.width or 0
end
contentMessages[line].scale = scale
end
--Now reposition everything properly
if align == "center" or align == "centre" then
x = x - width/2
elseif align == "right" then
x = x - width
end
for i,widget in ipairs(contentMessages[line]) do
local wx,wy = getWidgetPosition ( widget )
setWidgetPosition ( widget, x + wx, wy )
end
return true
end

function fadeLine ( line )
setLineAlpha ( line, 1 )
fadingLines[line] = getTickCount()
end
-----
addEventHandler ( "onClientRender",getRootElement(),
function()
for line,originalTick in pairs(fadingLines) do
local tickDifference = getTickCount() - originalTick
if tickDifference > endTime then
destroyLine ( line )
setLineAlpha ( line, 1 )
fadingLines[line] = nil
elseif tickDifference >config.startFade then
local fadeTimeDifference = tickDifference - config.startFade
--calculate the alpha
local newAlpha = 1 - fadeTimeDifference/config.fadeTime
--Set all the alphas
setLineAlpha ( line, newAlpha )
end
end
end )

function setLineAlpha ( line, alpha )
for i,part in ipairs(contentMessages[line]) do
setWidgetAlpha ( part, alpha )
end
end

function destroyLine ( line )
for k,part in ipairs(contentMessages[line]) do
destroyWidget(part)
end
contentMessages[line] = {}
end

function destroyWidget ( widget )
if isElement(widget) then
destroyElement ( widget )
elseif type(widget) == "table" and widget.destroy then
widget:destroy()
end
end

function getWidgetPosition ( widget )
if isElement(widget) then
return guiGetPosition ( widget, false )
elseif type(widget) == "table" and widget.position then
return widget:position()
end
end

function setWidgetPosition ( widget, x, y )
if isElement(widget) then
return guiSetPosition ( widget, x, y, false )
elseif type(widget) == "table" and widget.position then
return widget:position(x,y,false)
end
end

function setWidgetAlpha ( widget, alpha )
if isElement(widget) then
guiSetAlpha ( widget, alpha )
elseif type(widget) == "table" and widget.color then
local r,g,b = widget:color()
widget:color(r,g,b,alpha*255)
end
end
« Son Düzenleme: 24 Ocak 2018, 22:59:57 Gönderen: By.Angel »
 


Çevrimdışı swat1

  • Yeni Üye
  • *
    • İleti: 67
Yanıtla #7 : 25 Ocak 2018, 20:39:49
Denedim panel hiç gelmedi.
 


Çevrimdışı Mahlukat

  • Scripter
  • *
    • İleti: 655
Yanıtla #8 : 25 Ocak 2018, 20:51:11
panelin client.lua kodlarını atarmısın ?
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı swat1

  • Yeni Üye
  • *
    • İleti: 67
Yanıtla #9 : 25 Ocak 2018, 20:56:13
Buyrun;
Kod: lua
screenx,screeny = guiGetScreenSize()
width, height = 790, 350
x, y = (screenx/2-width/2), (screeny/2-height/2)

function shopInterface()
basma = guiCreateStaticImage(x, y, width, height, "resim/panel1.png", false)
guiSetVisible(basma, false)
--
panel_adi = guiCreateStaticImage(0, 0, width, 25, "resim/panel.png", false, basma)

panel_adii = guiCreateLabel(0, -8, width, 25, "Araç Kontrol Paneli", false, panel_adi)
guiLabelSetHorizontalAlign(panel_adii, "center")
guiLabelSetVerticalAlign(panel_adii, "bottom")
guiSetFont(panel_adii, "default-bold-small")
guiLabelSetColor(panel_adii, 255, 255, 255)
--
guiCreateStaticImage(25, 65, 210, 235, "resim/arrow.png", false, basma)
kaput = guiCreateStaticImage(107, 30, 45, 34, "resim/yukari.png", false, basma)
solon = guiCreateStaticImage(5, 135, 34, 45, "resim/sol.png", false, basma)
solarka = guiCreateStaticImage(5, 190, 34, 45, "resim/sol.png", false, basma)
bagaj = guiCreateStaticImage(107, 300, 45, 34, "resim/asagi.png", false, basma)
sagon = guiCreateStaticImage(220, 135, 34, 45, "resim/sag.png", false, basma)
sagarka = guiCreateStaticImage(220, 190, 34, 45, "resim/sag.png", false, basma)
--
guiCreateStaticImage(265, 135, 235, 82, "resim/car.png", false, basma)
bas = guiCreateStaticImage(325, 230, 45, 34, "resim/asagi.png", false, basma)
yukselt = guiCreateStaticImage(390, 230, 45, 34, "resim/yukari.png", false, basma)
--
guiCreateStaticImage(575, 60, 150, 250, "resim/car2.png", false, basma)
------------------------------------------------------------------------
peredlevoeP = guiCreateStaticImage(750, 210, 30, 40, "resim/sag.png", false, basma)
peredlevoeV = guiCreateStaticImage(710, 210, 30, 40, "resim/sol.png", false, basma)
------------------------------------------------------------------------
peredpravoV = guiCreateStaticImage(525, 210, 30, 40, "resim/sol.png", false, basma)
peredpravoP = guiCreateStaticImage(560, 210, 30, 40, "resim/sag.png", false, basma)
------------------------------------------------------------------------
zadlevoeP = guiCreateStaticImage(745, 100, 30, 40, "resim/sag.png", false, basma)
zadlevoeV = guiCreateStaticImage(705, 100, 30, 40, "resim/sol.png", false, basma)
------------------------------------------------------------------------
zadpravoeV = guiCreateStaticImage(525, 100, 30, 40, "resim/sol.png", false, basma)
zadpravoeP = guiCreateStaticImage(560, 100, 30, 40, "resim/sag.png", false, basma)
------------------------------------------------------------------------
end
addEventHandler("onClientResourceStart", resourceRoot, shopInterface)

addEventHandler("onClientGUIClick",root,
function ( x, y )
if source == kaput then
triggerServerEvent ("porta1", getLocalPlayer())
elseif source == solon then
triggerServerEvent ("porta2", getLocalPlayer())
elseif source == sagon then
triggerServerEvent ("porta3", getLocalPlayer())
elseif source == sagarka then
triggerServerEvent ("porta4", getLocalPlayer())
elseif source == solarka then
triggerServerEvent ("porta5", getLocalPlayer())
elseif source == bagaj then
triggerServerEvent ("porta6", getLocalPlayer())
elseif source == yukselt then
triggerServerEvent ("subir", getLocalPlayer())
playSound('sesler/bas.mp3')
elseif source == bas then
triggerServerEvent ("descer", getLocalPlayer())
playSound('sesler/bas.mp3')
end
end)

bindKey( "F4", "down",
function()
guiSetVisible(basma, not guiGetVisible(basma))
showCursor(guiGetVisible(basma))
end
)

function onGuiClick(button)
if button == "left" then
if source == bOpenHood then
local door = 0
local move_door = 1
triggerServerEvent("moveDoorVeh", getLocalPlayer(), door, move_door)
---------------------------------------------------------------------------------------------------
-------------------------------------- Arka Sağ ----------------------------------------------
---------------------------------------------------------------------------------------------------

elseif source == zadpravoeP then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rb_dummy", x-0.0005, y, z)
        end
end


elseif source == zadpravoeV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rb_dummy", x+0.0005, y, z)
        end
end

---------------------------------------------------------------------------------------------------
-------------------------------------- Arka Sol ----------------------------------------------
---------------------------------------------------------------------------------------------------

elseif source == zadlevoeP then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lb_dummy", x-0.0005, y, z)
        end
end

elseif source == zadlevoeV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo4 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lb_dummy", x+0.0005, y, z)
        end
end
---------------------------------------------------------------------------------------------------
-------------------------------------- ÖN Sağ ----------------------------------------------
---------------------------------------------------------------------------------------------------
elseif source == peredpravoP then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo2 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rf_dummy", x-0.0005, y, z)
        end
end

elseif source == peredpravoV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo2 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rf_dummy", x+0.0005, y, z)
        end
end

---------------------------------------------------------------------------------------------------
-------------------------------------- ÖN Sol ----------------------------------------------
---------------------------------------------------------------------------------------------------
elseif source == peredlevoeP then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo1 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lf_dummy", x-0.0005, y, z)
        end
end

elseif source == peredlevoeV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
local getComponent = getVehicleComponents(theVeh)
if (theVeh) then
        for steklo1 in pairs (getComponent) do
local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lf_dummy", x+0.0005, y, z)
        end
end

elseif source == bCloseMenu then
hideVehGUI()
end
end
end
addEventHandler("onClientGUIClick", getRootElement(), onGuiClick)
« Son Düzenleme: 25 Ocak 2018, 21:02:43 Gönderen: ByCash »
 


Çevrimdışı Mahlukat

  • Scripter
  • *
    • İleti: 655
Yanıtla #10 : 25 Ocak 2018, 21:05:14
Denermisin?
Kod: lua
screenx,screeny = guiGetScreenSize()
width, height = 790, 350
x, y = (screenx/2-width/2), (screeny/2-height/2)
 
function shopInterface()
        basma = guiCreateStaticImage(x, y, width, height, "resim/panel1.png", false)
        guiSetVisible(basma, false)
--
panel_adi = guiCreateStaticImage(0, 0, width, 25, "resim/panel.png", false, basma)
 
panel_adii = guiCreateLabel(0, -8, width, 25, "Araç Kontrol Paneli", false, panel_adi)
guiLabelSetHorizontalAlign(panel_adii, "center")
guiLabelSetVerticalAlign(panel_adii, "bottom")
guiSetFont(panel_adii, "default-bold-small")
guiLabelSetColor(panel_adii, 255, 255, 255)
--
        guiCreateStaticImage(25, 65, 210, 235, "resim/arrow.png", false, basma)
        kaput = guiCreateStaticImage(107, 30, 45, 34, "resim/yukari.png", false, basma)
        solon = guiCreateStaticImage(5, 135, 34, 45, "resim/sol.png", false, basma)
        solarka = guiCreateStaticImage(5, 190, 34, 45, "resim/sol.png", false, basma)
        bagaj = guiCreateStaticImage(107, 300, 45, 34, "resim/asagi.png", false, basma)
        sagon = guiCreateStaticImage(220, 135, 34, 45, "resim/sag.png", false, basma)
        sagarka = guiCreateStaticImage(220, 190, 34, 45, "resim/sag.png", false, basma)
--
        guiCreateStaticImage(265, 135, 235, 82, "resim/car.png", false, basma)
        bas = guiCreateStaticImage(325, 230, 45, 34, "resim/asagi.png", false, basma)
        yukselt = guiCreateStaticImage(390, 230, 45, 34, "resim/yukari.png", false, basma)
--
        guiCreateStaticImage(575, 60, 150, 250, "resim/car2.png", false, basma)
        ------------------------------------------------------------------------
        peredlevoeP = guiCreateStaticImage(750, 210, 30, 40, "resim/sag.png", false, basma)
        peredlevoeV = guiCreateStaticImage(710, 210, 30, 40, "resim/sol.png", false, basma)
        ------------------------------------------------------------------------
        peredpravoV = guiCreateStaticImage(525, 210, 30, 40, "resim/sol.png", false, basma)
        peredpravoP = guiCreateStaticImage(560, 210, 30, 40, "resim/sag.png", false, basma)
        ------------------------------------------------------------------------
        zadlevoeP = guiCreateStaticImage(745, 100, 30, 40, "resim/sag.png", false, basma)
        zadlevoeV = guiCreateStaticImage(705, 100, 30, 40, "resim/sol.png", false, basma)
        ------------------------------------------------------------------------
        zadpravoeV = guiCreateStaticImage(525, 100, 30, 40, "resim/sol.png", false, basma)
        zadpravoeP = guiCreateStaticImage(560, 100, 30, 40, "resim/sag.png", false, basma)
        ------------------------------------------------------------------------
end
addEventHandler("onClientResourceStart", resourceRoot, shopInterface)
 
addEventHandler("onClientGUIClick",root,
function ( x, y )
if source == kaput then
        triggerServerEvent ("porta1", getLocalPlayer())
        elseif source == solon then
        triggerServerEvent ("porta2", getLocalPlayer())
        elseif source == sagon then
        triggerServerEvent ("porta3", getLocalPlayer())
        elseif source == sagarka then
        triggerServerEvent ("porta4", getLocalPlayer())
        elseif source == solarka then
        triggerServerEvent ("porta5", getLocalPlayer())
        elseif source == bagaj then
        triggerServerEvent ("porta6", getLocalPlayer())
        elseif source == yukselt then
        triggerServerEvent ("subir", getLocalPlayer())
        playSound('sesler/bas.mp3')
        elseif source == bas then
        triggerServerEvent ("descer", getLocalPlayer())
        playSound('sesler/bas.mp3')
end
end)
 
bindKey( "F4", "down",
function()
if getPedOccupiedVehicleSeat(localPlayer) == 0 then
        guiSetVisible(basma, not guiGetVisible(basma))
        showCursor(guiGetVisible(basma))
end
end
)
 
function onGuiClick(button)
        if button == "left" then
                if source == bOpenHood then
                local door = 0
                local move_door = 1
                triggerServerEvent("moveDoorVeh", getLocalPlayer(), door, move_door)
        ---------------------------------------------------------------------------------------------------
        -------------------------------------- Arka Sağ ----------------------------------------------
        ---------------------------------------------------------------------------------------------------
               
                elseif source == zadpravoeP then               
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo4 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rb_dummy", x-0.0005, y, z)
        end
                end
               
               
                elseif source == zadpravoeV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo4 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rb_dummy", x+0.0005, y, z)
        end
                end
               
        ---------------------------------------------------------------------------------------------------
        -------------------------------------- Arka Sol ---------------------------------------------- 
        ---------------------------------------------------------------------------------------------------
               
                elseif source == zadlevoeP then         
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo4 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lb_dummy", x-0.0005, y, z)
        end
                end     
               
                elseif source == zadlevoeV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo4 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lb_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lb_dummy", x+0.0005, y, z)
        end
                end
        ---------------------------------------------------------------------------------------------------
        -------------------------------------- ÖN Sağ ---------------------------------------------- 
        ---------------------------------------------------------------------------------------------------             
                elseif source == peredpravoP then               
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo2 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rf_dummy", x-0.0005, y, z)
        end
                end     
               
                elseif source == peredpravoV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo2 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_rf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_rf_dummy", x+0.0005, y, z)
        end
                end
               
        ---------------------------------------------------------------------------------------------------
        -------------------------------------- ÖN Sol ----------------------------------------------   
        ---------------------------------------------------------------------------------------------------             
                elseif source == peredlevoeP then               
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo1 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lf_dummy", x-0.0005, y, z)
        end
                end     
               
                elseif source == peredlevoeV then
        local theVeh = getPedOccupiedVehicle(localPlayer)
                local getComponent = getVehicleComponents(theVeh)
                if (theVeh) then
        for steklo1 in pairs (getComponent) do
                local x, y, z = getVehicleComponentPosition(theVeh, "wheel_lf_dummy")
        setVehicleComponentPosition(theVeh, "wheel_lf_dummy", x+0.0005, y, z)
        end
                end
               
                elseif source == bCloseMenu then
                hideVehGUI()
                end             
        end
end     
addEventHandler("onClientGUIClick", getRootElement(), onGuiClick)
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı swat1

  • Yeni Üye
  • *
    • İleti: 67
Yanıtla #11 : 26 Ocak 2018, 09:57:41
Denedim panel hiç gelmiyor.
 


Çevrimdışı #Serius

  • Uzman Üye
  • *
    • İleti: 631
Yanıtla #12 : 26 Ocak 2018, 12:22:56
Çok özür dilerim tek araçta açılıyor birde tek araç sahibi açabiliyor hemen düzeltip atacam.

Buyur artık araçta olmadan bile açılır :)

-- Cient Side
Kod: lua
function panel_ac_kapa()
if getPedOccupiedVehicleSeat (getLocalPlayer()) == 0 then return
outputChatBox("#cc0000Araç Kontrol Panelini Sadece araç sahibikullanabilir.", 255, 255, 255, true)
elseif (guiGetVisible(basma) == false) then
guiSetVisible(basma, true)
showCursor(true)
else
guiSetVisible(basma, false)
showCursor(false)
end
end
bindKey("F5", "down", panel_ac_kapa)
« Son Düzenleme: 28 Ocak 2018, 19:10:11 Gönderen: Narkoz »