Neler yeni

Foruma hoş geldin, Ziyaretçi

Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.

Türkiye'nin İlk ve tek FiveM forum adresi

Forum adresimize hoş geldin FiveMTürk olarak amacımız siz değerli kullanıcılarımıza en aktif fikir ve paylaşım platformu sunmak bir yana en güvenilir şekilde alışveriş yapabileceğiniz bir platform sunmaktır.
DF DF
DF DF
DF DF

Paylaşım Komutlu Araç Transfer Etme

Swindler

?????????
FT Kullanıcı
Katılım
4 yıl 1 ay 11 gün
Mesajlar
1,151
Discord
Swindler#0006
Merhaba,
Forum üzerinde bu konunu çok arandığını gördüm ve paylaşma kararı aldım.Aşağıda vereceğim kodları esx_vehicleshop/server/main.lua nın içine attığınız zaman /aractransferet id plaka şeklinde kullanabilirsiniz.
39598
Kod:
RegisterCommand('aractransferet', function(source, args)

    
    myself = source
    other = args[1]
    
    if(GetPlayerName(tonumber(args[1])))then
            
    else
            
            TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Yanlış ID!")
            return
    end
    
    
    local plate1 = args[2]
    local plate2 = args[3]
    local plate3 = args[4]
    local plate4 = args[5]
    
 
    if plate1 ~= nil then plate01 = plate1 else plate01 = "" end
    if plate2 ~= nil then plate02 = plate2 else plate02 = "" end
    if plate3 ~= nil then plate03 = plate3 else plate03 = "" end
    if plate4 ~= nil then plate04 = plate4 else plate04 = "" end
 
 
    local plate = (plate01 .. " " .. plate02 .. " " .. plate03 .. " " .. plate04)

    
    mySteamID = GetPlayerIdentifiers(source)
    mySteam = mySteamID[1]
    myID = ESX.GetPlayerFromId(source).identifier
    myName = ESX.GetPlayerFromId(source).name

    targetSteamID = GetPlayerIdentifiers(args[1])
    targetSteamName = ESX.GetPlayerFromId(args[1]).name
    targetSteam = targetSteamID[1]
    
    MySQL.Async.fetchAll(
        'SELECT * FROM owned_vehicles WHERE plate = @plate',
        {
            ['@plate'] = plate
        },
        function(result)
            if result[1] ~= nil then
                local playerName = ESX.GetPlayerFromIdentifier(result[1].owner).identifier
                local pName = ESX.GetPlayerFromIdentifier(result[1].owner).name
                CarOwner = playerName
                print("Araba Transferi ", myID, CarOwner)
                if myID == CarOwner then
                    print("Transfer Edildi")
                    
                    data = {}
                        TriggerClientEvent('chatMessage', other, "^4Plakalı Araç ^*^1" .. plate .. "^r^4Tarafından Aana Transfer Edildi: ^*^2" .. myName)
            
                        MySQL.Sync.execute("UPDATE owned_vehicles SET owner=@owner WHERE plate=@plate", {['@owner'] = targetSteam, ['@plate'] = plate})
                        TriggerClientEvent('chatMessage', source, "^4Sen ^*^3Plakalı Aracı^0^4 Transfer Ettin ^*^1" .. plate .. "\" ^r^4to ^*^2".. targetSteamName)
                else
                    print("Did not transfer")
                    TriggerClientEvent('chatMessage', source, "^*^1You do not own the vehicle")
                end
            else
                TriggerClientEvent('chatMessage', source, "^1^*ERROR: ^r^0Bu araç plakası mevcut değil veya plaka yanlış yazılmış olabilir.")
            end
        
        end
 
Herkesin işine yarayabilecek bir script teşekkürler
 
Merhaba,
Forum üzerinde bu konunu çok arandığını gördüm ve paylaşma kararı aldım.Aşağıda vereceğim kodları esx_vehicleshop/server/main.lua nın içine attığınız zaman /aractransferet id plaka şeklinde kullanabilirsiniz.
Ekli dosyayı görüntüle 39598
Kod:
RegisterCommand('aractransferet', function(source, args)

   
    myself = source
    other = args[1]
   
    if(GetPlayerName(tonumber(args[1])))then
           
    else
           
            TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Yanlış ID!")
            return
    end
   
   
    local plate1 = args[2]
    local plate2 = args[3]
    local plate3 = args[4]
    local plate4 = args[5]
   

    if plate1 ~= nil then plate01 = plate1 else plate01 = "" end
    if plate2 ~= nil then plate02 = plate2 else plate02 = "" end
    if plate3 ~= nil then plate03 = plate3 else plate03 = "" end
    if plate4 ~= nil then plate04 = plate4 else plate04 = "" end


    local plate = (plate01 .. " " .. plate02 .. " " .. plate03 .. " " .. plate04)

   
    mySteamID = GetPlayerIdentifiers(source)
    mySteam = mySteamID[1]
    myID = ESX.GetPlayerFromId(source).identifier
    myName = ESX.GetPlayerFromId(source).name

    targetSteamID = GetPlayerIdentifiers(args[1])
    targetSteamName = ESX.GetPlayerFromId(args[1]).name
    targetSteam = targetSteamID[1]
   
    MySQL.Async.fetchAll(
        'SELECT * FROM owned_vehicles WHERE plate = @plate',
        {
            ['@plate'] = plate
        },
        function(result)
            if result[1] ~= nil then
                local playerName = ESX.GetPlayerFromIdentifier(result[1].owner).identifier
                local pName = ESX.GetPlayerFromIdentifier(result[1].owner).name
                CarOwner = playerName
                print("Araba Transferi ", myID, CarOwner)
                if myID == CarOwner then
                    print("Transfer Edildi")
                   
                    data = {}
                        TriggerClientEvent('chatMessage', other, "^4Plakalı Araç ^*^1" .. plate .. "^r^4Tarafından Aana Transfer Edildi: ^*^2" .. myName)
           
                        MySQL.Sync.execute("UPDATE owned_vehicles SET owner=@owner WHERE plate=@plate", {['@owner'] = targetSteam, ['@plate'] = plate})
                        TriggerClientEvent('chatMessage', source, "^4Sen ^*^3Plakalı Aracı^0^4 Transfer Ettin ^*^1" .. plate .. "\" ^r^4to ^*^2".. targetSteamName)
                else
                    print("Did not transfer")
                    TriggerClientEvent('chatMessage', source, "^*^1You do not own the vehicle")
                end
            else
                TriggerClientEvent('chatMessage', source, "^1^*ERROR: ^r^0Bu araç plakası mevcut değil veya plaka yanlış yazılmış olabilir.")
            end
       
        end
Server klasörünün içinde server var
 

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Kayıt ol

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Şimdi kayıt ol
Giriş yap

Eğer bir hesabınız var ise lütfen giriş yapın

Giriş yap

Bu konuyu görüntüleyen kullanıcılar

Tema düzenleyici

Tema özelletirmeleri

Granit arka planlar

Lütfen Javascript'i etkinleştirin!Javascript'i etkinleştirin!