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

Wysłany: 2017-02-02, 17:35


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

Witam, mam kod na czat frakcji i chcia?em doda? linijk? dzi?ki kt?rej b?d? widzia? w logach serwerowych kto co pisze. I tu le?y problem poniewa? gdy jest np. 2 administrator?w to czat w logach powtarza si? 2 razy. Jakie? propozycje?

Kod:
function globalMessage(plrcmd, ...)
    local frakcja=getElementData(plr,'player:duty')
    if not frakcja then
        return
    end
    local msg table.concat ( { ... }, " " )
    local admins=getElementsByType('player')
    for i,v in pairs(admins) do
    local pfrakcje=getElementData(v,'player:duty')
        if frakcja == pfrakcje then
            outputChatBox("#0055B5[Frakcja] #FFFFFF("..getElementData(plr,"id")..") "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..msgv25525474true)
        triggerClientEvent(root"admin:addText"root"Frakcja ("..getElementData(plr,"player:duty")..")> "..getPlayerName(plr).."("..getElementData(plr,"id").."): "..msg)
        end
    end
end
addCommandHandler("frakcja"globalMessage)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-02, 17:41


R3fr3Sh







Wiek: 27
Na forum: 4800 dni
Posty: 70

Piwa: 60

Respekt: 150
Respekt: 150Respekt: 150

Co? takiego powinno stykn??

function globalMessage(plrcmd, ...)
    local frakcja=getElementData(plr,'player:duty')
    if not frakcja then
        return
    end
    local msg table.concat ( { ... }, " " )
    local admins=getElementsByType('player')
    local displayed true
    for i,v in pairs(admins) do
       local pfrakcje=getElementData(v,'player:duty')
        if frakcja == pfrakcje then
            outputChatBox("#0055B5[Frakcja] #FFFFFF("..getElementData(plr,"id")..") "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..msgv25525474true)
            if displayed then 
              triggerClientEvent(root"admin:addText"root"Frakcja ("..getElementData(plr,"player:duty")..")> "..getPlayerName(plr).."("..getElementData(plr,"id").."): "..msg)
              displayed false
            end
        end
    end
end
addCommandHandler("frakcja"globalMessage)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-02, 18:00


Michaler







Wiek: 26
Na forum: 3799 dni
Posty: 77

Piwa: 1009

Respekt: 65,3

dzi?ki dzia?a :) leci :piwo:

Podpis
~~~~ NIE ODPOWIADAM NA ŻADNE KOMENTARZE ~~~~
Postaw piwo autorowi tego posta
 

 
Tagi: powtarzające :: się :: 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 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