Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2019-04-13, 12:32


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

ehh witam znowu przychodz? z problemem z nickiem teraz tylko po sprzedaniu auta na gie?dzie


local czyj getPlayerName(source):gsub("#%x%x%x%x%x%x","")
exports["marinarpg-db"]:dbSet("UPDATE marinarpg_pojazdy SET czyj=? WHERE id=?"vehicle:getData("player:sid"), vehicle:getData("vehicle:id"), czyj)

znowu zwraca samo uid ;-;

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-13, 13:00


AmaMa.

AmaMa.#3768






Wiek: 25
Na forum: 3208 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1825

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

killercycDDS,


local czyj getPlayerName(source):gsub("#%x%x%x%x%x%x","")
exports["marinarpg-db"]:dbSet("UPDATE marinarpg_pojazdy SET czyj=? WHERE id=?"czyjvehicle:getData("vehicle:id"))



Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-13, 23:43


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

heros123345, dalej nic zmienia z nicku na 0

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-14, 02:06


AmaMa.

AmaMa.#3768






Wiek: 25
Na forum: 3208 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1825

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

killercycDDS, poka? w bazie MySQL to "czyj"

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-14, 02:35


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-14, 03:30


AmaMa.

AmaMa.#3768






Wiek: 25
Na forum: 3208 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1825

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

killercycDDS, musisz da? ca?y kod sprzeda?y.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-14, 10:33


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

heros123345,

local cuboid = {}
local cub ColShape.Cuboid(-2302.0866699219, -179.6744995117234.32031253275.754)
createBlip(-2286.65, -179.9535.32432500000175)

function RGBToHex(redgreenbluealpha)
    if((red or red 255 or green or green 255 or blue or blue 255) or (alpha and (alpha or alpha 255))) then return nil end
    if(alphathen return string.format("#%.2X%.2X%.2X%.2X"redgreenbluealpha) else return string.format("#%.2X%.2X%.2X"redgreenblueend
end

addEvent("iyw_vehicles_exchange:buy_vehicle"true)
addEventHandler("iyw_vehicles_exchange:buy_vehicle"root, function(vehicle)
    local exchange vehicle:getData("vehicle:exchange")
    --local czyj getPlayerName(source):gsub("#%x%x%x%x%x%x","")
    if not exchange then return false end
    
    if source.money tonumber(exchange.costthen
        return triggerClientEvent(source"onClientAddNotification"source"Nie posiadasz tyle got?wki\nby m?c zakupi? ten pojazd! ("..tonumber(exchange.cost).."PLN)""error")
    elseif source.name == exchange.owner then
        return triggerClientEvent(source"onClientAddNotification"source"Nie mo?esz kupi? swojego pojazdu!""error")
    end
    
    vehicle:setData("vehicle:ownedPlayer"source:getData("player:sid"))
    warpPedIntoVehicle(sourcevehicle0)
    source:takeMoney(exchange.cost)
    
    if getPlayerFromName(exchange.owner) and getPlayerFromName(exchange.owner):getData("player:logged"then
        triggerClientEvent(getPlayerFromName(exchange.owner), "onClientAddNotification"getPlayerFromName(exchange.owner), "U?ytkownik "..string.gsub(source.name"#%x%x%x%x%x%x""").."\nkupi? Tw?j pojazd, otrzymujesz "..exchange.cost.."PLN do portfela.""success")
        --givePlayerMoney(getPlayerFromName(exchange.owner), exchange.cost)
        triggerEvent("admin:addText"resourceRootRGBToHex(02000)..("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext)..RGBToHex(255255255), math.random(0,99))
        triggerClientEvent("onDebugMessage"resourceRoot, ("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext), 5"INNE")
        exports["marinarpg-db"]:dbSet("update marinarpg_lista_graczy set bank_money=bank_money+? where id=? limit 1",exchange.costexchange.data)
    else
        exports["marinarpg-db"]:dbSet("update marinarpg_lista_graczy set bank_money=bank_money+? where id=? limit 1",exchange.costexchange.data)
        local czyj getPlayerName(source):gsub("#%x%x%x%x%x%x","")
        exports["marinarpg-db"]:dbSet("UPDATE marinarpg_pojazdy SET czyj=? WHERE id=?"czyjvehicle:getData("vehicle:id"))
        --exports["marinarpg-db"]:dbSet("update marinarpg_pojazdy set czyj=? where id=? limit 1",czyj)
        triggerEvent("admin:addText"resourceRootRGBToHex(02000)..("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext)..RGBToHex(255255255), math.random(0,99))
        triggerClientEvent("onDebugMessage"resourceRoot, ("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext), 5"INNE")
    end
    
    exports["marinarpg-db"]:dbSet("UPDATE marinarpg_pojazdy SET ownedPlayer=?, ownedGroup=0, rent=0, parking=1 WHERE id=?"source:getData("player:sid"), vehicle:getData("vehicle:id"))
    exports["marinarpg-db"]:dbSet("UPDATE marinarpg_pojazdy SET czyj=? WHERE id=?"vehicle:getData("player:sid"), vehicle:getData("vehicle:id"), czyj)
    if cuboid[vehicle] and isElement(cuboid[vehicle]) then cuboid[vehicle]:destroy() end
    vehicle:setData("vehicle:exchange"false)
    vehicle:setData("vehicle:desc""")
    destroyElement(vehicle)
end)

addEvent("iyw_vehicles_exchange:insert_exchange"true)
addEventHandler("iyw_vehicles_exchange:insert_exchange"root, function(vehicle,text)
    cuboid[vehicle] = ColShape.Sphere(0003)
    cuboid[vehicle]:attach(vehicle000.50)
    vehicle:setData("vehicle:desc""Model: "..(vehicle.name).."\nCena: "..text.." PLN\n\n\nPodejdz do tego pojazdu, aby uzyskac wiecej informacji!")
end)

addEventHandler("onColShapeHit"resourceRoot, function(playerdimension)
    if player.type == "player" and dimension then
        if not player.vehicle then
            if source == cub then return false end
            local vehicle source:getElementsWithin("vehicle")
            if #vehicle < 1 or #vehicle > 1 then return false end

            local data vehicle[1]:getData("vehicle:exchange")
            if not data then return false end
            
            local result exports['marinarpg-db']:dbGet("SELECT marinarpg_pojazdy.*,marinarpg_lista_graczy.Login FROM marinarpg_pojazdy left join marinarpg_lista_graczy on marinarpg_lista_graczy.id=marinarpg_pojazdy.ownedPlayer WHERE marinarpg_pojazdy.id=?"tonumber(getElementData(vehicle[1], "vehicle:id")))
            local result2 exports['marinarpg-db']:dbGet("SELECT marinarpg_pojazdy.firstowner,marinarpg_lista_graczy.Login FROM marinarpg_pojazdy left join marinarpg_lista_graczy on marinarpg_lista_graczy.id=marinarpg_pojazdy.firstowner WHERE marinarpg_pojazdy.id=?"tonumber(getElementData(vehicle[1], "vehicle:id")))
            local model exports['marinarpg-db']:dbGet("SELECT id,model from marinarpg_pojazdy where model=? and id<=? order by id desc"result[1].modelresult[1].id)
            triggerClientEvent(player"iyw_vehicles_exchange:show_gui"playervehicle[1], #model)
        end
    end
end)

addEventHandler("onColShapeHit"cub, function(playerdimension)
    if player.type == "player" and dimension then
        if player.vehicle then
            if player.vehicle:getData("vehicle:id"then
                if cuboid[player.vehicle] and isElement(cuboid[player.vehicle]) then cuboid[player.vehicle]:destroy() cuboid[player.vehicle] = false end
                player.vehicle:setData("vehicle:exchange"false)
                player.vehicle:setData("vehicle:desc"false)
            end
        end
    end
end)

addEventHandler("onColShapeLeave"cub, function(playerdimension)
    if player.type == "player" and dimension then
        if player.vehicle then
            if player.vehicle:getData("vehicle:id"then
                if cuboid[player.vehicle] and isElement(cuboid[player.vehicle]) then cuboid[player.vehicle]:destroy() cuboid[player.vehicle] = false end
                player.vehicle:setData("vehicle:exchange"false)
                player.vehicle:setData("vehicle:desc"false)
            end
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-14, 10:57


AmaMa.

AmaMa.#3768






Wiek: 25
Na forum: 3208 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1825

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

killercycDDS, Tak wygl?da aktualny kod na twoim serwerze?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-14, 10:59


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

heros123345, tak od strony serwera

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-14, 11:02


AmaMa.

AmaMa.#3768






Wiek: 25
Na forum: 3208 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1825

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

killercycDDS, Spr?buj tak:


local cuboid = {}
local cub ColShape.Cuboid(-2302.0866699219, -179.6744995117234.32031253275.754)
createBlip(-2286.65, -179.9535.32432500000175)

function RGBToHex(redgreenbluealpha)
    if((red or red 255 or green or green 255 or blue or blue 255) or (alpha and (alpha or alpha 255))) then return nil end
    if(alphathen return string.format("#%.2X%.2X%.2X%.2X"redgreenbluealpha) else return string.format("#%.2X%.2X%.2X"redgreenblueend
end

addEvent("iyw_vehicles_exchange:buy_vehicle"true)
addEventHandler("iyw_vehicles_exchange:buy_vehicle"root, function(vehicle)
    local exchange vehicle:getData("vehicle:exchange")
    if not exchange then return false end
    
    if source.money tonumber(exchange.costthen
        return triggerClientEvent(source"onClientAddNotification"source"Nie posiadasz tyle got?wki\nby m?c zakupi? ten pojazd! ("..tonumber(exchange.cost).."PLN)""error")
    elseif source.name == exchange.owner then
        return triggerClientEvent(source"onClientAddNotification"source"Nie mo?esz kupi? swojego pojazdu!""error")
    end
    
    vehicle:setData("vehicle:ownedPlayer"source:getData("player:sid"))
    warpPedIntoVehicle(sourcevehicle0)
    source:takeMoney(exchange.cost)
    
    if getPlayerFromName(exchange.owner) and getPlayerFromName(exchange.owner):getData("player:logged"then
        triggerClientEvent(getPlayerFromName(exchange.owner), "onClientAddNotification"getPlayerFromName(exchange.owner), "U?ytkownik "..string.gsub(source.name"#%x%x%x%x%x%x""").."\nkupi? Tw?j pojazd, otrzymujesz "..exchange.cost.."PLN do portfela.""success")
        triggerEvent("admin:addText"resourceRootRGBToHex(02000)..("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext)..RGBToHex(255255255), math.random(0,99))
        triggerClientEvent("onDebugMessage"resourceRoot, ("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext), 5"INNE")
        exports["marinarpg-db"]:dbSet("update marinarpg_lista_graczy set bank_money=bank_money+? where id=? limit 1",exchange.costexchange.data)
    else
        exports["marinarpg-db"]:dbSet("update marinarpg_lista_graczy set bank_money=bank_money+? where id=? limit 1",exchange.costexchange.data)
        triggerEvent("admin:addText"resourceRootRGBToHex(02000)..("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext)..RGBToHex(255255255), math.random(0,99))
        triggerClientEvent("onDebugMessage"resourceRoot, ("(GIE?DA) %s kupi? pojazd %s [ID: %s] od %s (%s PLN)"):format(source.name:gsub("#%x%x%x%x%x%x",""), vehicle:getName(), vehicle:getData("vehicle:id"), exchange.ownerexchange.costtext), 5"INNE")
    end
    exports["marinarpg-db"]:dbSet("UPDATE marinarpg_pojazdy SET ownedPlayer=?, ownedGroup=0, rent=0, parking=1 WHERE id=?"source:getData("player:sid"), vehicle:getData("vehicle:id"))
    exports["marinarpg-db"]:dbSet("UPDATE marinarpg_pojazdy SET czyj=? WHERE id=?", (source.name:gsub("#%x%x%x%x%x%x","")), vehicle:getData("vehicle:id"))
    if cuboid[vehicle] and isElement(cuboid[vehicle]) then cuboid[vehicle]:destroy() end
    vehicle:setData("vehicle:exchange"false)
    vehicle:setData("vehicle:desc""")
    destroyElement(vehicle)
end)

addEvent("iyw_vehicles_exchange:insert_exchange"true)
addEventHandler("iyw_vehicles_exchange:insert_exchange"root, function(vehicle,text)
    cuboid[vehicle] = ColShape.Sphere(0003)
    cuboid[vehicle]:attach(vehicle000.50)
    vehicle:setData("vehicle:desc""Model: "..(vehicle.name).."\nCena: "..text.." PLN\n\n\nPodejdz do tego pojazdu, aby uzyskac wiecej informacji!")
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
killercycDDS
Wysłany: 2019-04-14, 20:08


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

heros123345, dzi?ki dzia?a po usuwa?e? pewne rzeczy ale doda?em i poprawnie ju? dzia?a

Postaw piwo autorowi tego posta
 

 
Tagi: ten :: sam :: nick
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » ten sam p nick Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku