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

Wysłany: 2016-05-23, 08:51


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

witam, chc? ?eby m?j skrypt na logi serwerowe po lewej stronie wy?wietla? logi z mojego czatu

oto kod mojego czatu g??wnego:

addEventHandler("onPlayerChat"root, function(trescmsgtype)
    if (msgtype == 0then
        cancelEvent()
        local x,y,getElementPosition(source)
        for keygracze in ipairs(getElementsByType("player")) do
            local x2,y2,z2 getElementPosition(gracze)
            if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<50then
                local int getElementInterior(source)
                local dim getElementDimension(source)
                local int2 getElementInterior(gracze)
                local dim2 getElementDimension(gracze)
                local id getElementData(source"id")
                if (int == int2 and dim == dim2then
                    outputChatBox("#00FF1A[#ffffff"..getElementData(source,"id").."#00FF1A] #ffffff".. getPlayerName(source) ..": #ffffff".. trescgracze255255255true)
                end
            end
        end
    end
end)


a oto kod na logi serwerowe(chc? zeby pisa?o po lewej stronie pod napisem Logi serwerowe ?eby pisa?o kto co pisze):



local xtext=nil
local gameView={"Logi serwerowe:"}
local reportView={"Lista raport?w:"}
local sx,sy=guiGetScreenSize()

addEventHandler("onClientRender"root, function()
    if not getElementData(localPlayer,"administracjaduty"then return end
    concat=table.concat(gameView"\n")
    dxDrawText(concatsx*(10+1)/1024sy*(279+1)/768sx*(326+1)/1024sy*(497+1)/768tocolor(000255), 1.00"default-bold""left""top"falsetrue)
    dxDrawText(concatsx*(10)/1024sy*(279)/768sx*(326)/1024sy*(497)/768white1.00"default-bold""left""top"falsetrue)
end)

function renderingInfo()
dxDrawRectangle(sx*(258)/1024sy*(0)/768sx*(500)/1024sy*(23)/768tocolor(000155), false)
    dxDrawText(xtextsx*(258+1)/1024sy*(0+1)/768sx*(758+1)/1024sy*(23+1)/768tocolor(000255), 1.00"default-bold""center""center"falsetrue)
    dxDrawText(xtextsx*(258)/1024sy*(0)/768sx*(758)/1024sy*(23)/768tocolor(25500255), 1.00"default-bold""center""center"falsetrue)
end

addEventHandler("onClientRender"root, function()
    if not getElementData(localPlayer,"administracjaduty"then return end
    local tt={}
    for i,v in ipairs(reportView) do
        if v[1then table.insert(tt,v[1]) end
    end
    concat=table.concat(tt"\n")
    dxDrawText(concatsx*(698+1)/1024sy*(278+1)/768sx*(1014+1)/1024sy*(496+1)/768tocolor(000255), 1.00"default-bold""right""top"falsetrue)
    dxDrawText(concatsx*(698)/1024sy*(278)/768sx*(1014)/1024sy*(496)/768tocolor(255255255255), 1.00"default-bold""right""top"falsetrue)
end)

addEvent("onPlayerChat"true)
addEventHandler("onPlayerChat"root, function(text)
    table.insert(gameViewtext)    
    if #gameView > 10 then
        table.remove(gameView1)
    end
end)

addEvent("admin:addRaport"true)
addEventHandler("admin:addRaport"root, function(text,id)
    table.insert(reportView, {text,id})
    if #reportView > 10 then
        table.remove(reportView1)
    end
end)

addEvent("admin:removeRaport"true)
addEventHandler("admin:removeRaport"root, function(id)
    for i=#reportView, 1, -1 do
        if reportView[i][2] == id then
            table.remove(reportView,i)
        end
    end
end)

addEvent("admin:rendering"true)
addEventHandler("admin:rendering"root, function(text)
    xtext=text
    addEventHandler("onClientRender"rootrenderingInfo)
    setTimer(function()
        removeEventHandler("onClientRender"rootrenderingInfo)
    end50001)
end)


Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-23, 16:07


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Dodaj do skryptu na czat triggera

triggerClientEvent("onPlayerChat",localPlayer,tresc)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Tagi: logi :: serwerowe
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » logi serwerowe 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