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

Wysłany: 2017-11-16, 21:36


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

Witam mam problem z tym skryptem pr?buje go na sw?j serwer wstawi? ale wyskakuj? mi DB i nie wiem co mam zrobi? za pomoc stawiam :piwo:

DB w 10/28/40 linijce
S_side


local skrzyniaogloszen createObject 9800,0, -100 )

function ogloszenie sourcecmd, ... )
if not getElementData(source,"duty"then outputChatBox("*Brak uprawnien",source,255,0,0) return end
    if ... then
        if not getElementData skrzyniaogloszen"ogloszenie" then
            local text table.concat({...}, " " )
            setElementData skrzyniaogloszen"ogloszenie"true )
            setElementData skrzyniaogloszen"tekstogloszenia","(Admin) "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." ( "..getElementData source"id").." ) : \n "..text.." ")
            setTimer setElementData10000,1skrzyniaogloszen"ogloszenie"false )
        else
            outputChatBox("Og?oszenia mog? by? nadawane minimum 10 sekund."source255960true ) 

        end
    else
        outputChatBox("Aby nada? og?oszenie  /ogloszenie [tresc] ."source255960true ) 
    end
end
addCommandHandler("ogloszenie"ogloszenie)



c_side (tu s? b??dy)

local start getTickCount()
function isEventHandlerAddedsEventNamepElementAttachedTofunc )
    if 
        typesEventName ) == 'string' and 
        isElementpElementAttachedTo ) and 
        typefunc ) == 'function' 
    then
        local aAttachedFunctions getEventHandlerssEventNamepElementAttachedTo )
        if typeaAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
            for iv in ipairsaAttachedFunctions ) do
                if == func then
                    return true
                end
            end
        end
    end
 
    return false
end

function hud()
x,guiGetScreenSize()
screenW,screenH guiGetScreenSize()
 for k,v in ipairs getElementsByType "object" ) ) do
    if getElementData v"ogloszenie" then
        local tekst getElementData v"tekstogloszenia" )
        local width dxGetTextWidth(tekst,1,"Arial")
        local now getTickCount()
            local endTime start 2000
        local elapsedTime now start
        local duration endTime start

        local progress elapsedTime duration
        if progress and progress 4 then
        if not s then
        s getTickCount()
        end
        local xyinterpolateBetween (screenW 0.0022screenH 0.52260screenW 1.2screenH 0.5226 0, (s-getTickCount())/(( 2000 ) - ), "InOutBack")
        dxDrawRectangle(xyscreenW 0.2500 screenH 0.0365 + (width 0.05), tocolor(000151), false)
        dxDrawText(tekst,xyscreenW 0.2522screenH 0.0391tocolor(255255255255), 1.00"default""center""top"falsetruefalsefalsefalse)
        return end
        local pxpypz getElementPosition(localPlayer)
        local xyinterpolateBetween screenW * -0.2screenH 0.52260,screenW 0.0022screenH 0.5226 0progress"InOutBack")

        dxDrawRectangle(xyscreenW 0.2500 screenH 0.0365 + (width 0.05), tocolor(000151), false)
        dxDrawText(tekst,xyscreenW 0.2522screenH 0.0391tocolor(255255255255), 1.00"default""center""top"falsetruefalsefalsefalse)
    end
end
end

addEventHandler "onClientElementDataChange"root, function(data,old)
    if getElementType(source) == "object" and data == "ogloszenie" then
        if getElementData(source,"ogloszenie"then
            if isEventHandlerAdded("onClientRender",root,hudthen
                removeEventHandler "onClientRender"roothud)
            end
            start getTickCount()
            nil
            addEventHandler "onClientRender"roothud)
        else
            removeEventHandler "onClientRender"roothud)
            start getTickCount()
            nil
        end
    end
end)
addEventHandler "onClientRender"roothud)


Komentarz marcin778 dodany 2017-11-17, 13:39Tagi [lua][/lua] są czytelniejsze i ich używaj - większe szanse na pomoc.
Ostatnio zmieniony przez marcin778 2017-11-17, 13:39, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-17, 15:52


Pevo

Jabłko






Wiek: 23
Na forum: 3589 dni
Posty: 356
Nick w MP: Pevo

Piwa: 1571

Respekt: 355,8
Respekt: 355,8Respekt: 355,8Respekt: 355,8Respekt: 355,8

Nikt nie jest jasnowidzem. Podanie numeru linijki nie wystarczy tym bardziej jak nie dajesz pe?nego kodu. Zaznacz dok?adne linijki, w kt?rych jest b??d

Podpis
Jabłko
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-17, 16:32


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

EvilXmik, podaj najlepiej ss z b??d?w i dok?adne linijki

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Tagi: ogłoszeniach
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » DB w ogłoszeniach 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