Wysłany: 2016-10-15, 18:05
Artystek
Wiek: 23 Na forum: 3520 dni Posty: 143
Nick w MP: Artystek
Piwa : 74
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" , root , blockShoot )
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" , root , isRendering )
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" , root , isRendering )
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??
Wysłany: 2016-10-15, 18:43
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
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" , root , blockShoot )
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" , root , isRendering )
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??
Wysłany: 2016-10-15, 18:47
Artystek
Wiek: 23 Na forum: 3520 dni Posty: 143
Nick w MP: Artystek
Piwa : 74
Tylko, ?e chce suszarke do celowania i ga?nice do u?ywania jej czyli wiesz piana i te sprawy.
Wysłany: 2016-10-15, 18:50
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
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" , root , blockShoot )
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" , root , isRendering )
end
end
end
end )
Wysłany: 2016-10-15, 20:03
Artystek
Wiek: 23 Na forum: 3520 dni Posty: 143
Nick w MP: Artystek
Piwa : 74
Chodzi o osobny kod na ga?nice i suszarke. Ale jak daje ten i zamieniam id broni jedno nie dzia?a.
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
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" , root , blockShoot )
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" , root , isRendering )
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" , root , isRendering )
end
end
end )
Wysłany: 2016-10-15, 20:23
Artystek
Wiek: 23 Na forum: 3520 dni Posty: 143
Nick w MP: Artystek
Piwa : 74
Dzia?a, dzi?ki i gratuluje awansu.
Tagi: odblokowanie :: dla :: dwóch :: broni
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: