[YARDIM] Araç God

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı MehmetBas

  • Yeni Üye
  • *
    • İleti: 4
: 15 Nisan 2020, 23:42:35
Bir el freni sistemi indirdim ve buna El frenini kaldırdığı zaman araça god moduna geçmesine göre ayarladım fakat El frenini indirdiği zaman araç godunu kapatamadım. Nasıl yapabilirim

server
Kod
--//Far Aç/Kapat Fonksiyonu
function farlar_fonskiyon()
local arac = getPedOccupiedVehicle(source)
if arac then
local aracadi = getVehicleName(arac)
if getVehicleOverrideLights(arac) == 1 then
setVehicleOverrideLights(arac, 2)
outputChatBox("Arabanızın farları açıldı. ["..aracadi.."]", source, 80, 80, 80, true)
elseif getVehicleOverrideLights(arac) == 2 then
setVehicleOverrideLights(arac, 1)
outputChatBox("Arabanızın farları kapatıldı. ["..aracadi.."]", source, 10, 10, 10, true)
end
end
end
addEvent("farlar_event", true)
addEventHandler("farlar_event", getRootElement(), farlar_fonskiyon)

--//Kilit Aç/Kapat Fonksiyonu
function kilit_fonskiyon()
local arac = getPedOccupiedVehicle(source)
if arac then
local aracadi = getVehicleName(arac)
if isVehicleLocked(arac) then
setVehicleLocked(arac, false)
outputChatBox("Arabanızın kilidi açıldı. ["..aracadi.."]", source, 80, 80, 80, true)
else
setVehicleLocked(arac, true)
outputChatBox("Arabanız kilitlendi. ["..aracadi.."]", source, 10, 10, 10, true)
end
end
end
addEvent("kilit_event", true)
addEventHandler("kilit_event", getRootElement(), kilit_fonskiyon)

--//Motor Aç/Kapat Fonksiyonu
function motor_fonskiyon()
local arac = getPedOccupiedVehicle(source)
if arac then
local aracadi = getVehicleName(arac)
if getVehicleEngineState(arac) == false then
setVehicleEngineState(arac, true)
outputChatBox("Arabanızın motoru açıldı. ["..aracadi.."]", source, 80, 80, 80, true)
elseif getVehicleEngineState(arac) == true then
setVehicleEngineState(arac, false)
outputChatBox("Arabanızın motoru kapatıldı. ["..aracadi.."]", source, 10, 10, 10, true)
end
end
end
addEvent("motor_event", true)
addEventHandler("motor_event", getRootElement(), motor_fonskiyon)

--//Elfreni Kaldır/İndir Fonksiyonu
function elfreni_fonskiyon()
local arac = getPedOccupiedVehicle(source)
if arac then
local aracadi = getVehicleName(arac)
if isElementFrozen(arac) == false then
setElementFrozen(arac, true)
outputChatBox("Arabanızın elfreni kaldırıldı. ["..aracadi.."]", source, 80, 80, 80, true)
elseif isElementFrozen(arac) == true then
setElementFrozen(arac, false)
outputChatBox("Arabanızın elfreni indirildi. ["..aracadi.."]", source, 10, 10, 10, true)
end
end
end
addEvent("elfreni_event", true)
addEventHandler("elfreni_event", getRootElement(), elfreni_fonskiyon)

----
function nocardamage ( source )
    if ( isPedInVehicle ( source ) ) then
        if ( isVehicleDamageProof ( getPedOccupiedVehicle ( source ) )  == false )    then
            setVehicleDamageProof ( getPedOccupiedVehicle ( source ), true )
        end
    else
        outputChatBox ( "You must be inside a vehicle to set this.", source )
    end
end
addEvent("cardamage", true )
addEventHandler("cardamage", resourceRoot, nocardamage )

function disabledamage ( source )
    if ( isPedInVehicle ( source ) ) then
        setVehicleDamageProof ( getPedOccupiedVehicle ( source ), false )
    end
end
addEvent("nodamage", true)
addEventHandler("nodamage", resourceRoot, disabledamage )

client
Kod
--//Ayarlar
bindler = {

 farlar = "k", --//Farların açma/kapatma tuşunu ayarlıyabileceğiniz kısım.
 kilit = "l", --//Arac kilidinin açma/kapatma tuşunu ayarlıyabileceğiniz kısım.
 motor = "m", --//Motorun açma/kapatma tuşunu ayarlıyabileceğiniz kısım.
 elfreni = "n", --//El Freninin kaldırma/indirme tuşunu ayarlıyabileceğiniz kısım.

}

--//Fonksiyonlar
bindKey(bindler.farlar,"down",
function()
triggerServerEvent("farlar_event", getLocalPlayer())
end)

bindKey(bindler.kilit,"down",
function()
triggerServerEvent("kilit_event", getLocalPlayer())
end)

bindKey(bindler.motor,"down",
function()
triggerServerEvent("motor_event", getLocalPlayer())
end)

bindKey(bindler.elfreni,"down",
function()
triggerServerEvent("elfreni_event", getLocalPlayer())
triggerServerEvent("nodamage", root, localPlayer)
triggerServerEvent("cardamage", root, localPlayer)
end)



------
function carDamage()
   if getPlayerOccupiedSeat(g_Me) ~= 0 then
        errMsg('Araç Korumasını aktif etmek için arabanız olması gerekiyor.')
    return
end
  if isPedInVehicle(localPlayer) == true then
    if guiCheckBoxGetSelected( getControl( wndCreateVehicle, 'God' ) ) == true then
      triggerServerEvent("cardamage", root, localPlayer)
    else
      triggerServerEvent("nodamage", root, localPlayer)
    end
  end
end
 


MTASATURK

[YARDIM] Araç God
« : 15 Nisan 2020, 23:42:35 »