O ile si? nie myle, onClientClick odnosi sie do klikniecia kursorem (tym z showCursor)
Jezeli chcesz aby poprzez wycelowanie i klikniecie np lewy to musisz zbindowac lewy myszki i sprawdzic bron, cel czy jest, jezeli pojazd lecisz dalej w kodzie i naprawiasz
addEventHandler ( "onClientClick", root, function( button, state, _, _, _, _, _, element )
if element then
if button == "mouse1" and state == "down" and getElementType(element) == "vehicle" then
if getPedWeapon ( getLocalPlayer() ) == 22 then
fixVehicle ( element )
end
end
end
end )
if typ == "vehicle" then
if selected == 1 then
_,_,rz=getElementRotation(el)
fixVehicle(el)
setElementHealth(el,1000)
setElementRotation(el,0,0,rz)
outputChatBox("Naprawi?e?/a? pojazd.", source)
bindKey("mouse1","down",fixVehicle)
end
end
C?? nie wiem co zmajstrowa?e?, ale dla mnie to r?ce i nogi ma amputowane xD
Ja to uj??em tak:
addEventHandler( "onClientKey", root,
function(button,press)
if getPedWeapon ( getLocalPlayer() ) == 22 then
if button == "mouse1" then
target = getPedTarget(getLocalPlayer())
if target then
typ = getElementType(target)
if typ == "vehicle" then
fixVehicle(target)
end
end
end
end
end)
Nie testowane co prawda, ale powinno dzia?a?, w razie czego pisz.
C?? nie wiem co zmajstrowa?e?, ale dla mnie to r?ce i nogi ma amputowane xD
Ja to uj??em tak:
addEventHandler( "onClientKey", root,
function(button,press)
if getPedWeapon ( getLocalPlayer() ) == 22 then
if button == "mouse1" then
target = getPedTarget(getLocalPlayer())
if target then
typ = getElementType(target)
if typ == "vehicle" then
fixVehicle(target)
end
end
end
end
end)
Nie testowane co prawda, ale powinno dzia?a?, w razie czego pisz.
Nie dzia?a - podpinam si? do pro?by jego. Prosz? o pomoc ;c
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