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

Wysłany: 2016-10-15, 18:05


Artystek







Wiek: 23
Na forum: 3520 dni
Posty: 143
Nick w MP: Artystek

Piwa: 74

Respekt: 55,3

Witam,
Mam taki kod:


function blockShoot()
    if getPedWeapon(localPlayer) == 22 or getPedWeapon(localPlayer) == 42 then
        toggleControl("fire"false)
        toggleControl("aim_weapon"true)
        toggleControl("action"true)
    else
        toggleControl("fire"false)
        toggleControl("aim_weapon"false)
        toggleControl("action"false)
    end
end
addEventHandler("onClientRender"rootblockShoot)


addEventHandler("onClientPlayerTarget",root, function(el)
    if isPedAiming(localPlayer) and el and getPedWeapon(localPlayer) == 22 or isPedAiming(localPlayer) and el and getPedWeapon(localPlayer) == 42 then
        if not option.actived  then
           if getElementData(el,"p:inv"then return end
           if getElementType(el) == "vehicle" then
                value="vehicle"
                element=el
                option.actived=true
            elseif getElementType(el) == "player" then
                value="player"
                element=el
                option.actived=true
            else return end
            bindKey("mouse1""down"onElementClicked)
            bindKey("mouse_wheel_down""down"onElementMoveDown)
            bindKey("mouse_wheel_up""down"onElementMoveUp)
            addEventHandler("onClientHUDRender"rootisRendering)
        end
    else
        if option.actived then
            vehicle.el=nil
            option.actived=false
            unbindKey("mouse1""down"onElementClicked)
            unbindKey("mouse_wheel_down""down"onElementMoveDown)
            unbindKey("mouse_wheel_up""down"onElementMoveUp)
            removeEventHandler("onClientHUDRender"rootisRendering)
        end
    end
end)


I chcia?bym zrobi?, aby suszark? da?o si? celowa?, ale nie da?o si? strzela?(id 22), a ga?nic? da?o si? celowa? oraz strzela? (id 42) wie kto? jak mo?na to zrobi??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-10-15, 18:43


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

Dlaczego ga?nic? podpi??e? pod skrypt suszarki? Zobacz to:


function blockShoot()
    if getPedWeapon(localPlayer) == 22 then
        toggleControl("fire"false)
        toggleControl("aim_weapon"true)
        toggleControl("action"true)
end
end
addEventHandler("onClientRender"rootblockShoot)


addEventHandler("onClientPlayerTarget",root, function(el)
    if isPedAiming(localPlayer) and el and getPedWeapon(localPlayer) == 22 then
        if not option.actived  then
           if getElementData(el,"p:inv"then return end
               if getElementType(el) == "vehicle" then
                value="vehicle"
                element=el
                option.actived=true
            elseif getElementType(el) == "player" then
                value="player"
                element=el
                option.actived=true
            else return end
            bindKey("mouse1""down"onElementClicked)
            bindKey("mouse_wheel_down""down"onElementMoveDown)
            bindKey("mouse_wheel_up""down"onElementMoveUp)
            addEventHandler("onClientHUDRender"rootisRendering)
        end
            end
            end
end)


Jak gdzie? brakuje enda to go dopisz. Ten skrypt blokuje tylko strzelanie dla id broni 22 wiec dlaczego podpinasz pod to gasnic??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-10-15, 18:47


Artystek







Wiek: 23
Na forum: 3520 dni
Posty: 143
Nick w MP: Artystek

Piwa: 74

Respekt: 55,3

Tylko, ?e chce suszarke do celowania i ga?nice do u?ywania jej czyli wiesz piana i te sprawy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-10-15, 18:50


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

Chodzi ci o podmienienie ? Nie rozumiem chcesz mie? opcje suszarki ale dla ga?nicy? I ga?nic? robi? to co suszark? ale mie? w??czon? pian?? Je?eli tak to:

function blockShoot()
    if getPedWeapon(localPlayer) == 42 then
        toggleControl("fire"true)
        toggleControl("aim_weapon"true)
        toggleControl("action"true)
end
end
addEventHandler("onClientRender"rootblockShoot)

addEventHandler("onClientPlayerTarget",root, function(el)
    if isPedAiming(localPlayer) and el and getPedWeapon(localPlayer) == 42 then
        if not option.actived  then
           if getElementData(el,"p:inv"then return end
               if getElementType(el) == "vehicle" then
                value="vehicle"
                element=el
                option.actived=true
            elseif getElementType(el) == "player" then
                value="player"
                element=el
                option.actived=true
            else return end
            bindKey("mouse1""down"onElementClicked)
            bindKey("mouse_wheel_down""down"onElementMoveDown)
            bindKey("mouse_wheel_up""down"onElementMoveUp)
            addEventHandler("onClientHUDRender"rootisRendering)
        end
            end
            end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-10-15, 20:03


Artystek







Wiek: 23
Na forum: 3520 dni
Posty: 143
Nick w MP: Artystek

Piwa: 74

Respekt: 55,3

Chodzi o osobny kod na ga?nice i suszarke. Ale jak daje ten i zamieniam id broni jedno nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-10-15, 20:07


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

function blockShoot()
    if getPedWeapon(localPlayer) == 22
        toggleControl("fire"false)
        toggleControl("aim_weapon"true)
        toggleControl("action"true)
    elseif getPedWeapon(localPlayer) == 42 then
        toggleControl("fire",true)
        toggleControl("aim_weapon"true)
        toggleControl("action"true)
    end
end
addEventHandler("onClientRender"rootblockShoot)


addEventHandler("onClientPlayerTarget",root, function(el)
    if isPedAiming(localPlayer) and el and getPedWeapon(localPlayer) == 22 or isPedAiming(localPlayer) and el and getPedWeapon(localPlayer) == 42 then
        if not option.actived  then
           if getElementData(el,"p:inv"then return end
           if getElementType(el) == "vehicle" then
                value="vehicle"
                element=el
                option.actived=true
            elseif getElementType(el) == "player" then
                value="player"
                element=el
                option.actived=true
            else return end
            bindKey("mouse1""down"onElementClicked)
            bindKey("mouse_wheel_down""down"onElementMoveDown)
            bindKey("mouse_wheel_up""down"onElementMoveUp)
            addEventHandler("onClientHUDRender"rootisRendering)
        end
    else
        if option.actived then
            vehicle.el=nil
            option.actived=false
            unbindKey("mouse1""down"onElementClicked)
            unbindKey("mouse_wheel_down""down"onElementMoveDown)
            unbindKey("mouse_wheel_up""down"onElementMoveUp)
            removeEventHandler("onClientHUDRender"rootisRendering)
        end
    end
end)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-10-15, 20:23


Artystek







Wiek: 23
Na forum: 3520 dni
Posty: 143
Nick w MP: Artystek

Piwa: 74

Respekt: 55,3

Dzia?a, dzi?ki i gratuluje awansu.

Postaw piwo autorowi tego posta
 

 
Tagi: odblokowanie :: dla :: dwóch :: broni
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