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

Wysłany: 2017-07-28, 15:27


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Witam, mam kod, kt?ry zapisuje logi w pliku .txt oraz na ?cianie log?w. Ale problem jest taki: gdy ilo?? graczy pisz?cych na czacie wynosi 3, to w pliku TXT oraz w logach pokazuj? si? trzy linijki jednego logu: "Lokalny> nick: cos tam", gdy 5 os?b rozmawia, w tedy w logach robi si? straszny burdel... Pokazuje si? 5 razy "Lokalny> nick: cos tam"

addEventHandler("onPlayerChat", root, function(wiadomosc, typ)
    if typ == 0 then
        cancelEvent()
        local x, y, z = getElementPosition(source)
        local cuboid = createColSphere(x, y, z, 30)
        local wCuboid = getElementsWithinColShape(cuboid, "player")
        destroyElement(cuboid)
        for _, p in ipairs(wCuboid) do
            local nick = getPlayerName(source)
            local id = getElementData(source, "id") or 0
            local kolor = idRanga(source)
            wiadomosc = string.gsub(wiadomosc, "#%x%x%x%x%x%x", "")
            local info = "#aaaaaa["..id.."] "..kolor..""..nick..": #ffffff"..wiadomosc
            local info2 = "["..id.."] "..nick..": "..wiadomosc
            outputChatBox(info, p, 255, 255, 255, true)
            logczatulokalnego("Lokalny> "..info2)
            triggerClientEvent("logi", root, "Lokalny> "..info2)
end
            elseif typ == 1 then
                cancelEvent()
        local x, y, z = getElementPosition(source)
        local cuboid1 = createColSphere(x, y, z, 30)
        local wCuboid1 = getElementsWithinColShape(cuboid1, "player")
        destroyElement(cuboid1)
        for _, p in ipairs(wCuboid1) do
        local nick1 = getPlayerName(source)
        wiadomosc1 = string.gsub(wiadomosc, "#%x%x%x%x%x%x", "")
        local text = "#00CC00"..nick1.." "..wiadomosc1
        outputChatBox(text, p, 255, 255, 255, true)
        logczatulokalnego("ME> "..text)
        triggerClientEvent("logi", root, "ME> "..text)
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-28, 16:06


psychol.







Wiek: 23
Na forum: 3643 dni
Posty: 225
Nick w MP: psychol.

Piwa: 3003

Respekt: 244,5
Respekt: 244,5Respekt: 244,5


addEventHandler("onPlayerChat", root, function(wiadomosc, typ)
    if typ == 0 then
        cancelEvent()
        local x, y, z = getElementPosition(source)
        local cuboid = createColSphere(x, y, z, 30)
        local wCuboid = getElementsWithinColShape(cuboid, "player")
        destroyElement(cuboid)
        for _, p in ipairs(wCuboid) do
            local nick = getPlayerName(source)
            local id = getElementData(source, "id") or 0
            local kolor = idRanga(source)
            wiadomosc = string.gsub(wiadomosc, "#%x%x%x%x%x%x", "")
            local info = "#aaaaaa["..id.."] "..kolor..""..nick..": #ffffff"..wiadomosc
            info2 = "["..id.."] "..nick..": "..wiadomosc
            outputChatBox(info, p, 255, 255, 255, true)
end
logczatulokalnego("Lokalny> "..info2)
triggerClientEvent("logi", root, "Lokalny> "..info2)
            elseif typ == 1 then
                cancelEvent()
        local x, y, z = getElementPosition(source)
        local cuboid1 = createColSphere(x, y, z, 30)
        local wCuboid1 = getElementsWithinColShape(cuboid1, "player")
        destroyElement(cuboid1)
        for _, p in ipairs(wCuboid1) do
        local nick1 = getPlayerName(source)
        wiadomosc1 = string.gsub(wiadomosc, "#%x%x%x%x%x%x", "")
         text = "#00CC00"..nick1.." "..wiadomosc1
        outputChatBox(text, p, 255, 255, 255, true)
        end
        logczatulokalnego("ME> "..text)
        triggerClientEvent("logi", root, "ME> "..text)
    end
end)


Podpis


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-28, 16:19


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Asper, sprawdz?:)

Postaw piwo autorowi tego posta
 

 
Tagi: gracze :: colshape :: [logi]
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » gracze w colShape [logi] Odpowiedz do tematu

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