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

Wysłany: 2015-08-28, 11:16


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Jakie? sugestie ?

local sprzedaz createMarker(940.18,2253.33,9.90"cylinder"225500100)

function onSprzedazHit(hitElementdim)
    if getElementType(hitElement) == "player" then
    local players getElementsInMarker(sprzedaz)
    triggerClientEvent(hitElement"pokazGUISprzedazy"rootplayers)
    end
end
addEventHandler("onMarkerHit"sprzedazonSprzedazHit)

function getElementsInMarker(marker)
elements = {}
    for i,v in pairs(getElementsByType("player")) do
        if isElementWithinMarker(vmarkerthen
        table.insert(elementsv)
        end
    end
return elements
end

addEvent("pobierzListePojazdow"true)
addEventHandler("pobierzListePojazdow"getRootElement(), 
function()
local account getPlayerAccount(source)
    if account then
    local wlasciciel getAccountName(account)
    local query dbQuery(handler"SELECT * FROM pojazdy WHERE wlasciciel='"..wlasciciel.."'")
    local resultnum_rowserrormsg dbPoll (query, -1)
    triggerClientEvent(source"pokazListePojazdow"rootresult)
    end
end)

ofertyKupna = {}

addEvent("zaproponujKupnoPojazdu"true)
addEventHandler("zaproponujKupnoPojazdu"getRootElement(),
function(graczidcena)
    if not ofertyKupna[graczthen
    ofertyKupna[gracz] = {}
    ofertyKupna[gracz] = {graczsourceidcena}
    
    local query dbQuery(handler"SELECT model FROM pojazdy WHERE id='"..id.."'")
    local resultnum_rowserrormsg dbPoll (query, -1)
    local pojazd result[1].model
    local pojazd getVehicleNameFromModel(pojazd)
    local przebieg result[1].przebieg
    triggerClientEvent(gracz"pokazOferteKupnaPojazdu"rootsourcepojazdcenaprzebieg)
    else
    outputChatBox("Ten gracz w tym momencie ma otwart? inn? ofert? kupna pojazdu..."source255255255true)
    end
end)
ofertyKupna[gracz] = {}
    ofertyKupna[gracz] = {graczsourceidcena}
    if cena 1 then


addEvent("odrzucOferteKupna"true)
addEventHandler("odrzucOferteKupna"getRootElement(),
function()
    if ofertyKupna[sourcethen
    local od_kogo_oferta ofertyKupna[source][2]
        if isElement(od_kogo_ofertathen
        outputChatBox("Gracz "..getPlayerName(source).." odrzuci? Twoj? ofert? kupna pojazdu."od_kogo_oferta255255255true)
        end
    ofertyKupna[source] = nil
    end
end)

addEvent("przyjmijOferteKupna"true)
addEventHandler("przyjmijOferteKupna"getRootElement(),
function()
    if ofertyKupna[sourcethen
    local account getPlayerAccount(source)
      if account then
      local login getAccountName(account)
        if 50 >= getYourVehicleCount(loginthen
        local od_kogo_oferta ofertyKupna[source][2]
        local veh ofertyKupna[source][3] --id pojazdu
        local cena ofertyKupna[source][4]
            if isElement(od_kogo_ofertathen
            local cena tonumber(cena)
                if getPlayerMoney(source) >= cena then
                takePlayerMoney(sourcecena)
                givePlayerMoney(od_kogo_ofertacena)
                --nadpisanie danych
                local vehicle getVehicleByID(veh)
                ustawDanePojazdu(vehiclevehlogin)
                dbExec(handler"UPDATE pojazdy SET wlasciciel='"..login.."' WHERE id="..veh.."")
                --chat
                local pojazd getVehicleName(vehicle)
                outputChatBox("Gracz "..getPlayerName(source).." przyja? Twoj? ofert? i kupi? Tw?j pojazd "..pojazd.." za "..cena.."$."od_kogo_oferta255255255true)
                outputChatBox("Kupi?e? pojazd "..pojazd.." za "..cena.."$ od gracza "..getPlayerName(od_kogo_oferta).."."source255255255true)
                else
                outputChatBox("Gracz "..getPlayerName(source).." nie ma wystarczaj?co pieni?dzy by kupi? Tw?j pojazd."od_kogo_oferta255255255true)
                outputChatBox("Nie masz wystarczaj?co pieni?dzy by kupi? ten pojazd."source255255255true)
                end
            else
            outputChatBox("Gracz kt?ry sk?ada? Ci ofert? nie jest ju? online na serwerze."source255255255true)
            end
        else
        outputChatBox("Mo?esz posiada? maksymalnie 5 pojazd?w."source255255255true)
        end
      else
      outputChatBox("Nie jeste? zalogowany."source255255255true)
      end
    else
    outputChatBox("Wyst?pi? b??d, nie mo?esz teraz kupi? pojazdu :|"source255255 ,255true)
    end
ofertyKupna[source] = nil
end
end)


DB : http://www.wrzucajtu.pl/w...28_11-14-52.png

te ostatnie db :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-28, 11:37


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Opisz dok?adnie co nie dzia?a...

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-28, 11:38


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Wi?c nie tworzy si? marker nwm dla czego ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-28, 12:35


MIKAELmta







Wiek: 24
Na forum: 3979 dni
Posty: 311

Piwa: 10617

Respekt: 355,3
Respekt: 355,3Respekt: 355,3Respekt: 355,3Respekt: 355,3

Sprawdza?e?, czy na pewno wpisa?e? dobrze kordy?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-28, 12:36


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

tak.. ale s? db poda?em w 1 po?cie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-28, 13:37


Terr9909

Skrypter LUA






Wiek: 26
Na forum: 4234 dni
Posty: 346
Nick w MP: Split

Piwa: 1043

Respekt: 182,8
Respekt: 182,8Respekt: 182,8

What? Co to jest?
end)
ofertyKupna[gracz] = {}
    ofertyKupna[gracz] = {graczsourceidcena}
    if cena 1 then


Postaw piwo autorowi tego posta
 

 
Tagi: sprzedaz
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 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