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

Wysłany: 2019-04-07, 21:29


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot??, nie wiem jak si? do tego zabra?, chcia?bym by tylko frakcja SAPD, mog?a u?ywa? panelu kogut?w. Prosze o pomoc !
kod
--[[
Skrypt zostawykonany przez vNeXxuS.
Zakazuje siusuwania tej notatki o autorze.
Osoba kt?ra pobra?a dany skrypt ma tylko i wy??cznie prawa do:
    * Korzystania z skryptu
]]

local screenWscreenH guiGetScreenSize()

dff engineLoadDFF("kogut.dff")
engineReplaceModel(dff953)

addEvent("toggleSiren"true)
addEventHandler("toggleSiren"root, function()
    if getPedOccupiedVehicle(localPlayerthen
        local vehicle getPedOccupiedVehicle(localPlayer)
        if not getElementData(vehicle"sirenStatus") == true then
            setElementData(vehicle"sirenStatus"true)
            local x,y,getElementPosition(vehicle)
            siren playSound3D("/sounds/siren.mp3"x,y,ztrue)
            setSoundVolume(siren0.8)
            setSoundMaxDistance(siren100)
            attachElements(sirenvehicle000)
        elseif getElementData(vehicle"sirenStatus") == true then
            setElementData(vehicle"sirenStatus"false)
            destroyElement(siren)
        end
    end
end)

function dxDraw()
    dxDrawRectangle(screenW 0.8016screenH 0.2852screenW 0.1276screenH 0.2926tocolor(100200), false)
    dxDrawRectangle(screenW 0.8016screenH 0.5778screenW 0.1276screenH 0.0046tocolor(22900200), false)
    dxDrawRectangle(screenW 0.8016screenH 0.2852screenW 0.1276screenH 0.0139tocolor(22900200), false)
    dxDrawText("System O?wietlenia (O)"screenW 0.8016screenH 0.2852screenW 0.9292screenH 0.2991tocolor(255255255255), 0.85"default-bold""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Znajdujesz si? w panelu wyboru o?wietlenia\n SAPD. Kliknij w odpowiedni typ o?wietlenia aby\n zosta? on uruchomiony. Je?li chcesz dodatkowo\n w??czy? syren?, zaznacz poni?szy przycisk.\n\n\n* - Tylko w przypadku pojazd?w\n nieoznakowanych"screenW 0.8063screenH 0.4185screenW 0.9240screenH 0.4667tocolor(255255255255), 0.76"clear""left""top"falsefalsefalsefalsefalse)
    
    dxDrawRectangle(screenW 0.8042screenH 0.3046screenW 0.1219screenH 0.0148tocolor(25500255), false)
    dxDrawRectangle(screenW 0.8042screenH 0.3287screenW 0.1219screenH 0.0148tocolor(25500255), false)
    dxDrawRectangle(screenW 0.8042screenH 0.3528screenW 0.1219screenH 0.0148tocolor(25500255), false)
    dxDrawRectangle(screenW 0.8042screenH 0.3769screenW 0.1219screenH 0.0148tocolor(25500255), false)
    dxDrawRectangle(screenW 0.8042screenH 0.5528screenW 0.1219screenH 0.0148tocolor(25500255), false)
    dxDrawText("?wiat?a Alarmowe"screenW 0.8036screenH 0.3046screenW 0.9260screenH 0.3194tocolor(255255255255), 1"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Bia?e ?wiat?a Alarmowe"screenW 0.8042screenH 0.3287screenW 0.9266screenH 0.3435tocolor(255255255255), 1"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("?wiat?a Ostrzegawcze"screenW 0.8042screenH 0.3528screenW 0.9266screenH 0.3676tocolor(255255255255), 1"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Kogut*"screenW 0.8042screenH 0.3769screenW 0.9266screenH 0.3917tocolor(255255255255), 1"clear""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Syrena"screenW 0.8042screenH 0.5528screenW 0.9266screenH 0.5676tocolor(255255255255), 1"clear""center""center"falsefalsefalsefalsefalse)
end

function mousePosition(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*screenW,cy*screenH
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function openClose()
    if getElementData(localPlayer"systemos:open") == true then
        showCursor(false)
        removeEventHandler("onClientRender"getRootElement(), dxDraw)
        setElementData(localPlayer"systemos:open"false)
    elseif not getElementData(localPlayer"systemos:open") == true then
        if not getPedOccupiedVehicle(localPlayerthen return end
        showCursor(true)
        addEventHandler("onClientRender"getRootElement(), dxDraw)
        setElementData(localPlayer"systemos:open"true)
    end
end
bindKey("O""down"openClose)

addEventHandler("onClientClick"root, function(buttonstate)
    if getElementData(localPlayer"systemos:open") == true then
        if button == "left" and state == "down" then
            local vehicle getPedOccupiedVehicle(localPlayer)
            if mousePosition(screenW 0.8042screenH 0.3046screenW 0.1219screenH 0.0148then
                triggerServerEvent("firstLights"localPlayervehiclevehicleid)
            elseif mousePosition(screenW 0.8042screenH 0.3287screenW 0.1219screenH 0.0148then
                triggerServerEvent("secondLights"localPlayervehiclevehicleid)
            elseif mousePosition(screenW 0.8042screenH 0.3528screenW 0.1219screenH 0.0148then
                triggerServerEvent("thirdLights"localPlayervehiclevehicleid)
            elseif mousePosition(screenW 0.8042screenH 0.3769screenW 0.1219screenH 0.0148then
                triggerServerEvent("toggleBelt"localPlayervehiclevehicleid)
            elseif mousePosition(screenW 0.8042screenH 0.5528screenW 0.1219screenH 0.0148then
                triggerServerEvent("checkSiren"localPlayervehiclevehicleid)
            end
        end
    else return end
end)


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-08, 06:53


AmaMa.

AmaMa.#3768






Wiek: 25
Na forum: 3207 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1825

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

Zamie? na takie co?:


function openClose()
if getElementData(localPlayer,"player:duty") ~= "SAPD" then return end
    if getElementData(localPlayer"systemos:open") == true then
        showCursor(false)
        removeEventHandler("onClientRender"getRootElement(), dxDraw)
        setElementData(localPlayer"systemos:open"false)
    elseif not getElementData(localPlayer"systemos:open") == true then
        if not getPedOccupiedVehicle(localPlayerthen return end
        showCursor(true)
        addEventHandler("onClientRender"getRootElement(), dxDraw)
        setElementData(localPlayer"systemos:open"true)
    end
end
bindKey("O""down"openClose)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2019-04-08, 11:51


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

dzk

Postaw piwo autorowi tego posta
 

 
Tagi: kogut :: pod :: frakcję
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